網路路由問題

網路路由問題

情況是這樣的。我透過啟用 ip_forwarding 將伺服器 ns1 (雙宿主 Linux 盒子)變成路由器(echo 1 > /proc/sys/net/ipv4/ip_forward)

伺服器 ns1:

eth0:10.10.0.200/24(預設閘道:10.10.0.51)

eth1:192.168.53.198/24(我沒有為此介面設定任何預設閘道)

伺服器 ns1 上的路由表:

[root@ns1 ~]# netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.53.0    0.0.0.0         255.255.255.0   U         0 0          0 eth1
10.10.0.0       0.0.0.0         255.255.255.0   U         0 0          0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth1
0.0.0.0         10.10.0.51      0.0.0.0         UG        0 0          0 eth0

我正在嘗試從工作站 ping 網路伺服器(IP 為 10.10.0.54)但不成功。

工作站:

工作站的特點是:

eth0:192.168.53.150/24

預設閘道:192.168.53.198

這是我的工作站上的路由表:

root@workpc:~# netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.53.0    0.0.0.0         255.255.255.0   U         0 0          0 eth0
0.0.0.0         192.168.53.198  0.0.0.0         UG        0 0          0 eth0

為什麼我的工作站無法存取 10.10.0.54?我相信我已經正確設定了一切。

相關內容