If you are using NetworkManager: NM automatically executes scripts found in /etc/NetworkManager/dispatcher.d/
every time any interface changes its status (see man NetworkManager
). You can write a script to manually bring down the other interfaces and put the script in the dispatcher.d/
. NM passes 2 arguments to scripts found in the dispatcher.d/
, the name of the device and the action (whether an interface is brought up
or down
, again see NM manual for exact key words). So your script should only bring down the other interfaces if the 2nd argument is down.
If you aren't using NetworkManager, there's a software called ifplugd which might help you. However, this software is quite old. Last update was on 2005.