Application Load Balancer (ALB) supports cross-region mounting. This topic describes how to use ALB to mount servers in VPCs across different regions to achieve efficient traffic distribution and system optimization.
Use case
Under normal conditions, its servers in the China (Chengdu) region are sufficient to handle daily business traffic. However, during major promotional events, a surge in traffic can overwhelm the capacity of the servers in the China (Chengdu) region.
To address this, the company can integrate servers from the China (Hangzhou) region into its existing network architecture. By using an Application Load Balancer (ALB) instance with an IP-based Server Group and Cloud Enterprise Network (CEN), the company can quickly scale its resources. CEN allows the VPCs in different regions to communicate over a private network. Using this private connection, ALB can add servers from the cross-region VPC to an IP-based Server Group. This setup lets ALB forward client requests to servers in both the China (Chengdu) and China (Hangzhou) regions, significantly boosting the system's load capacity and response speed.
Limitations
Starting from 00:00:00 on February 25, 2025 (UTC+8), new instances will use the upgraded ALB by default. Existing ALB instances are not affected, except for instances created through self-service applications. For more information, see Application Load Balancer (ALB) Instance Upgrade Announcement.
This guide uses an upgraded ALB instance as an example. If you are using a non-upgraded ALB instance, see Instructions for non-upgraded ALB instances.
Backend server limitations
Only IP-based Server Groups support adding backend servers from a different region.
You can add only private IP addresses. Public IP addresses are not supported.
To add IPv6 servers, enable the IPv6 feature when you create the IP-based Server Group. Note the following points:
You can enable IPv6 for a Server Group only if the VPC selected for the Server Group has IPv6 enabled.
IPv6 Server Groups can only be added to listeners or forwarding rules of dual-stack upgraded ALB instances. Non-upgraded ALB instances are not supported.
After you enable IPv6 for a Server Group, you can add only IPv6 addresses that are within the CIDR block of the VPC where the Server Group resides. You cannot enable the Remote IP feature.
ALB to backend server forwarding limits
If you configure an Enterprise Edition transit router for your ALB service, the transit router will create an elastic network interface (ENI) within a vSwitch in the zone you specify. The ENI works as the ingress of the transit router for receiving traffic from the VPC. Therefore, ensure that there is at least a vSwitch available in the zone you select. For more details, see How transit routers work.
You cannot customize routing tables in the VPC where your ALB service is deployed for traffic forwarding between ALB and backend servers. Only system routing tables are allowed.
Before you begin
You have two Virtual Private Clouds (VPCs): VPC1 in the China (Chengdu) region and VPC2 in the China (Hangzhou) region.
VPC1 has two vSwitches: VSW1 in Availability Zone (Zone) A and VSW2 in Zone B.
VPC2 has two vSwitches: VSW3 in Zone H and VSW4 in Zone I.
The following table shows the CIDR block plan. If you plan your own CIDR blocks, make sure that the CIDR blocks you want to interconnect do not overlap.
You have created an Elastic Compute Service (ECS) instance named ECS01 in VSW1 and another ECS instance named ECS02 in VSW3, and have deployed an application service on both instances.
You have created an internet-facing ALB instance in VPC1.
You have registered a domain name, completed ICP filing, and configured a CNAME record for an ALB instance by using your own domain name.
You have created a CEN instance and created Transit Router instances in both the China (Chengdu) and China (Hangzhou) regions for the CEN instance.
Procedure
Step 1: Create an ALB server group
Create an IP-based Server Group and add ECS01 and the cross-region ECS02 as backend servers.
Log on to the ALB console.
In the top menu bar, select the region where the ALB is located. This topic uses China (Chengdu) as an example.
In the left-side navigation pane, choose .
On the Server Group page, click Create Server Group, configure the following parameters, and then click Create.
This guide describes only the required parameters. Leave other parameters at their default values. For more information, see Server groups.
Parameter
Description
Server Group Type
Select IP. This allows you to add servers that are not in the VPC by specifying their IP addresses.
VPC
Select VPC1.
Backend Server Protocol
Select HTTP.
NoteFor a Basic ALB instance, the HTTPS listener can only select server groups with an HTTP backend protocol.
Scheduling Algorithm
Use the default value, Weighted Round-robin. For more information about scheduling algorithms, see Scheduling algorithms.
In the Server group created. dialog box, click Add Backend Server .
In the Add Backend Server panel, add the private IP address of ECS01. Click Next, set the Port and Weight for the IP address, and then click OK.
The port must be consistent with the port used by the backend service. This guide uses port 80 and the default weight.
Click Add IP Address, and add the private IP address of ECS02. Because the IP address of ECS02 is not within the CIDR block of the VPC associated with the Server Group, turn on the Remote IP switch. Then, click Next, set the Port and Weight for the IP address, and then click OK. This guide uses port 80 and the default weight.
If the Remote IP switch is turned off, you can add only IP addresses that are within the CIDR block of the VPC where the Server Group resides. If the Remote IP switch is turned on, you can add IP addresses from the following CIDR blocks:
10.0.0.0/8
100.64.0.0/10
172.16.0.0/12
192.168.0.0/16
Step 2: Configure an ALB listener
Log on to the ALB console.
In the top menu bar, select the region where the ALB instance is located. In this topic, China (Chengdu) is selected.
On the Instances page, find the ALB instance that you created in VPC1 and click Create Listener in the Operations column.
On the wizard, configure the following parameters, leave other parameters at their default values, and then click Next.
Parameter
Description
Select Listener Protocol
Select HTTP as the listener protocol.
Listener Port
Enter the port used to receive and forward requests to backend servers. Valid values: 1 to 65535. This guide uses 80.
From the Server Group drop-down list, select IP. Select the Server Group that you created in Step 1, and then click Next.
In the Configuration Review wizard, confirm the configurations and click Submit.
Step 3: Connect the VPCs to Transit Routers
Connect VPC1 to the Transit Router in the China (Chengdu) region and VPC2 to the Transit Router in the China (Hangzhou) region. This establishes private, cross-region connectivity between VPC1 and VPC2, which allows the ALB instance to forward requests to the servers in the cross-region VPC.
Log on to the CEN console.
On the Instances page, click the ID of the CEN instance that you created.
On the tab, find the Transit Router instance in the China (Chengdu) region, and click Create Connection in the Operations column.
On the Connection with Peer Network Instance page, configure the following parameters to connect VPC1 to the Transit Router in the China (Chengdu) region, and then click OK.
This guide describes only the required parameters. Leave other parameters at their default values. For more information, see Create a VPC connection on an Enterprise Edition Transit Router.
Parameter
Description
Instance Type
This guide uses VPC as an example.
Region
Select the region of the network instance to connect. This guide uses China (Chengdu) as an example.
Networks
Select the ID of the VPC to connect. This guide uses VPC1 as an example.
vSwitch
Select vSwitches from the Availability Zones that the Enterprise Edition Transit Router supports. This guide uses VSW1 and VSW2 as examples.
Click Create More Connections and use the following information to connect VPC2 to the Transit Router in the China (Hangzhou) region.
Parameter
Description
Instance Type
Select VPC.
Region
Select China (Hangzhou).
Networks
Select VPC2.
vSwitch
Select VSW3 and VSW4.
Step 4: Create a cross-region TR connection
To enable private communication between VPC1 and VPC2, create a cross-region connection between the Transit Routers in different regions after you connect the VPCs to the Transit Routers.
Log on to the CEN console.
On the Instances page, click the ID of the CEN instance that you created.
On the tab, find the Transit Router instance in the China (Chengdu) region, and click Create Connection in the Operations column.
On the Connection with Peer Network Instance page, configure the following parameters, and then click OK.
This guide describes only the required parameters. Leave other parameters at their default values. For more information, see Create a cross-region connection on an Enterprise Edition Transit Router.
Parameter
Description
Instance Type
Select Inter-region Connection.
Region
Select the region of the peer Transit Router. This guide uses China (Chengdu) as an example.
Peer Region
Select the region of the peer Transit Router. This guide uses China (Hangzhou) as an example.
Bandwidth Allocation Mode
Select Pay-By-Data-Transfer.
You can use Cloud Data Transfer (CDT) to reduce costs for cross-region traffic between Transit Routers. If you have not activated this service, we recommend that you refer to Upgrade to CDT billing to activate it. Activating CDT is free of charge. You can also use a bandwidth plan based on your business requirements.
Step 5: Verify the configuration
After you complete the preceding steps, the ALB instance can forward client requests to both ECS01 and ECS02.
Test connectivity
Enter the domain name in a browser, for example,
http://<your_domain_name>. Refresh the page multiple times. You can observe that the client receives responses as expected, and the responding server switches between ECS01 and ECS02.

Test failover
Run the
systemctl stop nginx.servicecommand on the ECS01 instance to stop the application.Enter the domain name in your browser, for example
http://<your_domain_name>. If you still receive a response, this indicates that load balancing for servers in cross-region VPCs is implemented.

FAQ
Instructions for non-upgraded ALB instances
If you are using a non-upgraded ALB instance, follow the steps below. This process requires you to add routes for VPC1, VPC2, and the Transit Routers, and configure Security Groups for the ECS instances. For details, see Step 5: Configure routes and security groups. The other steps are the same as described above.
Limitations
Routes and security groups
Using ALB with peered same-region VPCs?
Yes, you can.
How is ALB with CEN billed?
In addition to ALB fees, CEN-related fees also apply. For more information, see Billing of CEN.
Related documents
If you need to use an ALB instance to add servers from an on-premises data center in the same region, see Add on-premises servers in the same region to an ALB instance.
If you need to use a Network Load Balancer (NLB) instance to add servers from an on-premises data center in the same region or from a VPC in a different region, see Add on-premises servers in the same region to an NLB instance or Add backend servers from a cross-region VPC to an NLB instance.