Category Archives: scripts

Check utilisation of RouterOS IP Pools

I was looking for a way to do a quick summary of the utilisation of my DHCP/PPP pools and stumbled across a helpful little script.

This was originally found on the MikroTik forums and posted back in 2010 written by dssmiktik, and surprisingly enough it works perfectly on even v6.0 with no changes required.

Continue reading Check utilisation of RouterOS IP Pools

Script Fu – Changing RADIUS server source address

Just a quick post to show an example of day to day usage of RouterOS scripting.

Goal: We had to change the src-address for a bunch of radius-server listings across 40 MikroTik devices, to match a new pptp-tunnel address. What would’ve been a pain was that the address is different on each device.

Solution: Create a scriptlet to pull the IP into the update (set) routine, ensuring it is formatted correctly for use.

Continue reading Script Fu – Changing RADIUS server source address

Replacing Hotspot SSL certificates with a script

While needing to update a bunch of routers with new SSL certificates for the hotspot config the other day, I realised there is currently no way to import a certificate in RouterOS via a scripted function (at least not that I’ve discovered prior to v6.3).

As such I set out to find a way to update routers with a single copy/paste block of code that would work across all versions and could also be run using a system such as router-tools or via an API interface and came up with the following.

Continue reading Replacing Hotspot SSL certificates with a script

Cool console: Terminal health

The following is a short but useful script which allows your system note to output recent info regarding router health and/or other details you might be interested in.

cool-console

Special thanks to Werner Venter for showing me the  ‘Cool Console‘ script which was modified and extended upon for this post.

Continue reading Cool console: Terminal health

Add a data limit to trial hotspot users

This script comes from the final slide of my recent MUM presentation on RouterOS scripting
It allows you to assign a data limit to trial hotspot users and:

a) have them kicked offline upon reaching this limit
b) create a temporary user to stop them from being able to log back in again

Hotspot
I spy, WiFi!

This is a feature which is not available via the current hotspot settings, so I decided to script it into existence. Enjoy!

Continue reading Add a data limit to trial hotspot users