Cloutik provides a remote access to your RouterOS device from any location, but it also helps you to leverage on the power of Mikrotik scripting.

Cloutik provides a library of predefined configurations that will help you to achieve either basic operations or very complexe ones. It provides some examples so that you can create your own configurations.

Each configuration contains RouterOS instructions that the device applies on its next synchronization with the Cloutik Controller. A configurations relies on the instructions that are valid when using a Terminal through Winbox or Webfig. Except that you do not need to connect to the device, it will just connect and retrieve its instructions to execute them.

A configuration is applied on Cloutik with one device or with a group of device. Then you can group some configuration operations with a single click.

When you create a Configuration, its complexity depends on the kind of operation to be achieved.

The Cloutik library contains some tasks very simple that can be applied to all Routerboard models and firmwares, while some others will be applicable only for a given recent firmware or some models (e.g. wireless features).
The goal is to ease the operations for any RouterOS device managed thanks to Cloutik.

Here is the content of a simple Configuration performing a firmware upgrade and a reboot :

provide

# Mikrotik Routerboard Firmware Update and reboot;
/system package update download; /system reboot;

But you can also perform any networking operation on the Mikrotik device, such as configuring a DHCP server, enabling or disabling an interface, or configure the DNS Servers :

# Mikrotik Routerboard : Set DNS Google servers
/ip dns set servers=8.8.8.8,8.8.4.4;

The Mikrotik scripting langage also permit to use

  • Conditional statements: “If (true) do (instruction X) else (instruction Y)”
  • Loops : “if”, “for”, “foreach”
  • maths operators : use directly operators like “+” “-” “*” “/”, relational operators “<” “>” “=” or logical operators
  • and many other possibilities

Here is an example with a conditional step to restrict the configuration operation to a specific condition : before configuring the RADIUS server IP address, you can check first whether the current value is the same or not. Note that you need to define the variables of your configuration with a “local” (limited to a section of the configuration) or “global” ( valid for the whole configuration).

# Mikrotik Set RADIUS Client with my-AAA 1.2.3.4
:local RadiusIP 1.2.3.4;
:local Radiussec mysecret;
:local Radiustout 00:00:01;
:local radiusID [/radius find comment="my-AAA"];
:local currentIP [/radius get $radiusID address];
#
Check if RADIUS client already configured
:if ($RadiusIP != $currentIP) do={
/radius set service=hotspot $radiusID address=$RadiusIP secret=$Radiussec timeout=$Radiustout;
/log info "radius my-AAA updated";
} else {/log info "no update my-AAA RADIUS already set";}

The aim of the Cloutik library is to provide a set of generic configuration. In addition, we suggest to use your favorite search engine to look for all technical resources spread on multiple sites and forums. When building your configuration, the references are the official Mikrotik websites, but there are many other websites with Scripts samples.

If you need a starting point, this is a short list of websites to visit :