1 #!/bin/sh 2 ip route flush table 10 3 ip route add default via 10.191.0.1 dev em1 src 10.191.0.100 table 10 prio 50 4 ip rule add from 10.191.0.100 table 10 5 ip route flush table 20 6 ip route add default via 10.191.10.1 dev em2 src 10.191.10.100 table 20 prio 50 7 ip rule add from 10.191.10.100 table 20 8 9 10 route add -net 10.0.0.0/8 gw 10.191.208.1
Note: The above configuration only needs to set the gateway of 10.191.0.100, other gateways do not need to be set
Put the above script in /etc/sysconfig/static-route.sh and set it to start at /etc/rc.loacl