Planning Networks and Resources
- Network Planning: Plan CIDR blocks of VPCs and their subnets, EIP, public NAT gateway, and route tables of VPCs and the enterprise router.
- Resource Planning: Plan the quantity, names, and other parameters of cloud resources, including VPCs, EIP, NAT gateway, ECSs, and enterprise router.
Network Planning
Figure 1 and Table 2 show the network planning and its description for enabling VPCs in the same region to share an EIP to access the Internet.
![](https://support.huaweicloud.com/eu/bestpractice-er/en-us_image_0000001168047394.png)
Path |
Description |
---|---|
Request traffic: from VPC 1 to Internet |
|
Response traffic: from Internet to VPC 1 |
|
Resource |
Description |
---|---|
VPCs |
|
NAT gateway |
Create a public NAT gateway in VPC 4, and add an SNAT rule with an EIP associated. |
Enterprise router |
|
ECSs |
The three ECSs are in different VPCs. If the ECSs are in different security groups, add rules to the security groups to allow access to each other. |
Destination |
Next Hop |
Route Type |
---|---|---|
0.0.0.0/0 |
Enterprise router |
Static route (custom) |
![](https://support.huaweicloud.com/eu/bestpractice-er/public_sys-resources/note_3.0-en-us.png)
- If you enable Auto Add Routes when creating a VPC attachment, you do not need to manually add static routes to the VPC route table. Instead, the system automatically adds routes (with this enterprise router as the next hop and 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 as the destinations) to all route tables of the VPC.
- If an existing route in the VPC route tables has a destination to 10.0.0.0/8, 172.16.0.0/12, or 192.168.0.0/16, the routes will fail to be added. In this case, do not to enable Auto Add Routes. After the attachment is created, manually add routes.
- You need to add a route to VPC route tables with destination set to a CIDR block on the Internet and next hop set to enterprise router.
- To reduce the number of routes, you can set the destination of a route (with an enterprise router as the next hop) to 0.0.0.0/0 in the VPC route table. However, in this case, ECSs in VPCs cannot be bound with EIPs. If an ECS in the VPC has an EIP bound, the VPC route table will have a policy-based route with 0.0.0.0/0 as the destination, which has a higher priority than the route with the enterprise router as the next hop. In this case, traffic is forwarded to the EIP and cannot reach the enterprise router.
Destination |
Next Hop |
Route Type |
---|---|---|
VPC 1 CIDR block: 10.1.0.0/16 |
Enterprise router |
Static route (custom) |
VPC 2 CIDR block: 10.2.0.0/16 |
Enterprise router |
Static route (custom) |
VPC 3 CIDR block: 10.3.0.0/16 |
Enterprise router |
Static route (custom) |
0.0.0.0/0 |
NAT gateway |
Static route (custom) |
![](https://support.huaweicloud.com/eu/bestpractice-er/public_sys-resources/note_3.0-en-us.png)
- Do not enable Auto Add Routes when creating attachments. Manually add routes to VPC route tables after the attachments are created.
- Do not bind an EIP to an ECS in VPCs. If you do that, policy-based routes with destination set to 0.0.0.0/0 are added to ECS route tables. The priority of the routes is higher than that of the route with destination to the NAT gateway. As a result, the traffic will be forwarded to the EIP of the ECS instead of the NAT gateway.
Destination |
Next Hop |
Route Type |
---|---|---|
VPC 1 CIDR block: 10.1.0.0/16 |
VPC 1 attachment: er-attach-business-01 |
Propagated route |
VPC 2 CIDR block: 10.2.0.0/16 |
VPC 2 attachment: er-attach-business-02 |
Propagated route |
VPC 3 CIDR block: 10.3.0.0/16 |
VPC 3 attachment: er-attach-business-03 |
Propagated route |
0.0.0.0/0 |
VPC 4 attachment: er-attach-nat |
Static route |
Resource Planning
![](https://support.huaweicloud.com/eu/bestpractice-er/public_sys-resources/note_3.0-en-us.png)
The following resource details are only examples. You can modify them as required.
- One enterprise router. See details in Table 6.
Table 6 Enterprise router details Enterprise Router Name
ASN
Default Route Table Association
Default Route Table Propagation
Association Route Table
Propagation Route Table
Attachment
er-test-01
64512
Enabled
Enabled
Default route table
Default route table
er-attach-business-01
er-attach-business-02
er-attach-business-03
er-attach-nat
- One EIP. Set the EIP type and bandwidth size as required. In this practice, the EIP is 123.60.73.78.
- One public NAT gateway. See details in Table 7.
- Four VPCs that do not overlap with each other. See details in Table 8.
Table 8 VPC details VPC Name
VPC CIDR Block
Subnet Name
Subnet CIDR Block
Association Route Table
vpc-business-01
10.1.0.0/16
subnet-business-01
10.1.0.0/24
Default route table
vpc-business-02
10.2.0.0/16
subnet-business-02
10.2.0.0/24
Default route table
vpc-business-03
10.3.0.0/16
subnet-business-03
10.3.0.0/24
Default route table
vpc-nat
192.168.0.0/16
subnet-nat
192.168.0.0/24
Default route table
- Three ECSs, respectively, in three VPCs. See details in Table 9.
Table 9 ECS details ECS Name
Image
VPC Name
Subnet Name
Security Group
Private IP Address
ecs-business-01
Public image:
CentOS 7.5 64-bit
vpc-business-01
subnet-business-01
sg-demo
(general-purpose web server)
10.1.0.134
ecs-business-02
vpc-business-02
subnet-business-02
10.2.0.215
ecs-business-03
vpc-business-03
subnet-business-03
10.3.0.14
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.