ip route flush table 50
ip route flush table 100
ip route flush table 150
ip route flush table 200
ip route flush table 250
for TABLE in 50 100 150 200 250
do
ip route | grep link | while read ROUTE
do
ip route add table $TABLE to $ROUTE
done
done
ip route add table 50 default via $wan1_gw dev ppp0 src $wan1_ip
ip route add table 100 default via $wan2_gw dev ppp1 src $wan2_ip
ip route add table 150 default via $wan3_gw dev ppp2 src $wan3_ip
ip route add table 200 default via $wan4_gw dev ppp3 src $wan4_ip
ip route add table 250 default via $wan5_gw dev ppp4 src $wan5_ip
ip route delete default
#带宽负载均衡
ip route add default scope global equalize nexthop via $wan1_gw dev ppp0 weight 1 nexthop via $wan2_gw dev ppp1 weight 1 nexthop via $wan3_gw dev ppp2 weight 1 nexthop via $wan4_gw dev ppp3 weight 1 nexthop via $wan5_gw dev ppp4 weight 1