[Networkmanager] Prevent activation of network connection

Thomas Haller thaller at redhat.com
Tue Dec 20 10:02:59 UTC 2022


On Mon, 2022-12-19 at 16:31 -0700, Orion Poplawski wrote:
> Is it possible to prevent activation of a connection via a dispatcher
> pre-up
> script or similar?  I'm trying to recreate the effect of the Windows
> "Disable
> Simultaneous Connection to Non-domain and Domain" GP setting -
> https://winaero.com/disable-simultaneous-connection-to-non-domain-and-domain-in-windows-10/
> 
> Thank you.
> 

Hi,


I think not. Well, you can call `nmcli connection down` from a
dispatcher script. But then activation already stated. Also, it will
block future autoconnect.

If you have a more complex policy about autoconnect, I think that you
would disable "connection.autoconnect" in the profile, and let your
scripts/tool handle the activation.


It seems what you ask for, is a more elaborate policy about how
profiles can autoconnect, and moreover, how they conflict. That would
be an interesting feature, but relatively hard to design correctly.


Thomas



More information about the Networkmanager mailing list