原文地址https://www.linuxidc.com/Linux/2018-05/152427.htm
vim /etc/init.d/network的倒数第二行,也就是exit $rc上一行加上以下
10的表明内网的,168的表明外网的,via后面是网关src是网卡ip
ip route flush table 1linux
ip route add default via 10.0.7.254 dev eth0 src 10.0.7.2 table 1vim
ip rule add from 10.0.7.2 table 1ide
ip route flush table 2rest
ip route add default via 168.6.101.254 dev eth1 src 168.6.101.2 table 2htm
ip rule add from 168.6.101.2 table 2ip
注意,要先disable掉NetworkManager这个服务
systemctl disable NetworkManager
systemctl stop NetworkManager
必须只由network服务来掌管network
systemctl restart networkit