auto eno1 iface eno1 inet static address 10.120.10.18X netmask 255.255.255.0 # <= 內網走路由,路由裏面配置了網關了,因此這裏要delete掉網關項。
auto eno2 iface eno2 inet static address 10.120.50.18X netmask 255.255.255.0 gateway 10.120.50.25X # 加這個爲了重啓系統後也能生效 up route add -net 10.0.0.0/8 gw 10.120.10.25X dev eno1
修改後,重啓網卡以生效:sudo /etc/init.d/networking restart
bash