1

I have a connection as follow: PC/Eth<==> Eth/raspberrypi/WLAN <===> WLAN/RPi-2

Problem:

I cannot ping PC from RPi-2 and vice versa

Troubleshooting:

  • PC can ping raspberrypi ethernet and raspberrypi WLAN
  • RPi-2 can ping raspberrypi ethernet and raspberrypi WLAN
  • Firewall is disabled on the PC
  • [update] raspberrypi is not replying back to arp requests!no idea why

logs:

IP summary
  • PC.eth = 192.168.137.1
  • raspberrypi.eth = 192.168.137.254
  • raspberrypi.wlan = 10.1.1.254
  • rpi-2.wlan = 10.1.1.4
PC:
route print 
 10.1.1.0    255.255.255.0   Auf Verbindung     192.168.137.1     38
C:\WINDOWS\system32>ping 10.1.1.254

Ping wird ausgeführt für 10.1.1.254 mit 32 Bytes Daten:
Antwort von 10.1.1.254: Bytes=32 Zeit<1ms TTL=64
Antwort von 10.1.1.254: Bytes=32 Zeit<1ms TTL=64

Ethernet-Adapter Ethernet 2:

   Verbindungsspezifisches DNS-Suffix:
   Verbindungslokale IPv6-Adresse  . : fe80::5897:b371:242e:36dc%10
   IPv4-Adresse  . . . . . . . . . . : 192.168.137.1
   Subnetzmaske  . . . . . . . . . . : 255.255.255.0
   Standardgateway . . . . . . . . . :

C:\WINDOWS\system32>tracert 10.1.1.4

Routenverfolgung zu 10.1.1.4 über maximal 30 Hops

  1  DESKTOP-R [192.168.137.1]  meldet: Zielhost nicht erreichbar.
raspberyypi:
:~ $ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.137.1   0.0.0.0         UG    202    0        0 eth0
10.1.1.0        0.0.0.0         255.255.255.0   U     0      0        0 wlan0
192.168.137.0   0.0.0.0         255.255.255.0   U     202    0        0 eth0
pi@raspberrypi:~ $ ping 192.168.137.1
PING 192.168.137.1 (192.168.137.1) 56(84) bytes of data.
64 bytes from 192.168.137.1: icmp_seq=1 ttl=128 time=0.567 ms
64 bytes from 192.168.137.1: icmp_seq=2 ttl=128 time=0.599 ms
^C
--- 192.168.137.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1032ms
rtt min/avg/max/mdev = 0.567/0.583/0.599/0.016 ms
pi@raspberrypi:~ $ ping 10.1.1.4
PING 10.1.1.4 (10.1.1.4) 56(84) bytes of data.
64 bytes from 10.1.1.4: icmp_seq=1 ttl=64 time=7.84 ms
64 bytes from 10.1.1.4: icmp_seq=2 ttl=64 time=23.3 ms
RPi-2
route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.1.1.254      0.0.0.0         UG    0      0        0 wlan0
10.1.1.0        0.0.0.0         255.255.255.0   U     0      0        0 wlan0
192.168.137.0   10.1.1.254      255.255.255.0   UG    0      0        0 wlan0

:~ $ ping 192.168.137.254
PING 192.168.137.254 (192.168.137.254) 56(84) bytes of data.
64 bytes from 192.168.137.254: icmp_seq=1 ttl=64 time=521 ms
64 bytes from 192.168.137.254: icmp_seq=2 ttl=64 time=13.9 ms

~ $ traceroute 192.168.137.1
traceroute to 192.168.137.1 (192.168.137.1), 30 hops max, 60 byte packets
 1  * * *
 2  * * *
 3  * * *
 4  * * *

update

tcpdump logs at raspberrypi

09:58:35.708389 ARP, Request who-has 10.1.1.4 tell 192.168.137.1, length 46
09:58:36.261002 ARP, Request who-has 10.1.1.4 tell 192.168.137.1, length 46
09:58:37.260683 ARP, Request who-has 10.1.1.4 tell 192.168.137.1, length 46
09:58:38.267982 ARP, Request who-has 10.1.1.4 tell 192.168.137.1, length 46
09:58:39.263476 ARP, Request who-has 10.1.1.4 tell 192.168.137.1, length 46

but it replies back for its own interface

10:28:12.777650 ARP, Request who-has 10.1.1.254 (b8:27:eb:7e:5b:b5) tell 192.168.137.1, length 46
10:28:12.777945 ARP, Reply 10.1.1.254 is-at b8:27:eb:7e:5b:b5, length 28

At this point, I think linux does not reply back to ARP request by the PC (or more specifically WLAN0 doesn't reply)

2 Answers 2

0

Your PC will need a default gateway (Standardgateway) configured before it can reach any subnet but its own.

You can set that in the adapter settings window, or in an Administrator Command Prompt, like this:

route add 0.0.0.0 mask 0.0.0.0 192.168.137.254

The traceroute from RPi-2 makes me think there's something else going on, so report back if that doesn't totally fix it.

4
  • Unfortunately that didn't work. I'd like to highlight that there is already a static route at the PC from 192.168.137.1 to 10.1.1.0/24 (check 1st line) My guess is that the traffic is blocked at 192.168.137.1 for some unknown reason. Is there a monitoring tool like tcpdump or wireshark to capture what/why blocked the traffic ?
    – stepj
    Feb 7, 2018 at 9:24
  • @P1h3r1e3d13 It is not true that you need a default gateway before a host can reach any subnet but its own. It suffices that the host has a route with a gateway via which the subnet is reachable. @stepj Have you enabled packet forwarding on raspberrypi? Put net.ipv4.ip_forward = 1 in /etc/sysctl.conf and run sysctl -p /etc/sysctl.conf. Feb 7, 2018 at 10:12
  • @JohanMyréen yes I did but that didn't help either!
    – stepj
    Feb 7, 2018 at 11:17
  • @JohanMyréen Ah, I missed the static route on the PC. Carry on.
    – Jacktose
    Feb 8, 2018 at 16:45
0

As a workaround, I have setup a bridge between the WLAN0 and eth0 at the raspberrypi and now it is working.

1
  • Welcome to superuser: Thankyou for answering the question, a workaround can pass as an answer so you can accept it, you or others can still answer it in another manner. again welcome to superuser.Thankyou
    – mic84
    Feb 13, 2018 at 8:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .