srisy 发表于 2010-1-31 09:33:52

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

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

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




/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

wsb2008 发表于 2010-1-31 10:26:46

第一个支持你,,请问下,能否共享下3.24的包

y13527189541 发表于 2010-1-31 17:21:45

第二个支持你

y13527189541 发表于 2010-1-31 17:23:30

大佬 。给个固定IP。+ADSL脚本

y13527189541 发表于 2010-1-31 17:24:31

383287237@qq.com

ssyxc 发表于 2010-2-1 00:27:47

好。

GDSZGYCHACKER 发表于 2010-2-1 01:08:32

女子单打。。。不错

WGHBOY 发表于 2010-2-1 03:50:13

还行,好像不是这样设置的吧

ehero 发表于 2010-2-2 13:51:14

kan kan

cool525000 发表于 2010-2-2 14:42:41

好好学习天天向上

fillmore 发表于 2010-2-2 16:52:47

还行,好像不是这样设置的吧
WGHBOY 发表于 2010-2-1 03:50 http://bbs.routerclub.com/images/common/back.gif


    猛男!哪你共享一下?你的PCC设置 啊!!!!???哈哈:lol

lijiahao 发表于 2010-2-2 17:55:35

在什么版本上做的??
我用4。5做双线效果很好,三线有一条同阁下的一样。

耳朵狗 发表于 2010-2-2 20:07:42

下来看看!~!!

tancunf4 发表于 2010-2-3 00:29:50

123956751@qq.com
给一份我吧

fillmore 发表于 2010-2-3 00:55:17

我用4.3的!没出现这种问题!!!!
页: [1] 2 3 4 5 6 7 8 9 10
查看完整版本: 放出PCC ADSL 5线负载均衡脚本!