找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2642|回复: 4

[其它] [求助]同isp 双adsl设置不成功

[复制链接]
发表于 2009-3-1 21:12:16 | 显示全部楼层 |阅读模式

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

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

×
我是这么设置的


/ip address add address=192.168.0.254/255.255.255.0 interface=ether1 comment=lan
/ip dns set primary-dns=202.96.134.133 secondary-dns=202.96.128.68 allow-remote-requests=yes
/ip firewall mangle add chain=forward protocol=tcp tcp-flags=syn action=change-mss new-mss=1440
/interface pppoe-client add name="pppoe-out1" interface=ether2 user="1001" password="1001" add-default-route=no disabled=no
/interface pppoe-client enable pppoe-out1
/ip address add address=58.58.58.1/32 interface=pppoe-out1 comment="1"
/ip route add gateway=58.58.58.1 routing-mark=1 comment="1"
/ip firewall mangle add chain=prerouting in-interface=ether1 connection-state=new nth=1,1,0 action=mark-connection new-connection-mark=1 passthrough=yes disabled=no
/ip firewall mangle add chain=prerouting in-interface=ether1 connection-mark=1 action=mark-routing new-routing-mark=1 passthrough=no disabled=no
/ip firewall nat add chain=srcnat connection-mark=1 action=src-nat to-addresses=58.58.58.1 to-ports=0-65535 comment="1" disabled=no
/interface pppoe-client add name="pppoe-out2" interface=ether2 user="1002" password="1002" add-default-route=no disabled=no
/interface pppoe-client enable pppoe-out2
/ip address add address=58.58.58.2/32 interface=pppoe-out2 comment="2"
/ip route add gateway=58.58.58.2 routing-mark=2 comment="2"
/ip firewall mangle add chain=prerouting in-interface=ether1 connection-state=new nth=1,1,1 action=mark-connection new-connection-mark=2 passthrough=yes disabled=no
/ip firewall mangle add chain=prerouting in-interface=ether1 connection-mark=2 action=mark-routing new-routing-mark=2 passthrough=no disabled=no
/ip firewall nat add chain=srcnat connection-mark=2 action=src-nat to-addresses=58.58.58.2 to-ports=0-65535 comment="2" disabled=no

然后每隔30秒运行这个脚本

:local assign-address
:local new-address
:local status
:local x
:set x 2
: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)]
        :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
        /ip route set [/ip route find comment=$i] gateway=$new-address
       }
   }
}

设置完成后,显示两个adsl已经拨号成功,客户机可以ping通routeros确无法访问外网,请高手帮忙看看是那个地方弄错了.

另外想咨询在RouterOS 4.0bata1中/ip firewall nat add chain=srcnat connection-mark=1 action=src-nat to-addresses=58.58.58.1 to-ports=0-65535 comment="1" disabled=no

为什么不能加上这个参数
routeros
 楼主| 发表于 2009-3-4 12:48:59 | 显示全部楼层
高手帮忙看看呀
routeros
回复

使用道具 举报

发表于 2009-3-4 12:59:27 | 显示全部楼层
好像你没有做IP伪装
routeros
回复

使用道具 举报

发表于 2009-3-4 15:05:26 | 显示全部楼层
现在用4.0设置多线很方便,关键是nth参数要理解好,ros3.0的中文说明书上写的很清楚!!我今天设置得5线同网关adsl已经不掉线也不丢包了,而且很均衡
routeros
回复

使用道具 举报

 楼主| 发表于 2009-3-6 22:00:14 | 显示全部楼层
routeros2.97已经弄成功,现在在4.0中没有成功,不知道是那个地方弄错了
routeros
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-5 22:02 , Processed in 0.064846 second(s), 5 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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