找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 12830|回复: 32

[负载平衡] 四线ADSL nth负载均衡 断线 掉线调整 报警脚本 多线ADSL可修改

[复制链接]
发表于 2008-10-13 11:49:08 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

×
:global ip
:global gateold
:global address
:global adsl1-statu [/interface get pppoe-out1 run]
:if ($adsl1-statu) do={
:set ip [/ip add get [/ip add find inter=pppoe-out1 dynamic=yes] address]
:set address [:pick $ip 0 ([:len $ip] -3)]
:log info ($address)
:set gateold [/ip route get [/ip route find comm=adsl1] gateway]
    :if ($gateold!=$address) do={
    /ip add set [/ip add find comm=adsl1] address=$address network=$address broadcast=$address
    /ip route set [/ip route find comm=adsl1] gateway=$address
    /ip fir nat set [/ip fir nat find comment=adsl1] to-addresses=$address
    }
}
:global adsl2-statu [/interface get pppoe-out2 run]
:if ($adsl2-statu) do={
:set ip [/ip add get [/ip add find inter=pppoe-out2 dynamic=yes] address]
:set address [:pick $ip 0 ([:len $ip] -3)]
:log info ($address)
:set gateold [/ip route get [/ip route find comm=adsl2] gateway]
    :if ($gateold!=$address) do={
    /ip add set [/ip add find comm=adsl2] address=$address network=$address broadcast=$address
    /ip route set [/ip route find comm=adsl2] gateway=$address
    /ip fir nat set [/ip fir nat find comment=adsl2] to-addresses=$address
    }
}
:global adsl3-statu [/interface get pppoe-out3 run]
:if ($adsl3-statu) do={
:set ip [/ip add get [/ip add find inter=pppoe-out3 dynamic=yes] address]
:set address [:pick $ip 0 ([:len $ip] -3)]
:log info ($address)
:set gateold [/ip route get [/ip route find comm=adsl3] gateway]
    :if ($gateold!=$address) do={
    /ip add set [/ip add find comm=adsl3] address=$address network=$address broadcast=$address
    /ip route set [/ip route find comm=adsl3] gateway=$address
   /ip fir nat set [/ip fir nat find comment=adsl3] to-addresses=$address
    }
}
:global adsl4-statu [/interface get pppoe-out4 run]
:if ($adsl4-statu) do={
:set ip [/ip add get [/ip add find inter=pppoe-out4 dynamic=yes] address]
:set address [:pick $ip 0 ([:len $ip] -3)]
:log info ($address)
:set gateold [/ip route get [/ip route find comm=adsl4] gateway]
    :if ($gateold!=$address) do={
    /ip add set [/ip add find comm=adsl4] address=$address network=$address broadcast=$address
    /ip route set [/ip route find comm=adsl4] gateway=$address
    /ip fir nat set [/ip fir nat find comment=adsl4] to-addresses=$address
    }
}
:if (($adsl1-statu)&&($adsl2-statu)&&($adsl3-statu)&&($adsl4-statu)) do={
:if ([ip fi man get [/ip fi man find comm=adsl1] disabled]=yes) do={/ip fi man en [/ip fi man find comm=adsl1]}
:if ([ip fi man get [/ip fi man find comm=adsl2] disabled]=yes) do={/ip fi man en [/ip fi man find comm=adsl2]}
:if ([ip fi man get [/ip fi man find comm=adsl3] disabled]=yes) do={/ip fi man en [/ip fi man find comm=adsl3]}
:if ([ip fi man get [/ip fi man find comm=adsl4] disabled]=yes) do={/ip fi man en [/ip fi man find comm=adsl4]}
:if ([ip fi man get [/ip fi man find comm=adsl1 action=mark-connection] nth]!=3,4,0) do={/ip fi man set [/ip fi man find comm=adsl1 action=mark-connection] nth=3,4,0}
:if ([ip fi man get [/ip fi man find comm=adsl2 action=mark-connection] nth]!=3,4,1) do={/ip fi man set [/ip fi man find comm=adsl1 action=mark-connection] nth=3,4,1}
:if ([ip fi man get [/ip fi man find comm=adsl3 action=mark-connection] nth]!=3,4,2) do={/ip fi man set [/ip fi man find comm=adsl1 action=mark-connection] nth=3,4,2}
:if ([ip fi man get [/ip fi man find comm=adsl4 action=mark-connection] nth]!=3,4,3) do={/ip fi man set [/ip fi man find comm=adsl2 action=mark-connection] nth=3,4,3}
:beep length=100ms frequency=1755
}
:if ((!$adsl1-statu)&&($adsl2-statu)&&($adsl3-statu)&&($adsl4-statu)) do={
:if ([ip fi man get [/ip fi man find comm=443 action=mark-connection] new-connection-mark]!=2) do={/ip fi man set [/ip fi man find comm=443 action=mark-connection] new-connection-mark=2}
:if ([ip fi man get [/ip fi man find comm=adsl1] disabled]=no) do={/ip fi man dis [/ip fi man find comm=adsl1]}
:if ([ip fi man get [/ip fi man find comm=adsl2] disabled]=yes) do={/ip fi man en [/ip fi man find comm=adsl2]}
:if ([ip fi man get [/ip fi man find comm=adsl3] disabled]=yes) do={/ip fi man en [/ip fi man find comm=adsl3]}
:if ([ip fi man get [/ip fi man find comm=adsl4] disabled]=yes) do={/ip fi man en [/ip fi man find comm=adsl4]}
#:if ([ip fi man get [/ip fi man find comm=adsl1 action=mark-connection] nth]!=3,4,0) do={/ip fi man set [/ip fi man find comm=adsl1 action=mark-connection] nth=3,4,0}
:if ([ip fi man get [/ip fi man find comm=adsl2 action=mark-connection] nth]!=2,3,0) do={/ip fi man set [/ip fi man find comm=adsl1 action=mark-connection] nth=2,3,0}
:if ([ip fi man get [/ip fi man find comm=adsl3 action=mark-connection] nth]!=2,3,1) do={/ip fi man set [/ip fi man find comm=adsl1 action=mark-connection] nth=2,3,1}
:if ([ip fi man get [/ip fi man find comm=adsl4 action=mark-connection] nth]!=2,3,2) do={/ip fi man set [/ip fi man find comm=adsl2 action=mark-connection] nth=2,3,2}
:beep length=100ms frequency=1755
}
:if (($adsl1-statu)&&(!$adsl2-statu)&&($adsl3-statu)&&($adsl4-statu)) do={
:if ([ip fi man get [/ip fi man find comm=443 action=mark-connection] new-connection-mark]!=1) do={/ip fi man set [/ip fi man find comm=443 action=mark-connection] new-connection-mark=1}
:if ([ip fi man get [/ip fi man find comm=adsl1] disabled]=yes) do={/ip fi man en [/ip fi man find comm=adsl1]}
:if ([ip fi man get [/ip fi man find comm=adsl2] disabled]=no) do={/ip fi man dis [/ip fi man find comm=adsl2]}
:if ([ip fi man get [/ip fi man find comm=adsl3] disabled]=yes) do={/ip fi man en [/ip fi man find comm=adsl3]}
:if ([ip fi man get [/ip fi man find comm=adsl4] disabled]=yes) do={/ip fi man en [/ip fi man find comm=adsl4]}
:if ([ip fi man get [/ip fi man find comm=adsl1 action=mark-connection] nth]!=2,3,0) do={/ip fi man set [/ip fi man find comm=adsl1 action=mark-connection] nth=2,3,0}
#:if ([ip fi man get [/ip fi man find comm=adsl2 action=mark-connection] nth]!=3,4,1) do={/ip fi man set [/ip fi man find comm=adsl1 action=mark-connection] nth=3,4,1}
:if ([ip fi man get [/ip fi man find comm=adsl3 action=mark-connection] nth]!=2,3,1) do={/ip fi man set [/ip fi man find comm=adsl1 action=mark-connection] nth=2,3,1}
:if ([ip fi man get [/ip fi man find comm=adsl4 action=mark-connection] nth]!=2,3,2) do={/ip fi man set [/ip fi man find comm=adsl2 action=mark-connection] nth=2,3,2}
:beep length=100ms frequency=1755
}
:if (($adsl1-statu)&&($adsl2-statu)&&(!$adsl3-statu)&&($adsl4-statu)) do={
:if ([ip fi man get [/ip fi man find comm=443 action=mark-connection] new-connection-mark]!=1) do={/ip fi man set [/ip fi man find comm=443 action=mark-connection] new-connection-mark=1}
:if ([ip fi man get [/ip fi man find comm=adsl1] disabled]=yes) do={/ip fi man en [/ip fi man find comm=adsl1]}
:if ([ip fi man get [/ip fi man find comm=adsl2] disabled]=yes) do={/ip fi man en [/ip fi man find comm=adsl2]}
:if ([ip fi man get [/ip fi man find comm=adsl3] disabled]=no) do={/ip fi man dis [/ip fi man find comm=adsl3]}
:if ([ip fi man get [/ip fi man find comm=adsl4] disabled]=yes) do={/ip fi man en [/ip fi man find comm=adsl4]}
:if ([ip fi man get [/ip fi man find comm=adsl1 action=mark-connection] nth]!=2,3,0) do={/ip fi man set [/ip fi man find comm=adsl1 action=mark-connection] nth=2,3,0}
:if ([ip fi man get [/ip fi man find comm=adsl2 action=mark-connection] nth]!=2,3,1) do={/ip fi man set [/ip fi man find comm=adsl1 action=mark-connection] nth=2,3,1}
#:if ([ip fi man get [/ip fi man find comm=adsl3 action=mark-connection] nth]!=3,4,2) do={/ip fi man set [/ip fi man find comm=adsl1 action=mark-connection] nth=3,4,2}
:if ([ip fi man get [/ip fi man find comm=adsl4 action=mark-connection] nth]!=2,3,2) do={/ip fi man set [/ip fi man find comm=adsl2 action=mark-connection] nth=2,3,2}
:beep length=100ms frequency=1755
}
:if (($adsl1-statu)&&($adsl2-statu)&&($adsl3-statu)&&(!$adsl4-statu)) do={
:if ([ip fi man get [/ip fi man find comm=443 action=mark-connection] new-connection-mark]!=1) do={/ip fi man set [/ip fi man find comm=443 action=mark-connection] new-connection-mark=1}
:if ([ip fi man get [/ip fi man find comm=adsl1] disabled]=yes) do={/ip fi man en [/ip fi man find comm=adsl1]}
:if ([ip fi man get [/ip fi man find comm=adsl2] disabled]=yes) do={/ip fi man en [/ip fi man find comm=adsl2]}
:if ([ip fi man get [/ip fi man find comm=adsl3] disabled]=yes) do={/ip fi man en [/ip fi man find comm=adsl3]}
:if ([ip fi man get [/ip fi man find comm=adsl4] disabled]=no) do={/ip fi man dis [/ip fi man find comm=adsl4]}
:if ([ip fi man get [/ip fi man find comm=adsl1 action=mark-connection] nth]!=2,3,0) do={/ip fi man set [/ip fi man find comm=adsl1 action=mark-connection] nth=2,3,0}
:if ([ip fi man get [/ip fi man find comm=adsl2 action=mark-connection] nth]!=2,3,1) do={/ip fi man set [/ip fi man find comm=adsl1 action=mark-connection] nth=2,3,1}
:if ([ip fi man get [/ip fi man find comm=adsl3 action=mark-connection] nth]!=2,3,2) do={/ip fi man set [/ip fi man find comm=adsl1 action=mark-connection] nth=2,3,2}
#:if ([ip fi man get [/ip fi man find comm=adsl4 action=mark-connection] nth]!=3,4,3) do={/ip fi man set [/ip fi man find comm=adsl2 action=mark-connection] nth=3,4,3}
:beep length=100ms frequency=1755
}
:if ((!$adsl1-statu)&&(!$adsl2-statu)&&($adsl3-statu)&&($adsl4-statu)) do={
:if ([ip fi man get [/ip fi man find comm=443 action=mark-connection] new-connection-mark]!=3) do={/ip fi man set [/ip fi man find comm=443 action=mark-connection] new-connection-mark=3}
:if ([ip fi man get [/ip fi man find comm=adsl1] disabled]=no) do={/ip fi man dis [/ip fi man find comm=adsl1]}
:if ([ip fi man get [/ip fi man find comm=adsl2] disabled]=no) do={/ip fi man dis [/ip fi man find comm=adsl2]}
:if ([ip fi man get [/ip fi man find comm=adsl3] disabled]=yes) do={/ip fi man en [/ip fi man find comm=adsl3]}
:if ([ip fi man get [/ip fi man find comm=adsl4] disabled]=yes) do={/ip fi man en [/ip fi man find comm=adsl4]}
#:if ([ip fi man get [/ip fi man find comm=adsl1 action=mark-connection] nth]!=3,4,0) do={/ip fi man set [/ip fi man find comm=adsl1 action=mark-connection] nth=3,4,0}
#:if ([ip fi man get [/ip fi man find comm=adsl2 action=mark-connection] nth]!=3,4,1) do={/ip fi man set [/ip fi man find comm=adsl1 action=mark-connection] nth=3,4,1}
:if ([ip fi man get [/ip fi man find comm=adsl3 action=mark-connection] nth]!=1,2,0) do={/ip fi man set [/ip fi man find comm=adsl1 action=mark-connection] nth=1,2,0}
:if ([ip fi man get [/ip fi man find comm=adsl4 action=mark-connection] nth]!=1,2,1) do={/ip fi man set [/ip fi man find comm=adsl2 action=mark-connection] nth=1,2,1}
:beep length=100ms frequency=1755
:delay 500ms
:beep length=100ms frequency=1755
}
:if (($adsl1-statu)&&(!$adsl2-statu)&&(!$adsl3-statu)&&($adsl4-statu)) do={
:if ([ip fi man get [/ip fi man find comm=443 action=mark-connection] new-connection-mark]!=1) do={/ip fi man set [/ip fi man find comm=443 action=mark-connection] new-connection-mark=1}
:if ([ip fi man get [/ip fi man find comm=adsl1] disabled]=yes) do={/ip fi man en [/ip fi man find comm=adsl1]}
:if ([ip fi man get [/ip fi man find comm=adsl2] disabled]=no) do={/ip fi man dis [/ip fi man find comm=adsl2]}
:if ([ip fi man get [/ip fi man find comm=adsl3] disabled]=no) do={/ip fi man dis [/ip fi man find comm=adsl3]}
:if ([ip fi man get [/ip fi man find comm=adsl4] disabled]=yes) do={/ip fi man en [/ip fi man find comm=adsl4]}
:if ([ip fi man get [/ip fi man find comm=adsl1 action=mark-connection] nth]!=1,2,0) do={/ip fi man set [/ip fi man find comm=adsl1 action=mark-connection] nth=1,2,0}
#:if ([ip fi man get [/ip fi man find comm=adsl2 action=mark-connection] nth]!=3,4,1) do={/ip fi man set [/ip fi man find comm=adsl1 action=mark-connection] nth=3,4,1}
#:if ([ip fi man get [/ip fi man find comm=adsl3 action=mark-connection] nth]!=1,2,0) do={/ip fi man set [/ip fi man find comm=adsl1 action=mark-connection] nth=1,2,0}
:if ([ip fi man get [/ip fi man find comm=adsl4 action=mark-connection] nth]!=1,2,1) do={/ip fi man set [/ip fi man find comm=adsl2 action=mark-connection] nth=1,2,1}
:beep length=100ms frequency=1755
:delay 500ms
:beep length=100ms frequency=1755
}
:if (($adsl1-statu)&&($adsl2-statu)&&(!$adsl3-statu)&&(!$adsl4-statu)) do={
:if ([ip fi man get [/ip fi man find comm=443 action=mark-connection] new-connection-mark]!=1) do={/ip fi man set [/ip fi man find comm=443 action=mark-connection] new-connection-mark=1}
:if ([ip fi man get [/ip fi man find comm=adsl1] disabled]=yes) do={/ip fi man en [/ip fi man find comm=adsl1]}
:if ([ip fi man get [/ip fi man find comm=adsl2] disabled]=yes) do={/ip fi man en [/ip fi man find comm=adsl2]}
:if ([ip fi man get [/ip fi man find comm=adsl3] disabled]=no) do={/ip fi man dis [/ip fi man find comm=adsl3]}
:if ([ip fi man get [/ip fi man find comm=adsl4] disabled]=no) do={/ip fi man dis [/ip fi man find comm=adsl4]}
:if ([ip fi man get [/ip fi man find comm=adsl1 action=mark-connection] nth]!=1,2,0) do={/ip fi man set [/ip fi man find comm=adsl1 action=mark-connection] nth=1,2,0}
:if ([ip fi man get [/ip fi man find comm=adsl2 action=mark-connection] nth]!=1,2,1) do={/ip fi man set [/ip fi man find comm=adsl1 action=mark-connection] nth=1,2,1}
#:if ([ip fi man get [/ip fi man find comm=adsl3 action=mark-connection] nth]!=3,4,2) do={/ip fi man set [/ip fi man find comm=adsl1 action=mark-connection] nth=3,4,2}
#:if ([ip fi man get [/ip fi man find comm=adsl4 action=mark-connection] nth]!=3,4,3) do={/ip fi man set [/ip fi man find comm=adsl2 action=mark-connection] nth=3,4,3}
:beep length=100ms frequency=1755
:delay 500ms
:beep length=100ms frequency=1755
}
:if ((!$adsl1-statu)&&($adsl2-statu)&&($adsl3-statu)&&(!$adsl4-statu)) do={
:if ([ip fi man get [/ip fi man find comm=443 action=mark-connection] new-connection-mark]!=2) do={/ip fi man set [/ip fi man find comm=443 action=mark-connection] new-connection-mark=2}
:if ([ip fi man get [/ip fi man find comm=adsl1] disabled]=no) do={/ip fi man dis [/ip fi man find comm=adsl1]}
:if ([ip fi man get [/ip fi man find comm=adsl2] disabled]=yes) do={/ip fi man en [/ip fi man find comm=adsl2]}
:if ([ip fi man get [/ip fi man find comm=adsl3] disabled]=yes) do={/ip fi man en [/ip fi man find comm=adsl3]}
:if ([ip fi man get [/ip fi man find comm=adsl4] disabled]=no) do={/ip fi man dis [/ip fi man find comm=adsl4]}
#:if ([ip fi man get [/ip fi man find comm=adsl1 action=mark-connection] nth]!=3,4,0) do={/ip fi man set [/ip fi man find comm=adsl1 action=mark-connection] nth=3,4,0}
:if ([ip fi man get [/ip fi man find comm=adsl2 action=mark-connection] nth]!=1,2,0) do={/ip fi man set [/ip fi man find comm=adsl1 action=mark-connection] nth=1,2,0}
:if ([ip fi man get [/ip fi man find comm=adsl3 action=mark-connection] nth]!=1,2,1) do={/ip fi man set [/ip fi man find comm=adsl1 action=mark-connection] nth=1,2,1}
#:if ([ip fi man get [/ip fi man find comm=adsl4 action=mark-connection] nth]!=3,4,3) do={/ip fi man set [/ip fi man find comm=adsl2 action=mark-connection] nth=3,4,3}
:beep length=100ms frequency=1755
:delay 500ms
:beep length=100ms frequency=1755
}
:if ((!$adsl1-statu)&&(!$adsl2-statu)&&(!$adsl3-statu)&&($adsl4-statu)) do={
:if ([ip fi man get [/ip fi man find comm=443 action=mark-connection] new-connection-mark]!=4) do={/ip fi man set [/ip fi man find comm=443 action=mark-connection] new-connection-mark=4}
:if ([ip fi man get [/ip fi man find comm=adsl1] disabled]=no) do={/ip fi man dis [/ip fi man find comm=adsl1]}
:if ([ip fi man get [/ip fi man find comm=adsl2] disabled]=no) do={/ip fi man dis [/ip fi man find comm=adsl2]}
:if ([ip fi man get [/ip fi man find comm=adsl3] disabled]=no) do={/ip fi man dis [/ip fi man find comm=adsl3]}
:if ([ip fi man get [/ip fi man find comm=adsl4] disabled]=yes) do={/ip fi man en [/ip fi man find comm=adsl4]}
#:if ([ip fi man get [/ip fi man find comm=adsl1 action=mark-connection] nth]!=3,4,0) do={/ip fi man set [/ip fi man find comm=adsl1 action=mark-connection] nth=3,4,0}
#:if ([ip fi man get [/ip fi man find comm=adsl2 action=mark-connection] nth]!=3,4,1) do={/ip fi man set [/ip fi man find comm=adsl1 action=mark-connection] nth=3,4,1}
#:if ([ip fi man get [/ip fi man find comm=adsl3 action=mark-connection] nth]!=3,4,2) do={/ip fi man set [/ip fi man find comm=adsl1 action=mark-connection] nth=3,4,2}
:if ([ip fi man get [/ip fi man find comm=adsl4 action=mark-connection] nth]!=0,1,0) do={/ip fi man set [/ip fi man find comm=adsl2 action=mark-connection] nth=0,1,0}
:beep length=100ms frequency=1755
:delay 500ms
:beep length=100ms frequency=1755
:delay 500ms
:beep length=100ms frequency=1755
}
:if (($adsl1-statu)&&(!$adsl2-statu)&&(!$adsl3-statu)&&(!$adsl4-statu)) do={
:if ([ip fi man get [/ip fi man find comm=443 action=mark-connection] new-connection-mark]!=1) do={/ip fi man set [/ip fi man find comm=443 action=mark-connection] new-connection-mark=2}
:if ([ip fi man get [/ip fi man find comm=adsl1] disabled]=yes) do={/ip fi man en [/ip fi man find comm=adsl1]}
:if ([ip fi man get [/ip fi man find comm=adsl2] disabled]=no) do={/ip fi man dis [/ip fi man find comm=adsl2]}
:if ([ip fi man get [/ip fi man find comm=adsl3] disabled]=no) do={/ip fi man dis [/ip fi man find comm=adsl3]}
:if ([ip fi man get [/ip fi man find comm=adsl4] disabled]=no) do={/ip fi man dis [/ip fi man find comm=adsl4]}
:if ([ip fi man get [/ip fi man find comm=adsl1 action=mark-connection] nth]!=0,1,0) do={/ip fi man set [/ip fi man find comm=adsl1 action=mark-connection] nth=0,1,0}
#:if ([ip fi man get [/ip fi man find comm=adsl2 action=mark-connection] nth]!=3,4,1) do={/ip fi man set [/ip fi man find comm=adsl1 action=mark-connection] nth=3,4,1}
#:if ([ip fi man get [/ip fi man find comm=adsl3 action=mark-connection] nth]!=3,4,2) do={/ip fi man set [/ip fi man find comm=adsl1 action=mark-connection] nth=3,4,2}
#:if ([ip fi man get [/ip fi man find comm=adsl4 action=mark-connection] nth]!=3,4,3) do={/ip fi man set [/ip fi man find comm=adsl2 action=mark-connection] nth=3,4,3}
:beep length=100ms frequency=1755
:delay 500ms
:beep length=100ms frequency=1755
:delay 500ms
:beep length=100ms frequency=1755
}
:if ((!$adsl1-statu)&&($adsl2-statu)&&(!$adsl3-statu)&&(!$adsl4-statu)) do={
:if ([ip fi man get [/ip fi man find comm=443 action=mark-connection] new-connection-mark]!=2) do={/ip fi man set [/ip fi man find comm=443 action=mark-connection] new-connection-mark=2}
:if ([ip fi man get [/ip fi man find comm=adsl1] disabled]=no) do={/ip fi man dis [/ip fi man find comm=adsl1]}
:if ([ip fi man get [/ip fi man find comm=adsl2] disabled]=yes) do={/ip fi man en [/ip fi man find comm=adsl2]}
:if ([ip fi man get [/ip fi man find comm=adsl3] disabled]=no) do={/ip fi man dis [/ip fi man find comm=adsl3]}
:if ([ip fi man get [/ip fi man find comm=adsl4] disabled]=no) do={/ip fi man dis [/ip fi man find comm=adsl4]}
#:if ([ip fi man get [/ip fi man find comm=adsl1 action=mark-connection] nth]!=3,4,0) do={/ip fi man set [/ip fi man find comm=adsl1 action=mark-connection] nth=3,4,0}
:if ([ip fi man get [/ip fi man find comm=adsl2 action=mark-connection] nth]!=0,1,0) do={/ip fi man set [/ip fi man find comm=adsl1 action=mark-connection] nth=0,1,0}
#:if ([ip fi man get [/ip fi man find comm=adsl3 action=mark-connection] nth]!=3,4,2) do={/ip fi man set [/ip fi man find comm=adsl1 action=mark-connection] nth=3,4,2}
#:if ([ip fi man get [/ip fi man find comm=adsl4 action=mark-connection] nth]!=3,4,3) do={/ip fi man set [/ip fi man find comm=adsl2 action=mark-connection] nth=3,4,3}
:beep length=100ms frequency=1755
:delay 500ms
:beep length=100ms frequency=1755
:delay 500ms
:beep length=100ms frequency=1755
}
:if ((!$adsl1-statu)&&(!$adsl2-statu)&&($adsl3-statu)&&(!$adsl4-statu)) do={
:if ([ip fi man get [/ip fi man find comm=443 action=mark-connection] new-connection-mark]!=3) do={/ip fi man set [/ip fi man find comm=443 action=mark-connection] new-connection-mark=3}
:if ([ip fi man get [/ip fi man find comm=adsl1] disabled]=no) do={/ip fi man dis [/ip fi man find comm=adsl1]}
:if ([ip fi man get [/ip fi man find comm=adsl2] disabled]=no) do={/ip fi man dis [/ip fi man find comm=adsl2]}
:if ([ip fi man get [/ip fi man find comm=adsl3] disabled]=yes) do={/ip fi man en [/ip fi man find comm=adsl3]}
:if ([ip fi man get [/ip fi man find comm=adsl4] disabled]=no) do={/ip fi man dis [/ip fi man find comm=adsl4]}
#:if ([ip fi man get [/ip fi man find comm=adsl1 action=mark-connection] nth]!=3,4,0) do={/ip fi man set [/ip fi man find comm=adsl1 action=mark-connection] nth=3,4,0}
#:if ([ip fi man get [/ip fi man find comm=adsl2 action=mark-connection] nth]!=3,4,1) do={/ip fi man set [/ip fi man find comm=adsl1 action=mark-connection] nth=3,4,1}
:if ([ip fi man get [/ip fi man find comm=adsl3 action=mark-connection] nth]!=0,1,0) do={/ip fi man set [/ip fi man find comm=adsl1 action=mark-connection] nth=0,1,0}
#:if ([ip fi man get [/ip fi man find comm=adsl4 action=mark-connection] nth]!=3,4,3) do={/ip fi man set [/ip fi man find comm=adsl2 action=mark-connection] nth=3,4,3}
:beep length=100ms frequency=1755
:delay 500ms
:beep length=100ms frequency=1755
:delay 500ms
:beep length=100ms frequency=1755
}
:if ((!$adsl1-statu)&&(!$adsl2-statu)&&(!$adsl3-statu)&&(!$adsl4-statu)) do={
:if ([ip fi man get [/ip fi man find comm=adsl1] disabled]=no) do={/ip fi man dis [/ip fi man find comm=adsl1]}
:if ([ip fi man get [/ip fi man find comm=adsl2] disabled]=no) do={/ip fi man dis [/ip fi man find comm=adsl2]}
:if ([ip fi man get [/ip fi man find comm=adsl3] disabled]=no) do={/ip fi man dis [/ip fi man find comm=adsl3]}
:if ([ip fi man get [/ip fi man find comm=adsl4] disabled]=no) do={/ip fi man dis [/ip fi man find comm=adsl4]}
#:if ([ip fi man get [/ip fi man find comm=adsl1 action=mark-connection] nth]!=3,4,0) do={/ip fi man set [/ip fi man find comm=adsl1 action=mark-connection] nth=3,4,0}
#:if ([ip fi man get [/ip fi man find comm=adsl2 action=mark-connection] nth]!=3,4,1) do={/ip fi man set [/ip fi man find comm=adsl1 action=mark-connection] nth=3,4,1}
#:if ([ip fi man get [/ip fi man find comm=adsl3 action=mark-connection] nth]!=0,1,0) do={/ip fi man set [/ip fi man find comm=adsl1 action=mark-connection] nth=0,1,0}
#:if ([ip fi man get [/ip fi man find comm=adsl4 action=mark-connection] nth]!=3,4,3) do={/ip fi man set [/ip fi man find comm=adsl2 action=mark-connection] nth=3,4,3}
:beep length=1s frequency=1755
}
routeros
发表于 2008-10-14 13:46:02 | 显示全部楼层
楼主是个大好人,顶一下,有人试过没有?
routeros
回复

