Showing posts with label Queue. Show all posts
Showing posts with label Queue. Show all posts

Wednesday, 6 April 2016

Queue Simple Game Browsing Donwload

Langsung Aja

Bw 2mbps/512kbps
Lan ethernet=ether2
Local ip router=192.168.88.1/27
 
 
/system scheduler
add disabled=no interval=1d name=sch-nice on-event=":if ([:len [/file find name=nice.rsc]] > 0) do={/file remove nice.rsc } ;/tool fetch url=http://ixp.mikrotik.co.id/download/nice.rsc ;/import nice.rsc" policy=ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive,api start-date=jan/01/1970 start-time=06:00:00
 
/ip firewall mangle
add action=mark-connection chain=forward comment="Point Blank" dst-address-list=nice dst-port=39190 new-connection-mark=conn.games protocol=tcp
add action=mark-connection chain=forward dst-address-list=nice dst-port=40000-40010 new-connection-mark=conn.games protocol=udp
add action=mark-connection chain=forward comment=Rohan dst-address-list=nice dst-port=22100 new-connection-mark=conn.games protocol=tcp
add action=mark-connection chain=forward comment="Ayo Dance" dst-address-list=nice dst-port=18901-18910 new-connection-mark=conn.games protocol=tcp
add action=mark-packet chain=forward connection-mark=conn.games new-packet-mark=pack.games passthrough=no
add action=mark-connection chain=forward connection-mark=!conn.heavy new-connection-mark=conn.all src-address=192.168.88.0/27
add action=mark-connection chain=forward connection-bytes=256000-0 connection-mark=conn.all connection-rate=100k-100M new-connection-mark=conn.heavy protocol=tcp
add action=mark-connection chain=forward connection-bytes=256000-0 connection-mark=conn.all connection-rate=100k-100M new-connection-mark=conn.heavy protocol=udp
add action=mark-packet chain=forward connection-mark=conn.all new-packet-mark=pack.all passthrough=no
add action=mark-packet chain=forward connection-mark=conn.heavy new-packet-mark=pack.heavy passthrough=no
 
/queue type
add kind=pcq name=q.ty.upload pcq-burst-rate=256k pcq-burst-threshold=128k 
    pcq-classifier=src-address pcq-dst-address6-mask=64 pcq-rate=96k 
    pcq-src-address6-mask=64
add kind=pcq name=q.ty.heavy pcq-burst-rate=512k pcq-burst-threshold=384k 
    pcq-burst-time=16s pcq-classifier=dst-address pcq-dst-address6-mask=64 
    pcq-rate=256k pcq-src-address6-mask=64
add kind=pcq name=q.ty.game pcq-burst-rate=384k pcq-burst-threshold=256k 
    pcq-burst-time=16s pcq-classifier=dst-address pcq-dst-address6-mask=64 
    pcq-rate=128k pcq-src-address6-mask=64
add kind=pcq name=q.ty.all pcq-burst-rate=512k pcq-burst-threshold=256k 
    pcq-burst-time=16s pcq-classifier=dst-address pcq-dst-address6-mask=64 
    pcq-rate=384k pcq-src-address6-mask=64
 
/queue simple
add burst-limit=0/0 burst-threshold=0/0 burst-time=0s/0s direction=upload disabled=no interface=ether2 limit-at=128k/0 max-limit=512k/0 name=qs-up-total 
    packet-marks="" parent=none priority=8 queue=q.ty.upload/default-small target-addresses="" total-queue=default-small
add burst-limit=0/0 burst-threshold=0/0 burst-time=0s/0s direction=download disabled=no interface=ether2 limit-at=0/0 max-limit=512k/2M name=qs-ds-total 
    packet-marks="" parent=none priority=8 queue=default-small/default-small target-addresses="" total-queue=default-small
add burst-limit=0/0 burst-threshold=0/0 burst-time=0s/0s direction=download disabled=no interface=ether2 limit-at=0/384k max-limit=0/512k name=qs.game 
    packet-marks=pack.games parent=qs-ds-total priority=6 queue=default-small/q.ty.game target-addresses="" total-queue=default-small
add burst-limit=0/0 burst-threshold=0/0 burst-time=0s/0s direction=download disabled=no interface=ether2 limit-at=0/512k max-limit=0/1536k name=qs-non-game 
    packet-marks="" parent=qs-ds-total priority=8 queue=default-small/default-small target-addresses="" total-queue=default-small
add burst-limit=0/0 burst-threshold=0/0 burst-time=0s/0s direction=download disabled=no interface=ether2 limit-at=0/0 max-limit=0/1M name=qs.all packet-marks=
    pack.all parent=qs-non-game priority=7 queue=default-small/q.ty.all target-addresses="" total-queue=default-small
add burst-limit=0/0 burst-threshold=0/0 burst-time=0s/0s direction=download disabled=no interface=ether2 limit-at=0/0 max-limit=0/1M name=qs.heavy 
    packet-marks=pack.heavy parent=qs-non-game priority=8 queue=default-small/q.ty.heavy target-addresses="" total-queue=default-small
 


/ip fi ma add copy-from=1 protocol={jenis protocol} dst-port={port games} comment=nama-games
.. dst
Langsung Aja Bw 2mbps/512kbps Lan ethernet= ether2 Local ip router = 192.168.88.1/27   /system scheduler add disabled=no interv... Read More
Read more ...

Wednesday, 6 January 2016

Queue Tree Pada Hotspot


Karena newbie liat di sini belum ada yg memaparkan tentang settingan queue tree di hotspot, newbie mau ikutan nyumbang settingan sederhana queue tree untuk hotspot yang dipakai di tempat publik alias free (contoh nya kafe, mall, dll). Mohon maaf kalo masih banyak kekurangannya Click here to enlarge
Anggap saja router mikrotik sudah terhubung ke internet dan sudah bisa sharing internet ke jaringan dibawah nya ya Click here to enlarge

Contoh:
ether1 = internet gateway (WAN)
ether2 = 192.168.10.1/24 (Hotspot) ==> dibuat dhcp

Kemudian setting hotspot (ga perlu dijelasin ya soalnya udah banyak tutorial nya kalo setting hotspot) Click here to enlarge. Setelah hotspot selesai disetting sekarang kita buat mangle untuk menangkap traffic hotspot nya.


Code:
 
/ip firewall mangle
add chain=prerouting action=jump jump-target=hotspot comment="Hotspot Jump Mangle"
add chain=postrouting action=jump jump-target=hotspot

add chain=prerouting action=mark-connection new-connection-mark=conn-up passthrough=yes dst-address=192.168.10.0/24 comment="Hotspot Connections"
add chain=postrouting action=mark-connection new-connection-mark=conn-down passthrough=yes src-address=192.168.10.0/24

add chain=prerouting action=mark-packet new-packet-mark=packet-up passthrough=yes connection-mark=conn-up comment="Hotspot Packets"
add chain=postrouting action=mark-packet new-packet-mark=packet-down passthrough=yes connection-mark=conn-down

