當兩個子網路連接到同一路由器時如何路由?

當兩個子網路連接到同一路由器時如何路由?

我有一個Router有 4 個乙太網路端口,內部eth0eth3OpenWRT 和這樣的配置:

  • 介面lan1只涉及eth0IP位址10.10.0.1/16
  • 介面lan2只涉及eth1IP位址10.11.0.1/16

OpenWRT自動產生的路由表為:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.10.0.0       *               255.255.0.0     U     0      0        0 eth0
10.11.0.0       *               255.255.0.0     U     0      0        0 eth1

正如您所看到的,這兩個介面是不同的子網路。

當我 ssh 進入路由器時,我可以 ping 通 10.10.0.0/16 和 10.11.0.0/16 上的兩個裝置。但是當我要從 10.11.0.0/16 ping 設備到 10.10.0.0/16 時,我只得到了bytes from 10.11.0.1: Destination Port Unreachable.

我想要做的是:能夠從 10.11.0.0 ping 10.10.0.0,反之亦然。

我怎樣才能做到這一點?

答案1

如果 10.10.0.0/16 和 10.11.0.0/16 上的兩個設備是 Windows 設備,我不相信它們會接受來自不同子網路的入站 ICMP 回顯請求。您可能必須透過 Windows 防火牆建立自訂規則:https://technet.microsoft.com/en-us/library/cc972926(v=ws.10).aspx

相關內容