Page 1 of 1

WiFi only works when Ethernet plugged in

Posted: Tue Oct 09, 2018 9:36 am
by bsder
Hi, folks,

My WiFi only seems to work when my Ethernet is plugged in.

I've seen this issue discussed in various places, but most of the solutions are sufficiently old that they no longer apply.

My WiFi asks for and gets an IP address. That doesn't seem to be an issue. Even the router thinks that it has connected and gotten an IP address when I leave the wired Ethernet disconnected. So, that part seems to be okay.

However, I can't ping, ssh, or do anything else until I plug in my wired Ethernet port. Then, everything works fine. If I pull the Ethernet back out, it stops again. If I put it back in, it starts again.

Presumably, this is a routing issue somewhere involving hotplugging. But I simply don't know how to hunt this down.

Any help would be appreciated. Thanks.

I'm on Raspbian latest as of today (8 October 2018).

Code: Select all

[email protected]:~# uname -a
Linux raspberrypi 4.14.70-v7+ #1144 SMP Tue Sep 18 17:34:46 BST 2018 armv7l GNU/Linux
[email protected]:~# ip route
default via 192.168.13.1 dev eth0 src 192.168.13.147 metric 202 
default via 192.168.13.1 dev wlan0 src 192.168.13.171 metric 303 
192.168.13.0/24 dev eth0 proto kernel scope link src 192.168.13.147 metric 202 
192.168.13.0/24 dev wlan0 proto kernel scope link src 192.168.13.171 metric 303 
[email protected]:~# ifconfig -a
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.13.147  netmask 255.255.255.0  broadcast 192.168.13.255
        inet6 fe80::7f8d:ed9a:ff0:4711  prefixlen 64  scopeid 0x20<link>
        ether b8:27:eb:aa:27:5a  txqueuelen 1000  (Ethernet)
        RX packets 5056  bytes 466047 (455.1 KiB)
        RX errors 0  dropped 1  overruns 0  frame 0
        TX packets 4431  bytes 469611 (458.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 104  bytes 13160 (12.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 104  bytes 13160 (12.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.13.171  netmask 255.255.255.0  broadcast 192.168.13.255
        inet6 fe80::10e3:df20:62b3:634e  prefixlen 64  scopeid 0x20<link>
        ether b8:27:eb:ff:72:0f  txqueuelen 1000  (Ethernet)
        RX packets 5  bytes 746 (746.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 34  bytes 5555 (5.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Re: WiFi only works when Ethernet plugged in

Posted: Tue Oct 09, 2018 10:07 am
by B.Goode
Presumably, this is a routing issue somewhere involving hotplugging. But I simply don't know how to hunt this down.

Any help would be appreciated.
Maybe the RPi is fine and it is the router that is 'confused'?

Have you tried disconnecting the cabled Ethernet, rebooting the router, and restarting the Wifi-only RPi, in that order?

Re: WiFi only works when Ethernet plugged in

Posted: Tue Oct 09, 2018 11:47 am
by SurferTim
It appears to be a routing problem. Both eth0 and wlan0 have the same localnet. 192.168.13.x.

With the same size localnet (255.255.255.0), the smallest metric (eth0) will have routing priority.

It is a bit odd for both the wireless and wired router interfaces to have the same IP assignment unless they are bridged.

Re: WiFi only works when Ethernet plugged in

Posted: Tue Oct 09, 2018 5:21 pm
by epoch1970
SurferTim wrote:
Tue Oct 09, 2018 11:47 am
It is a bit odd for both the wireless and wired router interfaces to have the same IP assignment unless they are bridged.
But they don't: "eth0 src 192.168.13.147", "wlan0 src 192.168.13.171".
They have the same default gw "default via 192.168.13.1" which is normal.

My guess is the router's wifi is configured to put the wifi client in some isolation mode.

Unless the above route and config commands were taken when eth0 was actually disconnected? (eth0 shows as up)

Re: WiFi only works when Ethernet plugged in

Posted: Tue Oct 09, 2018 5:24 pm
by SurferTim
It is a bit odd for both the wireless and wired ROUTER interfaces to have the same IP assignment unless they are bridged.

Re: WiFi only works when Ethernet plugged in

Posted: Tue Oct 09, 2018 5:36 pm
by epoch1970
My apologies. I misread, probably because to me it is the norm and not odd at all for wifi AP/routers to bridge their interfaces.

Re: WiFi only works when Ethernet plugged in

Posted: Tue Oct 09, 2018 9:03 pm
by bsder
B.Goode wrote:
Tue Oct 09, 2018 10:07 am
Presumably, this is a routing issue somewhere involving hotplugging. But I simply don't know how to hunt this down.

Any help would be appreciated.
Maybe the RPi is fine and it is the router that is 'confused'?

Have you tried disconnecting the cabled Ethernet, rebooting the router, and restarting the Wifi-only RPi, in that order?
Yes. I have. And I have tried several different permutations of reboot order. :)

It's going to take more than just reboots apparently.

Re: WiFi only works when Ethernet plugged in

Posted: Tue Oct 09, 2018 9:05 pm
by bsder
SurferTim wrote:
Tue Oct 09, 2018 11:47 am
It appears to be a routing problem. Both eth0 and wlan0 have the same localnet. 192.168.13.x.

With the same size localnet (255.255.255.0), the smallest metric (eth0) will have routing priority.

It is a bit odd for both the wireless and wired router interfaces to have the same IP assignment unless they are bridged.
Those are not the same IP addresses even though they are on the same subnet.

I assumed that would be the case that the lower priority would win. But it seems like when I disconnect the wired, the other interface never picks up (or, perhaps, the WiFi never actually comes online). Even pings from external hosts die.

Re: WiFi only works when Ethernet plugged in

Posted: Tue Oct 09, 2018 9:09 pm
by bsder
epoch1970 wrote:
Tue Oct 09, 2018 5:21 pm
SurferTim wrote:
Tue Oct 09, 2018 11:47 am
It is a bit odd for both the wireless and wired router interfaces to have the same IP assignment unless they are bridged.
But they don't: "eth0 src 192.168.13.147", "wlan0 src 192.168.13.171".
They have the same default gw "default via 192.168.13.1" which is normal.

My guess is the router's wifi is configured to put the wifi client in some isolation mode.

Unless the above route and config commands were taken when eth0 was actually disconnected? (eth0 shows as up)
I'm running fairly stock DD-WRT on the router, so, if that isn't the default for DD-WRT, then I surely didn't do it intentionally.

I guarantee those were taken when I was connected as it's kind of hard to cut and paste when I don't have a wired connection as I don't have network. :)

Re: WiFi only works when Ethernet plugged in

Posted: Thu Oct 11, 2018 9:06 am
by bsder
Sigh. After I got an HDMI cable and a USB hub to plug in my keyboard, I could see that the RPi could ping out to the world but not to other wireless devices.

Apparently DD-WRT has a known bug that nobody knows how to kill wherein going device to device on the same network occasionally fails.

Sorry for the noise.