Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Chapter 15. Configuring NetworkManager to ignore certain interfaces
To handle a network interface manually, configure it as unmanaged in NetworkManager. By default, NetworkManager manages all of them except those described in the /usr/lib/udev/rules.d/85-nm-unmanaged.rules file. You can explicitly configure other interfaces to be unmanaged to ignore them.
NetworkManager automatically activates any managed interface that detects a physical carrier signal. However, you can disable this behavior to prevent one from automatically coming online when a cable is connected. This is useful for securing or isolating unused interfaces.
15.1. Permanently configuring an interface as unmanaged by using a NetworkManager device section Link kopierenLink in die Zwischenablage kopiert!
Defining an interface as unmanaged sets it administratively down. If you use a device section in the configuration file for this action, you can set interfaces as unmanaged based on criteria, such as MAC address. NetworkManager does not manage these interfaces until you include them in a connection profile.
Use a device section in the configuration file to configure interfaces as unmanaged if you require flexible criteria, such as wildcards to match all wifi interfaces.
Procedure
Optional: Display the list of interfaces to identify the device or MAC address you want to set as
unmanaged:# ip link show ... 2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000 link/ether 52:54:00:74:79:56 brd ff:ff:ff:ff:ff:ff ...-
Create a
*.conffile in the/etc/NetworkManager/conf.d/directory, for example,/etc/NetworkManager/conf.d/99-unmanaged-devices.conf. For each interface you want to configure as unmanaged, add a section with a unique name to the file.
ImportantThe section name must begin with
device-.To configure a specific interface as unmanaged, add:
[device-enp1s0-unmanaged] match-device=interface-name:enp1s0 managed=0To configure an interface with a specific MAC address as unmanaged, add:
[device-mac525400747956-unmanaged] match-device=mac:52:54:00:74:79:56 managed=0To configure all interfaces of a specific type as unmanaged, add:
[device-ethernet-unmanaged] match-device=type:ethernet managed=0To set multiple interfaces as unmanaged, separate the entries in the
unmanaged-devicesparameter with a semicolon, for example:[device-multiple-devices-unmanaged] match-device=interface-name:enp1s0;interface-name:enp7s0 managed=0
Alternatively, you can add separate sections for each interface in this file or create additional
*.conffiles in the/etc/NetworkManager/conf.d/directory.Restart the host system:
# rebootThe reboot clears the state in the
/run/NetworkManager/devices/directory. This prevents that NetworkManager uses an existing connection from this directory for the interface you set as unmanaged.
Verification
Display the list of interfaces:
# nmcli device status DEVICE TYPE STATE CONNECTION enp1s0 ethernet unmanaged -- ...The
unmanagedstate next to theenp1s0device indicates that NetworkManager does not manage this interface.
Troubleshooting
If the output of the
nmcli device statuscommand does not list the interface asunmanaged, display the NetworkManager configuration:# NetworkManager --print-config ... [device-enp1s0-unmanaged] match-device=interface-name:enp1s0 managed=0 ...If the output does not match the settings that you configured, ensure that no configuration file with a higher priority overrides your settings. For details on how NetworkManager merges multiple configuration files, see the
NetworkManager.conf(5)man page on your system.
15.2. Temporarily configuring an interface as unmanaged by using nmcli Link kopierenLink in die Zwischenablage kopiert!
You can temporarily configure interfaces as unmanaged, for example, for testing purposes. This change persists a reload and restart of the NetworkManager systemd service, but not a system reboot.
Procedure
Optional: Display the list of interfaces to identify the one you want to set as
unmanaged:# nmcli device status DEVICE TYPE STATE CONNECTION enp1s0 ethernet disconnected -- ...Set an interface to the
unmanagedstate:# nmcli device set <interface> managed noOptional: Deactivate the interface:
# ip link set <interface> down
Verification
Display the list of interfaces:
# nmcli device status DEVICE TYPE STATE CONNECTION enp1s0 ethernet unmanaged -- ...The
unmanagedstate next to theenp1s0interface indicates that NetworkManager does not manage this device.If you have also deactivated the interface, verify that its state is
down:# ip link show enp1s02: enp1s0: <BROADCAST,MULTICAST> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000