Script help - add simple queues (MT OS 2.9.13)

I am trying to write a script that will generate simple queues for each customer’s static IP serviced off a given MT Router. Below is what I have and it will not run. Any help would be GREATLY appreciated. Also, if there is a better way to achieve the same end result I am open to suggestions.

Thanks in advance!
Drew

:for e from=1 to=255 step=1 do={
/queue simple add name=(10.10.149. . $e)
target-address=(10.10.149. . $e . “/32” ) interface=all
dst-address=(10.10.149. . $e . " /32" ) interface=all
parent=none
direction=both
priority=8
queue=default/default limit-at=64000/64000
max-limit=262144/512000
burst-limit=1000000/2000000
burst-threshold=256000/512000
burst-time=15s/15s
total-queue=default
p2p=all-p2p
}

Just a couple of minor problems:

You had interface=all specified twice.

The dst-address=(10.10.149. . $e . " /32" ) had a space just before the /32, inside the quotes.

Try this:

:for e from=1 to=255 step=1 do={ 
/queue simple add name=(10.10.149. . $e) \ 
target-address=(10.10.149. . $e . "/32" ) \ 
dst-address=(10.10.149. . $e . "/32" ) \
interface=all \ 
parent=none \ 
direction=both \ 
priority=8 \ 
queue=default/default limit-at=64000/64000 \ 
max-limit=262144/512000 \ 
burst-limit=1000000/2000000 \ 
burst-threshold=256000/512000 \ 
burst-time=15s/15s \ 
total-queue=default \ 
p2p=all-p2p \ 
}

I’m not sure this will quite work as you expect though, since both the target-address and dst-address are the same (I would guess that you really want dst-address to be 0.0.0.0/0).

You should also read up on PCQ, you could squish this all up into a single rule.

–Eric

Thank you Eric. The script runs now; however, the simple queue rules don’t show up in the WinBox interface.

I will read up on PCQ as you suggested. There are some customers that we may want to give different parameters to though. I am open to a better way to handle this stuff.

Kind regards,
Drew

Not sure why the rules don’t show, they do on my test box.

We usually have the MT grab the queue rules from Radius, when the user does a PPPoE login. Radius is the way to go, but it’s non-trivial to setup.

It’s nice, since everything is controled by a central database, and the customer always gets the same settings, no matter what router he connects to.

We do have a few small systems using PCQ, and it seems to work quite nicely.

–Eric