furuka, There is a totally easier way for that. Here's how we have ours set up.
The following steps we do everytime we add a user.
we assign a static IP address to everyone via DHCP (wont go in to detail on this)
We then add each IP to an address list based on what package they use.
The following steps we've done once.
we have a Queue tree setup using PCQ that limits users download and uploads speeds. (one queue for upload and one for download)
we then setup a few mangle rules to look at the lists, and then mark the packet based on the list.
you set the Queue's up once, and just add the IP addresses to the list and everything is done for you automagically.
here's a sample of my code,
[color=#008000]### Here's the mangle rules for the "basic" users. First one is for download, the second one is for the upload they both look at the address-list called Basic and act accordingly[/color]
/ip firewall mangle
add action=mark-packet chain=forward comment="User Basic Download" disabled=\
no dst-address-list=Basic new-packet-mark=Basic passthrough=no
add action=mark-packet chain=forward comment="User Basic Upload" disabled=no \
new-packet-mark=128u passthrough=no src-address-list=Basic
[color=#008000]###Here is the queue tree, we have a parent tree we set the Max Limit that all of the Queue's can use (we use our total bandwidth -10%, we use 2 here, one for download, and one for upload[/color]
/queue tree
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
max-limit=60M name=Download-All priority=8
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
max-limit=3M name=Upload-All parent=global-out priority=8
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
max-limit=3M name="1 User Basic" packet-mark=Basic parent=Download-All \
priority=5 queue="PCQ_1 Basic"
add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
max-limit=0 name=User128u packet-mark=128u parent=Upload-All priority=6 \
queue="PCQ_U 128"
[color=#008000]###Here's the Queue type, here's where we set the limit on the connections, you can see here we have the download set at 384k, and the upload at 128k. neither one has bursting enabled[/color]
/queue type
add kind=pcq name="PCQ_1 Basic" pcq-burst-rate=0 pcq-burst-threshold=0 \
pcq-burst-time=10s pcq-classifier=dst-address pcq-dst-address-mask=32 \
pcq-dst-address6-mask=128 pcq-limit=50 pcq-rate=384k \
pcq-src-address-mask=32 pcq-src-address6-mask=128 pcq-total-limit=2000
add kind=pcq name="PCQ_U 128" pcq-burst-rate=0 pcq-burst-threshold=0 \
pcq-burst-time=10s pcq-classifier=src-address pcq-dst-address-mask=32 \
pcq-dst-address6-mask=128 pcq-limit=50 pcq-rate=128k \
pcq-src-address-mask=32 pcq-src-address6-mask=128 pcq-total-limit=2000
I'm not saying this is the absolute best way to do this, or the best way to use the PCQ but it is a lot easier then what you are doing. we currently have about 220 customers.
if you want more info let me know.