4 配置路由
总配置效果图,注意comment的设置,在运行脚本时要用到
可以看到,我在路由表中加入了3条规则,前两条分别对应于在mangle中设置的两个路由标记
另外一条没有路由标记,官方解释说是用于路由被标记之外的ros本身的包,具体什么意思我也没有彻底明白
5 加入防adsl掉线脚本
:local assign-address
:local new-address
:local status
:local x
:set x 2
:for i from=1 to=$x do={
:set status [/interface get [/interface find name=(\"pppoe-out\" . $i)] running]
:if ($status=true) do={
:set new-address [/ip address get [/ip address find dynamic=yes interface=(\"pppoe-out\" . $i)] address]
:set new-address [:pick $new-address 0 ([:len $new-address] -3)]
:set assign-address [/ip address get [/ip address find dynamic=no interface=(\"pppoe-out\" . $i)] address]
:set assign-address [:pick $assign-address 0 ([:len $assign-address] -3)]
:if ($assign-address != $new-address) do={ /ip address set [/ip address find comment=$i] address=$new-address network=$new-address broadcast=$new-address
/ip route set [/ip route find comment=$i] gateway=$new-address
/ip fir nat set [/ip fir nat find comment=$i] to-addresses=$new-address
/ip route set [/ip route find comment=$i] gateway=$new-address
}
}
}
配置截图:
再到system->scheduler中加入一条
至此,双线adsl的配置就大功告成了!
目前我只尝试了2条ad负载均衡,不知道3条,4条是不是可以直接按照2条的思路去扩展,哪位仁兄做出来了希望给点思路,谢谢!