The software configures Network Manager to ignore some network devices
This article will explain in detail about software configuration Network Manager to ignore some network devices. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
NetworkManager is a daemon that can dynamically control and configure the network, corresponding to the NetworkManager.service service, the default profile path / etc/NetworkManager/NetworkManager.conf. Starting with RHEL/CentOS 7, network functions are provided by default by NetworkManager in the form of services. The server version of Ubuntu does not enable NetworkManager by default.
By default, NetworkManager manages all devices except lo (loopback) devices. However, in the container environment, many network devices are created by network drivers, and the control of container network devices by NetworkManager may lead to abnormal cluster network communication. Because container-related devices need to be set to unmanaged so that NetworkManager ignores these devices.
View device status # View device management status
Nmcli device status
Temporary unmanaged
If it is only a temporary test, you can use the nmcli command to set a network device to the unmanaged state. However, as soon as the NetworkManager service is restarted or the host is restarted, the network interface will return to the managed state.
Nmcli device set xxx managed no
Permanent unmanaged
To permanently exclude NetworkManager from managing some network devices, you need to set it through a configuration file.
Enable plug-in
Enable the plug-in keyfile under the [main] level of the / etc/NetworkManager/NetworkManager.conf configuration file.
[main]
Plugins=keyfile
Create a / etc/NetworkManager/conf.d/99-unmanaged-devices.conf configuration file that contains the following:
[keyfile]
Unmanaged-devices=interface-name:eth*,except:interface-name:eth0;interface-name:docker0;interface-name:flannel*;interface-name:flannel*;interface-name:cni0;;mac:66:77:88:99:00:aa
Separate by semicolon
You can use wildcards to match interfaces
Interface-name:eth*,except:interface-name:eth0; said: except for eth0, all other interfaces that begin with eth are unmanaged.
Interfaces can be excluded by mac address
Reload configuration
Systemctl reload NetworkManager
Disable Network Manager
Configuration errors, or untimely configuration updates, can lead to unnecessary problems. If you do not have to use NetworkManager services, it is generally recommended to disable NetworkManager services.
This is the end of the article on "configuring Network Manager to ignore some network devices". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.