找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 5823|回复: 12

[负载平衡] ADSL,PCC3线,总有一条没有流量。成功过,照搬就不行了!

  [复制链接]
发表于 2011-2-27 04:02:23 | 显示全部楼层 |阅读模式

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

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

×
唉,为什么呢?为什么呢?
曾经做过一台,至今仍键在。有几个月了。很正常。不限速用迅雷,即可三线全速。打开网页也很快!
可惜最近做的两台都有同样问题。就是只有两根线有流量。另一根连上了,但完全没反应,并且打开网页很慢很慢!甚至打不开。。。
想不透了。有经验的童鞋们,给说说吧。最近,头大了不少~。。。。
routeros
发表于 2011-2-27 04:42:59 | 显示全部楼层
负载没做好
routeros
回复

使用道具 举报

 楼主| 发表于 2011-3-1 19:18:47 | 显示全部楼层
回复 WGHBOY 的帖子

我用的脚本如下...最郁闷是有成功的,再做失败了!pppoe拔号正常,每一条线都有流量

/ip firewall mangle
add action=mark-connection chain=prerouting comment=pcc1 disabled=no \
    dst-address-type=!local new-connection-mark=adsl1-conn passthrough=yes \
    per-connection-classifier=both-addresses:3/0 src-address=172.88.88.0/24
add action=mark-routing chain=prerouting comment="" connection-mark=\
    adsl1-conn disabled=no new-routing-mark=adsl1-route passthrough=yes \
    src-address=172.88.88.0/24
add action=mark-connection chain=prerouting comment=pcc2 disabled=no \
    dst-address-type=!local new-connection-mark=adsl2-conn passthrough=yes \
    per-connection-classifier=both-addresses:3/1 src-address=172.88.88.0/24
add action=mark-routing chain=prerouting comment="" connection-mark=\
    adsl2-conn disabled=no new-routing-mark=adsl2-route passthrough=yes \
    src-address=172.88.88.0/24
add action=mark-connection chain=prerouting comment=pcc3 disabled=no \
    dst-address-type=!local new-connection-mark=adsl3-conn passthrough=yes \
    per-connection-classifier=both-addresses:3/2 src-address=172.88.88.0/24
add action=mark-routing chain=prerouting comment="" connection-mark=\
    adsl3-conn disabled=no new-routing-mark=adsl3-route passthrough=yes \
    src-address=172.88.88.0/24



/ip firewall mangle
add action=mark-connection chain=input comment="mark1" disabled=no in-interface=\
    pppoe-out1 new-connection-mark=adsl1-conn passthrough=yes
add action=mark-routing chain=output comment="" connection-mark=adsl1-conn \
    disabled=no new-routing-mark=adsl1-route passthrough=yes
add action=mark-connection chain=input comment="mark2" disabled=no in-interface=\
    pppoe-out2 new-connection-mark=adsl2-conn passthrough=yes
add action=mark-routing chain=output comment="" connection-mark=adsl2-conn \
    disabled=no new-routing-mark=adsl2-route passthrough=yes
add action=mark-connection chain=input comment="mark3" disabled=no in-interface=\
    pppoe-out3 new-connection-mark=adsl3-conn passthrough=yes
add action=mark-routing chain=output comment="" connection-mark=adsl3-conn \
    disabled=no new-routing-mark=adsl3-route passthrough=yes


/ip firewall nat
add action=masquerade chain=srcnat comment=out1 disabled=no out-interface=\
    pppoe-out1
add action=masquerade chain=srcnat comment=out2 disabled=no out-interface=\
    pppoe-out2
add action=masquerade chain=srcnat comment=out3 disabled=no out-interface=\
    pppoe-out3


/ip route
add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=\
    pppoe-out1 routing-mark=adsl1-route
add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=\
    pppoe-out2 routing-mark=adsl2-route
add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=\
    pppoe-out3 routing-mark=adsl3-route
routeros
回复

使用道具 举报

发表于 2011-3-3 11:45:32 | 显示全部楼层
估计是更新网关的脚本没做好
routeros
回复

使用道具 举报

发表于 2011-3-3 13:11:16 | 显示全部楼层
把你后来做的这个系统的盘装到以前做成功的机器上试一试,看是不是硬件有问题,还有ros的版本一样吗,用不同的版本再试试看看
routeros
回复

使用道具 举报

 楼主| 发表于 2011-3-4 03:18:01 | 显示全部楼层
回复 tkdpc 的帖子

我也想过这个问题。今天又搞到现在了~~比较烦躁!
真想弄个刷新网关的脚本上去。不过PCC好像不需要。也只是好像,找了很久资料。据某高手说:某些情况不能用gateway=pppoe-out?这样的写法。
不过,还是先睡了!
routeros
回复

使用道具 举报

 楼主| 发表于 2011-3-4 03:25:13 | 显示全部楼层
回复 yinfengbj 的帖子

都是330,不过是那种写盘破解版。成功的那个之前也有问题的,调了一段时间后就很爽了!
成功的用512M版本。失败的都是256M版本。没512CF卡了,正打算装个硬盘上去试试。
失败也失败得挺奇怪的。只要第三条线一拔号成功,就打不开网页了。如果第3线不上线禁用的话。其剩下两条线工作很正常。如果禁用第2条线。那么,1,3可以正常使用。禁用1的话,像三线都成功拔号一样。什么网页都打不开。迅雷也下载不了东西!!!
天啊。。。这么奇怪。在之前成功的那个调试时也没遇到过。成功的那个刚开始只是某条线没流量。百思不得其解,为什么别人用得好好的脚本,放我这不行了!哈哈哈~~严重怀疑那个256M版本有问题!明天装512M版本到硬盘里试试!
routeros
回复

