RouterOS Scripts
RouterOS is the operating system developed by MikroTik for networking tasks. This repository holds a number of scripts to manage RouterOS devices or extend their functionality.
Use at your own risk, pay attention to license and warranty!
Requirements
Latest version of the scripts require recent RouterOS to function properly. Make sure to install latest updates before you begin.
Specific scripts may require even newer RouterOS version.
Initial setup
Get me ready!
If you know how things work just copy and paste the initial commands. Remember to edit and rerun global-config-overlay
! First time users should take the long way below.
Be warned! Some details changed. So see the presentation, then follow the steps below for up-to-date commands.
The long way in detail
The update script does server certificate verification, so first step is to download the certificates. If you intend to download the scripts from a different location (for example from github.com) install the corresponding certificate chain.
Note that the commands above do not verify server certificate, so if you want to be safe download with your workstation's browser and transfer the files to your MikroTik device.
Let's Encrypt R3
Then we import the certificates.
For basic verification we rename the certifiactes and print their count. Make sure the certificate count is three.
Always make sure there are no certificates installed you do not know or want!
Actually we do not require the certificate named DST Root CA X3
, but as it is used by Let's Encrypt
to cross-sign we install it anyway - this makes sure things do not go wrong if the intermediate certificate is replaced. The IdenTrust certificate should be available from their download page. The site is crap and a good example how to not do it.
Now let's download the main scripts and add them in configuration on the fly.
Mark global-config-overlay
not to be overwritten by future updates.
The configuration needs to be tweaked for your needs. Edit global-config-overlay
, copy configuration from global-config
(the one without -overlay
).
And finally load configuration and functions and add the scheduler.
The last step is optional: Add this scheduler only if you want the scripts to be updated automatically!
Updating scripts
To update existing scripts just run function $ScriptInstallUpdate
.
Adding a script
To add a script from the repository run function $ScriptInstallUpdate
with a comma separated list of script names.
Scheduler and events
Most scripts are designed to run regularly from scheduler. We just added check-routeros-update
, so let's run it every hour to make sure not to miss an update.
Some events can run a script. If you want your DHCP hostnames to be available in DNS use dhcp-to-dns
with the events from dhcp server. For a regular cleanup add a scheduler entry.
There's much more to explore... Have fun!
Available Scripts
Last updated
Was this helpful?