找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 8027|回复: 1

[脚本] ROS双线拨号 PCC负载脚本【实测可用】

[复制链接]
发表于 2014-2-17 09:44:17 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

×
测试版本:ros 5.20/5.26,其实相近版本应该也行
内网段:172.16.2.0/24

ros.jpg.png



拨号配置:
/interface pppoe-client add name="pppoe-out1" interface=wan1 user="11" password="11" add-default-route=no disabled=no
/interface pppoe-client add name="pppoe-out2" interface=wan2 user="22" password="22" add-default-route=no disabled=no

Mangle标记:
/ip firewall mangle
add action=change-mss chain=forward comment="" disabled=no new-mss=1440 protocol=tcp tcp-flags=syn
add action=mark-connection chain=input comment="" disabled=no in-interface=pppoe-out1 new-connection-mark=1 passthrough=yes
add action=mark-routing chain=output comment="" connection-mark=1 disabled=no new-routing-mark=1 passthrough=yes
add action=mark-connection chain=input comment="" disabled=no in-interface=pppoe-out2 new-connection-mark=2 passthrough=yes
add action=mark-routing chain=output comment="" connection-mark=2 disabled=no new-routing-mark=2 passthrough=yes
add action=mark-connection chain=prerouting comment="PCC-1" disabled=no new-connection-mark=1 passthrough=yes per-connection-classifier=both-addresses-

and-ports:2/0 src-address=172.16.2.0/24 dst-address-type=!local
add action=mark-routing chain=prerouting comment="" connection-mark=1 disabled=no new-routing-mark=1 passthrough=yes src-address=172.16.2.0/24
add action=mark-connection chain=prerouting comment="PCC-2" disabled=no new-connection-mark=2 passthrough=yes per-connection-classifier=both-addresses-

and-ports:2/1 src-address=172.16.2.0/24 dst-address-type=!local
add action=mark-routing chain=prerouting comment="" connection-mark=2 disabled=no new-routing-mark=2 passthrough=yes src-address=172.16.2.0/24

NAT配置:
/ip firewall nat
add action=masquerade chain=srcnat comment=1 connection-mark=1 disabled=no out-interface=pppoe-out1 src-address=172.16.2.0/24
add action=masquerade chain=srcnat comment=2 connection-mark=2 disabled=no out-interface=pppoe-out2 src-address=172.16.2.0/24

路由配置:   
/ip route
add check-gateway=ping comment=1 disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe-out1 routing-mark=1
add check-gateway=ping comment=2 disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe-out2 routing-mark=2
add check-gateway=ping comment=1 disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe-out1
add check-gateway=ping comment=2 disabled=no distance=2 dst-address=0.0.0.0/0 gateway=pppoe-out2

routeros
发表于 2014-2-17 09:52:08 | 显示全部楼层
这个网上多的,用个软件就OK或用个脚本
routeros
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|小黑屋|软路由 ( 渝ICP备15001194号-1|渝公网安备 50011602500124号 )

GMT+8, 2024-12-22 10:50 , Processed in 0.047482 second(s), 5 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表