Page 1 of 1

More question on limiting bandwidth using PCQ

Posted: Wed Nov 28, 2007 6:54 pm
by thermant
Hi all,

I've read the article from http://wiki.mikrotik.com/wiki/PCQ_Examples, and turns out that is just the thing I need for my network. Thank you for all who posted the link.

One question though. In that example, EVERY client is limited to 32k up / 64k down, right? Well, I want to allow one or two of the computers in the network (consultant stations) to have no bandwidth limit. Every clients in my network has static IP, so DHCP is off.

Is that feasible? If so, how do I go about doing it? I've been trying to read quite a number of posts on bandwidth limiting, but the more I read, the more confused I get. heh. So it would be great if someone could just kindly let me know what to type.

Thank you all.

-Ted-

Re: More question on limiting bandwidth using PCQ

Posted: Thu Nov 29, 2007 3:15 am
by Chupaka
hmmm... I think, you can add rules to Mangle to mark your counsultant's packets with some packet mark, and your queues should not queue them =)

Re: More question on limiting bandwidth using PCQ

Posted: Thu Nov 29, 2007 9:06 am
by savage
Add a mangle for the couple of IP addresses, Action = Accept, Passthrough = NO

The rule will allow the packets, and it will stop passing from the rest of the mangle rules, therefore, will be excluded from the other rules that marks the packets for PCQ.

Re: More question on limiting bandwidth using PCQ

Posted: Thu Nov 29, 2007 5:10 pm
by thermant
Thanks a lot for replying.

The thing is, I really have no idea on how to go about doing it... Sorry, I'm really new at this (I'm not a network guy...)

So anyway, according to the wiki page, I add this line first, right?
/ip firewall mangle add chain=prerouting action=mark-packet new-packet-mark=all passthrough=no
Then I added 2 queue types and 2 queue trees lines, like so:
/queue type add name="PCQ_download" kind=pcq pcq-rate=128000 pcq-classifier=dst-address
/queue type add name="PCQ_upload" kind=pcq pcq-rate=128000 pcq-classifier=src-address
/queue tree add parent=global-in queue=PCQ_download packet-mark=all
/queue tree add parent=global-out queue=PCQ_upload packet-mark=all
Am I right so far?

Let's say the consultants' stations' IP are 192.168.1.100 and 192.168.1.200. How would the new mangle rule be? And do I put it -before- or -after- the first mangle?

Thanks again, you guys.

-Ted-

Re: More question on limiting bandwidth using PCQ

Posted: Thu Nov 29, 2007 6:56 pm
by Chupaka
How would the new mangle rule be? And do I put it -before- or -after- the first mangle?
before
/ip firewall mangle add chain=prerouting src-address = <consultant> action=accept
/ip firewall mangle add chain=prerouting dst-address = <consultant> action=accept

Re: More question on limiting bandwidth using PCQ

Posted: Fri Nov 30, 2007 8:38 am
by savage
Thanks a lot for replying.

So anyway, according to the wiki page, I add this line first, right?
/ip firewall mangle add chain=prerouting action=mark-packet new-packet-mark=all passthrough=no
No. Read what you typed - you said you do NOT want to mark their packets. You're doing exactly the opposite.
/ip firewall mangle add chain=prerouting action=accept src-address=192.168.1.0/24 passthrough=no
The above will do what you want, provided 192.168.1.0/24 is in use, ONLY by your consultants. The rule needs to be before any other mangle rules you have.

Re: More question on limiting bandwidth using PCQ

Posted: Fri Nov 30, 2007 11:10 am
by thermant
So to sum things up, here's what I think I should do:
/ip firewall mangle add chain=prerouting src-address = 192.168.1.100 action=accept passthrough=no
/ip firewall mangle add chain=prerouting dst-address = 192.168.1.100 action=accept passthrough=no
/ip firewall mangle add chain=prerouting src-address = 192.168.1.200 action=accept passthrough=no
/ip firewall mangle add chain=prerouting dst-address = 192.168.1.200 action=accept passthrough=no
/ip firewall mangle add chain=prerouting action=mark-packet new-packet-mark=all passthrough=no

Then I add these:
/queue type add name="PCQ_download" kind=pcq pcq-rate=128000 pcq-classifier=dst-address
/queue type add name="PCQ_upload" kind=pcq pcq-rate=128000 pcq-classifier=src-address
/queue tree add parent=global-in queue=PCQ_download packet-mark=all
/queue tree add parent=global-out queue=PCQ_upload packet-mark=all

