다른 네트워크 간에 ping을 수행할 수 없습니다.

다른 네트워크 간에 ping을 수행할 수 없습니다.

다음과 같이 연결되어 있습니다: PC/Eth<==> Eth/raspberrypi/WLAN <===> WLAN/RPi-2

문제:

RPi-2에서 PC를 핑할 수 없으며 그 반대의 경우도 마찬가지입니다.

문제 해결:

  • PC는 raspberrypi 이더넷 및 raspberrypi WLAN을 ping할 수 있습니다.
  • RPi-2는 raspberrypi 이더넷 및 raspberrypi WLAN을 ping할 수 있습니다.
  • PC에서 방화벽이 비활성화되었습니다.
  • [업데이트] raspberrypi가 arp 요청에 응답하지 않습니다! 이유를 모르겠습니다.

로그:

IP 요약
  • 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.
라즈베리피:
:~ $ 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  * * *

업데이트

raspberrypi의 tcpdump 로그

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

하지만 자체 인터페이스에 대해 응답합니다.

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

이 시점에서 내 생각에는 Linux가 PC의 ARP 요청에 응답하지 않는 것 같습니다. (또는 보다 구체적으로 WLAN0은 응답하지 않습니다.)

답변1

PC에는 기본 게이트웨이(표준 게이트웨이)가 자체 서브넷이 아닌 다른 서브넷에 도달하기 전에 구성됩니다.

어댑터 설정 창이나 관리자 명령 프롬프트에서 다음과 같이 설정할 수 있습니다.

route add 0.0.0.0 mask 0.0.0.0 192.168.137.254

RPi-2의 추적 경로를 보면 뭔가 다른 일이 일어나고 있는 것 같으니 문제가 완전히 해결되지 않으면 다시 보고해 주세요.

답변2

해결 방법으로 raspberrypi에서 WLAN0과 eth0 사이에 브리지를 설정했으며 이제 작동 중입니다.

관련 정보