0

On our home LAN, after rebooting the router, I cannot ssh from laptop A to laptop B except via the router. However, after doing a ping from laptop B to laptop A, I can connect normally from A to B. I can reproduce this issue by rebooting the router. Both laptops are connected to the router via WiFi and there are no other APs or routers connected. There are other devices on the LAN and I am not aware of any other ARP issues.

Demonstrating the problem after the router was rebooted:

scott@laptopa:~$ ip addr show dev wlp58s0 |grep 'inet '
    inet 192.168.8.194/24 brd 192.168.8.255 scope global dynamic noprefixroute wlp58s0
scott@laptopa:~$ ssh 192.168.8.131 echo okay
ssh: connect to host 192.168.8.131 port 443: No route to host
scott@laptopa:~$ ssh 192.168.8.131 echo okay
ssh: connect to host 192.168.8.131 port 443: No route to host
scott@laptopa:~$ ssh 192.168.8.131 echo okay
ssh: connect to host 192.168.8.131 port 443: No route to host
scott@laptopa:~$ arp |grep 9c:b6:d0:44:18:09
scott@laptopa:~$ 

The awkward work-around:

scott@laptopa:~$ ssh -o 'ProxyCommand ssh -q -W %h:%p root@192.168.8.1' 192.168.8.131 'ping -c 10 192.168.8.194'
PING 192.168.8.194 (192.168.8.194) 56(84) bytes of data.
64 bytes from 192.168.8.194: icmp_seq=1 ttl=64 time=66.3 ms
64 bytes from 192.168.8.194: icmp_seq=2 ttl=64 time=22.9 ms
64 bytes from 192.168.8.194: icmp_seq=3 ttl=64 time=106 ms
64 bytes from 192.168.8.194: icmp_seq=4 ttl=64 time=230 ms
64 bytes from 192.168.8.194: icmp_seq=5 ttl=64 time=252 ms
64 bytes from 192.168.8.194: icmp_seq=6 ttl=64 time=275 ms
64 bytes from 192.168.8.194: icmp_seq=7 ttl=64 time=298 ms
64 bytes from 192.168.8.194: icmp_seq=8 ttl=64 time=321 ms
64 bytes from 192.168.8.194: icmp_seq=9 ttl=64 time=38.3 ms
64 bytes from 192.168.8.194: icmp_seq=10 ttl=64 time=60.3 ms

--- 192.168.8.194 ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 9012ms
rtt min/avg/max/mdev = 22.950/167.478/321.937/112.761 ms

Demonstrating that it now works properly:

scott@laptopa:~$ ssh 192.168.8.131 echo okay
okay
scott@laptopa:~$ arp |grep 9c:b6:d0:44:18:09
laptopb.lan              ether   9c:b6:d0:44:18:09   C                     wlp58s0

Laptops A and B are both running Ubuntu 18.04, and the router is Lede (OpenWRT) 17.01.4.

  • The same (or equivalent) ip addr command on Laptop B too, please. And for testing purposes, ensure that you've got no iptables rules set. At all. On either laptop. – roaima Nov 14 '18 at 0:20
  • If it helps: I randomly have had the same issue for years (sometimes it works, sometimes it doesn't, often it works from A to B, but not from B to A). My workaround is to just manually add the arp entry, after that it works. No login into router needed. I don't know why the ARP request fails, possibly WLAN broadcasting issues? – dirkt Nov 14 '18 at 10:52
  • @roaima and dirkt - both of your comments were helpful. Thanks. I have answered my own question. – bitinerant Nov 16 '18 at 15:12
0

As @roaima suggested, I deleted all of my iptables rules and tested again. I had zero problems, even after rebooting the router several times. Then I added my iptables rules back in and tested further. I still had zero problems.

In short, I can no longer reproduce the problem, so maybe it's random as @dirkt has experienced. Maybe it's some other device on the network.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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