linux

流量切分线路方式

# 程序判断进入IP线路,设置服务器路由规则控制返回
vi /etc/iproute2/rt_tables
#添加一条策略
252   bgp2  #注意策略的序号顺序
ip route add default via 第二个出口上线IP(非默认网关) dev eth1 table bgp2
ip route add from 本机第二个ip table bgp2
#查看
ip route list table 252
ip rule list
#成功后将语句添加开机启动

  

原文地址:https://www.cnblogs.com/sharesdk/p/8694307.html