Copyright Notice
©2013-2026 Tencent Cloud. All rights reserved.
Copyright in this document is exclusively owned by Tencent Cloud. You must not reproduce, modify, copy or distribute in any way, in whole or in part, the contents of this document without Tencent Cloud's the prior written consent.
Trademark Notice
All trademarks associated with Tencent Cloud and its services are owned by the Tencent corporate group, including its parent, subsidiaries and affiliated companies, as the case may be. Trademarks of third parties referred to in this document are owned by their respective proprietors.
Service Statement
This document is intended to provide users with general information about Tencent Cloud's products and services only and does not form part of Tencent Cloud's terms and conditions. Tencent Cloud's products or services are subject to change. Specific products and services and the standards applicable to them are exclusively provided for in Tencent Cloud's applicable terms and conditions.
Last updated:2024-10-23 10:24:14
Last updated:2024-10-23 10:24:13


Last updated:2024-10-23 10:24:13

Last updated:2026-03-13 10:38:09
Last updated:2024-10-23 10:24:13


Last updated:2025-12-15 19:29:17
wget https://iso-1255486055.cos.ap-guangzhou.myqcloud.com/nic-hotplug.tgz
tar -zxvf nic-hotplug.tgz
cd nic-hotplugchmod +x ./install.sh./install.sh
ip rule show command. You can see that the policy-based route of the ENI eth1 has been added.
ip route show table eth1 command to view the ENI eth1 route table.
reboot command. Then, the routes of all ENIs will be automatically distributed.
eth1.ip addr

/etc/sysconfig/network-scripts/ folder.cd /etc/sysconfig/network-scripts/
ifcfg-eth1 for the new ENI.cp ifcfg-eth0 ifcfg-eth1
vim ifcfg-eth1
DEVICE='eth1' # Enter the actual ENI name obtained in step 1.NM_CONTROLLED='yes'ONBOOT='yes'IPADDR='192.168.1.62' # Enter the actual IP address of the ENI.NETMASK='255.255.255.192' # Enter the actual subnet mask.#GATEWAY='192.168.1.1' # Enter the actual IP address of the gateway of the subnet where the ENI is located. In this example, because eth1 and eth0 are in the same subnet and the gateway has been defined, so the IP address will not be entered repeatedly here to avoid gateway conflict.
BOOTPROTO=dhcp #Automatically acquire IP addressDEVICE=eth1 # Enter the name of the ENI to be configuredHWADDR=20:90:6F:63:98:CC # Please replace it with the actual MAC address of the ENIONBOOT=yesPERSISTENT_DHCLIENT=yesTYPE=EthernetUSERCTL=noPEERDNS=noDEFROUTE=no # Determine whether to set the ENI as the default route. Do not set eth1 as the default route here for avoiding route conflict
systemctl restart network
systemctl restart NetworkManager
ip addr

systemctl restart network
echo "10 t1" >> /etc/iproute2/rt_tables #Replace “10” with the actual route ID and “t1” with the actual route table name.echo "20 t2" >> /etc/iproute2/rt_tables #Replace “20” with the actual route ID and “t2” with the actual route table name.
ip route add default dev eth0 via 192.168.1.1 table 10 #Replace “192.168.1.1” with the subnet gateway of the primary ENI.ip route add default dev eth1 via 192.168.1.1 table 20 #Replace “192.168.1.1” with the subnet gateway of the secondary ENI.
vim /etc/sysconfig/network-scripts/route-eth0 # Edit the route-eth0 file
default dev eth0 via 192.168.1.1 table 10 # Add a default gateway for route table 10 in the route-eth0 file
vim /etc/sysconfig/network-scripts/route-eth0 # Edit the route-eth1 file default dev eth0 via 192.168.1.1 table 20 # Add a default gateway for route table 20 in the route-eth0 file
systemctl restart network
ip rule add from 192.168.1.5 table 10 #Enter the actual IP address of the primary ENI.ip rule add from 192.168.1.62 table 20 #Enter the actual IP address of the secondary ENI.
eth1.ip addr

/etc/network/ folder.cd /etc/network/
sudo suvim interfaces
auto eth1 # Enter the actual ENI name obtained in step 1.iface eth1 inet static # Enter the actual ENI name obtained in step 1.address 172.21.48.3 # Enter the actual IP address of the ENI.netmask 255.255.240.0 # Enter the actual subnet mask.
sudo suapt install ifupdown
ifdown eth1
ifup eth1
ip addr

ifdown eth1ifup eth1
echo "10 t1" >> /etc/iproute2/rt_tables #Replace “10” with the actual route ID and “t1” with the actual route table name.echo "20 t2" >> /etc/iproute2/rt_tables #Replace “20” with the actual route ID and “t2” with the actual route table name.
ip route add default dev eth0 via 172.21.48.1 table 10 #Replace “172.21.48.1” with the subnet gateway of the primary ENI.ip route add default dev eth1 via 172.21.48.1 table 20 #Replace “172.21.48.1” with the subnet gateway of the secondary ENI.
ip rule add from 172.21.48.11 table 10 #Enter the actual IP address of the primary ENI.ip rule add from 172.21.48.3 table 20 #Enter the actual IP address of the secondary ENI.
255.255.240.0.
The relationship between the CIDR bits and the subnet mask is described in the following table:CIDR Bits | Subnet Mask |
/28 | 255.255.255.240 |
/27 | 255.255.255.224 |
/26 | 255.255.255.192 |
/25 | 255.255.255.128 |
/24 | 255.255.255.0 |
/23 | 255.255.254.0 |
/22 | 255.255.252.0 |
/21 | 255.255.248.0 |
/20 | 255.255.240.0 |
/19 | 255.255.224.0 |
/18 | 255.255.192.0 |
/17 | 255.255.128.0 |
/16 | 255.255.0.0 |
192.168.0.0/24, the gateway is 192.168.0.1.
If you are not sure about the subnet IP range of the ENI, please follow the steps below:10.0.1.1.
Last updated:2024-10-23 10:24:14
Last updated:2024-10-23 10:24:13
Last updated:2024-10-23 10:24:13

Last updated:2024-10-23 10:24:13

Last updated:2024-10-23 10:24:14

10.0.0.0/24, the entered private IP address should be within 10.0.0.2 - 10.0.0.254.
# For example, `ip addr add 10.0.0.2/24 dev eth0`ip addr add Secondary private IP/CIDR bits dev eth0
ip addr command to view the configured IPs, as shown below.



ipconfig /all
Parameter Name | Parameter Value |
IP address | The IPv4 address obtained in step 1 |
Subnet mask | The subnet mask obtained in step 1 |
Default gateway | The default gateway obtained in step 1 |
Preferred DNS server | The DNS server obtained in step 1 |
Alternate DNS server | The alternate DNS server obtained in step 1. If the alternate DNS server is not given, ignore this parameter |
Last updated:2024-10-23 10:24:13


Last updated:2024-10-23 10:24:13



Last updated:2024-10-23 10:24:13


Last updated:2024-10-23 10:24:13


