我有一台笔记本电脑和一台台式电脑([电子邮件保护]), 我通常通过 ssh 将笔记本电脑连接到 PC。但现在当我尝试时,它显示以下错误。可能是什么问题?ssh -X [email protected]
ssh: connect to host 172.16.13.151 port 22: No route to host
输出ifconfig
如下:
eth0
Link encap:Ethernet HWaddr 2c:41:38:0d:bb:a2
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
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:1750 errors:0 dropped:0 overruns:0 frame:0
TX packets:1750 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:134949 (134.9 KB) TX bytes:134949 (134.9 KB)
wlan0
Link encap:Ethernet HWaddr d0:df:9a:76:18:1e
inet addr:172.16.101.213 Bcast:172.16.111.255 Mask:255.255.240.0
inet6 addr: fe80::d2df:9aff:fe76:181e/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:595855 errors:0 dropped:0 overruns:0 frame:0
TX packets:37917 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:138691381 (138.6 MB) TX bytes:4733835 (4.7 MB)
的输出route
如下:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 172.16.96.1 0.0.0.0 UG 0 0 0 wlan0
link-local * 255.255.0.0 U 1000 0 0 wlan0
172.16.96.0 * 255.255.240.0 U 2 0 0 wlan0
输出traceroute 172.16.13.151
给出
traceroute to 172.16.13.151 (172.16.13.151), 30 hops max, 60 byte packets
1 172.16.96.5 (172.16.96.5) 456.381 ms 457.461 ms 457.448 ms
2 172.16.96.5 (172.16.96.5) 5007.656 ms !H 5007.665 ms !H 5015.906 ms !H
答案1
源172.16.101.213
和目标172.16.13.151
不在同一网络上(基于网络掩码255.255.240.0
)。因此,您的笔记本电脑将数据包发送到默认网关172.16.96.1
,而默认网关显然不知道通往您 PC 的路由。