ROS软路由论坛 ROSABC.com 网络方案网络工程交流

 找回密码
 会员注册

QQ登录

只需一步,快速开始

查看: 7650|回复: 2

[交流] 关于ROS软路由3.20双线ADSL负载的问题请教

[复制链接]
发表于 2011-7-11 12:09:26 | 显示全部楼层
我建议你升级到4.0版本,这样就不需要使用脚本来修改动态网关了!可以直接使用pppoe拨号接口为网关
你在看看我们网站的PCC负载均衡配置
http://mikrotik.com.cn/newshow.aspx?ID=125
发表于 2011-7-14 10:01:56 | 显示全部楼层
谢谢YUS,q
 楼主| 发表于 2011-7-8 08:06:56 | 显示全部楼层 |阅读模式

马上注册成为ROSABC会员,随时发帖回复。

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

x
ROS软路由3.20双ADSL负载脚本
/ip address add address=172.16.1.1/255.255.255.0 interface=lan 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=wan1 user="ppppp" password="ppppp" 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=lan connection-state=new nth=2,1 action=mark-connection new-connection-mark=1

passthrough=yes disabled=no
/ip firewall mangle add chain=prerouting in-interface=lan connection-mark=1 action=mark-routing new-routing-mark=1 passthrough=yes

disabled=no
/ip firewall nat add chain=srcnat connection-mark=1 action=src-nat to-addresses=58.58.58.1 comment="1" disabled=no

/interface pppoe-client add name="pppoe-out2" interface=wan2 user="ooo" password="ooo" 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=lan connection-state=new nth=2,2 action=mark-connection new-connection-mark=2

passthrough=yes disabled=no
/ip firewall mangle add chain=prerouting in-interface=lan connection-mark=2 action=mark-routing new-routing-mark=2 passthrough=yes

disabled=no
/ip firewall nat add chain=srcnat connection-mark=2 action=src-nat to-addresses=58.58.58.2 comment="2" disabled=no
/ip route add gateway=58.58.58.1 comment="other" disabled=no


动态刷新网关
:global assign
:global new
:global status
:global 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 [/ip address get [/ip address find dynamic=yes interface=("pppoe-out" . $i)] address]
:set new [:pick $new 0 ([:len $new] -3)]
:set assign [/ip address get [/ip address find dynamic=no interface=("pppoe-out" . $i)] address]
:set assign [:pick $assign 0 ([:len $assign] -3)]
:if ($assign != $new) do={ /ip address set [/ip address find comment=("adsl" . $i)] address=$new network=$new broadcast=$new
/ip route set [/ip route find comment=("adsl" . $i)] gateway=$new
}
}
}
哪位高手帮忙看下是哪里错了,设置了一直上不了网。还有就是刷新网关的脚本,好像都没用, 我的IP一直都没有刷新过,一直是原来设置的那个。感激不尽
您需要登录后才可以回帖 登录 | 会员注册

本版积分规则

不良信息举报Q:2000617

软路由

不良信息举报Q:2000617|Archiver|ROS软路由论坛 ROSABC.com 网络方案网络工程交流

GMT+8, 2025-6-17 03:50 , Processed in 0.430882 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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