The CLI is really powerful and can be used to configure any setting on a Tik. In fact certain settings can only be configured from the CLI.

Don’t forget that you still have to navigate around teh hierarchy in just the same way as you do with the GUI. You need to type “/ip address” before you start configuring IP addresses for instance. If you don’t do this then information or commands wont be recognised.

See below:

[andisa@SyncroVPN] > /
[andisa@SyncroVPN] > reboot
bad command name reboot (line 1 column 1)

[andisa@SyncroVPN] > /system reboot
Reboot, yes? [y/N]:

Now the clever bits that make the CLI more powerful. Try using the find command within a set command.

Set changes existing configuration

Find will build a list of existing configurations for you to find.

For instance the following will change every user configuration in the PPP secrets to use the RoadWarrior profile

/ppp secret
/ppp secret> set [find ] profile=RoadWarrior

The following will change the configuration for the user named in the find statement and leave all the others.

ppp secret
set [find name=my.user ] profile=default

You can use the technique with any command to edit existing configurations

Have a look at Mikrotik’s own wiki for more examples.

https://wiki.mikrotik.com/wiki/Tips_and_Tricks_for_Beginners_and_Experienced_Users_of_RouterOS

https://wiki.mikrotik.com/wiki/Manual:Scripting_Tips_and_Tricks

in Mikrotik Routerboard