How's that? Do correct me if I'm wrong. And are those the only ones I need to add?

Do I need the fifth line in the mangle section (the 'all' one)? I'm assuming I do. I mean, that one is after the lines for the consultant, no?

Getting close, guys. Getting close.
Thanks much.

-Ted-

Re: More question on limiting bandwidth using PCQ

Posted: Fri Nov 30, 2007 3:42 pm
by Chupaka
very, very close. i'd rather say 'we are here' =)
yes, it seems to be correct, and "fifth rule" you need too

p.s. is it possible to add "action=accept passthrough=yes" ;)

Re: More question on limiting bandwidth using PCQ

Posted: Fri Nov 30, 2007 4:09 pm
by savage
p.s. is it possible to add "action=accept passthrough=yes" ;)
Good point ;)

Re: More question on limiting bandwidth using PCQ

Posted: Sun Dec 09, 2007 2:59 pm
by thermant
OK then, I'll try it out tonight.

Thanks much for replying, you two.
You're the best! 8)

:D :D :D :D

Re: More question on limiting bandwidth using PCQ

Posted: Tue Dec 11, 2007 10:40 am
by promind
OK then, I'll try it out tonight.

Thanks much for replying, you two.
You're the best! 8)

:D :D :D :D
try using chain forward instead of prerouting

Re: More question on limiting bandwidth using PCQ

Posted: Sat Dec 15, 2007 12:04 am
by thermant
You mean chain=forward?

Why do you suggest that? Will it perform better or something?

Re: More question on limiting bandwidth using PCQ

Posted: Tue Dec 18, 2007 2:10 am
by thermant
Hmm...

It won't work, you guys... Sure, it limits the bandwidth to 128k, but it limits EVERY station on the network to 128k, INCLUDING the consultant stations...

This is what I used:
/ip firewall mangle add chain=prerouting src-address = 192.168.1.100 action=accept passthrough=no
/ip firewall mangle add chain=prerouting dst-address = 192.168.1.100 action=accept passthrough=no
/ip firewall mangle add chain=prerouting src-address = 192.168.1.200 action=accept passthrough=no
/ip firewall mangle add chain=prerouting dst-address = 192.168.1.200 action=accept passthrough=no
/ip firewall mangle add chain=prerouting action=mark-packet new-packet-mark=all passthrough=no
/queue type add name="PCQ_download" kind=pcq pcq-rate=128000 pcq-classifier=dst-address
/queue type add name="PCQ_upload" kind=pcq pcq-rate=128000 pcq-classifier=src-address
/queue tree add parent=global-in queue=PCQ_download packet-mark=all
/queue tree add parent=global-out queue=PCQ_upload packet-mark=all

Even tried action=accept passthrough=yes, still no go...

Any ideas on what went wrong?
And yes, I did upgrade to .50...

:? :? :? Help... :? :? :?

Re: More question on limiting bandwidth using PCQ

Posted: Tue Dec 18, 2007 2:23 am
by thermant
:o :o :o

Hmm... Tried promind's advice, used chain=forward with everything...
/ip firewall mangle add chain=forward src-address = 192.168.1.100 action=accept passthrough=no
/ip firewall mangle add chain=forward dst-address = 192.168.1.100 action=accept passthrough=no
/ip firewall mangle add chain=forward src-address = 192.168.1.200 action=accept passthrough=no
/ip firewall mangle add chain=forward dst-address = 192.168.1.200 action=accept passthrough=no
/ip firewall mangle add chain=forward action=mark-packet new-packet-mark=all passthrough=no

Everything else stays the same.
And surprise, surprise... IT WORKS!!! :D Yay!

Only thing I'm concerned about is, well, I did use chain=forward on all 5.
I'm just worried something might be wrong.
Everything seems to be working normally though...

Will keep you updated.

Thanks much. ^^

-Ted-
EGS

Re: More question on limiting bandwidth using PCQ

Posted: Tue Dec 18, 2007 6:25 pm
by thermant
Something's wrong, you guys...

I saw occasional bandwidth usage that jumps above 128k. The highest I've seen so far is 250k-ish. Did I do something wrong? I don't have burst on, so this shouldn't happen, right?

Any ideas?

Thanks.

-Ted-
EGS