Thu Aug 25, 2016 10:15 am
Total Bandwidth = Up to 6 M
8 Clients that I have :
Billing : 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 firewall address-list
add address=192.168.88.0/24 disabled=no list=bridge-local comment="default configuration"
/ ip firewall mangle
add action=mark-connection chain=prerouting dst-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"
/queue tree
add name=All-Bandwidth parent=global packet-mark=All-Outpkt queue=default priority=1 max-limit=6M
/ ip firewall mangle
add action=mark-connection chain=forward comment="Billing" disabled=no dst-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 dst-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 dst-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 dst-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 dst-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 dst-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 dst-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 dst-address=192.168.88.9 new-connection-mark="Master-conn" passthrough=yes connection-mark=All-Outconn
/ ip firewall mangle
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"
/queue tree
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
Part I: Creating package per client to download and trees queue with priority you want , here the script follows :
/ip firewall layer7-protocol
add comment="" name=download regexp="^.*get.+\\.(exe|rar|iso|zip|7zip|flv|mkv|avi|mp4|3gp|rmvb|mp3|img|dat|mov).*\$"
/ ip firewall mangle
add chain=forward layer7-protocol=download action=mark-packet new-packet-mark="billing-dpkt" passthrough=no packet-mark=Billing-pkt comment="Billing-Down"
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"
/queue tree
add name=Billing-Down parent=Billing packet-mark=billing-dpkt 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
Here we take and use a connection per client and differentiate into packet connection downloaded by file extension , so if there is a file extension that you think is important , just add the file extension you want to layer 7 protocol of the script above .
Part II . Creating a connection package videos per client complete with tree queuing and priority as you please . the script follows
/ip firewall layer7-protocol
add comment="" name=streaming regexp="^.*get.+\\.(c.youtube.com|cdn.dailymotion.com|metacafe.com|mccont.com).*\$"
If the script above does not work , try RegExp both in script below !
/ip firewall layer7-protocol
add comment="" name=streaming regexp="videoplayback|video"
/ ip firewall mangle
add comment=Billing-Streams chain=forward layer7-protocol=streaming action=mark-packet new-packet-mark=billing-spkt passthrough=no packet-mark=Billing-pkt
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
/queue tree
add name=Billing-Streams parent=Billing packet-mark=billing-spkt 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
This is the same method to create a package connection as download package is to use a layer 7 protocol , content streaming video on other sites that have not been defined , you simply add the layer 7 protocol if you think that is important , and adjust the priority and the speed limit in trees queue as you please .
c. Making Online game packets per client complete with queue treenya, the following is scriptsnya:
Part III : Making Online connection package game per client complete with trees and queue priority , here the script follows :
/ ip firewall mangle
add action=mark-packet chain=forward packet-mark=All-Outpkt new-packet-mark=gpkt passthrough=yes protocol=tcp dst-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 dst-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,40000-40050,13000-13080
/ ip firewall mangle
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 dst-address=192.168.88.3 packet-mark=gpkt comment=Client1-Game
add action=mark-packet chain=forward new-packet-mark=client2-gpkt passthrough=no dst-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 dst-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 dst-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
/queue tree
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
In this case we make connections - online game initially , based out - interface = wlan1 and tcp and udp many ports used by online gaming . Then make an online package of connection games per address ip client that we finally catch packages online games in tree queues and priority that you want .
Part IV . Make browsing packet connections per client complete with queues of trees and give priority , here the following script :
/ ip firewall mangle
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"
/queue tree
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
guys can you help met to fit this script to may ros rb951g if i run this script cant work properly