2016年8月25日星期四上午10:15
总带宽=不超过6m
8 .我的客户:
计费:192.168.88.2
Client1: 192.168.88.3
Client2: 192.168.88.4
Client3: 192.168.88.5
Client4: 192.168.88.6
Client5: 192.168.88.7
Client6: 192.168.88.8
Master: 192.168.88.9
In-Interface = ether1
Out-Interface = bridge-local
/ip防火墙地址列表
Add address=192.168.88.0/24 disabled=no list=bridge-local comment="默认配置"
/ IP防火墙管理
add action=mark-connection chain=prerouting st-address="bridge-local" in-interface=ether1 new-connection-mark=All-Inconn disabled=no passthrough=yes comment="CONNECTION-IN"
add action=mark-packet chain=prerouting in-interface=ether1 connection-mark=All-Inconn disabled=no new-packet-mark=All-inpkt passthrough=yes comment="UPSTEAM PACKETS"
add action=mark-connection chain=forward - Out-interface=bridge-local - new-connection-mark=All-Outconn disabled=no passthrough=yes comment="CONNECTION-OUT"
add action=mark-packet chain=forward connection-mark=All-Outconn - new-packet-mark=All-Outpkt disabled=no passthrough=yes comment="DOWNSTEAM-PACKETS"
/队列树
add name=All-Bandwidth parent=global packet-mark=All-Outpkt queue=default priority=1 max-limit=6M
/ IP防火墙管理
add action=mark-connection chain=forward comment="Billing" disabled=no st-address=192.168.88.2 new-connection-mark="Billing-conn" passthrough=yes connection-mark=All-Outconn
add action=mark-connection chain=forward comment="Client1" disabled=no st-address=192.168.88.3 new-connection-mark="Client1-conn" passthrough=yes connection-mark=All-Outconn
add action=mark-connection chain=forward comment="Client2" disabled=no st-address=192.168.88.4 new-connection-mark="Client2-conn" passthrough=yes connection-mark=All-Outconn
add action=mark-connection chain=forward comment="Client3" disabled=no st-address=192.168.88.5 new-connection-mark="Client3-conn" passthrough=yes connection-mark=All-Outconn
add action=mark-connection chain=forward comment="Client4" disabled=no st-address=192.168.88.6 new-connection-mark="Client4-conn" passthrough=yes connection-mark=All-Outconn
add action=mark-connection chain=forward comment="Client5" disabled=no st-address=192.168.88.7 new-connection-mark="Client5-conn" passthrough=yes connection-mark=All-Outconn
add action=mark-connection chain=forward comment="Client6" disabled=no st-address=192.168.88.8 new-connection-mark="Client6-conn" passthrough=yes connection-mark=All-Outconn
add action=mark-connection chain=forward comment="Master" disabled=no st-address=192.168.88.9 new-connection-mark="Master-conn" passthrough=yes connection-mark=All-Outconn
/ IP防火墙管理
add action=mark-packet chain=forward new-packet-mark=" BILLING -pkt" passthrough=yes connection-mark=" BILLING -conn" comment="BILLING DOWNSTEAM"
add action=mark-packet chain=forward new-packet-mark=" CLIENT1 -pkt" passthrough=yes connection-mark=" CLIENT1 -conn" comment="CLIENT1 DOWNSTEAM"
add action=mark-packet chain=forward new-packet-mark=" CLIENT2 -pkt" passthrough=yes connection-mark=" CLIENT2 -conn" comment="CLIENT2 DOWNSTEAM"
add action=mark-packet chain=forward new-packet-mark= CLIENT3 -pkt passthrough=yes connection-mark= CLIENT3 -conn comment="CLIENT3 DOWNSTEAM"
add action=mark-packet chain=forward new-packet-mark= CLIENT4 -pkt passthrough=yes connection-mark= CLIENT4 -conn comment="CLIENT4 DOWNSTEAM"
add action=mark-packet chain=forward new-packet-mark= CLIENT5 -pkt passthrough=yes connection-mark= CLIENT5 -conn comment="CLIENT5 DOWNSTEAM"
add action=mark-packet chain=forward new-packet-mark= CLIENT6 -pkt passthrough=yes connection-mark= CLIENT6 -conn comment="CLIENT6 DOWNSTEAM"
add action=mark-packet chain=forward new-packet-mark= MASTER -pkt passthrough=yes connection-mark= MASTER -conn comment="MASTER DOWNSTEAM"
/队列树
add name="Billing" parent=All-Bandwidth packet-mark="Billing-pkt" queue=default priority=8 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=192k burst-time=2s
add name="Client1" parent=All-Bandwidth packet-mark="Client1-pkt" queue=default priority=8 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=192k burst-time=2s
add name="Client2" parent=All-Bandwidth packet-mark="Client2-pkt" queue=default priority=8 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=192k burst-time=2s
add name=Client3 parent=All-Bandwidth packet-mark=Client3-pkt queue=default priority=8 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=192k burst-time=2s
add name=Client4 parent=All-Bandwidth packet-mark=Client4-pkt queue=default priority=8 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=192k burst-time=2s
add name=Client5 parent=All-Bandwidth packet-mark=Client5-pkt queue=default priority=8 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=192k burst-time=2s
add name=Client6 parent=All-Bandwidth packet-mark=Client6-pkt queue=default priority=8 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=192k burst-time=2s
add name=Master parent=All-Bandwidth packet-mark=Master-pkt queue=default priority=8 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=192k burst-time=2s
第一部分:根据你想要的优先级为每个客户端创建要下载的包和树队列,脚本如下:
/ip firewall layer7-protocol
添加评论= " name =下载regexp =“^ *。+。\ \。(exe | rar iso zip | | | 7 zip | flv | mkv avi | | mp4 | 3 gp | rmvb mp3 | | img | dat | mov)。* \ $”
/ IP防火墙管理
add chain=forward layer7-protocol=download action=mark-packet new-packet-mark=" billingdpkt " passthrough=no packet-mark= billingpkt comment=" billingdown "
add chain=forward layer7-protocol=download action=mark-packet new-packet-mark="client1-dpkt" passthrough=no packet-mark=Client1-pkt comment="Client1-Down"
add chain=forward layer7-protocol=download action=mark-packet new-packet-mark="client2-dpkt" passthrough=no packet-mark=Client2-pkt comment="Client2-Down"
add chain=forward layer7-protocol=download action=mark-packet new-packet-mark=client3-dpkt passthrough=no packet-mark=Client3-pkt comment="Client3-Down"
add chain=forward layer7-protocol=download action=mark-packet new-packet-mark=client4-dpkt passthrough=no packet-mark=Client4-pkt comment="Client4-Down"
add chain=forward layer7-protocol=download action=mark-packet new-packet-mark=client5-dpkt passthrough=no packet-mark=Client5-pkt comment="Client5-Down"
add chain=forward layer7-protocol=download action=mark-packet new-packet-mark=client6-dpkt passthrough=no packet-mark=Client6-pkt comment="Client6-Down"
add chain=forward layer7-protocol=download action=mark-packet new-packet-mark=master-dpkt passthrough=no packet-mark=Master-pkt comment="Master-Down"
/队列树
add name= billingdown parent= billingpacket -mark= billingdpkt queue=default priority=6 limit-at=180k max-limit=180k burst-limit=256k burst-threshold=135k burst-time=2s
add name=Client1- down parent=Client1 packet-mark= Client1- dpkt queue=default priority=6 limit-at=180k max-limit=180k burst-limit=256k burst-threshold=135k burst-time=2s
add name=Client2- down parent=Client2 packet-mark= Client2- dpkt queue=default priority=6 limit-at=180k max-limit=180k burst-limit=256k burst-threshold=135k burst-time=2s
add name=Client3- down parent=Client3 packet-mark= Client3- dpkt queue=default priority=6 limit-at=180k max-limit=180k burst-limit=256k burst-threshold=135k burst-time=2s
add name=Client4- down parent=Client4 packet-mark= Client4- dpkt queue=default priority=6 limit-at=180k max-limit=180k burst-limit=256k burst-threshold=135k burst-time=2s
add name=Client5- down parent=Client5 packet-mark= Client5- dpkt queue=default priority=6 limit-at=180k max-limit=180k burst-limit=256k burst-threshold=135k burst-time=2s
add name=Client6- down parent=Client6 packet-mark= Client6- dpkt queue=default priority=6 limit-at=180k max-limit=180k burst-limit=256k burst-threshold=135k burst-time=2s
add name=Master- down parent=Master - packet-mark= Master- dpkt queue=default priority=6 limit-at=180k max-limit=180k burst-limit=256k burst-threshold=135k burst-time=2s
在这里,我们采用并使用每个客户端的连接,并区分为按文件扩展名下载的数据包连接,因此,如果您认为有一个文件扩展名很重要,只需将您想要的文件扩展名添加到上述脚本的第7层协议中。
第二部分。创建一个连接包视频每个客户端完成树队列和优先级,你喜欢。脚本如下
/ip firewall layer7-protocol
Add comment="" name=streaming regexp="^.*get.+\\.(c.youtube.com|cdn.dailymotion.com|metacafe.com|mccont.com).*\$"
如果上面的脚本不工作,尝试RegExp都在下面的脚本!
/ip firewall layer7-protocol
Add comment=" name=streaming " regexp="videoplayback|video"
/ IP防火墙管理
add comment= billingstreams chain=forward layer7-protocol=streaming action=mark-packet new-packet-mark= billingspkt passthrough=no packet-mark= billingpkt
add comment=Client1-Streams chain=forward layer7-protocol=streaming action=mark-packet new-packet-mark=client1-spkt passthrough=no packet-mark=Client1-pkt
add comment=Client2-Streams chain=forward layer7-protocol=streaming action=mark-packet new-packet-mark=client2-spkt passthrough=no packet-mark=Client2-pkt
add comment=Client3-Streams chain=forward layer7-protocol=streaming action=mark-packet new-packet-mark=client3-spkt passthrough=no packet-mark=Client3-pkt
add comment=Client4-Streams chain=forward layer7-protocol=streaming action=mark-packet new-packet-mark=client4-spkt passthrough=no packet-mark=Client4-pkt
add comment=Client5-Streams chain=forward layer7-protocol=streaming action=mark-packet new-packet-mark=client5-spkt passthrough=no packet-mark=Client5-pkt
add comment=Client6-Streams chain=forward layer7-protocol=streaming action=mark-packet new-packet-mark=client6-spkt passthrough=no packet-mark=Client6-pkt
add comment=Master-Streams chain=forward layer7-protocol=streaming action=mark-packet new-packet-mark=master-spkt passthrough=no packet-mark=Master-pkt
/队列树
add name= billingstreams parent= billingpacket -mark= billingspkt queue=default priority=8 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k burst-time=2s
add name=Client1- streams parent=Client1 packet-mark= Client1- spkt queue=default priority=8 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k burst-time=2s
add name=Client2- streams parent=Client2 packet-mark= Client2- spkt queue=default priority=8 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k burst-time=2s
add name=Client3- streams parent=Client3 packet-mark= Client3- spkt queue=default priority=8 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k burst-time=2s
add name=Client4- streams parent=Client4 packet-mark= Client4- spkt queue=default priority=8 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k burst-time=2s
add name=Client5- streams parent=Client5 packet-mark= Client5- spkt queue=default priority=8 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k burst-time=2s
add name=Client6- streams parent=Client6 packet-mark= Client6- spkt queue=default priority=8 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k burst-time=2s
add name=Master- streams parent=Master packet-mark= Master- spkt queue=default priority=8 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k burst-time=2s
这是同样的方法来创建一个包连接下载包是使用第7层协议,内容流视频在其他网站还没有定义,你只需添加第7层协议,如果你认为这是重要的,并调整优先级和速度限制在树队列,你喜欢。
c.使用队列treenya完成每个客户端的在线游戏数据包,下面是scriptsnya:
第三部分:使用树和队列优先级完成每个客户端的在线连接包游戏,脚本如下:
/ IP防火墙管理
add action=mark-packet chain=forward packet-mark=All-Outpkt - new-packet-mark=gpkt passthrough=yes protocol=tcp dest -port=5340-5352,6000-6152,10001-10011,14009-14030,18901-18909 comment="Online Game Portal"
add action=mark-packet chain=forward packet-mark=All-Outpkt new-packet-mark=gpkt passthrough=yes protocol=tcp dest -port=39190、27780、29000、22100、10009、4300、15001、15002、7341、7451
add action=mark-packet chain=forward packet-mark=All-Outpkt new-packet-mark=gpkt passthrough=yes protocol=tcp dst-port=40000、9300、9400、9700、7342、8005-8010、37466、36567、8822
add action=mark-packet chain=forward packet-mark=All-Outpkt new-packet-mark=gpkt passthrough=yes protocol=tcp dst-port=47611、16666、20000、5105、29000、18901-18909、9015
add action=mark-packet chain=forward packet-mark=All-Outpkt - new-packet-mark=gpkt passthrough=yes protocol=udp dst-port=27005,27015
add action=mark-packet chain=forward packet-mark=All-Outpkt new-packet-mark=gpkt passthrough=yes protocol=udp dst-port=27005-27020,13055,7800-7900,12060-12070
add action=mark-packet chain=forward packet-mark=All-Outpkt new-packet-mark=gpkt passthrough=yes protocol=udp dst-port=8005-8010、9068、1293、1479、9401、9600、30000
add action=mark-packet chain=forward packet-mark=All-Outpkt new-packet-mark=gpkt passthrough=yes protocol=udp dst-port=14009-14030,42051- 42052,400000 -40050,13000-13080
/ IP防火墙管理
add action=mark-packet chain=forward new-packet-mark=billing-gpkt passthrough=no dst-address=192.168.88.2 packet-mark=gpkt comment=Billing-Game
add action=mark-packet chain=forward new-packet-mark=client1-gpkt passthrough=no dest -address=192.168.88.3 packet-mark=gpkt comment=Client1-Game
add action=mark-packet chain=forward new-packet-mark=client2-gpkt passthrough=no dest -address=192.168.88.4 packet-mark=gpkt comment=Client2-Game
add action=mark-packet chain=forward new-packet-mark=client3-gpkt passthrough=no dst-address=192.168.88.5 packet-mark=gpkt comment=Client3-Game
add action=mark-packet chain=forward new-packet-mark=client4-gpkt passthrough=no dest -address=192.168.88.6 packet-mark=gpkt comment=Client4-Game
add action=mark-packet chain=forward new-packet-mark=client5-gpkt passthrough=no dst-address=192.168.88.7 packet-mark=gpkt comment=Client5-Game
add action=mark-packet chain=forward new-packet-mark=client6-gpkt passthrough=no dest -address=192.168.88.8 packet-mark=gpkt comment=Client6-Game
add action=mark-packet chain=forward new-packet-mark=master-gpkt passthrough=no dst-address=192.168.88.9 packet-mark=gpkt comment=Master-Game
/队列树
add name=Billing- game parent=Billing - packet-mark= Billing- gpkt queue=default priority=1 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k burst-time=2s
add name=Client1- game parent=Client1 packet-mark= Client1- gpkt queue=default priority=1 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k burst-time=2s
add name=Client2- game parent=Client2 - packet-mark= Client2- gpkt queue=default priority=1 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k burst-time=2s
add name=Client3- game parent=Client3 packet-mark= Client3- gpkt queue=default priority=1 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k burst-time=2s
add name=Client4- game parent=Client4 packet-mark= Client4- gpkt queue=default priority=1 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k burst-time=2s
add name=Client5- game parent=Client5 - packet-mark= Client5- gpkt queue=default priority=1 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k burst-time=2s
add name=Client6- game parent=Client6 - packet-mark= Client6- gpkt queue=default priority=1 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k burst-time=2s
add name=Master- game parent=Master packet-mark= Master- gpkt queue=default priority=1 limit-at=220k max-limit=220k burst-limit=256k burst-threshold=165k burst-time=2s
在这种情况下,我们建立连接-在线游戏最初,基于出接口= wlan1和tcp和udp许多端口使用的在线游戏。然后制作每个ip客户端连接游戏的在线包,我们最终捕获包在线游戏在树队列和优先级,你想要的。
第四部分。使用树队列完成每个客户端的浏览数据包连接,并给出优先级,下面是脚本:
/ IP防火墙管理
add action=mark-packet chain=forward connection-bytes=0-1000000 src-port=80,443 passthrough=no packet-mark= BILLING -pkt new-packet-mark= BILLING -bpkt protocol=tcp comment="BILLING BROWSING"
add action=mark-packet chain=forward connection-bytes=0-1000000 src-port=80,443 passthrough=no packet-mark= CLIENT1 -pkt new-packet-mark= CLIENT1 -bpkt protocol=tcp comment="CLIENT1 BROWSING"
add action=mark-packet chain=forward connection-bytes=0-1000000 src-port=80,443 passthrough=no packet-mark= CLIENT2 -pkt new-packet-mark= CLIENT2 -bpkt protocol=tcp comment="CLIENT2 BROWSING"
add action=mark-packet chain=forward connection-bytes=0-1000000 src-port=80,443 passthrough=no packet-mark= CLIENT3 -pkt new-packet-mark= CLIENT3 -bpkt protocol=tcp comment="CLIENT3 BROWSING"
add action=mark-packet chain=forward connection-bytes=0-1000000 src-port=80,443 passthrough=no packet-mark= CLIENT4 -pkt new-packet-mark= CLIENT4 -bpkt protocol=tcp comment="CLIENT4 BROWSING"
add action=mark-packet chain=forward connection-bytes=0-1000000 src-port=80,443 passthrough=no packet-mark= CLIENT5 -pkt new-packet-mark= CLIENT5 -bpkt protocol=tcp comment="CLIENT5 BROWSING"
add action=mark-packet chain=forward connection-bytes=0-1000000 src-port=80,443 passthrough=no packet-mark= CLIENT6 -pkt new-packet-mark= CLIENT6 -bpkt protocol=tcp comment="CLIENT6 BROWSING"
add action=mark-packet chain=forward connection-bytes=0-1000000 src-port=80,443 passthrough=no packet-mark= MASTER -pkt new-packet-mark= MASTER -bpkt protocol=tcp comment="MASTER BROWSING"
/队列树
add name="Billing- browsing " parent=Billing - packet-mark= Billing- bpkt queue=default priority=2 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=192k burst-time=2s
add name="Client1- browsing " parent=Client1 packet-mark= Client1- bpkt queue=default priority=2 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=192k burst-time=2s
add name="Client2- browsing " parent=Client2 packet-mark= Client2- bpkt queue=default priority=2 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=192k burst-time=2s
add name="Client3- browsing " parent=Client3 packet-mark= Client3- bpkt queue=default priority=2 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=192k burst-time=2s
add name="Client4- browsing " parent=Client4 packet-mark= Client4- bpkt queue=default priority=2 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=192k burst-time=2s
add name="Client5- browsing " parent=Client5 packet-mark= Client5- bpkt queue=default priority=2 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=192k burst-time=2s
add name="Client6- browsing " parent=Client6 packet-mark= Client6- bpkt queue=default priority=2 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=192k burst-time=2s
add name="Master- browsing " parent=Master packet-mark= Master- bpkt queue=default priority=2 limit-at=256k max-limit=256k burst-limit=720k burst-threshold=192k burst-time=2s
伙计们,如果我运行这个脚本不能正常工作,你能帮助我适应这个脚本到rb951g吗