If the number of network interfaces attached to an instance exceeds the upper limit, you can attach supplementary network interfaces to the network interfaces, including the primary and extended network interfaces, of the instance. This helps you set up flexible and highly available networks.
in the upper left corner and choose Network > Virtual Private Cloud.The Virtual Private Cloud page is displayed.
Parameter | Description | Example Value |
|---|---|---|
Region | Region where the supplementary network interface will be created. Select the region nearest to you to ensure the lowest latency possible. | - |
Network Interface | Network interface that you want the supplementary network interface to attach to. Select an elastic network interface from the drop-down list. | --(172.16.0.145) |
VPC | VPC where the supplementary network interface will be created. The VPC of the network interface that the supplementary network interface is attached to is selected by default. | vpc-A |
Subnet | Subnet where the supplementary network interface will be created. The supplementary network interface and its network interface can be in different subnets. | subnet-A01 |
Quantity | Number of supplementary network interfaces to be created. | 1 |
Private IP Address | Whether to assign a private IPv4 address or IPv6 address to the supplementary network interface. There are two options: IPv6 is shown only when IPv6 is enabled for the subnet of the supplementary network interface. | IPv4 |
IPv4 Address | How a private IPv4 address will be assigned to the supplementary network interface. There are two options: If you select Manually specify IP address, enter a private IPv4 address. | Automatically assign IP address |
IPv6 Address | How an IPv6 address will be assigned to the supplementary network interface if IPv6 network (Public and private network traffic) is selected for Private IP Address. There are two options: If you select Manually specify IP address, enter an IPv6 address. | Automatically assign IP address |
Security Group | Security group that the supplementary network interface will be associated with. | sg-001 |
Description (Optional) | Description of the supplementary network interface. The description can contain a maximum of 255 characters and cannot contain angle brackets (< or >). | - |
To use a supplementary network interface, you need to create a VLAN subinterface. For details, see Configuring a Supplementary Network Interface.
After a supplementary network interface is created, you need to create a VLAN subinterface for the network interface of the instance and configure a private IP address and default routes for the supplementary network interface.
Before doing so, you need to obtain:
Item | How to Obtain |
|---|---|
VLAN ID |
|
MAC address | |
Private IP address | |
Subnet mask |
|
Gateway address |
Item | How to Obtain |
|---|---|
MAC address |
|
Private IP address | |
Subnet mask |
|
Gateway address |
The following describes how to create a VLAN subinterface for a supplementary network interface of an ECS network interface. CentOS 7.8 is used as an example. In this example, the information about the supplementary network interface and subnet is as follows: This example describes how to configure the supplementary network interface for the primary network interface of an ECS. If you want to do the same thing for the extended network interface of the ECS, follow the similar steps.
ifconfig
Information similar to the following is displayed. In this example, the network interface name is eth0.
ip link add link <network-interface-name> name <VLAN-subinterface-name> type vlan id <VLAN-ID-of-the-supplementary-network-interface>
Variables in the preceding command are as follows:
Example command:
ip link add link eth0 name eth0.1937 type vlan id 1937
ip netns add <namespace-name>
namespace-name: Name it in the format of ns<supplementary-network-interface-VLAN-ID>. In this example, the name is ns1937.
Example command:
ip netns add ns1937
ip link set <VLAN-subinterface-name> netns <namespace-name>
Example command:
ip link set eth0.1937 netns ns1937
ip netns exec <namespace-name> ifconfig <VLAN-subinterface-name> hw ether <MAC-address-of-the-supplementary-network-interface>
Example command:
ip netns exec ns1937 ifconfig eth0.1937 hw ether fa:16:3e:6d:c5:5a
ip netns exec <namespace-name> ifconfig <VLAN-subinterface-name> up
Example command:
ip netns exec ns1937 ifconfig eth0.1937 up
ip netns exec <namespace-name> ip addr add <private-IP-address> dev <VLAN-subinterface-name>
private-IP-address: private IP address of the supplementary network interface/subnet mask. In this example, the value is 192.168.0.149/24.
Example command:
ip netns exec ns1937 ip addr add 192.168.0.149/24 dev eth0.1937
ip netns exec <namespace-name> ip route add default via <gateway-address-of-the-subnet-where-the-supplementary-network-interface-is-created>
Example command:
ip netns exec ns1937 ip route add default via 192.168.0.1
ping <private-IP-address-of-the-test-ECS>
Plan the same VPC and security group for the test ECS and the ECS with network interface attached, so that the two ECSs can communicate with each other by default.
Example command:
ping 192.168.0.133
If information similar to the following is displayed, the two ECSs can communicate with each other. If the communication is normal, proceed with 10.b.
ip netns exec <namespace-name> ping <private-IP-address-of-the-test-ECS>
Plan the same VPC and security group for the test ECS and the ECS with the supplementary network interface attached. This allows the two ECSs to communicate with each other by default.
Example command:
ip netns exec ns1937 ping 192.168.0.133
If information similar to the following is displayed, the two ECSs can communicate with each other. This means the supplementary network interface has worked.
[root@ecs-subeni-linux ~]# ip netns exec ns1937 ping 192.168.0.133PING 192.168.0.133 (192.168.0.133) 56(84) bytes of data.64 bytes from 192.168.0.133: icmp_seq=1 ttl=64 time=0.420 ms64 bytes from 192.168.0.133: icmp_seq=2 ttl=64 time=0.233 ms...--- 192.168.0.133 ping statistics ---2 packets transmitted, 2 received, 0% packet loss, time 999msrtt min/avg/max/mdev = 0.233/0.326/0.420/0.095 ms
vi /etc/rc.local
The parameters and values must be the same as those in steps 3 to 9.
chmod +x /etc/rc.local
If your operating system is Red Hat or EulerOS, run the following command after you perform 11.a.v:
chmod +x /etc/rc.d/rc.local
If DNS resolution is not required, take step 11.c to restart the ECS. cd /etc/sysconfig/network-scripts/ vi ifcfg-<network-interface-name> network-interface-name: the name queried in 2. In this example, the name is vi ifcfg-eth0. 114.114.114.114 is the public recursive DNS address.
reboot
ip netns exec <namespace-name> ping <public-domain-name>
For details, see Adding a Security Group Rule.
Direction | Priority | Action | Type | Protocol & Port | Source |
|---|---|---|---|---|---|
Inbound | 1 | Allow | IPv4 | TCP: 22 | Set the IP address based on service requirements. For example, to remotely log in to the ECS from a local PC, set the source to the IP address of the local PC. |
ip netns exec <namespace-name> netstat -antp | grep 22
Example command:
ip netns exec ns1937 netstat -antp | grep 22
ip netns exec <namespace-name> /sbin/sshd
Example command:
ip netns exec ns1937 /sbin/sshd
ip netns exec <namespace-name> netstat -antp | grep 22
Example command:
ip netns exec ns1937 netstat -antp | grep 22
If information similar to the following is displayed, port 22 is listened on:
For details, see Adding a Security Group Rule.
Direction | Priority | Action | Type | Protocol & Port | Source |
|---|---|---|---|---|---|
Inbound | 1 | Allow | IPv4 | TCP: 80 | 0.0.0.0/0 Allows any IP address to access the supplementary network interface over port 80. |
ip netns exec <namespace-name> netstat -antp | grep 80
Example command:
ip netns exec ns1937 netstat -antp | grep 80
The following describes how to create a VLAN subinterface on the network interface of a Windows ECS. Windows Server 2019 Standard 64bit is used as an example. In this example, the information about the supplementary network interface, primary network interface, and subnet is as follows: This example describes how to configure the supplementary network interface for the primary network interface of an ECS. If you want to do the same thing for the extended network interface of the ECS, follow the similar steps.
ipconfig
Information similar to the following is displayed. In this example, the Ethernet adapter name is tap7888b905-ee.

