我有三个路由器:
我有一个Windows PC连接到路由器1,局域网IP地址192.168.0.2。我希望能够访问路由器2和路由器3's网络上的设备从这台PC。
为了启用该功能,我运行了以下命令:
route -p ADD 192.168.13.0 MASK 255.255.255.0 192.168.68.122 metric 1 if 30
route -p ADD 192.168.68.0 MASK 255.255.255.0 192.168.0.20 metric 1 if 30这导致了route print在这个问题的底部给出的输出,这意味着它被设置为OK。
但是,我不能通过新的路由在任何一个网络上使用ping机器。例如:
C:\Users\Tom>ping 192.168.0.20 -n 1
Pinging 192.168.0.20 with 32 bytes of data:
Reply from 192.168.0.20: bytes=32 time<1ms TTL=64
Ping statistics for 192.168.0.20:
Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
C:\Users\Tom>ping 192.168.68.1 -n 1
Pinging 192.168.68.1 with 32 bytes of data:
Request timed out.
Ping statistics for 192.168.68.1:
Packets: Sent = 1, Received = 0, Lost = 1 (100% loss),
C:\Users\Tom>ping 192.168.68.122 -n 1
Pinging 192.168.68.122 with 32 bytes of data:
Request timed out.
Ping statistics for 192.168.68.122:
Packets: Sent = 1, Received = 0, Lost = 1 (100% loss),
C:\Users\Tom>ping 192.168.13.1 -n 1
Pinging 192.168.13.1 with 32 bytes of data:
Request timed out.
Ping statistics for 192.168.13.1:
Packets: Sent = 1, Received = 0, Lost = 1 (100% loss),我能理解如果路由器3's网络是无法访问的。(我不知道路由表是否支持按需要进行两步路由。)但是很难理解为什么路由器2's网络是不可访问的。
route print输出:
C:\Users\Tom>route print
===========================================================================
Interface List
22...00 ff 90 d2 fc 16 ......Juniper Network Connect Virtual Adapter
30...a4 bb 6d b3 8c a1 ......Intel(R) Ethernet Connection (5) I219-LM
18...0a 00 27 00 00 12 ......VirtualBox Host-Only Ethernet Adapter
25...00 ff aa 18 81 ac ......TAP-Windows Adapter V9
37...00 ff bd b8 d5 c4 ......TeamViewer VPN Adapter
6...44 01 bb a8 cb 97 ......Bluetooth Device (Personal Area Network)
1...........................Software Loopback Interface 1
===========================================================================
IPv4 Route Table
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 192.168.0.1 192.168.0.2 281
127.0.0.0 255.0.0.0 On-link 127.0.0.1 331
127.0.0.1 255.255.255.255 On-link 127.0.0.1 331
127.255.255.255 255.255.255.255 On-link 127.0.0.1 331
192.168.0.0 255.255.255.0 On-link 192.168.0.2 281
192.168.0.2 255.255.255.255 On-link 192.168.0.2 281
192.168.0.255 255.255.255.255 On-link 192.168.0.2 281
192.168.13.0 255.255.255.0 192.168.68.122 192.168.0.2 26
192.168.56.0 255.255.255.0 On-link 192.168.56.1 281
192.168.56.1 255.255.255.255 On-link 192.168.56.1 281
192.168.56.255 255.255.255.255 On-link 192.168.56.1 281
192.168.68.0 255.255.255.0 192.168.0.20 192.168.0.2 26
224.0.0.0 240.0.0.0 On-link 127.0.0.1 331
224.0.0.0 240.0.0.0 On-link 192.168.56.1 281
224.0.0.0 240.0.0.0 On-link 192.168.0.2 281
255.255.255.255 255.255.255.255 On-link 127.0.0.1 331
255.255.255.255 255.255.255.255 On-link 192.168.56.1 281
255.255.255.255 255.255.255.255 On-link 192.168.0.2 281
===========================================================================
Persistent Routes:
Network Address Netmask Gateway Address Metric
0.0.0.0 0.0.0.0 192.168.0.1 Default
192.168.68.0 255.255.255.0 192.168.0.20 1
192.168.13.0 255.255.255.0 192.168.68.122 1
===========================================================================
IPv6 Route Table
===========================================================================
Active Routes:
If Metric Network Destination Gateway
30 41 ::/0 fe80::1
1 331 ::1/128 On-link
30 41 2003:c9:f72b:a824::/64 On-link
30 281 2003:c9:f72b:a824:cd5f:d85f:eddb:aad2/128
On-link
30 281 2003:c9:f72b:a824:d143:ab14:fc96:dced/128
On-link
30 281 2003:c9:f72b:a824:d984:866c:9de8:9a5c/128
On-link
30 41 2003:c9:f72b:a834::/64 On-link
30 281 2003:c9:f72b:a834:99fb:2a0d:280d:bf6f/128
On-link
30 281 2003:c9:f72b:a834:d143:ab14:fc96:dced/128
On-link
30 281 2003:c9:f72b:a834:d984:866c:9de8:9a5c/128
On-link
30 41 2003:c9:f72b:a855::/64 On-link
30 281 2003:c9:f72b:a855:ad8f:d4ac:5f38:682d/128
On-link
30 281 2003:c9:f72b:a855:d984:866c:9de8:9a5c/128
On-link
18 281 fe80::/64 On-link
30 281 fe80::/64 On-link
18 281 fe80::11db:d621:42c7:94fb/128
On-link
30 281 fe80::d984:866c:9de8:9a5c/128
On-link
1 331 ff00::/8 On-link
18 281 ff00::/8 On-link
30 281 ff00::/8 On-link
===========================================================================
Persistent Routes:
None发布于 2021-12-28 08:59:28
为了正确地传输数据包,有两件事必须是正确的:
在路由器1上:
192.168.68.0/24的路由必须存在,路由器是192.168.0.20192.168.13.0/24的路由必须存在,路由器是192.168.0.20在路由器2上:
192.168.0.0/24的路径必须存在。这是一条自动连接的线路.192.168.13.0/24的路径必须存在。这是一条自动连接的线路.在路由器3上:
192.168.0.0/24的路由必须存在,路由器是192.168.68.1。192.168.68.0/24的路径必须存在。这是一条自动连接的线路.默认路由覆盖router 3上的路由。
https://serverfault.com/questions/1088330
复制相似问题