how to keep eth link down across reboots ?

Thomas Haller thaller at redhat.com
Wed Dec 13 08:16:10 UTC 2023


On Wed, 2023-12-13 at 09:05 +0100, lejeczek wrote:
>  Hi guys.
>  
>  how would you keep an Ethernet link/port powered down?
>  I was thinking I'll try first _udev_ rules - given other
> tools/managers are told to stay away from the link/port just as an
> extra precaution, complementing this:
>  
>  [keyfile]
>  unmanaged-devices=interface-name:gateway
>  
>  in NM's conf, but that part of the config - in order for NM to be
> able to bring iface up/down again - needs to be absent/not-used & NM
> has to reloaded.
>  Anybody would have a better, more practical solution?
>  
>  Just to stress - this is about having physical port "powered-down"
> and not just NM profile/iface not being up.
>  
>  many thanks, L. 


Hi,


just configure the interface as unmanaged.


I think the best way is a file /etc/NetworkManager/conf.d/90-device-
unmanage-gateway.conf with

   [device-90-device-unmanage-gateway]
   match-device=interface-name:gateway
   managed=0


This is best, because you can still overwrite it at runtime with `nmcli
device set $DEVICE managed yes` (only if you choose to).

Alternatives are:

- udev attribute NM_UNMANAGED=1
- udev attribute "ID_NET_MANAGED_BY" set to something other than
"org.freedesktop.NetworkManager" (since 1.45)
- [keyfile].unmanaged-devices= in NetworkManager.conf

(you don't need multiple ways for the same thing, as a "precaution").


See `man NetworkManager` and `man NetworkManager.conf`.


Thomas



More information about the Networkmanager mailing list