Accessing Multiple VPCs Using VPC Peering
Scenarios
After your environment has been connected to HUAWEI CLOUD, you can use VPC Peering to access other VPCs in the same region.
The subnets of the VPCs must be unique.
Typical Topology

Procedure
- Configure Direct Connect to connect your on-premises data center to VPC A.
- Create a connection.
- Create a virtual gateway.
When you create the virtual gateway, select VPC A for VPC.
- Create a virtual interface.
- Create a VPC peering connection between VPC A and VPC B.
- Log in to the management console.
- On the console homepage, click
in the upper left corner and select the desired region and project. - Hover on
to display Service List and choose Networking > Virtual Private Cloud. - In the navigation pane on the left, click VPC Peering.
- On the VPC Peering page, click Create VPC Peering Connection.
- Configure the parameters based on Table 1. Figure 1 Creating a VPC peering connection
Table 1 Parameter description Parameter
Description
Example Value
Name
Specifies the name of the VPC peering connection.
The name contains a maximum of 64 characters, which consist of letters, digits, hyphens (-), and underscores (_).
peering-001
Local VPC
Specifies the local VPC. You can select one from the drop-down list.
VPC B
Local VPC CIDR Block
Specifies the CIDR block for the local VPC.
192.168.2.0/24
Account
Specifies the account to which the VPC to peer with.
- My account: The VPC peering connection will connect two VPCs in your account, in the same region.
- Another account: The VPC peering connection will connect your VPC to a VPC in another account, in the same region.
My account
Peer Project
Specifies the project name. The project name of the current project is used by default.
You can log in to the management console, hover the cursor over account name in the upper right corner, and choose My Credentials. On the My Credentials page, view the project name and project ID.
aaa
Peer VPC
Specifies the peer VPC. You can select one from the drop-down list if the VPC peering connection is created between two VPCs of your own.
VPC A
Peer VPC CIDR Block
Specifies the CIDR block for the peer VPC.
The local and peer VPCs cannot have matching or overlapping CIDR blocks. Otherwise, the routes added for the VPC peering connection may not take effect.
192.168.10.0/24
Description
Provides supplementary information about the VPC peering connection.
-
- Click OK.
- Add routes for the VPC peering connection.
- Under Networking, click Virtual Private Cloud.
- In the navigation pane on the left, click VPC Peering.
- Locate the VPC peering connection in the connection list. Figure 2 VPC peering connection list
- Click the name of the VPC peering connection to switch to the page showing details about the connection.
- Click the Local Routes tab.
- In the Local Routes area, click Add Local Route. In the displayed dialog box, add a local route. Table 2 lists the parameters.Figure 3 Add Local Route
Table 2 Parameter description Parameter
Description
Example Value
Destination
Specifies the destination address. Set it to the peer VPC or subnet CIDR block.
Add the CIDR block of VPC A and the local subnet used by the on-premises data center.
192.168.10.0/24
192.168.1.0/24
Next Hop
Specifies the next instance along the path to the destination.
By default, the VPC peering connection ID is used as the next hop and cannot be changed.
-
In some regions, you need to click Route Tables to add the local route to the VPC route table.
The operations may vary depending on the region.
- Click OK to switch to the page showing the VPC peering connection details.
- Click the Peer Routes tab.
- In the Peer Routes area, click Add Peer Route and add a route. Table 3 lists the parameters.Figure 4 Add Peer Route
Table 3 Parameters for adding a peer route Parameter
Description
Example Value
Destination
Specifies the destination address. Set it to the CIDR block of the local VPC or its subnet.
CIDR block of VPC B: 192.168.2.0/24
192.168.2.0/24
Next Hop
Specifies the next instance along the path to the destination.
By default, the VPC peering connection ID is used as the next hop and cannot be changed.
-
In some regions, you need to click Route Tables to add the peer route to the VPC route table.
The operations may vary depending on the region.
- Click OK.
Last Article: Accessing Multiple VPCs Using a Connection
Next Article: Accessing OBS Using Direct Connect
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.