找回密码
 加入网盟
网吧营销大师 斗游营销大师10月3号到期 网吧网管技术教程
解压密码:131452189100


下载地址:

游客,如果您要查看本帖隐藏内容请回复





Routeros3.30 L6 智能限速脚本

### 在线主机记录、先防火墙 Forward 建 LAN 网卡 add src to address list "在线主机"、设定保存时间为二分钟在右。
:global zxzj [:len [/ip firewall address-list find list=("在线主机")]]
:log warning ("管理员好! 当前一共有 "."$zxzj"." 台机器在线")

上面脚本设定半小时运行一次方便统计时间区段上网人数。

###设置WAN带宽
:for aaa from 1 to 255 do={/queue simple add name=("RouName-" . $aaa) dst-address=("192.168.0." . $aaa) limit-at=0/0 max-limit=750000/1000000 burst-limit=1500000/3000000 burst-threshold=1200000/1000000 burst-time=30/30 interface=all}

上面是生成限速树,对网段内所有IP的限速列表!

###PCC双线负载均衡:  防火墙里Mangle里针对端口走线路效验 Route List 里的 Routing Mark 对应值。
/ip firewall mangle
add action=mark-connection chain=prerouting  disabled=no new-connection-mark=1 passthrough=yes per-connection-classifier=both-addresses:2/0 in-interface=LAN comment=PCC-1
add action=mark-routing chain=prerouting  connection-mark=1 disabled=no new-routing-mark=1 passthrough=yes in-interface=LAN
add action=mark-connection chain=prerouting  disabled=no new-connection-mark=2 passthrough=yes per-connection-classifier=both-addresses:2/1 in-interface=LAN comment=PCC-2
add action=mark-routing chain=prerouting  connection-mark=2 disabled=no new-routing-mark=2 passthrough=yes in-interface=LAN
/ip route
add  disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe-out1 routing-mark=1
add  disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe-out2 routing-mark=2

### 以下脚本QOS小包优先,网页优化、游戏置前、10M-15M带宽应用超爽。

/ip firewall mangle
add action=mark-connection chain=prerouting comment=\
"\D3\C5\CF\C8\B6\CB\BF\DA" disabled=no dst-port=443 new-connection-mark=\
Port_Conn passthrough=yes protocol=tcp
add action=mark-connection chain=prerouting comment="" disabled=no dst-port=\
3724 new-connection-mark=Port_Conn passthrough=yes protocol=tcp
add action=mark-connection chain=prerouting comment="" disabled=no dst-port=\
8000 new-connection-mark=Port_Conn passthrough=yes protocol=udp
add action=mark-packet chain=prerouting comment="" connection-mark=Port_Conn \
disabled=no new-packet-mark=Port_Packet passthrough=no
add action=mark-connection chain=prerouting comment="web\B6\CB\BF\DA" \
disabled=no dst-port=80 new-connection-mark=80_Conn passthrough=yes \
protocol=tcp
add action=mark-connection chain=prerouting comment="" disabled=no dst-port=\
53 new-connection-mark=80_Conn passthrough=yes protocol=udp
add action=mark-packet chain=prerouting comment="" connection-mark=80_Conn \
disabled=no new-packet-mark=80_packet passthrough=no
add action=mark-connection chain=prerouting comment="Games_\C1\B4\BD\D3" \
    connection-rate=0-80k disabled=no new-connection-mark=game passthrough=\
    yes protocol=tcp src-port=3724,6112,6114,1119,7777,10241
add action=mark-connection chain=prerouting comment="" connection-rate=0-20k \
    disabled=no new-connection-mark=game passthrough=yes protocol=tcp \
    src-port=5692,7101-7103,28012,2349,8586,10001-10070,28008,31414,6299,5130
add action=mark-connection chain=prerouting comment="" connection-rate=0-20k \
    disabled=no new-connection-mark=game passthrough=yes protocol=tcp \
    src-port=\
    3110-3120,6217,2181,28880,8001,21800,8030,6020,6030,6877,4680,13000-13002
add action=mark-connection chain=prerouting comment="" connection-rate=0-20k \
    disabled=no new-connection-mark=game passthrough=yes protocol=tcp \
    src-port=\
    3110-3120,28993,29000,5816,6868,33567,39311,9600,1119,3025,31414,3470
add action=mark-connection chain=prerouting comment="" connection-rate=0-20k \
    disabled=no new-connection-mark=game passthrough=yes protocol=tcp \
    src-port=\
    6004,7004,5562,9010-9014,17703-17706,8801,1253,1346,1272,1203,3468
add action=mark-connection chain=prerouting comment="" connection-rate=0-20k \
    disabled=no new-connection-mark=game passthrough=yes protocol=tcp \
    src-port=\
    25520-25521,25511,10906,30000-30010,8445-8451,3731-3735,7449,7237
