Networking Debian WPA – How to Disable WLAN Interface When Ethernet is Plugged In

debiannetworkingwpa

I am trying to come up with the standard configuration using wpa_supplicant for both Ethernet and wireless interfaces on a Debian system. I would like to do it in a way that when you plug in the Ethernet cable, the wireless interface is disabled, and enabled again when you unplug the cable (a reasonable configuration to get the best performance). How do I do it?

Best Answer

I second womble's assertion that wpa_supplicant is the wrong place to do this. You want to set something up in the /etc/network/ subtree, perhaps as womble suggests by increasing the metric of the wifi route, or perhaps by some other means involving a custom script in /etc/network/if-up.d/ that would take the wifi interface down if the ethernet interface came up.

Info on making scripts for /etc/network/if-up.d/ is on the interfaces man page, under the 'IFACE OPTIONS' section.

Related Topic