ROS双线拨号 PCC负载脚本【实测可用】
测试版本:ROS 5.20/5.26,其实相近版本应该也行内网段:172.16.2.0/24
拨号配置:
/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
这个网上多的,用个软件就OK或用个脚本
页:
[1]