找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 60388|回复: 152

[负载平衡] 放出PCC ADSL 5线负载均衡脚本!

  [复制链接]
发表于 2010-1-31 09:33:52 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 srisy 于 2010-1-31 09:52 编辑

以下为PCC ADSL 5线负载均衡脚本,能正常工作,但是有一个问题,中间有条线路PPPOE-out3,无论如何没有流量,
本人钻研数日,都无法开解,困惑至极,请高人指教!将之修改完善,造福大众!
1.jpg 2.jpg

3.jpg

/ip address add address=192.168.1.1/255.255.255.0 interface=ether1 comment=LAN
/ip dns set primary-dns=202.96.128.166 secondary-dns=202.96.128.68 allow-remote-requests=yes

/interface pppoe-client add name="pppoe-out1" interface=DSL254 user="gzDSL22222254@163.gd" password="1" add-default-route=no disabled=no
/interface pppoe-client add name="pppoe-out2" interface=DSL374 user="gzDSL22222374@163.gd" password="1" add-default-route=no disabled=no
/interface pppoe-client add name="pppoe-out3" interface=DSL404 user="gzDSL22222404@163.gd" password="1" add-default-route=no disabled=no
/interface pppoe-client add name="pppoe-out4" interface=DSL194 user="gzDSL22222194@163.gd" password="1" add-default-route=no disabled=no
/interface pppoe-client add name="pppoe-out5" interface=DSL864 user="gzDSL22222864@163.gd" password="1" add-default-route=no disabled=no
/ip firewall mangle
add action=change-mss chain=forward comment="CHANGE MSS" disabled=no new-mss=1440 protocol=tcp tcp-flags=syn

add action=mark-connection chain=input comment="" disabled=no in-interface=pppoe-out1 new-connection-mark=pppoe-out1_conn passthrough=yes
add action=mark-connection chain=input comment="" disabled=no in-interface=pppoe-out2 new-connection-mark=pppoe-out2_conn passthrough=yes
add action=mark-connection chain=input comment="" disabled=no in-interface=pppoe-out3 new-connection-mark=pppoe-out3_conn passthrough=yes
add action=mark-connection chain=input comment="" disabled=no in-interface=pppoe-out4 new-connection-mark=pppoe-out4_conn passthrough=yes
add action=mark-connection chain=input comment="" disabled=no in-interface=pppoe-out5 new-connection-mark=pppoe-out5_conn passthrough=yes

add action=mark-routing chain=output comment="" connection-mark=pppoe-out1_conn disabled=no new-routing-mark=to_pppoe-out1 passthrough=yes
add action=mark-routing chain=output comment="" connection-mark=pppoe-out2_conn disabled=no new-routing-mark=to_pppoe-out2 passthrough=yes
add action=mark-routing chain=output comment="" connection-mark=pppoe-out3_conn disabled=no new-routing-mark=to_pppoe-out3 passthrough=yes
add action=mark-routing chain=output comment="" connection-mark=pppoe-out4_conn disabled=no new-routing-mark=to_pppoe-out4 passthrough=yes
add action=mark-routing chain=output comment="" connection-mark=pppoe-out5_conn disabled=no new-routing-mark=to_pppoe-out5 passthrough=yes

add action=mark-connection chain=prerouting comment="" disabled=no dst-address-type=!local in-interface=ether1 new-connection-mark=pppoe-out1_conn passthrough=yes per-connection-classifier=both-addresses:5/0 src-address=192.168.1.0/24
add action=mark-connection chain=prerouting comment="" disabled=no dst-address-type=!local in-interface=ether1 new-connection-mark=pppoe-out2_conn passthrough=yes per-connection-classifier=both-addresses:5/1 src-address=192.168.1.0/24
add action=mark-connection chain=prerouting comment="" disabled=no dst-address-type=!local in-interface=ether1 new-connection-mark=pppoe-out3_conn passthrough=yes per-connection-classifier=both-addresses:5/2 src-address=192.168.1.0/24
add action=mark-connection chain=prerouting comment="" disabled=no dst-address-type=!local in-interface=ether1 new-connection-mark=pppoe-out4_conn passthrough=yes per-connection-classifier=both-addresses:5/3 src-address=192.168.1.0/24
add action=mark-connection chain=prerouting comment="" disabled=no dst-address-type=!local in-interface=ether1 new-connection-mark=pppoe-out5_conn passthrough=yes per-connection-classifier=both-addresses:5/4 src-address=192.168.1.0/24

