jiyouwork 发表于 2007-9-21 18:36:59

双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来判断的!

xujia1108 发表于 2009-4-11 13:16:16

有没有测试过。。 能不能用啊!

udata008 发表于 2009-4-12 01:03:44

:victory:
页: [1]
查看完整版本: 双ADSL动态网关掉线自动切换