Community discussions

MikroTik App
 
weber
just joined
Topic Author
Posts: 7
Joined: Sun Mar 25, 2012 9:18 pm
Location: Lviv, Ukraine

Equal bandwidth to all users behind NAT

Sun Mar 25, 2012 10:45 pm

I have already read multiple topics on this forum and tried many things.

My configuration:
--------------------------------
WAN (ether1): 1.1.1.1
LAN (ether2): 192.168.8.128/25
NAT
Internet speed 6M DL/UL

I want to spread bandwidth equally between all users.
It looks like I need the following:
/ip firewall mangle add chain=prerouting action=mark-packet new-packet-mark=all-packers passthrough=no

/queue type add name="pcq-download" kind=pcq pcq-rate=0 pcq-classifier=dst-address
/queue type add name="pcq-upload" kind=pcq pcq-rate=0 pcq-classifier=src-address

/queue tree add name="Download" parent=global-in queue=pcq-download packet-mark=all max-limit=6000
/queue tree add name="Upload" parent=global-out queue=pcq-upload packet-mark=all max-limit=6000

/queue simple add queue=pcq-upload/pcq-download target-addresses=192.168.8.128/25
Correct?

If yes I can't understand the relation of mangle rule + trees to the simple queue.
There is no reference between those things except queue type but it is just a type.

Ideally it is enough:
/queue type add name="pcq-download" kind=pcq pcq-rate=0 pcq-classifier=dst-address
/queue type add name="pcq-upload" kind=pcq pcq-rate=0 pcq-classifier=src-address

/queue simple add queue=pcq-upload/pcq-download target-addresses=192.168.8.128/25
Or those trees and mangle rule with max limit creates some abstraction to limit all bandwidth using pcq to 6M?

Thank you!
My configuration is very simple but would like to know exact opinions how it should work.
 
weber
just joined
Topic Author
Posts: 7
Joined: Sun Mar 25, 2012 9:18 pm
Location: Lviv, Ukraine

Re: Equal bandwidth to all users behind NAT

Sun Mar 25, 2012 11:47 pm

Or the following is correct in my case?
Please advice.
ip firewall mangle
1 chain=prerouting action=mark-packet new-packet-mark=packets-out
passthrough=no src-address=192.168.8.128/25

2 chain=postrouting action=mark-packet new-packet-mark=packets-in
passthrough=no dst-address=192.168.8.128/25

queue type
5 name="pcq-download" kind=pcq pcq-rate=0
pcq-classifier=dst-address

6 name="pcq-upload" kind=pcq pcq-rate=0
pcq-classifier=src-address

queue tree
2 name="Upload" parent=ether1-gateway packet-mark=packets-out
queue=pcq-upload max-limit=6M

3 name="Download" parent=ether2-master-local packet-mark=packets-in
queue=pcq-download max-limit=6M
 
weber
just joined
Topic Author
Posts: 7
Joined: Sun Mar 25, 2012 9:18 pm
Location: Lviv, Ukraine

Re: Equal bandwidth to all users behind NAT

Mon Mar 26, 2012 9:45 am

I ended up with:
- with no rules and queues the traffic is balanced anyway %)
- nothing could be done against torrent.
 
weber
just joined
Topic Author
Posts: 7
Joined: Sun Mar 25, 2012 9:18 pm
Location: Lviv, Ukraine

Re: Equal bandwidth to all users behind NAT

Tue Mar 27, 2012 11:24 am

Thanks to SolarW for the post http://forum.ru-board.com/topic.cgi?for ... rt=1720#14

Three things that I have to adjust in SolarW's post in order to make it work:
- IP Firewall Address List: clients 192.168.8.128/25 instead of listing every IP;
- Queue type UP src-address-mask is 32;
- Queue type DOWN dst-address-mask is 32.

And it works smoothly.
Hope this will help someone.

Who is online

Users browsing this forum: Ahrefs [Bot], shahzaddj1 and 84 guests