how to keep eth link down across reboots ?

Íñigo Huguet ihuguet at redhat.com
Thu Dec 14 11:17:24 UTC 2023


On Thu, Dec 14, 2023 at 12:01 PM lejeczek <peljasz at yahoo.co.uk> wrote:
> Thanks a lot! That seems more practical.
> There is one aspect I did not think of at first - will NM
> this way(or any other) be able to detect physical link/cable
> removal (naturally while device+profile/iface is up/on) ?
> BTW, what would a good way to watch such link (for such
> cable removal) outside (but perhaps with NM help) of NM?
>
> many thanks, L.
>

NM can show you de carrier state of any device, even unmanaged
devices, I think: nmcli -g WIRED-PROPERTIES.CARRIER device show eth0

If you have a profile on the interface and autoconnect=yes, it will
react to carrier up/down events, activating or deactivating that
profile (this won't happen if you configure ignore-carrier in the
.conf files, but for ethernet, by default carrier events are
considered).

Also, with some python scripting you could listen to the
notify::carrier signal that is sent via DBUS. Ask here for an example
if you intend to take this way.

-- 
Íñigo Huguet



More information about the Networkmanager mailing list