By default, NetworkManager is used to manage all Ethernet network interface controllers (NICs) in a simple and easy manner in Alibaba Cloud Linux 3. However, if you use NetworkManager in specific scenarios, such as containerized scenarios, to manage all Ethernet NICs in Alibaba Cloud Linux 3, the host network configuration may conflict with the container network configuration. To prevent the preceding issue, you can configure NetworkManager to manage primary NICs, such as eth0, but not secondary NICs, such as eth1.
Limits
This topic is applicable only to Elastic Compute Service (ECS) instances that run Alibaba Cloud Linux 3.
Check the status of NICs
Run the following command to check the status of NICs:
nmcli device statusThe following command output is returned, which indicates that the eth0 and eth1 NICs are managed by NetworkManager, but the lo NIC is not managed by NetworkManager.

Configure NetworkManager not to manage secondary NICs
You can use one of the following methods to configure NetworkManager not to manage secondary NICs. In the following examples, NetworkManager is configured not to manage the eth1 secondary NIC.
Method 1: Modify the unmanaged.conf file
The changes that you make by using this method immediately take effect and persist. The changes remain in effect even after you restart the operating system.
The unmanaged.conf file persists when you upgrade the NetworkManager Red Hat Package Manager (RPM) package or when you delete and then re-install the package.
Run the following command to open the
unmanaged.conffile:sudo vim /etc/NetworkManager/conf.d/unmanaged.confPress the
Ikey to enter Insert mode. Add the following content to the file:[keyfile] unmanaged-devices=interface-name:eth1Press the
Esckey, enter:wq, and then press theEnterkey to save and close the file.Run the following command for the changes to take effect:
sudo systemctl restart NetworkManagerRun the following command to check whether the changes have taken effect:
nmcli device status
Method 2: Run the nmcli command
The changes that you make by using this method immediately take effect but do not persist.
Run the following command to change the status of the
eth1secondary NIC to unmanaged:sudo nmcli device set eth1 managed noRun the following command to check whether the eth1 secondary NIC is in the unmanaged state:
nmcli device status
Method 3: Modify the ifcfg-eth1file
The changes that you make by using this method immediately take effect but do not persist.
Run the following command to open the
ifcfg-eth1file:sudo vim /etc/sysconfig/network-scripts/ifcfg-eth1Press the
Ikey to enter Insert mode. Append the following content to the end of the file:NM_CONTROLLED=noPress the
Esckey, enter:wq, and then press theEnterkey to save and close the file.Run the following command for the changes to take effect:
sudo systemctl restart NetworkManagerRun the following command to check whether the changes have taken effect:
nmcli device status