使用道具 举报

发表于 2008-10-14 13:50:45 | 显示全部楼层
楼主应该弄个文字说明在里面,太长了,看不过来,如果配上图,绝对是精华。
routeros
回复

使用道具 举报

发表于 2008-10-14 15:39:58 | 显示全部楼层
冗余了
routeros
回复

使用道具 举报

发表于 2008-10-14 19:14:37 | 显示全部楼层
没测试环境测试呢
routeros
回复

使用道具 举报

发表于 2008-10-14 21:01:57 | 显示全部楼层
看不懂,LZ请给出说明!
routeros
回复

使用道具 举报

发表于 2008-10-14 23:38:07 | 显示全部楼层
看着头晕
routeros
回复

使用道具 举报

发表于 2008-10-14 23:54:24 | 显示全部楼层
LZ请给出说明
routeros
回复

使用道具 举报

发表于 2008-10-15 01:20:14 | 显示全部楼层
看懂了,LZ有没有简明点的语言,这样太浪费CPU了
routeros
回复

使用道具 举报

发表于 2008-11-27 14:08:51 | 显示全部楼层
看着头晕
routeros
回复

使用道具 举报

发表于 2008-11-27 21:27:20 | 显示全部楼层
不是通用的,不过能发出来,就不错!
routeros
回复

使用道具 举报

发表于 2008-11-27 22:38:11 | 显示全部楼层
这东西导进去,估计路由器就不用干别的了...
routeros
回复

使用道具 举报

发表于 2008-11-29 12:30:52 | 显示全部楼层
不敢试!
routeros
回复

使用道具 举报

发表于 2008-12-11 16:36:58 | 显示全部楼层
楼主,我服了你。
routeros
回复

使用道具 举报

发表于 2008-12-11 16:57:04 | 显示全部楼层
真是人才 非常不错,很有条理
routeros
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|小黑屋|软路由 ( 渝ICP备15001194号-1|渝公网安备 50011602500124号 )

GMT+8, 2024-12-22 22:02 , Processed in 0.075992 second(s), 6 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表