Community discussions

MUM Europe 2020
 
ajay
just joined
Topic Author
Posts: 12
Joined: Thu May 17, 2012 12:48 pm

Bandwidth limitation on mikrotik

Thu Jan 24, 2013 7:59 pm

Hi Guys

I need help in configuring bandwidth controller on mikrotik. Following is my setup.

I have 20, 1mbps customers and total maximum bandwidth allowed at present is 3 Mbps between 20 customers.

My connection sharing ratio is 1:10

To share the speed equally between users i have following setup.

1 - USER AUTHENTICATES THROUGH PPPOE
2 - I CLASIFY THE TRAFFIC AND MARK THE PACKETS FOR THE TYPE OF BROADBAND CONNECTION
3 - I HAVE CREATED PCQ QUEUES FOR TYPE OF PLAN TO SHARE THE CONNECTION EQUALY BETWEEN USERS
4 - FINALLY I HAVE CREATED QUEUE TREE FOR UPLOAD and DOWNLOAD LIMITATIONS, WITH-LIMIT AT - 2Mbps AND MAX-LIMIT - 3Mbps

What I want to achieve is that each customer should not exceed 1 Mbps customer even though there is max of 3Mbps is available. Currently if there is only one user active then particular user will take all the available bandwidth (i.e. 3Mbps). This creates the problem for me as if there are more customers online then speed will be less and customers are complaining that they used to get 3Mbps and now its less. What i want to achieve is that each user should not exceed more than 1 Mbps speed even though more bandwidth is available.

Can anyone please point me to right direction?
 
User avatar
nickshore
Member
Member
Posts: 474
Joined: Thu Mar 03, 2005 4:14 pm
Location: Suffolk, UK.
Contact:

Re: Bandwidth limitation on mikrotik

Sat Jan 26, 2013 7:37 pm

Set the limit per customer in the PCQ using the Rate: setting

Hope that helps

Nick
Nick Shore MTCNA MTCWE MTCRE MTCINE MTCTCE
LinITX.com - MultiThread Consultants
Get your MikroTik RBs and Training: http://linitx.com/brand/mikrotik
Official UK MikroTik Distributor
IRC chan: #routerboard on irc.z.je (IPv4 and IPv6)
 
ajay
just joined
Topic Author
Posts: 12
Joined: Thu May 17, 2012 12:48 pm

Re: Bandwidth limitation on mikrotik

Wed Jan 30, 2013 5:18 am

Tried that but it doesn't seem to be working.

i set pcq-rate as 1024k, but still my users are able to download upto 3mbps

Ajay
 
deejayq
Member Candidate
Member Candidate
Posts: 195
Joined: Wed Feb 23, 2011 8:33 am

Re: Bandwidth limitation on mikrotik

Wed Jan 30, 2013 11:59 am

i would suggest you set a pfifo queue (the default queue) for every customer (20 queues are not that much for a router) with max-limit 1Mbps, the parent of the 20 queues should have a max limit of 3Mbps or even better (3*0.90)Mbps just to be sure that packets don't get queued in your ISP's router. I don't encourage using limit-at for the parent queue.
and this also means you have to mark the traffic of each client (20 or 40 rules in mangle chain, also no big deal for the router)
 
ajay
just joined
Topic Author
Posts: 12
Joined: Thu May 17, 2012 12:48 pm

Re: Bandwidth limitation on mikrotik

Thu Jan 31, 2013 3:27 pm

I am running ISP so users will not be static so above option is not valid for me.

Following is my setup however PCQ-RATE option doesn't seem to be working. If one user is online he is talking all (3Mbps) bandwidth. What I want to achieve is that maximum bandwidth per user should not exceed 1Mbps.

I am running ISP and my customers are authenticating through PPPoE. They will get private IP in the range of 172.20.8.0/22 and access the internet through NAT. I have also other users in different ip range, different broadband plan, however to narrow down the problem I am pasting the config for one type of customer only.

/ip firewall mangle

chain=prerouting action=mark-connection new-connection-mark=1024-Connection passthrough=yes src-address=172.20.8.0/22
chain=prerouting action=mark-packet new-packet-mark=1024Users passthrough=yes connection-mark=1024-Connection

/queue type

name="1024-Down" kind=pcq pcq-rate=1024k 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=128
pcq-dst-address6-mask=128
name="1024-Up" kind=pcq pcq-rate=1024k pcq-limit=50 pcq-classifier=src-address pcq-total-limit=2000 pcq-burst-rate=0 pcq-burst-threshold=>
pcq-burst-time=10s pcq-src-address-mask=32 pcq-dst-address-mask=32 pcq-src-address6-mask=128 pcq-dst-address6-mask=128

/queue tree ....ether1 - connected to WAN, ether2 connected to LAN

name="QUPLOAD" parent=ether1 packet-mark="" limit-at=0 priority=8 max-limit=10240k burst-limit=0 burst-threshold=0 burst-time=0s
name="QDOWNLOAD" parent=ether2 packet-mark="" limit-at=0 priority=8 max-limit=10240k burst-limit=0 burst-threshold=0 burst-time=0s
name="1MbpsDownload" parent=QDOWNLOAD packet-mark=1024Users limit-at=0 queue=1024-Down priority=8 max-limit=3076k burst-limit=0 burst-threshold=0 burst-time=0s
name="1MbpsUpload" parent=QUPLOAD packet-mark=1024Users limit-at=0 queue=1024-Up priority=8 max-limit=3076k burst-limit=0
burst-threshold=0 burst-time=0s



Any ideas what's wrong in the config?

Ajay
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8345
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Bandwidth limitation on mikrotik

Thu Jan 31, 2013 11:05 pm

users are not connected to ether2, users are connected to pppoe interfaces, one interface per user :) so...

ros code

/ip firewall mangle
add chain=forward action=mark-packet new-packet-mark=1024-upload src-address=172.20.8.0/22
add chain=forward action=mark-packet new-packet-mark=1024-download dst-address=172.20.8.0/22

/queue tree
add name="1MbpsDownload" parent=global-out packet-mark=1024-download queue=1024-Down max-limit=3076k
add name="1MbpsUpload" parent=global-out packet-mark=1024-upload queue=1024-Up max-limit=3076k
Russian-speaking forum: https://forum.mikrotik.by/. Welcome!

For every complex problem, there is a solution that is simple, neat, and wrong.

MikroTik. Your life. Your routing.
 
ajay
just joined
Topic Author
Posts: 12
Joined: Thu May 17, 2012 12:48 pm

Re: Bandwidth limitation on mikrotik

Fri Feb 01, 2013 4:45 am

Thanks for the reply, I will try and get back to you.

Cheers
Ajay
 
ajay
just joined
Topic Author
Posts: 12
Joined: Thu May 17, 2012 12:48 pm

Re: Bandwidth limitation on mikrotik

Fri Feb 01, 2013 7:38 am

Thanks a lot chupaka, it worked fine.
I will give you a karma for it . :)

Ajay

Who is online

Users browsing this forum: inteq, Vooray and 50 guests