多個 NIC、多個網關(公有和私有)

多個 NIC、多個網關(公有和私有)

提前致歉,重新提出已多次發布的問題。我嘗試遵循以前的指南,但似乎陷入相當困境!運行 Ubuntu 16.04,我有一個面向公眾的網路 (192.99.110.188) 和一個專用網路 (10.16.110.188)。用戶需要能夠從專用網路訪問,但公共網路對於更新和運行備份以進行崩潰計劃是必需的。

我的 /etc/network/interfaces 檔案的內容是:

auto eth0
allow-hotplug eth0
iface eth0 inet static
       address 192.99.110.188
       netmask 255.255.255.192
       broadcast 192.99.110.191
       gateway 192.99.110.129
       dns-nameservers 192.99.203.20 192.99.25.14

auto eth1
allow-hotplug eth1
iface eth1 inet static
       address 10.16.110.188
       netmask 255.255.255.192
       post-up ip route add 10.16.0.0/24 dev eth1 src 10.16.110.188 table rt2
       post-up ip route add default 10.16.110.188 via 10.16.110.129 dev eth1 table rt2
       post-up ip rule add from 10.16.110.188/32 table rt2
       post-up ip rule add to 10.16.110.188/32 table rt2 

路由表(route -n)如下圖所示:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         137.99.110.129  0.0.0.0         UG    0      0        0 eth0
10.16.110.128   0.0.0.0         255.255.255.192 U     0      0        0 eth1
192.99.110.128  0.0.0.0         255.255.255.192 U     0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 eth0

我已經擺弄設定有一段時間了,但為了安全起見,我一直在專用網路上運行(以便用戶可以存取內容)。然後,當我啟用公共介面 (eth0) 時,系統似乎工作了幾個小時,然後專用介面停止回應 - 提示憤怒的使用者電子郵件。

任何幫助將非常感激!

相關內容