Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2927878
  • 博文数量: 471
  • 博客积分: 10012
  • 博客等级: 上将
  • 技术积分: 5255
  • 用 户 组: 普通用户
  • 注册时间: 2006-04-10 23:58
文章分类

全部博文(471)

文章存档

2011年(3)

2010年(61)

2009年(52)

2008年(212)

2007年(69)

2006年(74)

我的朋友

分类: LINUX

2010-06-23 11:53:01

/ip firewall mangle
add action=mark-packet chain=prerouting comment="\B7\C0UDP\B9\A5\BB\F7" \
    disabled=no dst-port=0-65535 new-packet-mark=udp passthrough=yes \
    protocol=udp
add action=accept chain=prerouting comment="\CD\E2\BD\D3\CF\DE\CB\D9" \
    connection-mark=nolimit disabled=no
add action=mark-connection chain=prerouting comment=\
    "\C5\C5\B3\FD\B7\FE\CE\F1\C6\F7\CF\DE\CB\D9" disabled=no \
    new-connection-mark=nolimit passthrough=yes src-address=\
    192.168.0.245-192.168.0.253
add action=mark-connection chain=prerouting comment=\
    "\C5\C5\B3\FD\B7\FE\CE\F1\C6\F7\CF\DE\CB\D9" disabled=no \
    new-connection-mark=nolimit passthrough=yes src-address=\
    192.168.1.245-192.168.1.253
add action=mark-connection chain=forward comment="P2P\CF\DE\D6\C6" disabled=\
    no new-connection-mark=p2pCOM p2p=all-p2p passthrough=yes
add action=mark-packet chain=forward comment="P2P\CF\DE\D6\C6" \
    connection-mark=p2pCOM disabled=no new-packet-mark=p2p passthrough=yes
add action=mark-packet chain=prerouting comment=\
    "\B1\EA\BC\C7\CB\F9\D3\D0\CA\FD\BE\DD\B0\FC" disabled=no new-packet-mark=\
    all-mark passthrough=yes
/queue type
set default kind=pfifo name=default pfifo-limit=50
set ethernet-default kind=pfifo name=ethernet-default pfifo-limit=50
set wireless-default kind=sfq name=wireless-default sfq-allot=1514 \
    sfq-perturb=5
set synchronous-default kind=red name=synchronous-default red-avg-packet=1000 \
    red-burst=20 red-limit=60 red-max-threshold=50 red-min-threshold=10
set hotspot-default kind=sfq name=hotspot-default sfq-allot=1514 sfq-perturb=\
    5
add kind=pcq name=PCQUP pcq-classifier=src-address pcq-limit=50 pcq-rate=\
    1000000 pcq-total-limit=2000
add kind=pcq name=PCQ49M pcq-classifier=dst-address pcq-limit=50 pcq-rate=\
    1000000 pcq-total-limit=2000
add kind=pcq name=PCQ45M pcq-classifier=dst-address pcq-limit=50 pcq-rate=\
    2800000 pcq-total-limit=2000
add kind=pcq name=PCQ35M pcq-classifier=dst-address pcq-limit=50 pcq-rate=\
    15000000 pcq-total-limit=2000
set default-small kind=pfifo name=default-small pfifo-limit=10
/ system script
add name="arp" source=":foreach i in \[/ip arp find dynamic=yes \] do={/ip arp \
    add copy-from=\$i}" \
    policy=ftp,reboot,read,write,policy,test,winbox,password
add name="xs" source=":for yxcs from 2 to 254 do={ /queue simple add \
    name=\(\"A\" . \$yxcs\) dst-address=\(\"192.168.1.\" . \$yxcs . \"/32\"\) \
    max-limit=2000000/700000 }" \
    policy=ftp,reboot,read,write,policy,test,winbox,password
add name="Down35M" source=":if \(\[/queue tree get \[/queue tree find \
    name=\"PCQDown45M\"\] disable \]=false \) do={/queue tree disable \
    PCQDown45M}
\n
\n:if \(\[/queue tree get \[/queue tree find \
    name=\"PCQDown49M\"\] disable \]=false \) do={/queue tree disable \
    PCQDown49M}
\n
\n:if \(\[/queue tree get \[/queue tree find \
    name=\"PCQDown35M\"\] disable \]=true \) do={/queue tree enable \
    PCQDown35M}
\n
\n:log info \"〖已切换成 动态下载 高速〗\"}" \
    policy=ftp,reboot,read,write,policy,test,winbox,password
add name="Down45M" source=":if \(\[/queue tree get \[/queue tree find \
    name=\"PCQDown35M\"\] disable \]=false \) do={/queue tree disable \
    PCQDown35M}
\n
\n:if \(\[/queue tree get \[/queue tree find \
    name=\"PCQDown49M\"\] disable \]=false \) do={/queue tree disable \
    PCQDown49M}
\n
\n:if \(\[/queue tree get \[/queue tree find \
    name=\"PCQDown45M\"\] disable \]=true \) do={/queue tree enable \
    PCQDown45M}
\n
\n:log info \"〖已切换成 动态下载 中速〗\"}" \
    policy=ftp,reboot,read,write,policy,test,winbox,password
add name="Down49M" source=":if \(\[/queue tree get \[/queue tree find \
    name=\"PCQDown35M\"\] disable \]=false \) do={/queue tree disable \
    PCQDown35M}
\n
\n:if \(\[/queue tree get \[/queue tree find \
    name=\"PCQDown45M\"\] disable \]=false \) do={/queue tree disable \
    PCQDown45M}
\n
\n:if \(\[/queue tree get \[/queue tree find \
    name=\"PCQDown49M\"\] disable \]=true \) do={/queue tree enable \
    PCQDown49M}
\n
\n:log info \"〖已切换成 动态下载 低速〗\"}" \
    policy=ftp,reboot,read,write,policy,test,winbox,password
/tool traffic-monitor
add comment="" disabled=no interface=wan name=WanDown35M on-event=Down35M \
    threshold=35000000 traffic=received trigger=below
add comment="" disabled=no interface=wan name=WanDown45M on-event=Down45M \
    threshold=40000000 traffic=received trigger=above
add comment="" disabled=no interface=wan name=WanDown49M on-event=Down49M \
    threshold=48000000 traffic=received trigger=above
/queue tree
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=\
    2000000 max-limit=2000000 name=p2pW packet-mark=p2p parent=wan priority=8 \
    queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=\
    2000000 max-limit=2000000 name=p2pL packet-mark=p2p parent=Lan priority=8 \
    queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name=PCQUP packet-mark=all-mark parent=global-out priority=8 \
    queue=PCQUP
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
    max-limit=0 name=PCQDown35M packet-mark=all-mark parent=global-in \
    priority=8 queue=PCQ35M
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=yes limit-at=0 \
    max-limit=0 name=PCQDown45M packet-mark=all-mark parent=global-in \
    priority=8 queue=PCQ45M
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=yes limit-at=0 \
    max-limit=0 name=PCQDown49M packet-mark=all-mark parent=global-in \
    priority=8 queue=PCQ49M
#===========================================================================================================================#
#注意内网网卡名要为Lan 外网网卡为wan 才可以。其他自己去挖掘。   (此脚本2.X通用 请直接全选复制所有代码。在终端下粘贴)                                 
#QQ3475534 QQ群25209607 脚本具体自己看tool traffic-monitor 和system script 服务器
#排除限速在ip firewall mangle 实测20多家网吧。效果反映良好 此脚本是50M的,带机量为450PC 其他带宽的自己改
#===========================================================================================================================#
阅读(1514) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~