Creating a Supplementary Network Interface
Scenarios
The number of elastic network interfaces that can be attached to each ECS is limited. If this limit cannot meet your requirements, you can use supplementary network interfaces.
Notes and Constraints
- Supplementary network interfaces and its elastic network interface must be in the same VPC but can belong to different subnets and security groups.
- Before using a supplementary network interface, you need to create a VLAN sub-interface on its ECS NIC and configure routes. For details, see Configuring a Supplementary Network Interface.
Creating a Supplementary Network Interface
- Log in to the management console.
- Click in the upper left corner and select the desired region and project.
- Click in the upper left corner and choose Network > Virtual Private Cloud.
The Virtual Private Cloud page is displayed.
- In the upper right corner of the page, click Create Supplementary Network Interface.
- Configure the parameters based on Table 1.
Table 1 Parameter descriptions Parameter
Description
Example Value
Network Interface
Elastic network interface that the supplementary network interface to be attached to.
Select an elastic network interface from the drop-down list.
--(172.16.0.145)
VPC
VPC that the supplementary network interface belongs to. You do not need to set this parameter.
vpc-A
Subnet
Select the subnet for the supplementary network interface.
subnet-A01
Description
(Optional) Enter the description of the supplementary network interface in the text box as required.
The description can contain a maximum of 255 characters and cannot contain angle brackets (< or >).
-
Quantity
Number of supplementary network interfaces to be created. The value ranges from 1 to 20.
1
Private IP Address
Whether to assign a private IPv4 address to the supplementary network interface.
This parameter cannot be deselected in the current version.
-
IPv4 Address
Select a virtual IP address assignment mode.
- Automatically assign IP address: The system assigns an IP address automatically.
- Manually specify IP address: The system assigns an IP address that you specify.
If you select Manually specify IP address, enter a private IPv4 address.
Automatically assign IP address
Security Group
Select the security group that the supplementary network interface belongs to.
sg-001
- Click OK.
After a supplementary network interface is created, you need to create a VLAN sub-interface on the ECS NIC and configure routes. For details, see Configuring a Supplementary Network Interface.
Configuring a Supplementary Network Interface
After a supplementary network interface is created, you need to create a VLAN sub-interface and configure a private IP address and default routes for the interface.
You need to obtain the information about the supplementary network interface, as shown in Table 2.
Information |
How to Obtain |
Description |
---|---|---|
VLAN |
Management console |
Obtain the value from the supplementary network interface list. For details, see Viewing Basic Information About a Supplementary Network Interface. |
MAC address |
||
Private IP address |
||
Gateway |
Obtain the value from the details page of the subnet that the supplementary network interface belongs to. |
The following describes how to create a VLAN sub-interface on eth0 of an ECS (CentOS 8.2 is used as an example. For details about other OSs, see the OS documentation).
In this example:
- VLAN: 2110
- Private IP address: 192.168.0.2/24
- Gateway: 192.168.0.1
- MAC address: fa:16:3e:a1:b2:**
Procedure
- Log in to the ECS.
- Create a VLAN sub-interface for eth0.
- Create a namespace ns2110.
ip netns add ns2110
- Add the VLAN sub-interface eth0.2110 to the namespace ns2110.
ip link set eth0.2110 netns ns2110
- Change the MAC address of the VLAN sub-interface to fa:16:3e:a1:b2:**.
ip netns exec ns2110 ifconfig eth0.2110 hw ether fa:16:3e:a1:b2:**
- Enable the VLAN sub-interface.
- Configure the private IP address 192.168.0.2/24 for the VLAN sub-interface.
ip netns exec ns2110 ip addr add 192.168.0.2/24 dev eth0.2110
- Configure the default route for the VLAN sub-interface. 192.168.0.1 is the gateway of the subnet that the supplementary network interface works.
Verification
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