Linux 101 : The NetworkManager, the unmanaged devices and the nmcli tool
The devices that are not managed by the NetworkManager are called "unmanaged" devices.
The nmcli command and the unmanaged devices:
We could use the "nmcli" command to see the "unmanaged" devices:
The interfaces defined in "/etc/network/interfaces" file are not handled by the NetworkManager.
How to set a device as "unmanaged":
To turn a device into an "unmanaged" device, we list it in the "/etc/network/interfaces" file, then we set the below parameters in the "/etc/NetworkManager/NetworkManager.conf" file:
To make the NetworkManager handle a device, we list the interface in the "/etc/network/interfaces" file and we set in the "/etc/NetworkManager/NetworkManager.conf " file the "managed" parameter:
Then, we would need to restart the NetworkManager for the changes to take effect:
Setting the device to "unmanaged" using the nmcli tool:
We can set a device to unmanaged using the "nmcli" command as below:
Example:
We then set the device to "unmanaged".
Then we get the below:
Below is an example of the "/etc/network/interfaces" file:
We can use the ifup and ifdown command to bring an interface (mentioned in the "interface" file) up or down.
Below is the location where we can put the script than we want the system to run before and after bringing up an interface respectively:
- /etc/network/if-pre-up.d/
- /etc/network/if-up.d/
Below is the location where we can put the scripts that the system runs before and after bringing down an interface:
- /etc/network/if-down.d/
- /etc/network/if-post-down.d/
Comments