add action=mark-routing chain=prerouting comment="" connection-mark=pppoe-out1_conn disabled=no in-interface=ether1 new-routing-mark=to_pppoe-out1 passthrough=yes src-address=192.168.1.0/24
add action=mark-routing chain=prerouting comment="" connection-mark=pppoe-out2_conn disabled=no in-interface=ether1 new-routing-mark=to_pppoe-out2 passthrough=yes src-address=192.168.1.0/24
add action=mark-routing chain=prerouting comment="" connection-mark=pppoe-out3_conn disabled=no in-interface=ether1 new-routing-mark=to_pppoe-out3 passthrough=yes src-address=192.168.1.0/24
add action=mark-routing chain=prerouting comment="" connection-mark=pppoe-out3_conn disabled=no in-interface=ether1 new-routing-mark=to_pppoe-out4 passthrough=yes src-address=192.168.1.0/24
add action=mark-routing chain=prerouting comment="" connection-mark=pppoe-out3_conn disabled=no in-interface=ether1 new-routing-mark=to_pppoe-out5 passthrough=yes src-address=192.168.1.0/24

/ip route
add comment=1 disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe-out1 routing-mark=to_pppoe-out1 check-gateway=ping
add comment=2 disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe-out2 routing-mark=to_pppoe-out2 check-gateway=ping
add comment=3 disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe-out3 routing-mark=to_pppoe-out3 check-gateway=ping
add comment=4 disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe-out4 routing-mark=to_pppoe-out4 check-gateway=ping
add comment=5 disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe-out5 routing-mark=to_pppoe-out5 check-gateway=ping

add check-gateway=ping comment="pppoe-out1" disabled=no distance=10 dst-address=0.0.0.0/0 gateway=pppoe-out1
add check-gateway=ping comment="pppoe-out2" disabled=no distance=10 dst-address=0.0.0.0/0 gateway=pppoe-out2
add check-gateway=ping comment="pppoe-out3" disabled=no distance=10 dst-address=0.0.0.0/0 gateway=pppoe-out3
add check-gateway=ping comment="pppoe-out4" disabled=no distance=10 dst-address=0.0.0.0/0 gateway=pppoe-out4
add check-gateway=ping comment="pppoe-out5" disabled=no distance=10 dst-address=0.0.0.0/0 gateway=pppoe-out5

/ip firewall nat
add action=masquerade chain=srcnat comment="1" disabled=no out-interface=pppoe-out1
add action=masquerade chain=srcnat comment="2" disabled=no out-interface=pppoe-out2
add action=masquerade chain=srcnat comment="3" disabled=no out-interface=pppoe-out3
add action=masquerade chain=srcnat comment="4" disabled=no out-interface=pppoe-out4
add action=masquerade chain=srcnat comment="5" disabled=no out-interface=pppoe-out5
routeros
发表于 2010-1-31 10:26:46 | 显示全部楼层
第一个支持你,,请问下,能否共享下3.24的包
routeros
回复

使用道具 举报

发表于 2010-1-31 17:21:45 | 显示全部楼层
第二个支持你
routeros
回复

使用道具 举报

发表于 2010-1-31 17:23:30 | 显示全部楼层
大佬 。给个固定IP。+ADSL脚本
routeros
回复

使用道具 举报

发表于 2010-1-31 17:24:31 | 显示全部楼层
routeros
回复

使用道具 举报

发表于 2010-2-1 00:27:47 | 显示全部楼层
好。
routeros
回复

使用道具 举报

发表于 2010-2-1 01:08:32 | 显示全部楼层
女子单打。。。不错
routeros
回复

使用道具 举报

发表于 2010-2-1 03:50:13 | 显示全部楼层
还行,好像不是这样设置的吧
routeros
回复

使用道具 举报

发表于 2010-2-2 13:51:14 | 显示全部楼层
kan kan
routeros
回复

使用道具 举报

发表于 2010-2-2 14:42:41 | 显示全部楼层
好好学习天天向上
routeros
回复

使用道具 举报

发表于 2010-2-2 16:52:47 | 显示全部楼层
routeros
回复

使用道具 举报

发表于 2010-2-2 17:55:35 | 显示全部楼层
在什么版本上做的??
我用4。5做双线效果很好,三线有一条同阁下的一样。
routeros
回复

使用道具 举报

发表于 2010-2-2 20:07:42 | 显示全部楼层
下来看看!~!!
routeros
回复

使用道具 举报

发表于 2010-2-3 00:29:50 | 显示全部楼层
123956751@qq.com
给一份我吧
routeros
回复

使用道具 举报

发表于 2010-2-3 00:55:17 | 显示全部楼层
我用4.3的!没出现这种问题!!!! 8263518.png
routeros
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-6 09:55 , Processed in 0.164839 second(s), 5 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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