|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
×
看了很多做汇聚、分流的方法,各说说有理,没一个完好的方案,全汇聚的游戏掉线,分流的又起不到WAN流量叠加。想了半天,我搞了个折中方案,用Nth+random,单线程应用的就一个WAN,多线程的应用才多WAN汇聚,下面我只把实现这功能的测试脚本发上来,大家试试看,直接导入运行,不会影响你原来的ros工作,你只需到ip firewall address-list中看运行结果,有IP_01到IP_06的地址列表,这些列表内容相互没有重复的,能做到这样,剩下的只是加路由标记,建几个路由就行了,如果还想进一步流量匀衡,我想只需做个检测脚本,哪个WAN口超出限制流量,就减少对应的那条路由标记的 random值,反之增加。我没条件试,只给大家一个思路,大家试试看是还可行。
/ip firewall mangle
# dst-address=!10.0.0.0/8是我的内网IP段,改成你的就行了
add chain=prerouting dst-address=!10.0.0.0/8 connection-state=new nth=5,6,0 action=mark-connection new-connection-mark=IP-01 passthrough=yes
add chain=prerouting random=16 dst-address-list=!IP_00 connection-mark=IP-01 action=add-dst-to-address-list address-list=IP_01 address-list-timeout=1m
add chain=prerouting connection-mark=IP-01 dst-address-list=IP_01 action=add-dst-to-address-list address-list=IP_00 address-list-timeout=1m
add chain=prerouting nth=5,6,1 action=mark-connection new-connection-mark=IP-02 passthrough=yes
add chain=prerouting random=16 dst-address-list=!IP_00 connection-mark=IP-02 action=add-dst-to-address-list address-list=IP_02 address-list-timeout=1m
add chain=prerouting connection-mark=IP-02 dst-address-list=IP_02 action=add-dst-to-address-list address-list=IP_00 address-list-timeout=1m
add chain=prerouting nth=5,6,2 action=mark-connection new-connection-mark=IP-03 passthrough=yes
add chain=prerouting random=16 dst-address-list=!IP_00 connection-mark=IP-03 action=add-dst-to-address-list address-list=IP_03 address-list-timeout=1m
add chain=prerouting connection-mark=IP-03 dst-address-list=IP_03 action=add-dst-to-address-list address-list=IP_00 address-list-timeout=1m
add chain=prerouting nth=5,6,3 action=mark-connection new-connection-mark=IP-04 passthrough=yes
add chain=prerouting random=16 dst-address-list=!IP_00 connection-mark=IP-04 action=add-dst-to-address-list address-list=IP_04 address-list-timeout=1m
add chain=prerouting connection-mark=IP-04 dst-address-list=IP_04 action=add-dst-to-address-list address-list=IP_00 address-list-timeout=1m
add chain=prerouting nth=5,6,4 action=mark-connection new-connection-mark=IP-05 passthrough=yes
add chain=prerouting random=16 dst-address-list=!IP_00 connection-mark=IP-05 action=add-dst-to-address-list address-list=IP_05 address-list-timeout=1m
add chain=prerouting connection-mark=IP-05 dst-address-list=IP_05 action=add-dst-to-address-list address-list=IP_00 address-list-timeout=1m
add chain=prerouting nth=5,6,5 action=mark-connection new-connection-mark=IP-06 passthrough=yes
add chain=prerouting random=20 dst-address-list=!IP_00 connection-mark=IP-06 action=add-dst-to-address-list address-list=IP_06 address-list-timeout=1m
add chain=prerouting connection-mark=IP-06 dst-address-list=IP_06 action=add-dst-to-address-list address-list=IP_00 address-list-timeout=1m |
|