Accessing a VPC over Two Direct Connect Connections Terminated at Two Locations Through Static Routes (Virtual Gateway)
Overview
Your on-premises data center can access a VPC in the same region through two Direct Connect connections, a virtual gateway, and static routes. The two connections work in active/active and load balancing mode and can automatically switch over in the event of a failure, eliminating single points of failure.
Application Scenarios
To meet high service availability requirements, you can use two physical Direct Connect connections terminated at different Direct Connect locations in the same Huawei Cloud region. The two connections work in load balancing and active-active forwarding mode to access the same VPC. In normal cases, both connections carry service traffic at the same time. If one connection fails, traffic is automatically switched to the other connection to ensure service continuity.
Solution Architecture
The on-premises network is connected to a VPC in the CN-Hong Kong region over two Direct Connect connections, with one terminated at Hong Kong-Sha Tin and the other terminated at HK-Sai Kung-Mobile. Each connection uses its own virtual interface, but both are associated with the same virtual gateway. Static routes are used for dual-connection load balancing and redundancy.
The following table lists the CIDR blocks used in this example.
| Item | CIDR Block |
|---|---|
| On-premises network | 10.1.123.0/24 |
| Local and remote gateways (addresses for interconnection) | 10.0.0.0/30 and 10.0.0.4/30 |
| VPC | 192.168.0.0/16 |
Advantages
- High reliability: Dual connections work in load balancing mode, and automatic failover is supported in case of a single point of failure (SPOF), ensuring service continuity.
- Easy deployment: Static routes are easy to configure, and BGP is not required, simplifying O&M.
- High performance: Both connections are used concurrently and their bandwidths are aggregated to deliver higher total throughput.
- Secure isolation: Communications over Direct Connect connections are over the private network, eliminating security risks associated with the Internet.
Constraints
- Your on-premises network must use a single-mode fiber with a 1GE, 10GE, 40GE, or 100GE optical module to connect to the access device in Huawei Cloud.
- Auto-negotiation for the ports must be disabled. Port speed and full-duplex mode must be manually configured.
- 802.1Q VLAN encapsulation is supported on your on-premises network.
- CIDR blocks used by Direct Connect connections cannot conflict with that of the cloud and on-premises networks.
- Bidirectional Forwarding Detection (BFD) must be enabled for non-directly connected connections. You can submit a service ticket to enable BFD.
Resource and Cost Planning
The following table describes the resource planning in the best practice.
| Region | Resource | Description | Quantity | Price |
|---|---|---|---|---|
| CN-Hong Kong | VPC | VPC subnet: 192.168.0.0/16 | 1 | Free |
| Connection | Connection dc-connect1 is associated with virtual gateway vgw-test and virtual interface vif-test1.
| 2 | ||
| Connection dc-connect2 is associated with virtual gateway vgw-test and virtual interface vif-test2.
| ||||
| Virtual gateway | Local subnet in the associated VPC: 192.168.0.0/16 | 1 | ||
| Virtual interface | Each of the two connections has its own virtual interface, while both virtual interfaces are associated with the same virtual gateway. | 2 |
Process Flowchart
In this scenario, the on-premises network connects to the VPC over two connections that are terminated at two locations in the same region, and static routes are used to route traffic between the on-premises network and the VPC.

Step 1: Create a Connection
- Go to the Connections page.
- In the upper left corner of the page, click
and select a region and project. - Click Create Connection. Configure the following parameters:
- Region: CN-Hong Kong
- Connection Name: dc-connect1
- Location: Hong Kong-Sha Tin
- Port Type: 1GE
- Leased Line Bandwidth (Mbit/s): 100
Configure other parameters based on service requirements.
- Submit the request for review.
- Contact the carrier for cabling after your request is approved.
- Confirm the cabling on the console after the cabling is complete.
- Confirm the Direct Connect configuration and complete the payment.
- Wait until the Huawei Cloud construction is complete and the status changes to Normal.
Repeat the preceding steps to create another connection named dc-connect2 and select HK-Sai Kung-Mobile as the location.
Step 2: Create a Virtual Gateway
A virtual gateway is the core gateway for a Direct Connect connection to access a VPC. Two Direct Connect connections share one virtual gateway for load balancing.
- Go to the Virtual Gateways page.
- Click Create Virtual Gateway. Key configuration parameters:
- Name: vgw-test
- VPC: Select the target VPC.
- Local Subnet: 192.168.0.0/16
- BGP ASN: 64512 by default
Configure other parameters based on service requirements.
- Click OK and wait until the status changes to Normal.
Step 3: Create a Virtual Interface
Create a virtual interface for each connection and associate them with the same virtual gateway for dual-connection load balancing.
- Create virtual interface vif-test1.
- In the navigation pane on the left, choose Direct Connect > Virtual Interfaces.
- Click Create Virtual Interface.
Key configuration parameters:
- Name: vif-test1
- Virtual Interface Priority: Preferred
- Connection: dc-connect1
- Gateway: Virtual gateway
- Virtual Gateway: vgw-test
- VLAN: 30
- Bandwidth (Mbit/s): 100
- Local Gateway (Huawei Cloud): 10.0.0.1/30
- Remote Gateway (Customer): 10.0.0.2/30
- Routing Mode: Static
- Remote Subnet: 10.1.123.0/24
Configure other parameters based on service requirements.
- Click Create Now.
- Create virtual interface vif-test2.
Repeat the creation process and modify the following parameters:
- Name: vif-test2
- Connection: dc-connect2
- VLAN: 32
- Local Gateway: 10.0.0.5/30
- Remote Gateway: 10.0.0.6/30
- Remote Subnet: 10.1.123.0/24
Retain other parameters the same as those of virtual interface vif-test1.
Step 4: Configure On-Premises Routes
Configure two equal-cost static routes on the on-premises gateway. (A Huawei-developed device is used as an example here.)
# Point to the Huawei Cloud gateway of Direct Connect connection dc-connect1. ip route-static 192.168.0.0 255.255.0.0 10.0.0.1 # Point to the Huawei Cloud gateway of Direct Connect connection dc-connect2. ip route-static 192.168.0.0 255.255.0.0 10.0.0.5
After a Direct Connect connection is created in self-service mode, the Direct Connect gateway on Huawei Cloud automatically delivers routes from the cloud to the on-premises network.
Testing Connectivity and Load Balancing
- Use the ping command to test the connectivity.
In the on-premises data center, ping the private IP address of the ECS in the VPC to test the connectivity.
ping 192.168.1.100
- Test load balancing.
- Test failover.
Manually disconnect one connection and continuously perform ping tests. Check whether traffic can be quickly switched to the other connection, and services are not interrupted.
Helpful Links
- For details about how to troubleshoot connection faults, see Network and Connectivity and Routing.
- For common problems about establishing network connectivity using Direct Connect, see Leased Line.
- For common problems about Direct Connect interconnection, see Interconnection with the Cloud.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot