|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
×
参考ZOOYO版主的ADSL动态网关修改的,本人没条件试验. 如有不明参考ADSL动态网关脚本和光纤与ADSL在网吧的应用
http://bbs.routerclub.com/thread-18165-1-1.html
一条断线自动切换到另一条:
:if ([/in pppoe-c get [find name=pppoe-out1] running]=false) do {
:global adsl "pppoe-out2"
:global new-ip [ /ip address get [/ip address find broa=0.0.0.0 int=$adsl] network ]
:global old-ip [ /ip route get [/ip route find comm="adsl1"] gateway ]
:if ($new-ip != $old-ip) do={
:log info [/ip route set [/ip route find comm="adsl1"] gateway=$new-ip]
:log info "〖1线中断转到2线〗"
}
}
:if ([/in pppoe-c get [find name=pppoe-out2] running]=false) do {
:global adsl "pppoe-out1"
:global new-ip [ /ip address get [/ip address find broa=0.0.0.0 int=$adsl] network ]
:global old-ip [ /ip route get [/ip route find comm="adsl2"] gateway ]
:if ($new-ip != $old-ip) do={
:log info [/ip route set [/ip route find comm="adsl2"] gateway=$new-ip]
:log info "〖2线中断转到1线〗"
}
}
线路恢复:
:if ([/in pppoe-c get [find name=pppoe-out1] running]=true) do {
:global adsl "pppoe-out1"
:global new-ip [ /ip address get [/ip address find broa=0.0.0.0 int=$adsl] network ]
:global old-ip [ /ip route get [/ip route find comm="adsl1"] gateway ]
:if ($new-ip != $old-ip) do={
:log info [/ip route set [/ip route find comm="adsl1"] gateway=$new-ip]
:log info "〖1线网络恢复〗"
}
}
:if ([/in pppoe-c get [find name=pppoe-out2] running]=true) do {
:global adsl "pppoe-out2"
:global new-ip [ /ip address get [/ip address find broa=0.0.0.0 int=$adsl] network ]
:global old-ip [ /ip route get [/ip route find comm="adsl2"] gateway ]
:if ($new-ip != $old-ip) do={
:log info [/ip route set [/ip route find comm="adsl2"] gateway=$new-ip]
:log info "〖2线网络恢复〗"
}
}
引用ZOOYO版主一句: 这是路由表,大家一定要加入comment标签,我写的脚本是通过comment来判断的! |
|