找回密码
 注册

QQ登录

只需一步,快速开始

搜索
楼主: bh

[负载平衡] NTH负载均衡的断线切换讨论

[复制链接]
发表于 2008-8-22 13:41:52 | 显示全部楼层
晕,弄这么麻烦,ADSL掉线是经常的时候,一会儿就自动连接上了,断线的时候就让客户的数据包走默认路由就行了,什么都不用设置!
routeros
回复

使用道具 举报

发表于 2008-8-22 14:41:47 | 显示全部楼层
dddddddddddd
routeros
回复

使用道具 举报

发表于 2008-8-22 15:06:38 | 显示全部楼层
原帖由 fluzj 于 2008-8-22 11:37 发表
我不熟悉ROS的脚本,不过看程序流程这个脚本好像还是有问题的,他假设的掉线似乎是comm=ADSL4-ADSL1递减按顺序掉线,这在实际运行中似乎是不太可能的。

显然你没把程序读懂~~
routeros
回复

使用道具 举报

发表于 2008-8-22 15:08:01 | 显示全部楼层
comm=adsl1-adsl4只是一个标记而已,并不一定是固定在真实线路上的1-4
routeros
回复

使用道具 举报

发表于 2008-10-13 11:44:32 | 显示全部楼层
以下我是在学习了楼上很多热心人的回复后的改良,无条件的公布给大家新的脚本,希望对大家有帮助,
: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-13 11:46:35 | 显示全部楼层
以上做了关于443端口分流的走单一ADSL线路,并加入断几线报几次警报的脚本.
routeros
回复

使用道具 举报

发表于 2008-10-13 14:10:40 | 显示全部楼层
看不太懂...  怎么没有一点解释的啊
routeros
回复

使用道具 举报

发表于 2008-10-13 22:36:38 | 显示全部楼层
16楼正解...
routeros
回复

使用道具 举报

 楼主| 发表于 2008-10-13 22:48:05 | 显示全部楼层
20楼辛苦了
routeros
回复

使用道具 举报

发表于 2008-10-15 02:05:20 | 显示全部楼层
最终还是没有解决
routeros
回复

使用道具 举报

发表于 2008-11-30 22:08:35 | 显示全部楼层
原帖由 专卖精品 于 2008-8-22 13:41 发表
晕,弄这么麻烦,ADSL掉线是经常的时候,一会儿就自动连接上了,断线的时候就让客户的数据包走默认路由就行了,什么都不用设置!


非常赞同!

以现在ADSL线路的稳定状态来看,需要考虑ADSL掉线这种牛角尖的问题?
routeros
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-17 14:52 , Processed in 0.105134 second(s), 3 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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