ubuntu下
#!/bin/sh
#前提用联通IP登录系统
cp /etc/iproute2/rt_tables /etc/iproute2/rt_tables.bak
# telecom
#echo 200 telecom >> /etc/iproute2/rt_tables
#unioncom
#echo 201 unioncom >> /etc/iproute2/rt_tables
ip route add 122.193.101.51/29 dev eth0 src 122.193.101.51 table liantong
ip route add default via 122.193.101.49 table liantong
ip route add 222.92.154.139/29 dev eth1 src 222.92.154.139 table dianxin
ip route add default via 222.92.154.137 table dianxin
ip route add 122.193.101.51/29 dev eth0 src 122.193.101.51
ip route add 222.92.154.139/29 dev eth1 src 222.92.154.139
#更换试试
ip route add default via 222.92.154.137
#liangtong
ip rule add from 122.193.101.51 table liantong
#dianxin
ip rule add from 222.92.154.139 table dianxin
redhat
双网卡,双公网IP,保持每个公网IP胡通
ip route add default via 180.153.154.1 dev eth0 src 180.153.154.155 table hengs01
ip route add default via 180.153.153.25 dev eth2 src 180.153.153.28 table hengs02
ip rule add from 180.153.154.155 table hengs01
ip rule add from 180.153.153.28 table hengs02