greney 发表于 2010-9-2 16:15:12

PCC 9线脚本

本人ROS 3.30 9线PPPOE PCC负载中
QQ 69737095
欢迎大家来探讨

/ip address add address=192.168.0.1/255.255.255.0 interface=lan comment=lan
/ip dns set primary-dns=202.102.192.68 secondary-dns=202.102.199.68 allow-remote-requests=yes

/ip firewall mangle
add action=change-mss chain=forward comment="" 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-connection chain=input comment="" disabled=no in-interface=pppoe-out6 new-connection-mark=pppoe-out6_conn passthrough=yes
add action=mark-connection chain=input comment="" disabled=no in-interface=pppoe-out7 new-connection-mark=pppoe-out7_conn passthrough=yes
add action=mark-connection chain=input comment="" disabled=no in-interface=pppoe-out8 new-connection-mark=pppoe-out8_conn passthrough=yes
add action=mark-connection chain=input comment="" disabled=no in-interface=pppoe-out9 new-connection-mark=pppoe-out9_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-routing chain=output comment="" connection-mark=pppoe-out6_conn disabled=no new-routing-mark=to_pppoe-out6 passthrough=yes
add action=mark-routing chain=output comment="" connection-mark=pppoe-out7_conn disabled=no new-routing-mark=to_pppoe-out7 passthrough=yes
add action=mark-routing chain=output comment="" connection-mark=pppoe-out8_conn disabled=no new-routing-mark=to_pppoe-out8 passthrough=yes
add action=mark-routing chain=output comment="" connection-mark=pppoe-out9_conn disabled=no new-routing-mark=to_pppoe-out9 passthrough=yes

add action=mark-connection chain=prerouting comment="" disabled=no dst-address-type=!local in-interface=lan new-connection-mark=pppoe-out1_conn passthrough=yes per-connection-classifier=both-addresses:9/0 src-address=192.168.0.0/24
add action=mark-connection chain=prerouting comment="" disabled=no dst-address-type=!local in-interface=lan new-connection-mark=pppoe-out2_conn passthrough=yes per-connection-classifier=both-addresses:9/1 src-address=192.168.0.0/24
add action=mark-connection chain=prerouting comment="" disabled=no dst-address-type=!local in-interface=lan new-connection-mark=pppoe-out3_conn passthrough=yes per-connection-classifier=both-addresses:9/2 src-address=192.168.0.0/24
add action=mark-connection chain=prerouting comment="" disabled=no dst-address-type=!local in-interface=lan new-connection-mark=pppoe-out4_conn passthrough=yes per-connection-classifier=both-addresses:9/3 src-address=192.168.0.0/24
add action=mark-connection chain=prerouting comment="" disabled=no dst-address-type=!local in-interface=lan new-connection-mark=pppoe-out5_conn passthrough=yes per-connection-classifier=both-addresses:9/4 src-address=192.168.0.0/24
add action=mark-connection chain=prerouting comment="" disabled=no dst-address-type=!local in-interface=lan new-connection-mark=pppoe-out6_conn passthrough=yes per-connection-classifier=both-addresses:9/5 src-address=192.168.0.0/24
add action=mark-connection chain=prerouting comment="" disabled=no dst-address-type=!local in-interface=lan new-connection-mark=pppoe-out7_conn passthrough=yes per-connection-classifier=both-addresses:9/6 src-address=192.168.0.0/24
add action=mark-connection chain=prerouting comment="" disabled=no dst-address-type=!local in-interface=lan new-connection-mark=pppoe-out8_conn passthrough=yes per-connection-classifier=both-addresses:9/7 src-address=192.168.0.0/24
add action=mark-connection chain=prerouting comment="" disabled=no dst-address-type=!local in-interface=lan new-connection-mark=pppoe-out9_conn passthrough=yes per-connection-classifier=both-addresses:9/8 src-address=192.168.0.0/24