add action=mark-connection chain=prerouting comment="" connection-rate=0-20k \
    disabled=no new-connection-mark=game passthrough=yes protocol=tcp \
    src-port=7100-7200,7440,7491,7204,7400-7401,7500,7300,6040,6050,6661-6663
add action=mark-connection chain=prerouting comment="" connection-rate=0-20k \
    disabled=no new-connection-mark=game passthrough=yes protocol=tcp \
    src-port=27931,47611,1607,2175,6000,20002-20007,22001,13317
add action=mark-connection chain=prerouting comment="" connection-rate=0-20k \
    disabled=no new-connection-mark=game passthrough=yes protocol=tcp \
    src-port=7100,7203-7204,7400,7417,6831-6832,6840-6847,8888
add action=mark-connection chain=prerouting comment="" connection-rate=0-10k \
    disabled=no new-connection-mark=game passthrough=yes protocol=tcp \
    src-port=14500,8000,15000
add action=mark-connection chain=prerouting comment="" connection-rate=0-59k \
    disabled=no new-connection-mark=game passthrough=yes protocol=udp \
    src-port=12000-13000,2349,5063,39311,1764,12721,3133,4550,3620
add action=mark-connection chain=prerouting comment="" connection-rate=0-20k \
    disabled=no new-connection-mark=game passthrough=yes protocol=udp \
    src-port="8861,1932,2287,14531,1897,2428,13735,1039,1100,1210,1381,1473,15\
    09,1785,18979"
add action=mark-connection chain=prerouting comment="" connection-rate=0-20k \
    disabled=no new-connection-mark=game passthrough=yes protocol=udp \
    src-port="1140,1371,1510,16434,9865,2105,1497,31519,9000,1151,4311,1506,15\
    59,55952,59823"
add action=mark-connection chain=prerouting comment="" connection-rate=0-20k \
    disabled=no new-connection-mark=game passthrough=yes protocol=udp \
    src-port="32404,32405,32406,1176,1076,1169,13791,1139,11337,9000,1511,2009\
    6,20059,27005-27030"
add action=mark-connection chain=prerouting comment="" connection-rate=0-20k \
    disabled=no new-connection-mark=game passthrough=yes protocol=udp \
    src-port="7263,2408,2468,2117,1871,1429,2294,1520,57236,1429,2494,7625,155\
    2,1842,12411"
add action=mark-connection chain=prerouting comment="" connection-rate=0-20k \
    disabled=no new-connection-mark=game passthrough=yes protocol=udp \
    src-port="1273,1061,65473,1940,2882,1501,4078,8369,4861,4964,8445-8452,708\
    1,30700-30711"
add action=mark-connection chain=prerouting comment="" connection-rate=0-20k \
    disabled=no new-connection-mark=game passthrough=yes protocol=udp \
    src-port="32824,9646,8024,15966,18997,49386,15086,22634,35339,1610,1308,66\
    60,6600,1991,30195"
add action=mark-connection chain=prerouting comment="" connection-rate=0-20k \
    disabled=no new-connection-mark=game passthrough=yes protocol=udp \
    src-port="12345,6660,1610,6600,7002,15002-15004,3100,1059,4111,32424,32299\
    ,15101-15104,14401"
add action=mark-connection chain=prerouting comment="" connection-rate=0-20k \
    disabled=no new-connection-mark=game passthrough=yes protocol=udp \
    src-port=8000-8005,32407
add action=mark-packet chain=prerouting comment="" connection-mark=game \
    disabled=no new-packet-mark=game passthrough=no
add action=mark-connection chain=prerouting comment=\
"\C6\E4\CB\FB\CA\FD\BE\DD" disabled=no new-connection-mark=Other_Conn \
passthrough=yes
add action=mark-packet chain=prerouting comment="" connection-mark=Other_Conn \
disabled=no new-packet-mark=Other_Packet passthrough=no

/queue tree
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=10M name=totaldown \
packet-mark="" parent=global-in priority=8 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=3M max-limit=10M name=portdown \
packet-mark=Port_Packet parent=totaldown priority=1 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=4M max-limit=10M name=otherdown \
packet-mark=Other_Packet parent=totaldown priority=8 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=3M max-limit=10M name=80down \
packet-mark=80_packet parent=totaldown priority=2 queue=default
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=3M max-limit=10M name=game \
packet-mark=game parent=totaldown priority=1 queue=default


分享至 : QQ空间
收藏

4 个回复

倒序浏览
mood100 列兵 2018-5-8 14:43:53
2#
ROS一直用其的,继续学习一下
回复 使用道具 举报
66666666666666666666
回复 使用道具 举报
好好学习,天天向上~~~~~~
回复 使用道具 举报
辛苦谢谢分享
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 加入网盟
关闭

华夏网盟推荐 上一条 /1 下一条