找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 3495|回复: 3

[负载平衡] {求助} 做完NTH负载平衡后 路由重启ADSL找不到网关??

[复制链接]
发表于 2012-3-4 09:25:24 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 seahifi 于 2012-3-4 12:52 编辑

环境: ros2.9.27
wan1: interface=ether2 (ADSL动态拨号)
wan2: interface=ether3 (ADSL固定IP)
add.JPG
按网上的教程安全完成后
发现重启路由后 重新捕获的ether2网关是ADSL新IP 不是新网关
rou-bad.JPG
需要把新IP改成新网关后 才能正常
rou-good.JPG
ADSL长时间断线后 再重拨 一样的问题
脚本如下
:local assign-address
:local new-address
:local status
:local adckip
:local new-gateway
:local x
:set x 1
:for i from=1 to=$x do={
    :set status [/interface get [/interface find  name=("pppoe-out" . $i)] running]
    :if ($status=true) do={
     :set new-address [/ip address get [/ip address find dynamic=yes interface=("pppoe-out" . $i)] address]
     :set new-address [:pick $new-address 0 ([:len $new-address] -3)]
     :set assign-address [/ip address get [/ip address find dynamic=no interface=("pppoe-out" . $i)] address]
     :set assign-address [:pick $assign-address 0 ([:len $assign-address] -3)]
     :set new-gateway [/ip address get [/ip address find dynamic=yes interface=pppoe-out1] network]
     :set adckip [/tool netwatch get [/tool netwatch find comment=$i] host]
     :if ($assign-address != $new-address) do={ /ip address set [/ip address find comment=$i] address=$new-address network=$new-address broadcast=$new-address
        /ip route set [/ip route find comment=$i] gateway=$new-address
        /ip fir nat set [/ip fir nat find comment=$i] to-addresses=$new-address
       }
     :if ($new-gateway != $adckip) do={/tool netwatch set [/tool netwatch find comment=$i] host=$new-gateway]
       }
   }
}

怎么办??
求助哇
  
routeros
 楼主| 发表于 2012-3-4 12:53:15 | 显示全部楼层
routeros
回复

使用道具 举报

 楼主| 发表于 2012-3-10 10:50:04 | 显示全部楼层
:'):'):')
routeros
回复

使用道具 举报

 楼主| 发表于 2012-3-12 11:30:15 | 显示全部楼层
....................
routeros
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-18 05:32 , Processed in 0.056365 second(s), 5 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2023 Discuz! Team.

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