add chain=prerouting action=mark-packet new-packet-mark=hotspot-up passthrough=no connection-mark=conn-up
add chain=postrouting action=mark-packet new-packet-mark=hotspot-down passthrough=no connection-mark=conn-down
Setelah mangle utama kita buat, sekarang kita akan menambahkan lagi mangle untuk memisahkan jalur browsing, download, facebook dan youtube (yg lain2 bisa ditambahkan sendiri ya
Agar memudahkan pemisahan bandwidth tersebut kita akan menggunakan fasilitas layer-7-protocol dari mikrotik.
Code:
 

/ip firewall layer7-protocol
add name=Download regexp="^.*(get|GET).+\\.(exe|rar|zip|7z|cab|asf|mov|wmv|mpg|mpeg|mkv|avi|flv|pdf|wav|rm|mp3|mp4|ram|rmvb|dat|daa|iso|nrg|bin|vcd|mp2|3gp|mpe|qt|raw|wma|ogg|doc|deb|tar|bzip|gzip|gzip2|0[0-1][0-1]).*\$"
add name=Facebook regexp="^.*get.+.facebook.com.*\$|^.*get.+.zynga.com.*\$|^.*get.+.fbcdn.net.*\$"
add name=Youtube regexp="^.*get.+.c.youtube.com.*\$"
Setelah layer-7-protocol kita tambahkan, kita buat mangle nya.
Code:
 
/ip firewall mangle
add chain=hotspot action=mark-packet new-packet-mark=facebook passthrough=no protocol=tcp layer7-protocol=Facebook comment="Facebook"
add chain=hotspot action=mark-packet new-packet-mark=youtube passthrough=no protocol=tcp layer7-protocol=Youtube comment="Youtube"
add chain=hotspot action=mark-packet new-packet-mark=download passthrough=no protocol=tcp layer7-protocol=Download comment="Download"
Selesai pembuatan mangle sekarang kita ubah settingan hotspot user profile nya. Disini saya memakai contoh profile Hotspot.
Untuk Incoming Packet Mark dan Outgoing Packet Mark jangan lupa kita isikan dengan marking hotspot yang sudah kita buat tadi. Incoming Packet Mark kita isikan dengan hotspot-up dan Outgoing Packet Mark kita isikan dengan hotspot-down.

Sekarang kita buat queue tree nya
Code:
 

/queue type
add name="pcq-down" kind=pcq pcq-rate=1M pcq-limit=50 pcq-classifier=dst-address pcq-total-limit=2000 pcq-burst-rate=0 pcq-burst-threshold=0 pcq-burst-time=10s pcq-src-address-mask=32 pcq-dst-address-mask=32 pcq-src-address6-mask=64 pcq-dst-address6-mask=64
add name="pcq-up" kind=pcq pcq-rate=1M pcq-limit=50 pcq-classifier=src-address pcq-total-limit=2000 pcq-burst-rate=0 pcq-burst-threshold=0 pcq-burst-time=10s pcq-src-address-mask=32 pcq-dst-address-mask=32 pcq-src-address6-mask=64 pcq-dst-address6-mask=64

/queue tree
add name="Hotspot Down" parent=global-out packet-mark="" limit-at=0 priority=8 max-limit=1M burst-limit=0 burst-threshold=0 burst-time=0s
add name="Hotspot Up" parent=global-in packet-mark="" limit-at=0 priority=8 max-limit=1M burst-limit=0 burst-threshold=0 burst-time=0s 
add name="Hotspot Browsing" parent="Hotspot Down" packet-mark=hotspot-down limit-at=256k queue=pcq-down priority=2 max-limit=1M burst-limit=0 burst-threshold=0 burst-time=0s
add name="Hotspot Facebook" parent="Hotspot Down" packet-mark=facebook limit-at=256k queue=pcq-down priority=2 max-limit=1M burst-limit=0 burst-threshold=0 burst-time=0s
add name="Hotspot Youtube" parent="Hotspot Down" packet-mark=youtube limit-at=128k queue=pcq-down priority=8 max-limit=1M burst-limit=0 burst-threshold=0 burst-time=0s
add name="Hotspot Download" parent="Hotspot Down" packet-mark=download limit-at=128k queue=pcq-down priority=8 max-limit=1M burst-limit=0 burst-threshold=0 burst-time=0s
add name="Hotspot Upload" parent="Hotspot Up" packet-mark=hotspot-up limit-at=256k queue=pcq-up priority=8 max-limit=1M burst-limit=0 burst-threshold=0 burst-time=0s
Nanti setiap user hotspot yang login otomatis ip nya akan termangle secara otomatis ip address nya
Karena newbie liat di sini belum ada yg memaparkan tentang settingan queue tree di hotspot, newbie mau ikutan nyumbang settingan sederha... Read More
Read more ...

Mikrotik Queue Tree – v6.0

## This is the interface to run the QOS on. This is the edge interface before traffic leaves your MikroTik
:global QOSINTERFACE "ether1" 
 
## This is the name of this interface. Use it to distinguish it from other QOS scripts running
:global TREE "WAN1"
 
## Adjust the queue types speeds to match the download and upload speed for each interface
:global PCQDOWNLOD "50M"
:global PCQUPLOAD "10M"
 
## Adjust queue tree speeds to match the download and upload speed for each interface.
## MAXDOWNLOAD = MAXDLINT + MAXDLNONINT  where MAXDLINT = ~90% of MAXDOWNLOAD
 
:global MAXDOWNLOAD "50M"
:global MAXDLINT "40M"
:global MAXDLNONINT "10M"
 
:global MAXUPLOAD "10M"
:global MAXUPINT "9M"
:global MAXUPNONINT "1M"
 
####################
############################################There are no more value to change below this line############################################
####################
 
#IP Address List Entries:
#Add any PPPoE ranges to the "QOSCustomerIPs" list.
 
/ip firewall address-list
add address=192.168.0.0/16 comment="" disabled=no list=QOSCustomerIPs
add address=10.0.0.0/8 comment="" disabled=no list=QOSCustomerIPs
add address=172.16.0.0/12 comment="" disabled=no list=QOSCustomerIPs
add address=10.0.0.0/24 comment="ISP IP Addresses" disabled=no list=ISP
 
add address=12.129.193.0/24 comment=WoW disabled=no list=games
add address=12.129.222.0/23 comment=WoW disabled=no list=games
add address=12.129.225.0/24 comment=WoW disabled=no list=games
add address=12.129.228.0/24 comment=WoW disabled=no list=games
add address=12.129.233.0/24 comment=WoW disabled=no list=games
add address=12.129.252.0/23 comment=WoW disabled=no list=games
add address=63.241.255.0/24 comment=WoW disabled=no list=games
add address=72.5.213.0/24 comment=WoW disabled=no list=games
add address=80.239.149.0/24 comment=WoW disabled=no list=games
add address=80.239.179.0/24 comment=WoW disabled=no list=games
add address=80.239.181.0/24 comment=WoW disabled=no list=games
add address=80.239.185.0/24 comment=WoW disabled=no list=games
add address=80.239.233.0/24 comment=WoW disabled=no list=games
add address=192.12.244.0/24 comment=WoW disabled=no list=games
add address=195.12.246.0/24 comment=WoW disabled=no list=games
add address=199.107.6.0/23 comment=WoW disabled=no list=games
add address=199.107.24.0/23 comment=WoW disabled=no list=games
add address=206.16.118.0/23 comment=WoW disabled=no list=games
add address=206.16.147.0/24 comment=WoW disabled=no list=games
add address=206.18.148.0/23 comment=WoW disabled=no list=games
add address=206.18.98.0/23 comment=WoW disabled=no list=games
add address=206.16.235.0/24 comment=WoW disabled=no list=games
add address=206.17.111.0/24 comment=WoW disabled=no list=games
add address=213.248.123.0/24 comment=WoW disabled=no list=games
add address=213.248.127.0/24 comment=WoW disabled=no list=games
 
add address=202.9.66.0/23 comment=SC2 disabled=no list=games
add address=12.129.254.0/23 comment=SC2 disabled=no list=games
add address=12.129.206.0/24 comment=SC2 disabled=no list=games
 
add address=12.129.242.0/24 comment="Diablo III" disabled=no list=games
add address=12.130.245.0/24 comment="Diablo III" disabled=no list=games
add address=12.130.244.0/24 comment="Diablo III" disabled=no list=games
add address=12.130.246.0/24 comment="Diablo III" disabled=no list=games
 
add address=63.150.138.0/24 disabled=no comment="Dota 2" list=games
add address=103.10.124.0/24 disabled=no comment="Dota 2" list=games
add address=103.10.125.0/24 disabled=no comment="Dota 2" list=games
add address=103.28.54.0/23 disabled=no comment="Dota 2" list=games
add address=146.66.152.0/23 disabled=no comment="Dota 2" list=games
add address=146.66.154.0/24 disabled=no comment="Dota 2" list=games
add address=146.66.155.0/24 disabled=no comment="Dota 2" list=games
add address=146.66.156.0/23 disabled=no comment="Dota 2" list=games
add address=146.66.158.0/23 disabled=no comment="Dota 2" list=games
add address=185.25.180.0/23 disabled=no comment="Dota 2" list=games
add address=185.25.182.0/24 disabled=no comment="Dota 2" list=games
add address=192.69.96.0/22 disabled=no comment="Dota 2" list=games
add address=205.196.6.0/24 disabled=no comment="Dota 2" list=games
add address=208.64.200.0/24 disabled=no comment="Dota 2" list=games
add address=208.64.201.0/24 disabled=no comment="Dota 2" list=games
add address=208.64.202.0/24 disabled=no comment="Dota 2" list=games
add address=208.64.203.0/24 disabled=no comment="Dota 2" list=games
add address=208.78.164.0/22 disabled=no comment="Dota 2" list=games
add address=216.111.123.0/24 disabled=no comment="Dota 2" list=games
 
add address=31.186.224.0/24 comment="LoL Europe" disabled=no list=games
add address=31.186.226.0/24 comment="LoL Europe" disabled=no list=games
add address=64.7.194.0/24 comment="LoL Europe" disabled=no list=games
add address=95.172.65.0/24 comment="LoL Europe" disabled=no list=games
add address=95.172.70.0/24 comment="LoL Europe" disabled=no list=games
add address=66.150.148.0/24 comment="LoL EU-NE" disabled=no list=games
add address=64.7.194.0/24 comment="LoL NA" disabled=no list=games
add address=66.150.148.0/24 comment="LoL NA" disabled=no list=games
add address=192.64.168.0/24 comment="LoL NA" disabled=no list=games
add address=192.64.169.0/24 comment="LoL NA" disabled=no list=games
add address=192.64.170.0/24 comment="LoL NA" disabled=no list=games
add address=216.133.234.0/24 comment="LoL NA" disabled=no list=games
add address=192.64.169.0/24 comment="LoL Oceania" disabled=no list=games
add address=59.100.95.128/25 comment="LoL Oceania" disabled=no list=games
add address=203.116.112.128/25 comment="LoL Singapore/Malaysia" disabled=no list=games
 
add list=games comment="Lowerping - US West - Panther 1" address=216.240.136.162
add list=games comment="Lowerping - US West - Panther 2" address=216.240.145.9
add list=games comment="Lowerping - US West - Panther 3" address=64.69.36.224
add list=games comment="Lowerping - US West - Panther 4" address=208.70.75.171
add list=games comment="Lowerping - US West - Panther 5" address=208.70.78.93
add list=games comment="Lowerping - US West - Panther 6" address=216.240.136.167
add list=games comment="Lowerping - US West - Tiger 1" address=64.56.65.9
add list=games comment="Lowerping - US West - Tiger 2" address=74.222.8.249
add list=games comment="Lowerping - US West - Fox 1" address=216.18.198.2
add list=games comment="Lowerping - US West - Fox 2" address=173.231.26.242
add list=games comment="Lowerping - US West - Lion A1" address=66.212.28.128
add list=games comment="Lowerping - US West - Lion A2" address=66.63.191.237
add list=games comment="Lowerping - US West - Lion B1" address=72.11.142.216
add list=games comment="Lowerping - US West - Lion B2" address=72.11.142.217
add list=games comment="Lowerping - US West - Lion C1" address=96.44.172.186
add list=games comment="Lowerping - US West - Lion C2" address=96.44.177.26
add list=games comment="Lowerping - US West - Lion D1" address=96.44.177.27
add list=games comment="Lowerping - US West - Lion D2" address=72.11.142.218
add list=games comment="Lowerping - US West - Panda 1" address=64.120.10.178
add list=games comment="Lowerping - US West - Rhino 1" address=72.51.46.93
add list=games comment="Lowerping - US West - Squid 1" address=173.245.68.180
add list=games comment="Lowerping - US West - Squid 2" address=173.245.68.178
add list=games comment="Lowerping - US West - Koala 1" address=8.17.252.162
add list=games comment="Lowerping - US West - Koala 2" address=8.17.252.163
add list=games comment="Lowerping - US West - Salmon 1" address=50.23.65.37
add list=games comment="Lowerping - US West - Salmon 2" address=174.127.96.124
add list=games comment="Lowerping - US West - Salmon 3" address=174.127.96.127
add list=games comment="Lowerping - US East - Cobra 1" address=66.109.20.100
add list=games comment="Lowerping - US East - Otter 1" address=66.199.235.194
add list=games comment="Lowerping - US East - Otter 2" address=72.9.100.90
add list=games comment="Lowerping - US East - Spider 1" address=173.208.45.82
add list=games comment="Lowerping - US Central - Frog 1" address=69.162.127.98
add list=games comment="Lowerping - US Central - Tadpole 1" address=174.133.108.202
add list=games comment="Lowerping - US Central - Toad 1" address=174.34.132.50
add list=games comment="Lowerping - Chicago - Macaw 1" address=70.32.43.122
add list=games comment="Lowerping - Chicago - Jaguar 1" address=184.154.38.138
add list=games comment="Lowerping - Europe - London 1" address=78.129.220.51
add list=games comment="Lowerping - Europe - Germany 1" address=188.138.24.38
add list=games comment="Lowerping - Europe - Germany 3" address=85.10.193.111
add list=games comment="Lowerping - Europe - Netherlands 1" address=94.75.208.164
add list=games comment="Lowerping - Europe - Netherlands 2" address=62.212.91.21
add list=games comment="Lowerping - Europe - Paris 1" address=91.191.144.94
add list=games comment="Lowerping - Europe - Paris 2" address=46.21.207.116
 
add list=games comment="SWTOR - USA/EUROPE" address=159.153.0.0/16
 
add address=206.127.144.0/20 comment="GW2 - ArenaNet (NC Interactive)" disabled=no list=games
add address=64.25.32.0/20 comment="GW2 - ArenaNet (NC Interactive)" disabled=no list=games
 
 
#Mangle Rules:
/ip firewall mangle
add action=log chain=notes comment="Start of QoS tree version updated on 4/4/2014" disabled=no log-prefix=""
add action=accept chain=prerouting comment="Accept traffic From QOSCustomerIPs to QOSCustomerIPs" disabled=no dst-address-list=QOSCustomerIPs src-address-list=QOSCustomerIPs
add action=mark-packet chain=prerouting comment="We should start with marking everything as unknown - dn_p7_interactive $TREE" disabled=no in-interface=$QOSINTERFACE new-packet-mark=("dn_p7_interactive_".$TREE) passthrough=yes
add action=mark-packet chain=postrouting comment="We should start with marking everything as unknown - up_p7_interactive" disabled=no new-packet-mark=("up_p7_interactive_".$TREE) out-interface=$QOSINTERFACE passthrough=yes
add action=mark-packet chain=postrouting comment="Mark all ACK packets p1 for outbound traffic." disabled=no new-packet-mark=("up_p1_interactive_".$TREE) out-interface=$QOSINTERFACE passthrough=yes protocol=tcp tcp-flags=ack
add action=mark-packet chain=prerouting comment="Mark all ACK packets p1 for outbound traffic." disabled=no in-interface=$QOSINTERFACE new-packet-mark=("dn_p1_interactive_".$TREE) passthrough=yes protocol=tcp tcp-flags=ack
add action=mark-connection chain=prerouting comment="Mark p2p connections first" disabled=no new-connection-mark=p2p_conn p2p=all-p2p passthrough=yes
add action=mark-packet chain=prerouting comment="Identifiable P2P is set at p8_noninteractive with NO PASSTHROUGH.  This is the lowest priority we can configure" connection-mark=p2p_conn disabled=no in-interface=$QOSINTERFACE new-packet-mark=("dn_p8_noninteractive_".$TREE) passthrough=no
add action=mark-packet chain=postrouting comment="Identifiable P2P is set at p8_noninteractive with NO PASSTHROUGH.  This is the lowest priority we can configure" connection-mark=p2p_conn disabled=no new-packet-mark=("up_p8_noninteractive_".$TREE) out-interface=$QOSINTERFACE passthrough=no
add action=mark-packet chain=prerouting comment="Default Bittorrent as p8_noninteractive with NO PASSTHROUGH" disabled=no in-interface=$QOSINTERFACE new-packet-mark=("dn_p8_noninteractive_".$TREE) passthrough=no src-port=6881 protocol=tcp
add action=mark-packet chain=postrouting comment="Default Bittorrent as p8_noninteractive with NO PASSTHROUGH" disabled=no out-interface=$QOSINTERFACE new-packet-mark=("up_p8_interactive_".$TREE) passthrough=no dst-port=6881 protocol=tcp
add action=mark-packet chain=prerouting comment="Mark ISP as p1_interactive with NO PASSTHROUGH" disabled=no in-interface=$QOSINTERFACE new-packet-mark=("dn_p1_interactive_".$TREE) passthrough=no src-address-list=ISP
add action=mark-packet chain=postrouting comment="Mark ISP as p1_interactive with NO PASSTHROUGH" disabled=no dst-address-list=ISP new-packet-mark=("up_p1_interactive_".$TREE) out-interface=$QOSINTERFACE passthrough=no
add action=mark-packet chain=prerouting comment="BGP as p1_interactive with NO PASSTHROUGH" disabled=no in-interface=$QOSINTERFACE new-packet-mark=("dn_p1_interactive_".$TREE) passthrough=no src-port=179 protocol=tcp
add action=mark-packet chain=postrouting comment="BGP as p1_interactive with NO PASSTHROUGH" disabled=no out-interface=$QOSINTERFACE new-packet-mark=("up_p1_interactive_".$TREE) passthrough=no dst-port=179 protocol=tcp
add action=mark-packet chain=prerouting comment="OSPF as p1_interactive with NO PASSTHROUGH" disabled=no in-interface=$QOSINTERFACE new-packet-mark=("dn_p1_interactive_".$TREE) passthrough=no protocol=ospf
add action=mark-packet chain=postrouting comment="OSPF as p1_interactive with NO PASSTHROUGH" disabled=no out-interface=$QOSINTERFACE new-packet-mark=("up_p1_interactive_".$TREE) passthrough=no protocol=ospf
add action=mark-packet chain=postrouting comment="Mark VoIP/ICMP Test (8080 udp) 0-1000000 as p1_interactive with NO PASSTHROUGH" connection-bytes=0-1000000 disabled=no dst-port=8080 new-packet-mark=("up_p1_interactive_".$TREE) passthrough=no protocol=udp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="Mark VoIP/ICMP Test (8080 udp) 0-1000000 as p1_interactive with NO PASSTHROUGH" connection-bytes=0-1000000 disabled=no new-packet-mark=("dn_p1_interactive_".$TREE) passthrough=no protocol=udp src-port=8080 in-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="Mark DNS 0-64k p1_interactive with NO PASSTHROUGH" connection-rate=0-64k disabled=no dst-port=53 new-packet-mark=("dn_p1_interactive_".$TREE) passthrough=no protocol=tcp in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="Mark DNS 0-64k p1_interactive with NO PASSTHROUGH" connection-rate=0-64k disabled=no new-packet-mark=("up_p1_interactive_".$TREE) passthrough=no protocol=tcp src-port=53 out-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="Mark DNS 0-64k p1_interactive with NO PASSTHROUGH" connection-rate=0-64k disabled=no dst-port=53 new-packet-mark=("up_p1_interactive_".$TREE) passthrough=no protocol=udp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="Mark DNS 0-64k p1_interactive with NO PASSTHROUGH" connection-rate=0-64k disabled=no new-packet-mark=("dn_p1_interactive_".$TREE) passthrough=no protocol=udp src-port=53 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="ICMP is p1_interactive NO PASSTHROUGH" disabled=no new-packet-mark=("up_p1_interactive_".$TREE) passthrough=no protocol=icmp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="ICMP is p1_interactive NO PASSTHROUGH" disabled=no new-packet-mark=("dn_p1_interactive_".$TREE) passthrough=no protocol=icmp in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="FaceTime - 0-512k connection rate Set for p1_interactive with NO PASSTHROUGH" connection-rate=0-512k disabled=no dst-port=3478,4080,5223 new-packet-mark=("up_p1_interactive_".$TREE) passthrough=no protocol=tcp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="FaceTime - 0-512k connection rate Set for p1_interactive with NO PASSTHROUGH" connection-rate=0-512k disabled=no new-packet-mark=("dn_p1_interactive_".$TREE) passthrough=no protocol=tcp src-port=3478,4080,5223 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="FaceTime - 0-512k connection rate Set for p1_interactive with NO PASSTHROUGH" connection-rate=0-512k disabled=no dst-port=16393-16402 new-packet-mark=("up_p1_interactive_".$TREE) passthrough=no protocol=udp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="FaceTime - 0-512k connection rate Set for p1_interactive with NO PASSTHROUGH" connection-rate=0-512k disabled=no new-packet-mark=("dn_p1_interactive_".$TREE) passthrough=no protocol=udp src-port=16393-16402 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="VOIP - SIP - 0-512k connection rate Set for p1_interactive with NO PASSTHROUGH" connection-rate=0-512k disabled=no dst-port=5060-5061 new-packet-mark=("up_p1_interactive_".$TREE) passthrough=no protocol=tcp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="VOIP - SIP - 0-512k connection rate Set for p1_interactive with NO PASSTHROUGH" connection-rate=0-512k disabled=no new-packet-mark=("dn_p1_interactive_".$TREE) passthrough=no protocol=tcp src-port=5060-5061 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="VOIP - SIP - 0-512k connection rate Set for p1_interactive with NO PASSTHROUGH" connection-rate=0-512k disabled=no dst-port=5060-5061 new-packet-mark=("up_p1_interactive_".$TREE) passthrough=no protocol=udp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="VOIP - SIP - 0-512k connection rate Set for p1_interactive with NO PASSTHROUGH" connection-rate=0-512k disabled=no new-packet-mark=("dn_p1_interactive_".$TREE) passthrough=no protocol=udp src-port=5060-5061 in-interface=$QOSINTERFACE
add action=mark-connection chain=prerouting comment="VOIP - mark DSCP 46 with voip connection mark" disabled=no dscp=46 new-connection-mark=voip passthrough=yes
add action=mark-packet chain=postrouting comment="For the voip connection mark - 0-512k set to p1_interactive with NO PASSTHROUGH" connection-mark=voip connection-rate=0-512k disabled=no new-packet-mark=("up_p1_interactive_".$TREE) passthrough=no protocol=tcp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="For the voip connection mark - 0-512k set to p1_interactive with NO PASSTHROUGH" connection-mark=voip connection-rate=0-512k disabled=no new-packet-mark=("dn_p1_interactive_".$TREE) passthrough=no protocol=tcp in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="For the voip connection mark - 0-512k set to p1_interactive with NO PASSTHROUGH" connection-mark=voip connection-rate=0-512k disabled=no new-packet-mark=("up_p1_interactive_".$TREE) passthrough=no protocol=udp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="For the voip connection mark - 0-512k set to p1_interactive with NO PASSTHROUGH" connection-mark=voip connection-rate=0-512k disabled=no new-packet-mark=("dn_p1_interactive_".$TREE) passthrough=no protocol=udp in-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="NTP is set at p1_interactive." disabled=no dst-port=123 new-packet-mark=("dn_p1_interactive_".$TREE) passthrough=no protocol=udp src-port=123 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="NTP is set at p1_interactive." disabled=no new-packet-mark=("up_p1_interactive_".$TREE) passthrough=no protocol=udp dst-port=123 out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="WINBOX p1_interactive NO PASSTHROUGH" disabled=no new-packet-mark=("dn_p1_interactive_".$TREE) passthrough=no protocol=tcp src-port=8291 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="WINBOX p1_interactive NO PASSTHROUGH" disabled=no dst-port=8291 new-packet-mark=("up_p1_interactive_".$TREE) passthrough=no protocol=tcp out-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="### SITE SPECIFIC ADDRESS LIST ### p2_interactive NO PASSTHROUGH" disabled=no dst-address-list=site-specific new-packet-mark=("up_p2_interactive_".$TREE) passthrough=no out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="### SITE SPECIFIC ADDRESS LIST ### p2_interactive NO PASSTHROUGH" disabled=no new-packet-mark=("dn_p2_interactive_".$TREE) passthrough=no src-address-list=site-specific in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="Game Server IPs (games) p2_interactive NO PASSTHROUGH" disabled=no dst-address-list=games new-packet-mark=("up_p2_interactive_".$TREE) passthrough=no out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="Game Server IPs (games) p2_interactive NO PASSTHROUGH" disabled=no new-packet-mark=("dn_p2_interactive_".$TREE) passthrough=no src-address-list=games in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="RDP/VNC 0-1Mbps set at p2_interactive NO PASSTHROUGH" connection-rate=0-1M disabled=no dst-port=3389,5900 new-packet-mark=("up_p2_interactive_".$TREE) passthrough=no protocol=tcp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="RDP/VNC 0-1Mbps set at p2_interactive NO PASSTHROUGH" connection-rate=0-1M disabled=no new-packet-mark=("dn_p2_interactive_".$TREE) passthrough=no protocol=tcp src-port=3389,5900 in-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="RDP/VNC 0-1Mbps set at p2_interactive NO PASSTHROUGH" connection-rate=0-1M disabled=no new-packet-mark=("dn_p2_interactive_".$TREE) passthrough=no protocol=tcp src-port=3389,5900 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="Steam (games) 0-256k down p2_interactive NO PASSTHROUGH" connection-rate=0-256k disabled=no dst-port=27000-28999 new-packet-mark=("up_p2_interactive_".$TREE) passthrough=no protocol=udp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="Steam (games) 0-256k up p2_interactive NO PASSTHROUGH" connection-rate=0-256k disabled=no new-packet-mark=("dn_p2_interactive_".$TREE) passthrough=no protocol=udp src-port=27000-27015 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="Runes of Magic (games) 0-256k down p2_interactive NO PASSTHROUGH" connection-rate=0-256k disabled=no dst-port=21002,16401-16402,16502 new-packet-mark=up_p2_interactive_wan out-interface=$QOSINTERFACE passthrough=no protocol=tcp
add action=mark-packet chain=prerouting comment="Runes of Magic (games) 0-256k up p2_interactive NO PASSTHROUGH" connection-rate=0-256k disabled=no in-interface=$QOSINTERFACE new-packet-mark=dn_p2_interactive_wan passthrough=no protocol=udp src-port=21002,16401-16402,16502
add action=mark-packet chain=postrouting comment="GunZ (games) 0-256k down p2_interactive NO PASSTHROUGH" connection-rate=0-256k disabled=no dst-port=7700-7800 new-packet-mark=("up_p2_interactive_".$TREE) passthrough=no protocol=udp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="GunZ (games) 0-256k up p2_interactive NO PASSTHROUGH" connection-rate=0-256k disabled=no new-packet-mark=("dn_p2_interactive_".$TREE) passthrough=no protocol=udp src-port=7700-7800 in-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="Trickster Online (games) 0-128k up p2_interactive NO PASSTHROUGH" connection-rate=0-128k disabled=no new-packet-mark=("dn_p2_interactive_".$TREE) passthrough=no protocol=tcp src-port=10006,13339,22006 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="Trickster Online (games) 0-128k down p2_interactive NO PASSTHROUGH" connection-rate=0-128k disabled=no dst-port=10006,13339,22006 new-packet-mark=("up_p2_interactive_".$TREE) passthrough=no protocol=tcp out-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="Battle.net (games) 0-128k p2_interactive NO PASSTHROUGH" connection-rate=0-128k disabled=no dst-port=6112-6119 new-packet-mark=("up_p2_interactive_".$TREE) passthrough=no protocol=udp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="Battle.net (games) 0-128k p2_interactive NO PASSTHROUGH" connection-rate=0-128k disabled=no new-packet-mark=("dn_p2_interactive_".$TREE) passthrough=no protocol=udp src-port=6112-6119 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="Warcraft 3 and WoW 0-128k (games) p2_interactive NO PASSTHROUGH" connection-rate=0-128k disabled=no dst-port=6112-6119 new-packet-mark=("up_p2_interactive_".$TREE) passthrough=no protocol=tcp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="Warcraft 3 and WoW 0-512k (games) p2_interactive NO PASSTHROUGH" connection-rate=0-512k disabled=no new-packet-mark=("dn_p2_interactive_".$TREE) passthrough=no protocol=tcp src-port=6112-6119 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="World of Warcraft (games) 0-128k up p2_interactive NO PASSTHROUGH" connection-rate=0-128k disabled=no dst-port=1119 new-packet-mark=("up_p2_interactive_".$TREE) passthrough=no protocol=tcp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="World of Warcraft (games) 0-512k down p2_interactive NO PASSTHROUGH" connection-rate=0-512k disabled=no new-packet-mark=("dn_p2_interactive_".$TREE) passthrough=no protocol=tcp src-port=1119 in-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="World of Warcraft (games) 0-512k down p2_interactive NO PASSTHROUGH" connection-rate=0-512k disabled=no new-packet-mark=("dn_p2_interactive_".$TREE) passthrough=no protocol=tcp src-port=3724 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="World of Warcraft (games) 0-128k up p2_interactive NO PASSTHROUGH" connection-rate=0-128k disabled=no dst-port=3724 new-packet-mark=("up_p2_interactive_".$TREE) passthrough=no protocol=tcp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="EVE Online (games) 0-512k down p2_interactive NO PASSTHROUGH" connection-rate=0-512k disabled=no new-packet-mark=("dn_p2_interactive_".$TREE) passthrough=no protocol=tcp src-port=26000 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="EVE Online (games) 0-512k up p2_interactive NO PASSTHROUGH" connection-rate=0-128k disabled=no dst-port=26000 new-packet-mark=("up_p2_interactive_".$TREE) passthrough=no protocol=tcp out-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="Garena 0-128k (games) p2_interactive NO PASSTHROUGH" connection-rate=0-128k disabled=no dst-port=1513 new-packet-mark=("up_p2_interactive_".$TREE) passthrough=no protocol=udp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="Garena 0-128k (games) p2_interactive NO PASSTHROUGH" connection-rate=0-128k disabled=no new-packet-mark=("dn_p2_interactive_".$TREE) passthrough=no protocol=udp src-port=1513 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="Garena 0-128k (games) p2_interactive NO PASSTHROUGH" connection-rate=0-128k disabled=no dst-port=7456 new-packet-mark=("up_p2_interactive_".$TREE) passthrough=no protocol=tcp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="Garena 0-128k (games) p2_interactive NO PASSTHROUGH" connection-rate=0-128k disabled=no new-packet-mark=("dn_p2_interactive_".$TREE) passthrough=no protocol=tcp src-port=7456 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="Garena 0-128k (games) p2_interactive NO PASSTHROUGH" connection-rate=0-128k disabled=no dst-port=8687 new-packet-mark=("up_p2_interactive_".$TREE) passthrough=no protocol=tcp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="Garena 0-128k (games) p2_interactive NO PASSTHROUGH" connection-rate=0-128k disabled=no new-packet-mark=("dn_p2_interactive_".$TREE) passthrough=no protocol=tcp src-port=8687 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="Lineage 0-128k (games) p2_interactive NO PASSTHROUGH" connection-rate=0-128k disabled=no dst-port=2000,2003 new-packet-mark=("up_p2_interactive_".$TREE) passthrough=no protocol=tcp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="Lineage 0-128k (games) p2_interactive NO PASSTHROUGH" connection-rate=0-128k disabled=no new-packet-mark=("dn_p2_interactive_".$TREE) passthrough=no protocol=tcp src-port=2000,2003 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="PlayStation Network (games) 0-128k up p2_interactive NO PASSTHROUGH" connection-rate=0-128k disabled=no dst-port=3478,3479,3658 new-packet-mark=("up_p2_interactive_".$TREE) passthrough=no protocol=udp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="PlayStation Network (games) 0-256k down p2_interactive NO PASSTHROUGH" connection-rate=0-256k disabled=no new-packet-mark=("dn_p2_interactive_".$TREE) passthrough=no protocol=udp src-port=3478,3479,3658 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="PlayStation Network (games) 0-128k up p2_interactive NO PASSTHROUGH" connection-rate=0-128k disabled=no dst-port=5223 new-packet-mark=("up_p2_interactive_".$TREE) passthrough=no protocol=tcp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="PlayStation Network (games) 0-256k down p2_interactive NO PASSTHROUGH" connection-rate=0-256k disabled=no new-packet-mark=("dn_p2_interactive_".$TREE) passthrough=no protocol=tcp src-port=5223 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="Xbox Live (games) p2_interactive NO PASSTHROUGH" disabled=no dst-port=3074 new-packet-mark=("up_p2_interactive_".$TREE) passthrough=no protocol=udp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="Xbox Live (games) p2_interactive NO PASSTHROUGH" disabled=no new-packet-mark=("dn_p2_interactive_".$TREE) passthrough=no protocol=udp src-port=3074 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="Xbox Live (games) p2_interactive NO PASSTHROUGH" disabled=no dst-port=3074 new-packet-mark=("up_p2_interactive_".$TREE) passthrough=no protocol=tcp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="Xbox Live (games) p2_interactive NO PASSTHROUGH" disabled=no new-packet-mark=("dn_p2_interactive_".$TREE) passthrough=no protocol=tcp src-port=3074 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="Guild Wars (games) 0-1024k up p2_interactive NO PASSTHROUGH" connection-rate=0-1024k disabled=no dst-port=6112,6600 new-packet-mark=("up_p2_interactive_".$TREE) passthrough=no protocol=tcp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="Guild Wars (games) 0-2048k down p2_interactive NO PASSTHROUGH" connection-rate=0-2048k disabled=no new-packet-mark=("dn_p2_interactive_".$TREE) passthrough=no protocol=tcp src-port=6112,6600 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="Company of Heroes (games) 0-128k up p2_interactive NO PASSTHROUGH" connection-rate=0-128k disabled=no dst-port=30260 new-packet-mark=("up_p2_interactive_".$TREE) passthrough=no protocol=udp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="Company of Heroes (games) 0-128k down p2_interactive NO PASSTHROUGH" connection-rate=0-128k disabled=no new-packet-mark=("dn_p2_interactive_".$TREE) passthrough=no protocol=udp src-port=30260 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="Heroes of Newerth (games) 0-128k up p2_interactive NO PASSTHROUGH" connection-rate=0-128k disabled=no dst-port=11235-11335 new-packet-mark=("up_p2_interactive_".$TREE) passthrough=no protocol=udp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="Heroes of Newerth (games) 0-128k down p2_interactive NO PASSTHROUGH" connection-rate=0-128k disabled=no new-packet-mark=("dn_p2_interactive_".$TREE) passthrough=no protocol=udp src-port=11235-11335 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="Heroes of Newerth (games) 0-128k up p2_interactive NO PASSTHROUGH" connection-rate=0-128k disabled=no dst-port=11031 new-packet-mark=("up_p2_interactive_".$TREE) passthrough=no protocol=tcp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="Heroes of Newerth (games) 0-128k down p2_interactive NO PASSTHROUGH" connection-rate=0-128k disabled=no new-packet-mark=("dn_p2_interactive_".$TREE) passthrough=no protocol=tcp src-port=11031 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="AVA (games) 0-128k p2_interactive NO PASSTHROUGH" connection-rate=0-128k disabled=no dst-port=28004 new-packet-mark=("up_p2_interactive_".$TREE) passthrough=no protocol=tcp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="AVA (games) 0-128k p2_interactive NO PASSTHROUGH" connection-rate=0-128k disabled=no new-packet-mark=("dn_p2_interactive_".$TREE) passthrough=no protocol=tcp src-port=28004 in-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="World of Warcraft (games) 0-256k down p2_interactive NO PASSTHROUGH" connection-rate=0-256k disabled=no new-packet-mark=("dn_p2_interactive_".$TREE) passthrough=no protocol=tcp src-port=3724 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="World of Warcraft (games) 0-128k up p2_interactive NO PASSTHROUGH" connection-rate=0-128k disabled=no dst-port=3724 new-packet-mark=("up_p2_interactive_".$TREE) passthrough=no protocol=tcp out-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="Steam (codMW2) PS3 0-128k p2_interactive NO PASSTHROUGH" connection-rate=0-128k disabled=no dst-port=5223,3074 new-packet-mark=("up_p2_interactive_".$TREE) passthrough=no protocol=tcp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="Steam (codMW2) PS3 0-128k p2_interactive NO PASSTHROUGH" connection-rate=0-256k disabled=no new-packet-mark=("dn_p2_interactive_".$TREE) passthrough=no protocol=tcp src-port=5223,3074 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="Steam (codMW2) PS3 0-128k p2_interactive NO PASSTHROUGH" connection-rate=0-128k disabled=no dst-port=2005,3074,3075 new-packet-mark=("up_p2_interactive_".$TREE) passthrough=no protocol=udp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="Steam (codMW2) PS3 0-128k p2_interactive NO PASSTHROUGH" connection-rate=0-256k disabled=no new-packet-mark=("dn_p2_interactive_".$TREE) passthrough=no protocol=udp src-port=2005,3074,3075 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="Steam (codMW2) 0-64k down p2_interactive NO PASSTHROUGH" connection-rate=0-64k disabled=no dst-port=1500,3005,3101,28960 new-packet-mark=("up_p2_interactive_".$TREE) passthrough=no protocol=udp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="Steam (codMW2) 0-64k up p2_interactive NO PASSTHROUGH" connection-rate=0-64k disabled=no new-packet-mark=("dn_p2_interactive_".$TREE) passthrough=no protocol=udp src-port=1500,3005,3101,28960 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="BFBC2 (games) p2_interactive NO PASSTHROUGH" disabled=no dst-port=18390,18395,13505 new-packet-mark=("up_p2_interactive_".$TREE) passthrough=no protocol=tcp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="BFBC2 (games) p2_interactive NO PASSTHROUGH" disabled=no new-packet-mark=("dn_p2_interactive_".$TREE) passthrough=no protocol=tcp src-port=18390,18395,13505 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="BFBC2 (games) p2_interactive NO PASSTHROUGH" disabled=no dst-port=18395 new-packet-mark=("up_p2_interactive_".$TREE) passthrough=no protocol=udp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="BFBC2 (games) p2_interactive NO PASSTHROUGH" disabled=no new-packet-mark=("dn_p2_interactive_".$TREE) passthrough=no protocol=udp src-port=18395 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="Requiem Online 0-256k (games) p2_interactive NO PASSTHROUGH" connection-rate=0-256k disabled=no dst-port=7110,7230 new-packet-mark=("up_p2_interactive_".$TREE) passthrough=no protocol=tcp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="Requiem Online 0-256k (games) p2_interactive NO PASSTHROUGH" connection-rate=0-256k disabled=no new-packet-mark=("dn_p2_interactive_".$TREE) passthrough=no protocol=tcp src-port=7230,7110 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="Crysis 2 (games) p2_interactive NO PASSTHROUGH" connection-rate=0-128k disabled=no dst-port=64100 new-packet-mark=("up_p2_interactive_".$TREE) passthrough=no protocol=tcp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="Crysis 2 (games) p2_interactive NO PASSTHROUGH" connection-rate=0-128k disabled=no new-packet-mark=("dn_p2_interactive_".$TREE) passthrough=no protocol=tcp src-port=64100 in-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="UT3 (games) 0-128k down p2_interactive NO PASSTHROUGH" connection-rate=0-128k disabled=no new-packet-mark=("dn_p2_interactive_".$TREE) passthrough=no protocol=udp src-port=7777,3783 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="UT3 (games) 0-128k up p2_interactive NO PASSTHROUGH" connection-rate=0-128k disabled=no dst-port=7777,3783 new-packet-mark=("up_p2_interactive_".$TREE) passthrough=no protocol=udp out-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="Rift (games) 0-128k down p2_interactive NO PASSTHROUGH" connection-rate=0-128k disabled=no dst-port=6520-6540 new-packet-mark=("up_p2_interactive_".$TREE) passthrough=no protocol=tcp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="Rift (games) 0-128k up p2_interactive NO PASSTHROUGH" connection-rate=0-128k disabled=no new-packet-mark=("dn_p2_interactive_".$TREE) passthrough=no protocol=tcp src-port=6520-6540 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="Red Alert 3 (games) p2_interactive NO PASSTHROUGH" connection-rate=0-128k disabled=no dst-port=4321,6660-6669,28900,29900,2901 new-packet-mark=("up_p2_interactive_".$TREE) passthrough=no protocol=udp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="Red Alert 3 (games) p2_interactive NO PASSTHROUGH" connection-rate=0-128k disabled=no new-packet-mark=("dn_p2_interactive_".$TREE) passthrough=no protocol=udp src-port=4321,6660-6669,28900,29900,2901 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="Red Alert 3 (games) p2_interactive NO PASSTHROUGH" connection-rate=0-128k disabled=no dst-port=6515,6500,13139,27900  new-packet-mark=("up_p2_interactive_".$TREE) passthrough=no protocol=tcp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="Red Alert 3 (games) p2_interactive NO PASSTHROUGH" connection-rate=0-128k disabled=no new-packet-mark=("dn_p2_interactive_".$TREE) passthrough=no protocol=tcp src-port=6515,6500,13139,27900 in-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="Freelancer (games) 0-256k down p2_interactive NO PASSTHROUGH" connection-rate=0-256k disabled=no new-packet-mark=("dn_p2_interactive_".$TREE) passthrough=no protocol=udp src-port=2302-2304 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="Freelancer (games) 0-128k up p2_interactive NO PASSTHROUGH" connection-rate=0-128k disabled=no dst-port=2302-2304 new-packet-mark=("up_p2_interactive_".$TREE) passthrough=no protocol=udp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="Minecraft (games) 0-512k down p2_interactive NO PASSTHROUGH" connection-rate=0-512k disabled=no new-packet-mark=("dn_p2_interactive_".$TREE) passthrough=no protocol=tcp src-port=25565 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="Minecraft (games) 0-128k up p2_interactive NO PASSTHROUGH" connection-rate=0-128k disabled=no dst-port=25565 new-packet-mark=("up_p2_interactive_".$TREE) passthrough=no protocol=tcp out-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="SSH 0-256k up p2_interactive NO PASSTHROUGH" connection-rate=0-256k disabled=no dst-port=22 new-packet-mark=("up_p2_interactive_".$TREE) passthrough=no protocol=tcp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="SSH 0-256k down p2_interactive NO PASSTHROUGH" connection-rate=0-256k disabled=no new-packet-mark=("dn_p2_interactive_".$TREE) passthrough=no protocol=tcp src-port=22 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="ICQ p2_interactive NO PASSTHROUGH" disabled=no dst-port=5190 new-packet-mark=("up_p2_interactive_".$TREE) passthrough=no protocol=tcp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="ICQ p2_interactive NO PASSTHROUGH" disabled=no new-packet-mark=("dn_p2_interactive_".$TREE) passthrough=no protocol=tcp src-port=5190 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="MSN p2_interactive NO PASSTHROUGH" disabled=no dst-port=1863 new-packet-mark=("up_p2_interactive_".$TREE) passthrough=no protocol=tcp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="MSN p2_interactive NO PASSTHROUGH" disabled=no new-packet-mark=("dn_p2_interactive_".$TREE) passthrough=no protocol=tcp src-port=1863 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="NateON (Messenger) 0-128k p2_interactive NO PASSTHROUGH" connection-rate=0-128k disabled=no dst-port=5004 new-packet-mark=("up_p2_interactive_".$TREE) passthrough=no protocol=tcp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="NateON (Messenger) 0-128k p2_interactive NO PASSTHROUGH" connection-rate=0-128k disabled=no new-packet-mark=("dn_p2_interactive_".$TREE) passthrough=no protocol=tcp src-port=5004 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="telnet 0-64k up p2_interactive NO PASSTHROUGH" connection-rate=0-64k disabled=no dst-port=23 new-packet-mark=("up_p2_interactive_".$TREE) passthrough=no protocol=tcp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="telnet 0-64k down p2_interactive NO PASSTHROUGH" connection-rate=0-64k disabled=no new-packet-mark=("dn_p2_interactive_".$TREE) passthrough=no protocol=tcp src-port=23 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="IPSEC-ESP - Set for p3_interactive with PASSTHROUGH" disabled=no new-packet-mark=("up_p3_interactive_".$TREE) passthrough=yes protocol=ipsec-esp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="IPSEC-ESP - Set for p3_interactive with PASSTHROUGH" disabled=no new-packet-mark=("dn_p3_interactive_".$TREE) passthrough=yes protocol=ipsec-esp in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="IPSEC-AH - Set for p3_interactive with PASSTHROUGH" disabled=no new-packet-mark=("up_p3_interactive_".$TREE) passthrough=yes protocol=ipsec-ah out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="IPSEC-AH - Set for p3_interactive with PASSTHROUGH" disabled=no new-packet-mark=("dn_p3_interactive_".$TREE) passthrough=yes protocol=ipsec-ah in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="IPSEC NAT-Traversal p3_interactive NO PASSTHROUGH" disabled=no dst-port=4500 new-packet-mark=("up_p3_interactive_".$TREE) passthrough=no protocol=udp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="IPSEC NAT-Traversal p3_interactive NO PASSTHROUGH" disabled=no new-packet-mark=("dn_p3_interactive_".$TREE) passthrough=no protocol=udp src-port=4500 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="This will match Hulu and similar streams - p6_interactive NO PASSTHROUGH" disabled=no dst-port=1935 new-packet-mark=("up_p6_interactive_".$TREE) passthrough=no protocol=tcp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="This will match Hulu and similar streams - p6_interactive NO PASSTHROUGH" disabled=no new-packet-mark=("dn_p6_interactive_".$TREE) passthrough=no protocol=tcp src-port=1935 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="RTSP (Real time streaming protocol) set at p6_interactive NO PASSTHROUGH" disabled=no dst-port=554 new-packet-mark=("up_p6_interactive_".$TREE) passthrough=no protocol=tcp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="RTSP (Real time streaming protocol) set at p6_interactive NO PASSTHROUGH" disabled=no new-packet-mark=("dn_p6_interactive_".$TREE) passthrough=no protocol=tcp src-port=554 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="RTSP (Real time streaming protocol) set at p6_interactive NO PASSTHROUGH" disabled=no dst-port=554 new-packet-mark=("up_p6_interactive_".$TREE) passthrough=no protocol=udp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="RTSP (Real time streaming protocol) set at p6_interactive NO PASSTHROUGH" disabled=no new-packet-mark=("dn_p6_interactive_".$TREE) passthrough=no protocol=udp src-port=554 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="Pop3 - Set at p4_interactive with NO PASSTHROUGH" disabled=no dst-port=110 new-packet-mark=("up_p4_interactive_".$TREE) passthrough=no protocol=tcp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="Pop3 - Set at p4_interactive with NO PASSTHROUGH" disabled=no new-packet-mark=("dn_p4_interactive_".$TREE) passthrough=no protocol=tcp src-port=110 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="SMTP traffic will be p4_interactive by default NO PASSTHROUGH " disabled=no dst-port=25 new-packet-mark=("up_p4_interactive_".$TREE) passthrough=no protocol=tcp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="SMTP traffic will be p4_interactive by default NO PASSTHROUGH " disabled=no new-packet-mark=("dn_p4_interactive_".$TREE) passthrough=no protocol=tcp src-port=25 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="Secure SMTP - Set at p4_interactive with NO PASSTHROUGH" disabled=no dst-port=465 new-packet-mark=("up_p4_interactive_".$TREE) passthrough=no protocol=tcp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="Secure SMTP - Set at p4_interactive with NO PASSTHROUGH" disabled=no new-packet-mark=("dn_p4_interactive_".$TREE) passthrough=no protocol=tcp src-port=465 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="Secure IMAP- Set at p4_interactive with NO PASSTHROUGH" disabled=no dst-port=485 new-packet-mark=("up_p4_interactive_".$TREE) passthrough=no protocol=tcp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="Secure IMAP- Set at p4_interactive with NO PASSTHROUGH" disabled=no new-packet-mark=("dn_p4_interactive_".$TREE) passthrough=no protocol=tcp src-port=485 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="IMAP over SSL- Set at p4_interactive with NO PASSTHROUGH" disabled=no dst-port=993 new-packet-mark=("up_p4_interactive_".$TREE) passthrough=no protocol=tcp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="IMAP over SSL- Set at p4_interactive with NO PASSTHROUGH" disabled=no new-packet-mark=("dn_p4_interactive_".$TREE) passthrough=no protocol=tcp src-port=993 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="IMAP - Set at p4_interactive with NO PASSTHROUGH" disabled=no dst-port=143 new-packet-mark=("up_p4_interactive_".$TREE) passthrough=no protocol=tcp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="IMAP - Set at p4_interactive with NO PASSTHROUGH" disabled=no new-packet-mark=("dn_p4_interactive_".$TREE) passthrough=no protocol=tcp src-port=143 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="POP3 over SSL- Set at p4_interactive with NO PASSTHROUGH" disabled=no dst-port=995 new-packet-mark=("up_p4_interactive_".$TREE) passthrough=no protocol=tcp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="POP3 over SSL- Set at p4_interactive with NO PASSTHROUGH" disabled=no new-packet-mark=("dn_p4_interactive_".$TREE) passthrough=no protocol=tcp src-port=995 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="Subversion - Set at p4_interactive with NO PASSTHROUGH" disabled=no dst-port=3690 new-packet-mark=("up_p4_interactive_".$TREE) passthrough=no protocol=tcp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="Subversion - Set at p4_interactive with NO PASSTHROUGH" disabled=no new-packet-mark=("dn_p4_interactive_".$TREE) passthrough=no protocol=tcp src-port=3690 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="SNMP set at p4_interactive NO PASSTHROUGH" disabled=no dst-port=161 new-packet-mark=("up_p4_interactive_".$TREE) passthrough=no protocol=udp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="SNMP set at p4_interactive NO PASSTHROUGH" disabled=no new-packet-mark=("dn_p4_interactive_".$TREE) passthrough=no protocol=udp src-port=161 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="OpenVPN set at p4_interactive NO PASSTHROUGH" disabled=no dst-port=1194 new-packet-mark=("up_p4_interactive_".$TREE) passthrough=no protocol=udp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="OpenVPN set at p4_interactive NO PASSTHROUGH" disabled=no new-packet-mark=("dn_p4_interactive_".$TREE) passthrough=no protocol=udp src-port=1194 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="Steam (login) 0-128k p4_interactive NO PASSTHROUGH" connection-rate=0-128k disabled=no dst-port=27014-27050 new-packet-mark=("up_p4_interactive_".$TREE) passthrough=no protocol=tcp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="Steam (login) 0-128k p4_interactive NO PASSTHROUGH" connection-rate=0-128k disabled=no new-packet-mark=("dn_p4_interactive_".$TREE) passthrough=no protocol=tcp src-port=27014-27050 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="Steam (downloads) p2_noninteractive NO PASSTHROUGH" disabled=no dst-port=27014-27050 new-packet-mark=("up_p2_noninteractive_".$TREE) passthrough=no protocol=tcp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="Steam (downloads) p2_noninteractive NO PASSTHROUGH" disabled=no new-packet-mark=("dn_p2_noninteractive_".$TREE) passthrough=no protocol=tcp src-port=27014-27050 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="NNTP is set at p7_noninteractive, NO PASSTHROUGH" disabled=no dst-port=119 new-packet-mark=("up_p7_noninteractive_".$TREE) passthrough=no protocol=tcp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="NNTP is set at p7_noninteractive, NO PASSTHROUGH" disabled=no new-packet-mark=("dn_p7_noninteractive_".$TREE) passthrough=no protocol=tcp src-port=119 in-interface=$QOSINTERFACE
add action=mark-packet chain=postrouting comment="NNTP - Alt port p7_noninteractive, NO PASSTHROUGH" disabled=no dst-port=433 new-packet-mark=("up_p7_noninteractive_".$TREE) passthrough=no protocol=tcp out-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="NNTP - Alt port p7_noninteractive, NO PASSTHROUGH" disabled=no new-packet-mark=("dn_p7_noninteractive_".$TREE) passthrough=no protocol=tcp src-port=433 in-interface=$QOSINTERFACE
add action=mark-packet chain=prerouting comment="http download will be treated as dn_p3_interactive" disabled=no src-port=80,443,8080 protocol=tcp in-interface=$QOSINTERFACE new-packet-mark=("dn_p3_interactive_".$TREE) passthrough=no
add action=mark-packet chain=postrouting comment="http upload will be treated as up_p3_interactive" disabled=no dst-port=80,443,8080 protocol=tcp out-interface=$QOSINTERFACE new-packet-mark=("up_p3_interactive_".$TREE) passthrough=no
add action=log chain=notes comment="End QoS tree" disabled=no log-prefix=""
 
#Queue Type:
/queue type
add kind=pcq name=("Download_".$TREE) pcq-classifier=dst-address pcq-limit=50 pcq-rate=$"PCQDOWNLOD" pcq-total-limit=25000
add kind=pcq name=("Upload_".$TREE) pcq-classifier=src-address pcq-limit=50 pcq-rate=$"PCQUPLOAD" pcq-total-limit=25000
 
#Queue Tree:
/queue tree
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=$"MAXDOWNLOAD" name=("Download_".$TREE) parent=global priority=1
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=$"MAXUPLOAD" name=("Upload_".$TREE) parent=global priority=1
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=$"MAXDLINT" max-limit=$"MAXDOWNLOAD" name=("DN_Interactive_".$TREE) parent=("Download_".$TREE) priority=1
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=$"MAXDLNONINT" max-limit=$"MAXDOWNLOAD" name=("DN_NonInteractive_".$TREE) parent=("Download_".$TREE) priority=8
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=$"MAXUPINT" max-limit=$"MAXUPLOAD" name=("UP_Interactive_".$TREE) parent=("Upload_".$TREE) priority=1
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=$"MAXUPNONINT" max-limit=$"MAXUPLOAD" name=("UP_NonInteractive_".$TREE) parent=("Upload_".$TREE) priority=8
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=("down_p1_interactive_".$TREE) packet-mark=("dn_p1_interactive_".$TREE) parent=("DN_Interactive_".$TREE) priority=1 queue=("Download_".$TREE)
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=("down_p2_interactive_".$TREE) packet-mark=("dn_p2_interactive_".$TREE) parent=("DN_Interactive_".$TREE) priority=2 queue=("Download_".$TREE)
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=("down_p3_interactive_".$TREE) packet-mark=("dn_p3_interactive_".$TREE) parent=("DN_Interactive_".$TREE) priority=3 queue=("Download_".$TREE)
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=("down_p4_interactive_".$TREE) packet-mark=("dn_p4_interactive_".$TREE) parent=("DN_Interactive_".$TREE) priority=4 queue=("Download_".$TREE)
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=("down_p5_interactive_".$TREE) packet-mark=("dn_p5_interactive_".$TREE) parent=("DN_Interactive_".$TREE) priority=5 queue=("Download_".$TREE)
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=("down_p6_interactive_".$TREE) packet-mark=("dn_p6_interactive_".$TREE) parent=("DN_Interactive_".$TREE) priority=6 queue=("Download_".$TREE)
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=("down_p7_interactive_".$TREE) packet-mark=("dn_p7_interactive_".$TREE) parent=("DN_Interactive_".$TREE) priority=7 queue=("Download_".$TREE)
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=("down_p8_interactive_".$TREE) packet-mark=("dn_p8_interactive_".$TREE) parent=("DN_Interactive_".$TREE) priority=8 queue=("Download_".$TREE)
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=("down_p1_noninteractive_".$TREE) packet-mark=("dn_p1_noninteractive_".$TREE) parent=("DN_NonInteractive_".$TREE) priority=1 queue=("Download_".$TREE)
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=("down_p2_noninteractive_".$TREE) packet-mark=("dn_p2_noninteractive_".$TREE) parent=("DN_NonInteractive_".$TREE) priority=2 queue=("Download_".$TREE)
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=("down_p3_noninteractive_".$TREE) packet-mark=("dn_p3_noninteractive_".$TREE) parent=("DN_NonInteractive_".$TREE) priority=3 queue=("Download_".$TREE)
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=("down_p4_noninteractive_".$TREE) packet-mark=("dn_p4_noninteractive_".$TREE) parent=("DN_NonInteractive_".$TREE) priority=4 queue=("Download_".$TREE)
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=("down_p5_noninteractive_".$TREE) packet-mark=("dn_p5_noninteractive_".$TREE) parent=("DN_NonInteractive_".$TREE) priority=5 queue=("Download_".$TREE)
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=("down_p6_noninteractive_".$TREE) packet-mark=("dn_p6_noninteractive_".$TREE) parent=("DN_NonInteractive_".$TREE) priority=6 queue=("Download_".$TREE)
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=("down_p7_noninteractive_".$TREE) packet-mark=("dn_p7_noninteractive_".$TREE) parent=("DN_NonInteractive_".$TREE) priority=7 queue=("Download_".$TREE)
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=("down_p8_noninteractive_".$TREE) packet-mark=("dn_p8_noninteractive_".$TREE) parent=("DN_NonInteractive_".$TREE) priority=8 queue=("Download_".$TREE)
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=("up_p1_interactive_".$TREE) packet-mark=("up_p1_interactive_".$TREE) parent=("UP_Interactive_".$TREE) priority=1 queue=("Upload_".$TREE)
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=("up_p2_interactive_".$TREE) packet-mark=("up_p2_interactive_".$TREE) parent=("UP_Interactive_".$TREE) priority=2 queue=("Upload_".$TREE)
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=("up_p3_interactive_".$TREE) packet-mark=("up_p3_interactive_".$TREE) parent=("UP_Interactive_".$TREE) priority=3 queue=("Upload_".$TREE)
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=("up_p4_interactive_".$TREE) packet-mark=("up_p4_interactive_".$TREE) parent=("UP_Interactive_".$TREE) priority=4 queue=("Upload_".$TREE)
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=("up_p5_interactive_".$TREE) packet-mark=("up_p5_interactive_".$TREE) parent=("UP_Interactive_".$TREE) priority=5 queue=("Upload_".$TREE)
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=("up_p6_interactive_".$TREE) packet-mark=("up_p6_interactive_".$TREE) parent=("UP_Interactive_".$TREE) priority=6 queue=("Upload_".$TREE)
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=("up_p7_interactive_".$TREE) packet-mark=("up_p7_interactive_".$TREE) parent=("UP_Interactive_".$TREE) priority=7 queue=("Upload_".$TREE)
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=("up_p8_interactive_".$TREE) packet-mark=("up_p8_interactive_".$TREE) parent=("UP_Interactive_".$TREE) priority=8 queue=("Upload_".$TREE)
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=("up_p1_noninteractive_".$TREE) packet-mark=("up_p1_noninteractive_".$TREE) parent=("UP_NonInteractive_".$TREE) priority=1 queue=("Upload_".$TREE)
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=("up_p2_noninteractive_".$TREE) packet-mark=("up_p2_noninteractive_".$TREE) parent=("UP_NonInteractive_".$TREE) priority=2 queue=("Upload_".$TREE)
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=("up_p3_noninteractive_".$TREE) packet-mark=("up_p3_noninteractive_".$TREE) parent=("UP_NonInteractive_".$TREE) priority=3 queue=("Upload_".$TREE)
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=("up_p4_noninteractive_".$TREE) packet-mark=("up_p4_noninteractive_".$TREE) parent=("UP_NonInteractive_".$TREE) priority=4 queue=("Upload_".$TREE)
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=("up_p5_noninteractive_".$TREE) packet-mark=("up_p5_noninteractive_".$TREE) parent=("UP_NonInteractive_".$TREE) priority=5 queue=("Upload_".$TREE)
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=("up_p6_noninteractive_".$TREE) packet-mark=("up_p6_noninteractive_".$TREE) parent=("UP_NonInteractive_".$TREE) priority=6 queue=("Upload_".$TREE)
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=("up_p7_noninteractive_".$TREE) packet-mark=("up_p7_noninteractive_".$TREE) parent=("UP_NonInteractive_".$TREE) priority=7 queue=("Upload_".$TREE)
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name=("up_p8_noninteractive_".$TREE) packet-mark=("up_p8_noninteractive_".$TREE) parent=("UP_NonInteractive_".$TREE) priority=8 queue=("Upload_".$TREE)
 
/system script environment
remove [ find name=QOSINTERFACE ]
remove [ find name=TREE ]
remove [ find name=PCQDOWNLOD ]
remove [ find name=PCQUPLOAD ]
remove [ find name=MAXDOWNLOAD ]
remove [ find name=MAXDLINT ]
remove [ find name=MAXDLNONINT ]
remove [ find name=MAXUPLOAD ]
remove [ find name=MAXUPINT ]
remove [ find name=MAXUPNONINT ]
 
## This is the interface to run the QOS on. This is the edge interface before traffic leaves your MikroTik :global QOSINTERFACE "ether1... Read More
Read more ...

Queue Tree Untuk Hotspot

ether1 = internet gateway (WAN)
ether2 = 192.168.10.1/24 (Hotspot) ==> dibuat dhcp
Kemudian setting hotspot (ga perlu dijelasin ya soalnya udah banyak tutorial nya kalo setting hotspot)
langsung aja :
/ip firewall mangle
add chain=prerouting action=jump jump-target=hotspot comment="Hotspot Jump Mangle"
add chain=postrouting action=jump jump-target=hotspot

add chain=prerouting action=mark-connection new-connection-mark=conn-up passthrough=yes dst-address=192.168.10.0/24 comment="Hotspot Connections"
add chain=postrouting action=mark-connection new-connection-mark=conn-down passthrough=yes src-address=192.168.10.0/24

add chain=prerouting action=mark-packet new-packet-mark=packet-up passthrough=yes connection-mark=conn-up comment="Hotspot Packets"
add chain=postrouting action=mark-packet new-packet-mark=packet-down passthrough=yes connection-mark=conn-down

add chain=prerouting action=mark-packet new-packet-mark=hotspot-up passthrough=no connection-mark=conn-up
add chain=postrouting action=mark-packet new-packet-mark=hotspot-down passthrough=no connection-mark=conn-down

Setelah mangle utama kita buat, sekarang kita akan menambahkan lagi mangle untuk memisahkan jalur browsing, download, facebook dan youtube


/ip firewall layer7-protocol
add name=Download regexp="^.*(get|GET).+\\.(exe|rar|zip|7z|cab|asf|mov|wmv|mpg|mpeg|mkv|avi|flv|pdf|wav|rm|mp3|mp4|ram|rmvb|dat|daa|iso|nrg|bin|vcd|mp2|3gp|mpe|qt|raw|wma|ogg|doc|deb|tar|bzip|gzip|gzip2|0[0-1][0-1]).*\$"
add name=Facebook regexp="^.*get.+.facebook.com.*\$|^.*get.+.zynga.com.*\$|^.*get.+.fbcdn.net.*\$"
add name=Youtube regexp="^.*get.+.c.youtube.com.*\$"
Setelah layer-7-protocol kita tambahkan, kita buat mangle nya.

/ip firewall mangle
add chain=hotspot action=mark-packet new-packet-mark=facebook passthrough=no protocol=tcp layer7-protocol=Facebook comment="Facebook"
add chain=hotspot action=mark-packet new-packet-mark=youtube passthrough=no protocol=tcp layer7-protocol=Youtube comment="Youtube"
add chain=hotspot action=mark-packet new-packet-mark=download passthrough=no protocol=tcp layer7-protocol=Download comment="Download"
 Selesai pembuatan mangle sekarang kita ubah settingan hotspot user profile nya. Disini saya memakai contoh profile Hotspot.
Click here to enlarge

 
Sekarang kita buat queue tree nya

/queue type
add name="pcq-down" kind=pcq pcq-rate=1M pcq-limit=50 pcq-classifier=dst-address pcq-total-limit=2000 pcq-burst-rate=0 pcq-burst-threshold=0 pcq-burst-time=10s pcq-src-address-mask=32 pcq-dst-address-mask=32 pcq-src-address6-mask=64 pcq-dst-address6-mask=64
add name="pcq-up" kind=pcq pcq-rate=1M pcq-limit=50 pcq-classifier=src-address pcq-total-limit=2000 pcq-burst-rate=0 pcq-burst-threshold=0 pcq-burst-time=10s pcq-src-address-mask=32 pcq-dst-address-mask=32 pcq-src-address6-mask=64 pcq-dst-address6-mask=64

/queue tree
add name="Hotspot Down" parent=global-out packet-mark="" limit-at=0 priority=8 max-limit=1M burst-limit=0 burst-threshold=0 burst-time=0s
add name="Hotspot Up" parent=global-in packet-mark="" limit-at=0 priority=8 max-limit=1M burst-limit=0 burst-threshold=0 burst-time=0s 
add name="Hotspot Browsing" parent="Hotspot Down" packet-mark=hotspot-down limit-at=256k queue=pcq-down priority=2 max-limit=1M burst-limit=0 burst-threshold=0 burst-time=0s
add name="Hotspot Facebook" parent="Hotspot Down" packet-mark=facebook limit-at=256k queue=pcq-down priority=2 max-limit=1M burst-limit=0 burst-threshold=0 burst-time=0s
add name="Hotspot Youtube" parent="Hotspot Down" packet-mark=youtube limit-at=128k queue=pcq-down priority=8 max-limit=1M burst-limit=0 burst-threshold=0 burst-time=0s
add name="Hotspot Download" parent="Hotspot Down" packet-mark=download limit-at=128k queue=pcq-down priority=8 max-limit=1M burst-limit=0 burst-threshold=0 burst-time=0s
add name="Hotspot Upload" parent="Hotspot Up" packet-mark=hotspot-up limit-at=256k queue=pcq-up priority=8 max-limit=1M burst-limit=0 burst-threshold=0 burst-time=0s
finis ether1 = internet gateway (WAN) ether2 = 192.168.10.1/24 (Hotspot) ==> dibuat dhcp Kemudian setting hotspot (ga perlu dijelasin ya so... Read More
Read more ...

MIkrotik Queue Simple Untuk Game



Menggunakan :
1 mb dedicated untuk IIX (lokal)
1 mb up to untuk IX (inter)
RB750G (RouterOS 5.7)
tanpa proxy

Untuk Mangel + beberapa port game

Code
/ip f m
 add action=mark-connection chain=forward comment=IIX connection-bytes=\
    245760-4294967295 connection-mark=!ALL.int.c disabled=no \
    dst-address-list=nice new-connection-mark=ALL.iix.c \
    packet-mark=!Game_pkt passthrough=yes protocol=tcp
add action=mark-packet chain=prerouting connection-mark=ALL.iix.c disabled=no \
    new-packet-mark=ALL.iix.p packet-mark=\
    !Game_pkt passthrough=no
add action=mark-connection chain=forward comment=INT connection-bytes=\
    245760-4294967295 disabled=no dst-address-list=!nice new-connection-mark=\
    ALL.int.c passthrough=yes protocol=tcp src-address-list=warnet
add action=mark-packet chain=prerouting connection-mark=ALL.int.c disabled=no \
    new-packet-mark=ALL.int.p passthrough=no
add action=mark-connection chain=game comment="Fifa2 Online" disabled=no \
    dst-address=202.158.252.131-202.158.252.133 dst-port=6215,6217 \
    new-connection-mark=Game passthrough=yes protocol=tcp
add action=mark-connection chain=game comment=CF disabled=no dst-port=\
    10009,13008,16666,28012 new-connection-mark=Game passthrough=yes \
    protocol=tcp
add action=mark-connection chain=game disabled=no dst-port=12020-12080,13000 \
    new-connection-mark=Game passthrough=yes protocol=udp
add action=mark-connection chain=game comment="Lost Saga" disabled=no \
    dst-address=203.89.146.0/23 dst-port=14009-14010 new-connection-mark=Game \
    passthrough=yes protocol=tcp
add action=mark-connection chain=game disabled=no dst-address=203.89.146.0/23 \
    dst-port=40000-40010 new-connection-mark=Game passthrough=yes protocol=\
    udp
add action=mark-connection chain=game comment="Point Blank" disabled=no \
    dst-address=203.89.146.0/23 dst-port=39190 new-connection-mark=Game \
    passthrough=yes protocol=tcp
add action=mark-connection chain=game disabled=no dst-address=203.89.146.0/23 \
    dst-port=40000-40010 new-connection-mark=Game passthrough=yes protocol=\
    udp
add action=mark-packet chain=game connection-mark=Game disabled=no \
    new-packet-mark=Game_pkt passthrough=no
add action=jump chain=prerouting disabled=no jump-target=game
 
/que typ
add name="pcq-Down" kind=pcq pcq-rate=0 pcq-limit=50 \
pcq-classifier=dst-address,dst-port pcq-total-limit=2000 pcq-burst-rate=0 \
pcq-burst-threshold=0 pcq-burst-time=10s pcq-src-address-mask=32 \
pcq-dst-address-mask=32 pcq-src-address6-mask=128 pcq-dst-address6-mask=128 \
add name="pcq-Up" kind=pcq pcq-rate=0 pcq-limit=50 \
pcq-classifier=src-address,src-port pcq-total-limit=2000 pcq-burst-rate=0 \
pcq-burst-threshold=0 pcq-burst-time=10s pcq-src-address-mask=32 \
pcq-dst-address-mask=32 pcq-src-address6-mask=128 pcq-dst-address6-mask=128 \
 
/que si
add name="IX" interface=Lan parent=none packet-marks=ALL.int.p direction=both \
priority=8 queue=pcq-Up/pcq-Down limit-at=0/0 max-limit=614k/614k \
burst-limit=768k/768k burst-threshold=461k/461k burst-time=15s/15s \
total-queue=default-small

add name="IIX" interface=Lan parent=none packet-marks=ALL.iix.p \
direction=both priority=8 queue=pcq-Up/pcq-Down limit-at=0/0 \
max-limit=250k/250k burst-limit=352k/352k burst-threshold=188k/188k burst-time=15s/15s \
total-queue=default-small

add name="Game" interface=Lan parent=none packet-marks=Game_pkt \
direction=both priority=1 queue=default/default limit-at=0/0 \
max-limit=0/0 burst-limit=0/0 burst-threshold=0/0 \
burst-time=0s/0s total-queue=default
Menggunakan : 1 mb dedicated untuk IIX (lokal) 1 mb up to untuk IX (inter) RB750G (RouterOS 5.7) tanpa proxy Untuk Mangel + bebera... Read More
Read more ...