|
发表于 2009-4-5 20:54:30
|
显示全部楼层
1、在原基础上把连接数负载改成带宽叠加负载均衡,使之能最大化利用所接入线路的带宽,并且可以自由增加ADSL线路。
: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
} |
|