A secondary network interface is a type of elastic network interface. Secondary network interfaces can be attached to ECS instances within a VPC and can be migrated between different ECS instances.
ALB allows you to add both the primary private IP address and secondary private IP addresses of a secondary network interface to a server group.
To use a secondary network interface as a backend server, you need to perform the following operations:
The secondary network interface must be attached to an ECS instance. For detailed instructions, see Attaching a secondary network interface.
Log in to the ALB console.
In the left-side navigation pane, click Server group to go to the Server group page.
On the Server group page, find the server group to which you want to add a backend server, and then click Add backend server in the Actions column.
On the Select backend server page, enable Advanced mode.
Select the secondary network interface attached to the ECS instance, select IP addresses, and then click Next: configure ports and weights. You can select one or more IP addresses of the secondary network interface.
On the Configure ports and weights page, set the port and weight for the backend server, and then click Save.
tip
Parameter | Description |
|---|---|
Port | Configure the port of the backend server. The backend server uses this port to provide services and receive requests. Valid values: 1 to 65535. |
Weight | Configure the weight of the backend server. Default value: 100. Valid values: 0 to 100.
|
Copy | Optional. Click Clone to clone an added backend server entry. After that, enter a different port number in the new entry. This method allows ALB to forward requests to different ports of the same backend server. |
Remove | Optional. Click Remove to remove the added backend server. |
ALB uses the private CIDR block 100.64.0.0/10 to forward client requests and send health check requests to backend servers. When a secondary network interface is used as a backend server, you need to configure a route containing this private CIDR block 100.64.0.0/10 for the network interface. This allows the backend server to properly respond to client requests and health check requests.
The route information that needs to be configured is as follows:
Destination Address | Destination Address Mask | Gateway Address | Network Interface | Hop Count |
|---|---|---|---|---|
100.64.0.0 | 255.192.0.0 | Gateway address of the subnet where the network interface is located | Name of the secondary network interface, such as eth2 | 100 |
For specific methods to configure a network interface route, refer to Configure a network interface route.
warning
After configuring routes through the command line interface (CLI), if you restart the ECS instance, the manually added routes will be cleared. In this case, you need to reconfigure the routes.