通过WiFi连接时,我无法通过SSH连接到Raspberry Pi。通过以太网连接RasPi时,一切正常。但是,当它通过WiFi加密狗连接时,我可以ping通路由器(在10.0.0.2上)并从RasPi访问互联网,但无法对其进行SSH(ssh命令没有响应,并最终报告“操作时间已到”出来”)。我也无法在分配给它的静态IP地址上ping RasPi。
我正在使用的WiFi加密狗是TP-Link TL-WN823N。我使用WICD将其设置在静态IP 10.0.0.28上。有趣的是,当我本周初尝试通过SSH与该WiFi软件狗进行连接时,它确实起作用了。现在,我再次尝试,但是,它不再起作用了。据我所知,我没有进行任何配置更改。
我已经运行了一些命令以便为您提供一些诊断信息。所有这些命令都是在我连接了WiFi加密狗但没有连接以太网电缆的情况下启动RasPi之后运行的。我正在尝试通过10.0.0.28连接到设备(您可能会从/ etc / network / interfaces注意到,我已经为以太网配置了静态IP 10.0.0.27;当我使用时,两个接口的静态IP都相同首先遇到了这个问题,所以我将它们更改为其他问题,以防万一可能导致冲突。不用说,那是行不通的。
$ ifconfig
eth0 Link encap:Ethernet HWaddr b8:27:eb:c2:f1:37
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1104 (1.0 KiB) TX bytes:1104 (1.0 KiB)
wlan0 Link encap:Ethernet HWaddr c0:4a:00:1b:32:ca
inet addr:10.0.0.28 Bcast:10.0.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:71 errors:0 dropped:95 overruns:0 frame:0
TX packets:74 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:8866 (8.6 KiB) TX bytes:8377 (8.1 KiB)
$iwconfig
wlan0 IEEE 802.11bg ESSID:"Mercutech" Nickname:"<WIFI@REALTEK>"
Mode:Managed Frequency:2.412 GHz Access Point: 00:26:F2:26:B4:62
Bit Rate:54 Mb/s Sensitivity:0/0
Retry:off RTS thr:off Fragment thr:off
Power Management:off
Link Quality=100/100 Signal level=85/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.
eth0 no wireless extensions.
$ cat /etc/network/interfaces
auto lo
iface lo inet loopback
iface eth0 inet static
address 10.0.0.27
netmask 255.255.255.0
network 10.0.0.0
broadcast 10.0.0.255
gateway 10.0.0.2
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
$ cat /etc/resolv.conf
nameserver 10.0.0.2
$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.0.0.2 0.0.0.0 UG 0 0 0 wlan0
10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0
$ sudo cat /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1