使用道具 举报

发表于 2011-3-5 23:20:15 | 显示全部楼层
本帖最后由 wanken 于 2011-3-5 23:47 编辑

以下紅字建議不要.... !封包你有需要進入本機嗎?
/ip firewall mangle
add action=mark-connection chain=input comment="mark1" disabled=no in-interface=\
    pppoe-out1 new-connection-mark=adsl1-conn passthrough=yes
add action=mark-routing chain=output comment="" connection-mark=adsl1-conn \
    disabled=no new-routing-mark=adsl1-route passthrough=yes
add action=mark-connection chain=input comment="mark2" disabled=no in-interface=\
    pppoe-out2 new-connection-mark=adsl2-conn passthrough=yes
add action=mark-routing chain=output comment="" connection-mark=adsl2-conn \
    disabled=no new-routing-mark=adsl2-route passthrough=yes
add action=mark-connection chain=input comment="mark3" disabled=no in-interface=\
    pppoe-out3 new-connection-mark=adsl3-conn passthrough=yes
add action=mark-routing chain=output comment="" connection-mark=adsl3-conn \
    disabled=no new-routing-mark=adsl3-route passthrough=yes


以下綠色字先取消設定 disable 改為腳本取得看看吧
/ip route
add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=\
    pppoe-out1 routing-mark=adsl1-route
add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=\
    pppoe-out2 routing-mark=adsl2-route
add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=\
    pppoe-out3 routing-mark=adsl3-route




以下藍色字你可以用來自動取得adsl網關試試看能不能改進!
配置路由(网关)
拨号成功后,PPPOE会自动添加IP地址和网关,我们要做的就是手动再添加3次这些地址。
adsl的网关随便填用防adsl掉线脚本来自动修改它手动添加1个和PPPOE自动添加出来一样的网关IP,并标记为comment="adsl1-route"为 ADSL的一線     设定 routing mark 为 adsl1-route   interface 为 pppoe-out1
第二及第三條adsl 同樣設定 記得改          comment="adsl-2"  comment="adsl-3"     routing mark 为 adsl2-route     routing mark 为 adsl3-route


添加脚本adsl-gateway取得adsl  ip address 的动态(network)网关 来修改 ip route 中的网关

取得 ip address 的动态(network)网关 来修改 ip route 中的网关
用winbox到 / system script

add name="adsl-gateway-1"   
:global adslwg
:set adslwg [/ip address get [/ip address find dynamic=yes interface=pppoe-out1] network]
/ip route set [/ip route find comment=adsl1-route] gateway=$adslwg

add name="adsl-gateway-2"   
:global adslwg
:set adslwg [/ip address get [/ip address find dynamic=yes interface=pppoe-out2] network]
/ip route set [/ip route find comment=adsl2-route] gateway=$adslwg

add name="adsl-gateway-3"   
:global adslwg
:set adslwg [/ip address get [/ip address find dynamic=yes interface=pppoe-out3] network]
/ip route set [/ip route find comment=adsl3-route] gateway=$adslwg

以10秒钟运行一次script脚本,就是上面那3个,来防adsl掉线后重新拨接网关没有及时更新!
用winbox到  / system scheduler
add name=" adsl-gateway-1 " on-event=/system script run adsl-gateway-1" start-date=jMay/29/2010 start-time=00:00:00 interval=10s comment="" \
disabled=no

/ system scheduler
add name=" adsl-gateway-2 " on-event=/system script run adsl-gateway-2" start-date=jMay/29/2010 start-time=00:00:00 interval=10s comment="" \
disabled=no

/ system scheduler
add name=" adsl-gateway-1 " on-event=/system script run adsl-gateway-3" start-date=jMay/29/2010 start-time=00:00:00 interval=10s comment="" \
disabled=no



以上看看能不能改進,可以就告知一下吧!我的pcc都是用腳本取得gateway的。
routeros
回复

使用道具 举报

发表于 2011-3-6 00:36:02 | 显示全部楼层
楼上的,一加一式教学。
routeros
回复

使用道具 举报

 楼主| 发表于 2011-3-6 00:48:12 | 显示全部楼层
回复 wanken 的帖子

太感谢了...明晚去试试!
routeros
回复

使用道具 举报

发表于 2011-3-6 09:03:00 | 显示全部楼层
   这家伙好似好掂水!!!!! 能否解释一下代码-_-
routeros
回复

使用道具 举报

发表于 2011-3-8 02:29:35 | 显示全部楼层
我的双线 也是 有时候好用 有时候不好使
最可气的是 取消负载后 划单独的address lis 走另一条adsl 有时候可以过去有时候都在一条线上 另一条没有流量 不过hotspot 好使,用了负载均衡后 hotspot 用户无法打开网站
routeros
回复

使用道具 举报

发表于 2012-7-18 13:20:29 | 显示全部楼层
我也遇到同样的总问题了,总有一条线没有流量
routeros
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-4-28 21:24 , Processed in 0.178644 second(s), 4 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2023 Discuz! Team.

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