本次列出使用PCC负载均衡实例
网上看到过教程,感觉脚本来的快点,下面就是PCC2个ADSL的负载均衡的脚本:
/ip firewall mangle
add action=mark-connection chain=prerouting disabled=no new-connection-mark=1 \
passthrough=yes per-connection-classifier=both-addresses:2/0 src-address=\
10.20.20.0/24
add action=mark-connection chain=prerouting disabled=no new-connection-mark=2 \
passthrough=yes per-connection-classifier=both-addresses:2/1 src-address=\
10.20.20.0/24
add action=mark-routing chain=prerouting connection-mark=1 disabled=no \
new-routing-mark=1 passthrough=yes src-address=10.20.20.0/24
add action=mark-routing chain=prerouting connection-mark=2 disabled=no \
new-routing-mark=2 passthrough=yes src-address=10.20.20.0/24
/ip route
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe-out1 \
routing-mark=1 scope=30 target-scope=10
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe-out2 \
routing-mark=2 scope=30 target-scope=10
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe-out1 scope=30 \
target-scope=10
add disabled=no distance=2 dst-address=0.0.0.0/0 gateway=pppoe-out2 scope=30 \
target-scope=10