双ADSL动态网关掉线自动切换
参考ZOOYO版主的ADSL动态网关修改的,本人没条件试验.如有不明参考ADSL动态网关脚本和光纤与ADSL在网吧的应用http://bbs.routerclub.com/thread-18165-1-1.html
一条断线自动切换到另一条:
:if ( running]=false) do {
:global adsl "pppoe-out2"
:global new-ip [ /ip address get network ]
:global old-ip [ /ip route get gateway ]
:if ($new-ip != $old-ip) do={
:log info gateway=$new-ip]
:log info "〖1线中断转到2线〗"
}
}
:if ( running]=false) do {
:global adsl "pppoe-out1"
:global new-ip [ /ip address get network ]
:global old-ip [ /ip route get gateway ]
:if ($new-ip != $old-ip) do={
:log info gateway=$new-ip]
:log info "〖2线中断转到1线〗"
}
}
线路恢复:
:if ( running]=true) do {
:global adsl "pppoe-out1"
:global new-ip [ /ip address get network ]
:global old-ip [ /ip route get gateway ]
:if ($new-ip != $old-ip) do={
:log info gateway=$new-ip]
:log info "〖1线网络恢复〗"
}
}
:if ( running]=true) do {
:global adsl "pppoe-out2"
:global new-ip [ /ip address get network ]
:global old-ip [ /ip route get gateway ]
:if ($new-ip != $old-ip) do={
:log info gateway=$new-ip]
:log info "〖2线网络恢复〗"
}
}
引用ZOOYO版主一句:这是路由表,大家一定要加入comment标签,我写的脚本是通过comment来判断的! 有没有测试过。。 能不能用啊! :victory:
页:
[1]