wan1 eth0.2 192.168.3.102 gateway 192.168.3.1 电信
wan2 eth0.3 192.168.30.102 gateway 192.168.30.1 网通
iptables -t nat -I POSTROUTING -s 192.168.3.0/24 -o eth0.2 -j SNAT --to-source 192.168.3.102
iptables -t nat -I POSTROUTING -s 192.168.30.0/24 -o eth0.3 -j SNAT --to-source 192.168.30.102
ip route add default scope global nexthop via 192.168.3.1 dev eth0.2 weight 1 nexthop via 192.168.30.1 dev eth0.3 weight 1
带宽叠加只做上面的就可以了
下面的是流量分割
201 dianxin
202 wangtong
//通向该网关的一条路由,并使之成为默认网关,分别负责一个单独的上行流
ip route add 192.168.3.0/24 dev eth0.2 src 192.168.3.102 table dianxin
ip route add default via 192.168.3.1 table dianxin
ip route add 192.168.30.0/24 dev eth0.3 src 192.168.30.102 table wangtong
ip route add default via 192.168.30.1 table dianxin
//你需要保证的就是如果你已经有了相应的源地址,就应该把数据包从相应的网卡路由出去
ip rule add from 192.168.3.102 table dianxin
ip rule add from 192.168.30.102 table wangtong
ip address add 192.168.50.50/24 broadcast + dev eth0 label eth0:vbir
阅读(1173) | 评论(0) | 转发(0) |