Community discussions

MikroTik App
 
User avatar
CristianDeluxe
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 53
Joined: Fri Jun 05, 2009 10:59 am
Location: Spain
Contact:

How to: Queue tree and limit Mb per subnet?

Fri Oct 16, 2009 6:56 pm

Hello and sorry for my bad English

I have a 100MB ATM circuit and I need to limit 30Mb, 30Mb and 25M per subnet, but is more complicated, I need all the traffic to be marked through the mangle rules and make a priority (QOS) for each subnet in the tree queue

For example:

Subnet 1)
Ips: 1.2.0.0/28
Packet mark: Customers1.
Limit: 30Mb
Queue Tree: VoIP (pr1), Web (pr2), P2P (pr3), chat, etc ...

Subnet 2)
Ips: 1.2.4.0/28
Packet mark: Customers2.
Limit: 30Mb
Queue Tree: VoIP (pr1), Web (pr2), P2P (pr3), chat, etc ...

Subnet 3)
Ips: 1.2.6.0/28
Packet mark: Customers3.
Limit: 25Mb
Queue Tree: VoIP (pr1), Web (pr2), P2P (pr3), chat, etc ...


Mangle rules and tree structure would be the same for all subnets.

I tried to clone the trees, creating three equal and mark subnets using "Mark Routing" tool in mangle rules but no work.

How do I mark the packets per subnet and mark too their service (p2p, voip)?

Please I need help, I tried searching on the wiki and manuals, but can not find anything to help me
 
User avatar
CristianDeluxe
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 53
Joined: Fri Jun 05, 2009 10:59 am
Location: Spain
Contact:

Re: How to: Queue tree and limit Mb per subnet?

Mon Oct 19, 2009 10:42 am

Any idea how to implement this? a link, or whatever please!
 
User avatar
edgar_abraham
newbie
Posts: 40
Joined: Thu Feb 14, 2008 11:56 pm
Location: Mexicali, Mexico

Re: How to: Queue tree and limit Mb per subnet?

Mon Oct 19, 2009 9:41 pm

try this part of the manual I have been using and work great!!!!!!

This example shows how to equally share 10Mibps download and 2Mibps upload among active users in the network 192.168.0.0/24. If Host A is downloading 2 Mibps, Host B gets 8 Mibps and vice versa. There might be situations when both hosts want to use maximum bandwidth (10 Mibps), then they will receive 5 Mibps each, the same goes for upload. This setup is also valid for more than 2 users.


At first, mark all traffic, coming from local network 192.168.0.0/24 with a mark users:

/ip firewall mangle add chain=forward src-address=192.168.0.0/24 \
action=mark-connection new-connection-mark=users-con
/ip firewall mangle add connection-mark=users-con action=mark-packet \
new-packet-mark=users chain=forward
Now we will add 2 new PCQ types. The first, called pcq-download will group all traffic by destination address. As we will attach this queue type to the Local interface, it will create a dynamic queue for each destination address (user) which is downloading to the network 192.168.0.0/24. The second type, called pcq-upload will group the traffic by source address. We will attach this queue to the Public interface so it will make one dynamic queue for each user who is uploading to Internet from the local network 192.168.0.0/24.

/queue type add name=pcq-download kind=pcq pcq-classifier=dst-address
/queue type add name=pcq-upload kind=pcq pcq-classifier=src-address
Finally, make a queue tree for download traffic:

/queue tree add name=Download parent=Local max-limit=10240000
/queue tree add parent=Download queue=pcq-download packet-mark=users
And for upload traffic:

/queue tree add name=Upload parent=Public max-limit=2048000
/queue tree add parent=Upload queue=pcq-upload packet-mark=users


and then know you can make queue simple to prior traffic. voip, p2p etc.