Hi,is there an easy way to hard cap users on a mikrotik user.All Usage for our users gets saved on a MySQL database,so if a script can acess data from their and implement a hard cap solution it would be ideal,but any other solution(maybe with queus),would be ok as well.Any suggestions.Thanks
Any ideas???without using a full radius server setup.I’m using accounting collecter,so i’d like to keep my Mysql database in that form rather than using an radius setup.Any help would really be apreciated,I need to hard cap people but i’m having some trouble!!
Thanks…
RADIUS can use SQL DB as a back-end.
thanks for the reply…
Ja I know the radius server has got the MySQL backend,but then i’ll have to configure the freeradius and configure all the clients their,and thats just a bit of a big mission at the moment.I thought maybe there some sort of automated script you can use to do this sort of thing,but it seems not??
you could do it via ssh provided you have dedicated host to run the script.
not sure how that would work?maybe you can give more info on how that would work?
Thanks
a perl or python script running on a linux machine that checks a user against your SQL database. Then the script would log into the router via ssh and issue some CLI commands.
Eugene
Ok,that sounds pretty cool.That’s exactly what i was hoping to do,but just a few questions.If you know,otherwise i’ll try to figure it out.I know how to do perl mysql interaction,but i’m having some trouble with the following.
1)if i want to ssh into the router from the script,how will i do this.something like a system(“ssh xxx.xxx.xxx.xx”), won’t work because of password needed.How can i get around this.I know how to do it between linux boxes,but my mikrotik knowledge not that good.
2)What type of command am i looking for to kill the user once,the cap limit is reached?I can’t seem to find a command that can do this.
Thanks for the help so far!
-
use ssh keys. you should generate a key on your linux box with ‘ssh-keygen -t dsa’ and then import it on the router with ‘/user ssh-keys import’
-
I think disabling the user record (for HS and PPP) should work.
Eugene
Thanks Eugene,you’re a legend.
Just sort out all the mysql stuff and it’ll work,but that’s easy luckily
I’m just limiting the queue to 1byte or something for every user that’s over the limit
Thanks