You are not logged in.

#1 2012-05-22 02:58:57

Fackamato
Member
Registered: 2006-03-31
Posts: 579

Wifi + ethernet = no network connectivity

Hoi,

My laptop is usually connected using WiFi, which works fine. When I dock the laptop (which has an ethernet cable plugged in) the laptop gets an IP on eth0 as well, which breaks all network connectivity. For example, existing SSH sessions just stop responding, until I pull the cable.

How can I fix this?

I'm using XFCE4 and NetworkManager. (testing)

Thanks in advance,

Offline

#2 2012-05-22 03:25:54

Ranmaru
Member
From: Japan
Registered: 2011-11-20
Posts: 60

Re: Wifi + ethernet = no network connectivity

I think the problem is that NetworkManager generally prefers ethernet over WiFi and thus tries to route all traffic through eth0 as soon as you connect the cable.

I guess you could fix it by using your routing table to prefer the wireless connection over ethernet, but then you would have the problem the other way around. Use the route command to check your routing table and change it according to your setup.

route add default gw {IP-ADDRESS} {WIFI-INTERFACE}

Last edited by Ranmaru (2012-05-22 03:27:24)

Offline

#3 2012-05-22 04:14:24

Fackamato
Member
Registered: 2006-03-31
Posts: 579

Re: Wifi + ethernet = no network connectivity

Ranmaru wrote:

I think the problem is that NetworkManager generally prefers ethernet over WiFi and thus tries to route all traffic through eth0 as soon as you connect the cable.

I guess you could fix it by using your routing table to prefer the wireless connection over ethernet, but then you would have the problem the other way around. Use the route command to check your routing table and change it according to your setup.

route add default gw {IP-ADDRESS} {WIFI-INTERFACE}

Yeah I was suspecting something like that. (route metric, perhaps). I just tried it now and my current connections are actually working. Now, the problem would be that if I open an SSH connection to a server over the LAN, then remove the laptop from the docking station, that'd break. I wonder if it's possible (perhaps with iptable rules?) to make all HTTP, HTTPS traffic go over LAN (if available), and prefer SSH on WiFi...

Wifi only

$ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         wifi            0.0.0.0         UG    0      0        0 wlan0
10.114.17.0     *               255.255.255.0   U     0      0        0 wlan0

Wifi + LAN

$ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         non-wifi        0.0.0.0         UG    0      0        0 eth0
10.36.60.0      *               255.255.255.0   U     0      0        0 eth0
10.114.17.0     *               255.255.255.0   U     0      0        0 wlan0

Offline

Board footer

Powered by FluxBB