Ubuntu

兩個 Raspberry PI 之間無法訪問目標主機

  • November 4, 2020

我有一個帶有樹莓派的臨時 IPv4 網路。現在這些節點彼此相鄰,每當我嘗試從 10.0.0.4 ping 到 10.0.0.6 時,這就是輸出。

PING 10.0.0.6 (10.0.0.6) 56(84) bytes of data.
From 10.0.0.4 icmp_seq=1 Destination Host Unreachable
From 10.0.0.4 icmp_seq=2 Destination Host Unreachable
From 10.0.0.4 icmp_seq=3 Destination Host Unreachable

兩個設備上的路由似乎都很好,這些是它們的 iwconfig、路由、arp 輸出:

在 10.0.0.4

pi@pi-raspberry4:~$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.254   0.0.0.0         UG    0      0        0 wdongle
10.0.0.0        0.0.0.0         255.255.255.0   U     0      0        0 wboard
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 wboard
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 wdongle

pi@pi-raspberry4:~$ arp -n
Address                  HWtype  HWaddress           Flags Mask            Iface
10.0.0.1                         (incomplete)                              wboard
192.168.1.7              ether   28:39:26:c6:2e:af   C                     wdongle
10.0.0.6                         (incomplete)                              wboard
10.0.0.2                         (incomplete)                              wboard
10.0.0.16                        (incomplete)                              wboard
192.168.1.254            ether   cc:7b:35:0d:7c:f8   C                     wdongle
10.0.0.15                        (incomplete)                              wboard
10.0.0.12                        (incomplete)                              wboard
pi@pi-raspberry4:~$ iwconfig
wdongle   IEEE 802.11bgn  ESSID:"tplinktest"  Nickname:"<WIFI@REALTEK>"
         Mode:Managed  Frequency:2.412 GHz  Access Point: 14:CC:20:64:C7:10   
         Bit Rate:300 Mb/s   Sensitivity:0/0  
         Retry:off   RTS thr:off   Fragment thr:off
         Power Management:off
         Link Quality=98/100  Signal level=64/100  Noise level=0/100
         Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
         Tx excessive retries:0  Invalid misc:0   Missed beacon:0

lo        no wireless extensions.

wboard    IEEE 802.11bgn  ESSID:"RPiAdHocNetwork"  
         Mode:Ad-Hoc  Frequency:2.437 GHz  Cell: 9A:29:92:92:6B:6C   
         Tx-Power=31 dBm   
         Retry short limit:7   RTS thr=1 B   Fragment thr:off
         Power Management:on
         
eth0      no wireless extensions.

ip6tnl0   no wireless extensions.

在 10.0.0.6

pi@pi-raspberry6:/etc$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.254   0.0.0.0         UG    0      0        0 wdongle
0.0.0.0         0.0.0.0         0.0.0.0         U     1002   0        0 eth0
10.0.0.0        0.0.0.0         255.255.255.0   U     0      0        0 wboard
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 wboard
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 wdongle


pi@pi-raspberry6:/etc$ arp -n
Address                  HWtype  HWaddress           Flags Mask            Iface
10.0.0.2                 ether   b8:27:eb:c6:8b:41   C                     wboard
192.168.1.254            ether   cc:7b:35:0d:7c:f8   C                     wdongle
10.0.0.1                         (incomplete)                              wboard
10.0.0.15                        (incomplete)                              wboard
10.0.0.4                         (incomplete)                              wboard
192.168.1.7              ether   28:39:26:c6:2e:af   C                     wdongle

pi@pi-raspberry6:/etc$ iwconfig
wdongle   IEEE 802.11bgn  ESSID:"tplinktest"  Nickname:"<WIFI@REALTEK>"
         Mode:Managed  Frequency:2.412 GHz  Access Point: 14:CC:20:64:C7:10   
         Bit Rate:300 Mb/s   Sensitivity:0/0  
         Retry:off   RTS thr:off   Fragment thr:off
         Power Management:off
         Link Quality=100/100  Signal level=75/100  Noise level=0/100
         Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
         Tx excessive retries:0  Invalid misc:0   Missed beacon:0

lo        no wireless extensions.

wboard    IEEE 802.11bgn  ESSID:"RPiAdHocNetwork"  
         Mode:Ad-Hoc  Frequency:2.437 GHz  Cell: 9A:29:92:92:6B:6C   
         Tx-Power=31 dBm   
         Retry short limit:7   RTS thr=1 B   Fragment thr:off
         Power Management:on
         
eth0      no wireless extensions.

ip6tnl0   no wireless extensions.

**我的問題:**可能是什麼原因造成的,如何解決?(除非它的硬體有問題)

注意:我的網路目前由 4 個樹莓派組成(其中一個是 3B+ 其餘的 3B)。它們中的每一個都通過闆卡 NIC 在 ad-hoc 網路中,並通過外部加密狗在我的家庭網路中。節點 10.0.0.4 -6 - 15 正在執行 Ubuntu 16.04.4 LTS,節點 10.0.0.2 可能有 rpi 的 NOOBS 發行版(我沒有找到 lsb_release)

似乎相互互動的唯一節點是 10.0.0.2 和 10.0.0.6。以前我正在執行一些 iperf 實驗,它們每個都傳輸了大約 1 Gb 的數據,但突然有些節點消失並且無法訪問(即 10.0.0.4 和 10.0.0.15)

原來問題是sshguard

我不知道 sshguard 正在執行並且在覆盆子之間進行了一些失敗的嘗試。在失敗的登錄嘗試日誌中存在這一行:

Blocking 192.168.1.7:4 for >630secs: 40 danger in 4 attacks over 2 seconds (all: 40d in 1 abuses over 2s)

sshguard 似乎阻止了來自可疑攻擊者的所有 ipv4 流量,結果我是攻擊者

引用自:https://unix.stackexchange.com/questions/617616