Community discussions

MikroTik App
 
User avatar
kolorasta
Member
Member
Topic Author
Posts: 310
Joined: Sun Jun 25, 2006 11:55 pm
Location: Argentina

Bandwidth limit to a group of IPs. Is it possible?

Mon Jul 10, 2006 11:47 pm

i read this article (http://wiki.mikrotik.com/wiki/PCQ_Examples) and i have the following question:

is it possible to shape traffic like is shown in this image?

Image

What i want to do is assign certain speed limits for specific computers (192.168.0.30, 192.168.0.31, 192.168.0.50) and then assign certain bandwidth to a group of computers... in the picture, share 512kbps upload/512kbps download between 192.168.0.33, 192.168.0.35 and 192.168.0.40.
 
jo2jo
Forum Guru
Forum Guru
Posts: 1007
Joined: Fri May 26, 2006 1:25 am

Tue Jul 11, 2006 7:34 am

yes you need to look into firewall -> mangle rules with the action packet mark....then setup up a simple queue under "queues" to grab and shape the packets with the marking and criteria u set up in the mangle rules.
 
User avatar
sergejs
MikroTik Support
MikroTik Support
Posts: 6697
Joined: Thu Mar 31, 2005 3:33 pm
Location: Riga, Latvia
Contact:

Tue Jul 11, 2006 7:47 am

kolorasta,'ip firewall address-list' feature will help you to create user groups, and don't apply mangle rule per each user fromthe same group.
 
User avatar
kolorasta
Member
Member
Topic Author
Posts: 310
Joined: Sun Jun 25, 2006 11:55 pm
Location: Argentina

Fri Aug 18, 2006 11:35 pm

kolorasta,'ip firewall address-list' feature will help you to create user groups, and don't apply mangle rule per each user fromthe same group.
I have different clients with different services...

i have ip/mac combinations (not ppoe or something like that)

i want to make for example:
List: ip

Residential: 172.16.0.31,172.16.0.35,172.16.0.54,172.16.0.40
Corporative: 172.16.030,172.16.0.100,172.16.0.60

then i want to apply different upload/download speed and QoS to these groups... I have several goups (6 or more) and some of these groups has 40 ips or more...

in list i couldn't put ips in that way (asorted) only let me put range (172.16.0.30-172.16.0.40) or specifying subnet (172.16.0.1/21)
 
advantz
Member Candidate
Member Candidate
Posts: 187
Joined: Thu Jul 08, 2004 4:11 am

Sat Aug 19, 2006 3:41 am

It can be done with mangle + address list + queue tree

That's why I requested simple queue that can use "address-list" feature to
simplified this...
because with mangle only mark one way e.g. upstream or downstream, you need to mangle both ways
 
User avatar
fatonk
Member
Member
Posts: 438
Joined: Tue Feb 22, 2005 11:06 am
Location: Mitrovica/Kosova

Sat Aug 19, 2006 2:13 pm

It is possible to use PCQ for that kind of setup, but to be more elegant solution, it would be good that /24 subnet to assign i order like:

Residential 172.16.0.1 -> 172.16.0.30
Corporative 172.16.0.33 -> 172.16.0.60 etc and so one

with this kind of address allocation you can mangle traffic based on range (subnet), for residential 172.16.0.0/27 for corporative 172.16.0.32/27 and so one, and than you can apply the mangle rules into a queuing rule in this case PCQ type, tree.

I will post you a configuration that works for me with no problem.

Regards
 
User avatar
samsoft08
Long time Member
Long time Member
Posts: 613
Joined: Sat Nov 26, 2005 10:52 pm

Sat Aug 19, 2006 5:31 pm

because with mangle only mark one way e.g. upstream or downstream, you need to mangle both ways
i think as in the manual example , you can use PCQ for upstream and downstream by assigning dst-port and src-port in the Q type , so u have to use mangle once , it will mangle both ways at the same time .
 
User avatar
kolorasta
Member
Member
Topic Author
Posts: 310
Joined: Sun Jun 25, 2006 11:55 pm
Location: Argentina

Sat Aug 19, 2006 8:28 pm

It is possible to use PCQ for that kind of setup, but to be more elegant solution, it would be good that /24 subnet to assign i order like:

Residential 172.16.0.1 -> 172.16.0.30
Corporative 172.16.0.33 -> 172.16.0.60 etc and so one

with this kind of address allocation you can mangle traffic based on range (subnet), for residential 172.16.0.0/27 for corporative 172.16.0.32/27 and so one, and than you can apply the mangle rules into a queuing rule in this case PCQ type, tree.

I will post you a configuration that works for me with no problem.

Regards
ok ... thanks.. i wait for that configuration
 
User avatar
fatonk
Member
Member
Posts: 438
Joined: Tue Feb 22, 2005 11:06 am
Location: Mitrovica/Kosova

Sun Aug 20, 2006 12:51 am

OK, here we go :-)

