Chapter 6. Configuring NetworkManager to ignore certain devices

By default, NetworkManager manages all devices except the lo (loopback) device. However, you can set certain devices as unmanaged to configure that NetworkManager ignores these devices. With this setting, you can manually manage these devices, for example, using a script.

6.1. Permanently configuring a device as unmanaged in NetworkManager

You can configure devices as unmanaged based on several criteria, such as the interface name, MAC address, or device type. This procedure describes how to permanently set the enp1s0 interface as unmanaged in NetworkManager.

To temporarily configure network devices as unmanaged, see Section 6.2, “Temporarily configuring a device as unmanaged in NetworkManager”.

Procedure

  1. Optional: Display the list of devices to identify the device you want to set as unmanaged:

    # nmcli device status
    DEVICE  TYPE      STATE         CONNECTION
    enp1s0  ethernet  disconnected  --
    ...
  2. Create the /etc/NetworkManager/conf.d/99-unmanaged-devices.conf file with the following content:

    [keyfile]
    unmanaged-devices=interface-name:enp1s0

    To set multiple devices as unmanaged, separate the entries in the unmanaged-devices parameter with semicolon:

    [keyfile]
    unmanaged-devices=interface-name:interface_1;interface-name:interface_2;...
  3. Reload the NetworkManager service:

    # systemctl reload NetworkManager

Verification steps

  • Display the list of devices:

    # nmcli device status
    DEVICE  TYPE      STATE      CONNECTION
    enp1s0  ethernet  unmanaged  --
    ...

    The unmanaged state next to the enp1s0 device indicates that NetworkManager does not manage this device.

Additional resources

  • For a list of criteria you can use to configure devices as unmanaged and the corresponding syntax, see the Device List Format section in the NetworkManager.conf(5) man page.

6.2. Temporarily configuring a device as unmanaged in NetworkManager

You can configure devices as unmanaged based on several criteria, such as the interface name, MAC address, or device type. This procedure describes how to temporarily set the enp1s0 interface as unmanaged in NetworkManager.

Use this method, for example, for testing purposes. To permanently configure network devices as unmanaged, see Section 6.1, “Permanently configuring a device as unmanaged in NetworkManager”.

Use this method, for example, for testing purposes. To permanently configure network devices as unmanaged, see the Permanently configuring a device as unmanaged in NetworkManager section in the Configuring and managing networking documentation.

Procedure

  1. Optional: Display the list of devices to identify the device you want to set as unmanaged:

    # nmcli device status
    DEVICE  TYPE      STATE         CONNECTION
    enp1s0  ethernet  disconnected  --
    ...
  2. Set the enp1s0 device to the unmanaged state:

    # nmcli device set enp1s0 managed no

Verification steps

  • Display the list of devices:

    # nmcli device status
    DEVICE  TYPE      STATE      CONNECTION
    enp1s0  ethernet  unmanaged  --
    ...

    The unmanaged state next to the enp1s0 device indicates that NetworkManager does not manage this device.

Additional resources

  • For a list of criteria you can use to configure devices as unmanaged and the corresponding syntax, see the Device List Format section in the NetworkManager.conf(5) man page.