Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page

Network and Resource Planning

Updated on 2025-02-27 GMT+08:00
To use an enterprise router and a NAT gateway to allow VPCs in the same region to share an EIP to access the Internet, you need:
  • 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 shows the network planning for enabling VPCs in the same region to share an EIP to access the Internet.

Figure 1 Network planning for enabling VPCs in the same region to share an EIP to access the Internet
Table 1 Network traffic flows

Path

Description

Request traffic: from VPC 1 to Internet

  1. In the route table of VPC 1, there is a route with the next hop set to the enterprise router to forward traffic from VPC 1 to the enterprise router.
  2. In the route table of the enterprise router, there is a static route with the next hop set to the VPC 4 attachment to forward traffic from the enterprise router to VPC 4.
  3. In the route table of VPC 4, there is a route with the next hop set to the NAT gateway to forward traffic from VPC 4 to the NAT gateway.
  4. The NAT gateway forwards the traffic to a destination on the Internet through the EIP configured in an SNAT rule.

Response traffic: from Internet to VPC 1

  1. The destination on the Internet forwards the traffic to the NAT gateway through the EIP configured in the SNAT rule.
  2. The NAT gateway forwards the traffic to VPC 4 based on the SNAT rule.
  3. In the route table of VPC 4, there is a route with the next hop set to the enterprise router to forward traffic from VPC 4 to the enterprise router.
  4. In the route table of the enterprise router, there is a propagated route with the next hop set to the VPC 1 attachment to forward traffic from the enterprise router to VPC 1.
Table 2 Description of network planning for enabling VPCs in the same region to share an EIP to access the Internet

Resource

Description

VPC

  • The CIDR blocks of the VPCs to be connected cannot overlap with each other.

    In this example, the CIDR blocks of the VPCs are propagated to the enterprise router route table as the destination in routes. The CIDR blocks cannot be modified and overlapping CIDR blocks may cause route conflicts.

    If your existing VPCs have overlapping CIDR blocks, do not use propagated routes. Instead, you need to manually add static routes to the route table of the enterprise router. The destination can be VPC subnet CIDR blocks or smaller ones.

  • Each VPC has a default route table.
  • The routes in the default route table are described as follows:
    • Local: a system route for communications between subnets in a VPC.
    • Enterprise Router: a custom route for routing traffic from a VPC subnet to the enterprise router.

      In order to keep route configuration simple, VPC 1, VPC 2 and VPC 3 each have such a route with destination set to 0.0.0.0/0. For route details, see Table 3.

      The route table of VPC 4 has a route with NAT gateway as the next hop and 0.0.0.0/0 as the destination. To prevent conflicts with this route, set the destinations to CIDR blocks of the other three VPCs for routes with enterprise router as the next hop in this route table. For route details, see Table 4.

    • NAT gateway: a route configured by the system for routing traffic from the VPC subnet to the NAT gateway.

NAT gateway

Create a public NAT gateway in VPC 4, and add an SNAT rule with an EIP associated.

Enterprise router

  • After Default Route Table Association and Default Route Table Propagation are enabled and VPC attachments are created, Enterprise Router will automatically:
    • Associate VPC attachments with the default route table of the enterprise router.
    • Propagate VPC attachments to the default route table of the enterprise router. The route table automatically learns the VPC CIDR blocks as the destination of routes. For details, see Table 5.
  • In the enterprise router route table, add a static route with the destination set to 0.0.0.0/0 for routing traffic for accessing the Internet through VPC 4.

ECS

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.

Table 3 Route table for VPC 1, VPC 2, and VPC 3

Destination

Next Hop

Route Type

0.0.0.0/0

Enterprise router

Static route (custom)

NOTE:
  • 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 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.
Table 4 VPC 4 route table

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)

NOTE:
  • 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.
Table 5 Enterprise router route table

Destination

Next Hop

Route Type

VPC 1 CIDR block: 10.1.0.0/16

VPC 1 attachment: er-attach-business-01

Propagated

VPC 2 CIDR block: 10.2.0.0/16

VPC 2 attachment: er-attach-business-02

Propagated

VPC 3 CIDR block: 10.3.0.0/16

VPC 3 attachment: er-attach-business-03

Propagated

0.0.0.0/0

VPC 4 attachment: er-attach-nat

Static route

Resource Planning

An enterprise router, a NAT gateway, an EIP, four VPCs, and three ECSs are in the same region but can be in different AZs.
NOTE:

The following resource details are only examples. You can modify them if needed.

  • 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.
    Table 7 Public NAT gateway details

    Public NAT Gateway Name

    VPC

    Subnet

    SNAT Rule Scenario

    SNAT Rule CIDR Block

    nat-demo

    vpc-nat

    subnet-nat

    VPC

    Custom: 0.0.0.0/0

  • Four VPCs that do not overlap with each other. See details in Table 8.
    Table 8 VPC details

    VPC

    VPC CIDR Block

    Subnet

    Subnet CIDR Block

    Association Route Table

    VPC 1: vpc-business-01

    10.1.0.0/16

    subnet-business-01

    10.1.0.0/24

    Default route table

    VPC 2: vpc-business-02

    10.2.0.0/16

    subnet-business-02

    10.2.0.0/24

    Default route table

    VPC 3: vpc-business-03

    10.3.0.0/16

    subnet-business-03

    10.3.0.0/24

    Default route table

    VPC 4: 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

    Subnet

    Security Group

    Private IP Address

    ECS 1: 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 2: ecs-business-02

    vpc-business-02

    subnet-business-02

    10.2.0.215

    ECS 3: ecs-business-03

    vpc-business-03

    subnet-business-03

    10.3.0.14

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback