|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
×
bow兄帮我一下,我现在有两条光纤,一条电信100m和一条网通100m。我想做策略路由,玩电信的游戏自动走电信,玩网通的游戏自动走网通,下面这个帮我看一下有什么问题
第一:
/ ip address
add address=192.168.1.1/24 network=192.168.1.0 broadcast=192.168.1.255 \
interface=lan comment="" disabled=no
add address=电信地址/掩码 network=自动设置 broadcast=自动设置
interface=TEL comment="" disabled=no
add address=网通地址/掩码 network=自动设置 broadcast=自动设置
interface=CNC comment="" disabled=no
第二:
添加 网通的路由网关
ip route
add dst-address=59.80.0.0/14 gateway=网通网关 check-gateway=ping \
distance=0 scope=255 target-scope=10 comment="CNC" disabled=no
add dst-address=60.0.0.0/13 gateway=网通网关 check-gateway=ping \
distance=0 scope=255 target-scope=10 comment="CNC" disabled=no
add dst-address=60.8.0.0/15 gateway=网通网关 check-gateway=ping \
distance=0 scope=255 target-scope=10 comment="CNC" disabled=no
略
第三
设置好监控的开关
/ 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 \
电信网关\n" policy=ftp,reboot,read,write,policy,test,winbox,password
add name="CNCup" source="/ip route set \[/ip route find comment=CNC\] gateway \
网通网关\n" policy=ftp,reboot,read,write,policy,test,winbox,password
add name="dxdown" source=":if \(\[/tool netwatch get \[/tool netwatch find \
comment=CNC\] status\]=\"down\"\) do {/ip route set \[/ip route find \
comment=TEL\] gateway \[/ip address get \[/ip address find \
interface=pppoe-out1\] network\]} else {/ip route set \[/ip route find \
comment=TEL\] gateway 网通网关}" \
policy=ftp,reboot,read,write,policy,test,winbox,password
add name="CNCdown" source=":if \(\[/tool netwatch get \[/tool netwatch find \
comment=TEL\] status\]=\"down\"\) do {/ip route set \[/ip route find \
comment=CNC\] gateway \[/ip address get \[/ip address find \
interface=pppoe-out1\] network\]} else {/ip route set \[/ip route find \
comment=CNC\] gateway 电信网关}" \
policy=ftp,reboot,read,write,policy,test,winbox,password |
|