vi /etc/iproute2/rt_tables
: # # local # #1 inr.ruhep 1 c2q.q9400 2 pdc.e2160
ip route add 192.168.11.0/24 dev eth0 src 192.168.11.248 table pdc.e2160 ip route add default via 192.168.11.251 table pdc.e2160 ip rule add from 192.168.11.248 table pdc.e2160 ip route add 192.168.12.0/24 dev eth1 src 192.168.12.246 table c2q.q9400 ip route add default via 192.168.12.250 table c2q.q9400 ip rule add from 192.168.12.246 table c2q.q9400 ip route add default scope global nexthop via 192.168.11.251 dev eth0 weight 1 nexthop via 192.168.12.250 dev eth1 weight 4
vi /etc/sysconfig/network-scripts/route-eth0
192.168.11.0/24 dev eth0 src 192.168.11.248 table pdc.e2160 default via 192.168.11.251 table pdc.e2160
vi /etc/sysconfig/network-scripts/rule-eth0
from 192.168.11.248 table pdc.e2160
vi /etc/sysconfig/network-scripts/route-eth1
192.168.12.0/24 dev eth1 src 192.168.12.246 table c2q.q9400 default via 192.168.12.250 table c2q.q9400 default scope global nexthop via 192.168.11.251 dev eth0 weight 1 nexthop via 192.168.12.250 dev eth1 weight 4
vi /etc/sysconfig/network-scripts/rule-eth1
from 192.168.12.246 table c2q.q9400
[root@xen-server ~]# ip route show 192.168.12.0/24 dev eth1 proto kernel scope link src 192.168.12.246 192.168.11.0/24 dev eth0 proto kernel scope link src 192.168.11.248 169.254.0.0/16 dev eth1 scope link default nexthop via 192.168.11.251 dev eth0 weight 1 nexthop via 192.168.12.250 dev eth1 weight 4
vi /etc/sysconfig/network-scripts/route-eth1
192.168.12.0/24 dev eth1 src 192.168.12.246 table c2q.q9400 default via 192.168.12.250 table c2q.q9400 #default scope global nexthop via 192.168.11.251 dev eth0 weight 1 nexthop via 192.168.12.250 dev eth1 weight 4 default scope global nexthop via 192.168.12.250 dev eth1 weight 4
service network restart
[root@xen-server ~]# ip route show 192.168.12.0/24 dev eth1 proto kernel scope link src 192.168.12.246 192.168.11.0/24 dev eth0 proto kernel scope link src 192.168.11.248 169.254.0.0/16 dev eth1 scope link default via 192.168.12.250 dev eth1