Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

3 Answers

up vote 2 down vote accepted

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.

share|improve this answer
    
Hi, how can I create this custom script in /etc/network/if-up.d/? This sounds the most reasonable way to go forward. –  Grzenio May 10 '09 at 20:08
add comment

Are you sure that wpa_supplicant is what you want to be fiddling with to do this? It's really just for authenticating WPA connections, not doing link status detection and the rest of it.

Personally, I wouldn't even bother disabling the wifi, I'd just have an up action on the wifi interface that gave it's route a higher metric, so that if the wired interface was up it would be preferred. Something like this should do the trick (assuming that your LAN is 192.168.10.0/24):

iface home inet dhcp
    [usual WPA guff here]
    up route del -net 192.168.10.0 netmask 255.255.255.0
    up route add -net 192.168.10.0 netmask 255.255.255.0 metric 1

Doing the link-sense autodetection I have no idea about; I don't typically want my network interfaces doing stuff I don't know about, so I've never looked into it.

share|improve this answer
    
Hi, what is the 192.168.10.0 address? I am not sure if its relevant, but I am using this pc on more than one wireless network, so I get different settings from dhcp server. –  Grzenio May 27 '09 at 12:47
add comment

Works for me out of the box.

I think the package implementing it is network-manager-gnome (it contains the panel applet).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.