This set-up works fine for me, with this configuration you can limit a p2p traffic to 56 Kbit for each IP of the subnet 172.16.0.0/27, and also the overall traffic will be limited to 128 UP and 256 DOWN and that per IP address of the above mentioned subnet. Here it is the configuration:


ip firewall mangle add chain=forward src-address=172.16.0.0/27 p2p=all-p2p action=mark-connection new-connection-mark=p2p_conn

ip firewall mangle add chain=forward src-address=172.16.0.0/27 connection-mark=p2p_conn action=mark-packet new-packet-mark=p2p

ip firewall mangle add chain=forward sr-address=172.16.0.0/27 connection-mark=!p2p_conn action=mark-packet new-packet-mark=other



queue type add name=p2p-Down kind=pcq pcq-rate=56000 pcq-limit=50 pcq-classifier=dst-address pcq-total-limit=2000

queue type add name=p2p-Up kind=pcq pcq-rate=56000 pcq-limit=50 pcq-classifier=src-address pcq-total-limit=2000

queue type add name=Down kind=pcq pcq-rate=262015 pcq-limit=50 pcq-classifier=dst-address pcq-total-limit=2000

queue type add name=Up kind=pcq pcq-rate=131072 pcq-limit=50 pcq-classifier=src-address pcq-total-limit=2000



queue tree add name=p2p-up parent=5.8Ghz packet-mark=p2p limit-at=0 queue=p2p-Up priority=8 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s

queue tree add name=p2p-Down parent=ether1 packet-mark=p2p limit-at=0 queue=p2p-Down priority=8 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s

queue tree add name=Upload parent=5.8Ghz packet-mark=other limit-at=0 queue=Up priority=1 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s

queue tree add name=Download parent=ether1 packet-mark=other limit-at=0 queue=Down priority=1 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0

Reagrads

Faton
 
User avatar
samsoft08
Long time Member
Long time Member
Posts: 613
Joined: Sat Nov 26, 2005 10:52 pm

Sun Aug 20, 2006 1:37 am

i think you should use prerouting instead of using forward in the mangle
 
yudhi
newbie
Posts: 29
Joined: Mon Mar 06, 2006 9:27 am
Location: World wide web

Mon Aug 21, 2006 5:07 pm

Guys,

I have list of IPs allocation for our country used by local ISP in local exchange (lets call IIX), then other IPs out of that list are overseas.
I want to know how to configure :
- There are 2 group of users, 256K and 512K.
- Per user (per IP) for 256K group have minimum 5 Kbps to overseas up/down, burstable to 32 Kbps up and burstable 256 Kbps down.
- Per user (per IP) for 512K group have minimum 10 Kbps to overseas up/down, burstable to 32 Kbps up and burstable 512 Kbps down.
- Per user (per IP) for both group have minimum 5 Kbps to IIX up/down, burstable to 512 Kbps up/down.

Somebody could help me, please ?
Thanks.
 
miahac
Long time Member
Long time Member
Posts: 516
Joined: Wed Dec 14, 2005 5:04 pm
Location: Wichita, KS

Thu Aug 31, 2006 5:36 am

what did you use to draw that?
 
User avatar
fatonk
Member
Member
Posts: 438
Joined: Tue Feb 22, 2005 11:06 am
Location: Mitrovica/Kosova

Thu Aug 31, 2006 9:12 am

I think it is a microsoft office visio.
 
miahac
Long time Member
Long time Member
Posts: 516
Joined: Wed Dec 14, 2005 5:04 pm
Location: Wichita, KS

Thu Aug 31, 2006 5:33 pm

oh... $$$$$
 
pecahbelah
just joined
Posts: 1
Joined: Sat Jun 17, 2006 5:01 am

Re: Bandwidth limit to a group of IPs. Is it possible?

Tue Oct 31, 2006 8:34 pm

is it possible to shape traffic like is shown in this image?

Image

What i want to do is assign certain speed limits for a group of computers... in the picture
 
User avatar
fatonk
Member
Member
Posts: 438
Joined: Tue Feb 22, 2005 11:06 am
Location: Mitrovica/Kosova

Wed Nov 01, 2006 11:34 am

Is that bandwidth for the whole group, or it is for each host in that group.

Regards

Faton
 
tralala
just joined
Posts: 21
Joined: Mon Oct 02, 2006 10:55 am

Wed Nov 01, 2006 11:35 am

There is example in the manual (just read it all).
packet mark -> queue tree with pcq rate 0
or just simple queue with pcq rate 0

Its work, but the problem is that if full bandiwth is used, ping is jumping to around 100ms for all users. So its useless, and its better to avoid it.