2

I've had my Raspberry pi 3 for a couple of years and everything has worked fine. A week ago I bought a new router + AP and the Pi could connect (through ethernet to my router as well as the Wifi) without any issues. In the router it gets one ip for the Wifi-connection and one for the ethernet (I guess that's normal?). I've set an ip-reservation on the dhcp for the ethernet in my router and everything worked perfectly and I have accessed it a couple of times each day.

Today, when I tried to access a webserver on the Pi I got ERR_CONNECTION_REFUSED and when I tried to SSH into it I get Connection Refused. I tried another service running on the Pi which is exposed on a third port, and this did not work either. But I CAN ping the Raspberry using the ethernet-ip.

However if I change to the Wifi-ip I can access the webserver, the service and SSH.

Running ifconfig on the Pi gives (192.168.168.14 is the static ip for the ethernet, which does not work, while .236 is the one for the Wifi which works).

pi@raspberrypi:~ $ ifconfig
docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.17.0.1  netmask 255.255.0.0  broadcast 172.17.255.255
        ether [[MAC]]  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.14  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 [[MAC]]  prefixlen 64  scopeid 0x20<link>
        ether [[MAC]]  txqueuelen 1000  (Ethernet)
        RX packets 604  bytes 249961 (244.1 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 367  bytes 44103 (43.0 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 1352  bytes 249602 (243.7 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1352  bytes 249602 (243.7 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.236  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 [[MAC]]  prefixlen 64  scopeid 0x20<link>
        ether [[MAC]]  txqueuelen 1000  (Ethernet)
        RX packets 170  bytes 41919 (40.9 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 28  bytes 4449 (4.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Checking the traffic analyser in my router tells me that the Pi is sending and receiving traffic over the ethernet-interface.

What could be the reason I cannot access it over ethernet? I have not changed anything (as far as I recall...) on the router or on the Pi.

Output from tcpdump in wireshark where 192.168.1.14 is the eth0-ip of my Pi, and 192.168.1.5 is the ip of the access-point where my computer that I'm trying to connect to the Pi with is connected.

12  2.062785    192.168.1.5 192.168.1.14    TCP 74  45848 → 8080 [SYN] Seq=0 Win=29200 Len=0 MSS=1460 SACK_PERM=1 TSval=621222 TSecr=0 WS=16
13  2.062993    192.168.1.14    192.168.1.5 TCP 74  8080 → 45848 [SYN, ACK] Seq=0 Ack=1 Win=65160 Len=0 MSS=1460 SACK_PERM=1 TSval=2910307558 TSecr=621222 WS=128
2
  • 1
    Try running sudo tcpdump -w dump.pcap eth0 and connect to your webserver (or SSH) over the ethernet. Later, you can stop the tcpdump (ctrl+c) and load the generated file in Wireshark to discover if any incoming packets are there.
    – enedil
    Commented Aug 27, 2020 at 13:29
  • 1
    @enedil I tried it but I dont know how too interpret the result in Wireshark. I get some entries where source is the ip of my access-point (where the computer I'm trying to SSH into the Pi-with is connected) and target is the eth0-ip of the Pi. All of these entries are greyed out... I've added two of the entries in my question.
    – Cleared
    Commented Aug 27, 2020 at 13:42

2 Answers 2

3

I have not changed anything (as far as I recall...) on the router or on the Pi.

You have done a very essential modification. You set a static ip for the ethernet in your router. This breaks the computer based configuration of your network, done by your router, in particular you are also using docker containers. Doing this is not a task to simplify things. You need some networking know how because you have to do all things manual now, like avoiding double ip addresses, giving the correct default gateway and DNS server to the clients and maybe other things.

You should revert the setting to use the DHCP server as it was running for years before. I think it will run then the next years again. Having a different ip address on every interface is normal. That's by definition to have unique ip addresses on the network.

6
  • 1
    Mayby you missunderstood me, in the DHCP-settings in my router, I assigned a static IP for the MAC-adress of the Pi, this to make it simpler to access it from other units in my network. So the Pi still gets the IP from the DHCP on my router. I fail to see how this would break anything? I also fail to see how the docker-network-interface (docker0) should be a problem? And as I mentioned in the question, everything worked fine after setting the static IP (and installing docker for that matter).
    – Cleared
    Commented Aug 27, 2020 at 17:29
  • 2
    I'd check your router and see if another device is using .14. You've set a static ip on the router which isn't really a static ip (technically its an ip reservation within the dhcp server), so if theres another device on the network with a true static ip (I.e. set on the device) then you'll end up not being able to access one of the devices.
    – rohtua
    Commented Aug 27, 2020 at 17:51
  • 1
    @rohtua Thanks for the clarification, yes i'ts an ip-reservation in the dhpc-server, I'll update the question to prevent further missunderstanding. I've checked the router and only the Pi has that ip, no other device has a (true) static ip.
    – Cleared
    Commented Aug 27, 2020 at 18:02
  • 2
    You could try is changing/removing the ip reservation on the router and reboot the pi. see what ip the router gives it. I've had issues in the past where an ip reservation hasn't stuck properly in the dhcp server so when the lease has expired the pi has requested a new ip address and everythings got stuck. Changing/removing the reservation should fix it. That its lasted a week id guess you dhcp leases last 7 days? I'd recommend setting the static ip on the device but use an ip outside the dhcp range. E.g. if the dhcp server issues ips .64 to .253 use ips .1 to 63 for your static ips.
    – rohtua
    Commented Aug 27, 2020 at 18:18
  • 1
    Thanks for the help troubleshooting! Now that I think about it, the issues appered after I rebooted the Pi for the first time since I got the new router (however I have been able to access it with the reserved IP through the new router, it had the same ip on the old router). I've removed the reserved ip and was able to access it over ethernet (with the "dynamic ip"). Changing it back to reserved (.14) (and rebooting) and I could no longer access it. Changing to another reserved ip (.15) and I could access it with that ip. My reserved ip is outside the dhcp range (which starts at 38)
    – Cleared
    Commented Aug 27, 2020 at 19:12
2

After troubleshooting for a while I realised that the problem was on the client-side, i.e. on the computer from which I tried to access the pie. Still not sure what the actual issue was but a simple reboot of the computer solved the issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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