New-NetLbfoTeam -Name <bond-group-name> -TeamMembers "<Ethernet-adapter-name-of-the-network-interface>" -TeamingMode SwitchIndependent -LoadBalancingAlgorithm IPAddresses -Confirm:$false
Variables in the preceding command are as follows:
Example command:
New-NetLbfoTeam -Name Team1 -TeamMembers "tap7888b905-ee" -TeamingMode SwitchIndependent -LoadBalancingAlgorithm IPAddresses -Confirm:$false
Information similar to the following is displayed.

Get-NetLbfoTeamMember
Information similar to the following is displayed.

Get-NetAdapter
Information similar to the following is displayed:

Add-NetLbfoTeamNIC -Team "<bond-group-name>" -VlanID <VLAN-ID-of-the-supplementary-network-interface> -Confirm:$false
Example command:
Add-NetLbfoTeamNIC -Team "Team1" -VlanID 2242 -Confirm:$false
Information similar to the following is displayed:

ncpa.cpl
On the displayed page, Team1 is the bond group created in 4.a, and Team1 – VLAN 2242 is the VLAN subinterface created in 5.a.

The Team1 Status page is displayed.

The Team1 Properties page is displayed.

The Microsoft Network Adapter Multiplexor Driver Properties page is displayed.

When entering the MAC address, remove the colons (:) and use the uppercase letters. For example, if the MAC address of the network interface is fa:16:3e:6d:c5:d5, enter FA163E6DC5D5.

The Internet Protocol Version 4 (TCP/IPv4) Properties page is displayed.




On the Network Connection Details page, check whether the following information is correctly configured:


The Network Connections page is displayed.

The Team1 - VLAN 2242 Status page is displayed.

The Team1 - VLAN 2242 Properties page is displayed.

The Microsoft Network Adapter Multiplexor Driver #2 Properties page is displayed.

When entering the MAC address, remove the colons (:) and use the uppercase letters. For example, if the MAC address of the supplementary network interface is fa:16:3e:6d:c5:db, enter FA163E6DC5DB.

The Internet Protocol Version 4 (TCP/IPv4) Properties page is displayed.



If the following warning is displayed, click Yes to close the dialog box.


On the Network Connection Details page, check whether the following information is correctly configured:


Ping <private-IP-address-of-the-test-ECS> -S <private-IP-address-of-the-network-interface>
Plan the same VPC and security group for the test ECS and the ECS with network interface attached, so that the two ECSs can communicate with each other by default.
Example command:
Ping 192.168.0.133 -S 192.168.0.16
If information similar to the following is displayed, the two ECSs can communicate with each other.

Ping <private-IP-address-of-the-test-ECS> -S <private-IP-address-of-the-supplementary-network-interface>
Plan the same VPC and security group for the test ECS and the ECS with the supplementary network interface attached. This allows the two ECSs to communicate with each other by default.
Example command:
Ping 192.168.0.133 -S 192.168.0.22
If information similar to the following is displayed, the two ECSs can communicate with each other.
