|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
×
用的是ros2.96版,网通网关192.168.1.1,电信网关192.168.0.1,设置192.168.1.1为默认路由,
add dst-address=0.0.0.0/0 gateway=192.168.1.1 check-gateway=ping \
distance=0 scope=255 target-scope=10 comment="" disabled=no
并添加其他电信IP段走192.168.0.1网关。
经测试,双线策略正常,问题出在断线自动切换上,自动检测网络状态正常,但是电信断线可以自动走网通网关,而网通断线却走不了电信网关,这时候只有电信段能上,网通就掉了。请大家帮忙指点一下,我的切换脚本:
设置好监控的开关
/ tool netwatch
add host=电信网关 timeout=1s interval=1m up-script=dxup \
down-script=dxdown comment="TEL" disabled=no
add host=网通网关 timeout=1s interval=1m up-script=CNCup \
down-script=CNCdown comment="CNC" disabled=no
--------------------------------------------------------------------------------------------------------
第四写好脚本自动切换
/ system script
add name="dxup" source="/ip route set \[/ip route find comment=TEL\] gateway \
192.168.0.1\n" policy=ftp,reboot,read,write,policy,test,winbox,password
add name="CNCup" source="/ip route set \[/ip route find comment=CNC\] gateway \
192.168.1.1\n" policy=ftp,reboot,read,write,policy,test,winbox,password
add name="dxdown" source=":if \(\[/tool netwatch get \[/tool netwatch find \
comment=CNC\] status\]=\"up\"\) do {/ip route set \[/ip route find \
comment=TEL\] gateway 192.168.1.1}" \
policy=ftp,reboot,read,write,policy,test,winbox,password
add name="CNCdown" source=":if \(\[/tool netwatch get \[/tool netwatch find \
comment=TEL\] status\]=\"up\"\) do {/ip route set \[/ip route find \
comment=CNC\] gateway 192.168.0.1}" \
policy=ftp,reboot,read,write,policy,test,winbox,password |
|