I want to configure guessnet
and wpa_supplicant
such that if I plug in my LAN cable, it connects to the network via the cable and if I unplug it, it automatically switches to WLAN and vice versa. I managed to make it work, however if I unplug the cable, it takes 10 to 20 seconds to connect to the WLAN network, which is pretty slow. In contrast, if I plug in the cable, it takes just a second to disconnect from WLAN and connect to LAN.
Is there any way to get a better configuration to make the switching to WLAN much faster?
By the way, when I tried new settings I often had to reboot, which was very annoying, a simple service networking restart
was not enough - perhaps this has to do something with my configuration.
My system is Ubuntu 13.10. Here are my config-files:
/etc/network/interfaces
auto lo
iface lo inet loopback
#use guessnett
mapping eth0
script /usr/sbin/guessnet-ifupdown
#map timeout: 3
map default: unknown
iface home inet static
address 192.168.1.80
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 192.168.1.1
test1 peer address 192.168.1.1
iface no-net inet manual
test2 missing-cable
iface unknown inet dhcp
iface wlanWork inet dhcp
auto wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
And this is my /etc/wpa/supplicant.conf
ctrl_interface=/var/run/wpa_supplicant
eapol_version=1
ap_scan=1
network={
ssid="mywlan"
scan_ssid=1
psk="1234"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
group=CCMP
id_str="home" ## specified in /etc/network/interfaces
}
network={
ssid="wlanWork"
scan_ssid=1
psk="1234"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
group=CCMP
id_str="wlanWork" ## specified in /etc/network/interfaces
}
Finally this is /etc/default/ifplugd
as generated by dpkg-reconfigure ifplugd
INTERFACES="eth0"
HOTPLUG_INTERFACES=""
ARGS="-q -f -u0 -d10 -w -I"
SUSPEND_ACTION="stop"
Edit I noticed some wired problems with this setup which I cannot reproduce. One time WLAN worked, but LAN didn't have the proper route/gateway. After setting the gateway manually via route add default gw 192.168.1.1
and rebooting, it worked again. After a second reboot nothing worked despite the fact that I got the correct IP (even ping 192.168.1.1
didn't work). Then I had to do sudo dhclient
to get a working Internet connection again...