add action=mark-routing chain=prerouting comment="" connection-mark=pppoe-out1_conn disabled=no in-interface=lan new-routing-mark=to_pppoe-out1 passthrough=yes src-address=192.168.0.0/24
add action=mark-routing chain=prerouting comment="" connection-mark=pppoe-out2_conn disabled=no in-interface=lan new-routing-mark=to_pppoe-out2 passthrough=yes src-address=192.168.0.0/24
add action=mark-routing chain=prerouting comment="" connection-mark=pppoe-out3_conn disabled=no in-interface=lan new-routing-mark=to_pppoe-out3 passthrough=yes src-address=192.168.0.0/24
add action=mark-routing chain=prerouting comment="" connection-mark=pppoe-out4_conn disabled=no in-interface=lan new-routing-mark=to_pppoe-out4 passthrough=yes src-address=192.168.0.0/24
add action=mark-routing chain=prerouting comment="" connection-mark=pppoe-out5_conn disabled=no in-interface=lan new-routing-mark=to_pppoe-out5 passthrough=yes src-address=192.168.0.0/24
add action=mark-routing chain=prerouting comment="" connection-mark=pppoe-out6_conn disabled=no in-interface=lan new-routing-mark=to_pppoe-out6 passthrough=yes src-address=192.168.0.0/24
add action=mark-routing chain=prerouting comment="" connection-mark=pppoe-out7_conn disabled=no in-interface=lan new-routing-mark=to_pppoe-out7 passthrough=yes src-address=192.168.0.0/24
add action=mark-routing chain=prerouting comment="" connection-mark=pppoe-out8_conn disabled=no in-interface=lan new-routing-mark=to_pppoe-out8 passthrough=yes src-address=192.168.0.0/24
add action=mark-routing chain=prerouting comment="" connection-mark=pppoe-out9_conn disabled=no in-interface=lan new-routing-mark=to_pppoe-out9 passthrough=yes src-address=192.168.0.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 comment=6 disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe-out6 routing-mark=to_pppoe-out6 check-gateway=ping
add comment=7 disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe-out7 routing-mark=to_pppoe-out7 check-gateway=ping
add comment=8 disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe-out8 routing-mark=to_pppoe-out8 check-gateway=ping
add comment=9 disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe-out9 routing-mark=to_pppoe-out9 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
add check-gateway=ping comment="pppoe-out6" disabled=no distance=10 dst-address=0.0.0.0/0 gateway=pppoe-out6
add check-gateway=ping comment="pppoe-out7" disabled=no distance=10 dst-address=0.0.0.0/0 gateway=pppoe-out7
add check-gateway=ping comment="pppoe-out8" disabled=no distance=10 dst-address=0.0.0.0/0 gateway=pppoe-out8
add check-gateway=ping comment="pppoe-out9" disabled=no distance=10 dst-address=0.0.0.0/0 gateway=pppoe-out9

/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
add action=masquerade chain=srcnat comment="6" disabled=no out-interface=pppoe-out6
add action=masquerade chain=srcnat comment="7" disabled=no out-interface=pppoe-out7
add action=masquerade chain=srcnat comment="8" disabled=no out-interface=pppoe-out8
add action=masquerade chain=srcnat comment="9" disabled=no out-interface=pppoe-out9

9939781 发表于 2010-9-2 17:33:28

我汗,好长啊。。。

qinguofang 发表于 2010-9-2 23:58:32

有这么多的吗?

47771885 发表于 2010-9-3 00:01:49

确实 繁琐了些

火蚂蚁 发表于 2010-9-3 08:37:45

很繁琐

imxch 发表于 2010-9-7 09:08:34

确实 繁琐了些
47771885 发表于 2010-9-3 00:01 http://bbs.routerclub.com/images/common/back.gif


你有简单的放个出来给学习下
谢谢

wugalang88 发表于 2010-9-7 11:17:06

是这样长吧

ksw520 发表于 2010-9-7 11:31:15

3线和9线有多大区别? 我记得早前发过 自动根据线路通断 动态调整的脚本。
页: [1]
查看完整版本: PCC 9线脚本