Page 1 of 1

Configuring RouterOS

Posted: Fri Jan 13, 2006 12:56 pm
by flovin

I was wondering if someone has made a clever way of configuring RouterOS boxes, I was thinking along the lines of writing a small application to set up the box, with a config based upon data from our customer database and documentation database- and then dumping the config automagically to the RB via tftp or similar.

The point of this would be enabling someone non-technical to configure a box, e.g. office personel, and at the same time ensuring that all configurations are reflected in the documentation and customer database.

The way I would like to do this is writing a program from which the user could choose which router to configure, it would be an isolated segment of course, we don't want the user to reset the configuration on other routers. This program would then be able to send mac-telnet commands to the router to do whatever I wanted to do.

But so far I've only seen an interactive mac-telnet client, the one included with the Neighbour Viewer.

Any clever way of doing this?


Posted: Fri Jan 13, 2006 1:05 pm
by YazzY
Use expect to automaticaly login via ssh/telnet and send custom commands to your router.
The commands can be stored in any way you want as long as your application is able to fetch/read them.
Here is an example of how I coded something like that creating a simple CLI in shell and dialog. ... uteros.txt

Posted: Fri Jan 13, 2006 1:14 pm
by flovin
Thanks for the suggestion, I was originally thinking along those lines as well - but I'd like to be able to do it with MAC telnet, that way you could take the RB antennas out of the box, plug in the Ethernet cable.. after 30-45 seconds the box would be configured, without the user doing anything manually except selecting the customer. I did write some small script for the RB500, but they have a serial port - the RB antennas don't.

With your method we'd still need to go in with mac-telnet to set the IP before being able to configure. Though I guess that's still a lot better than nothing.

Of course, if Mikrotik could give me the source for the MAC telnet client and eventually the Neighbourhood Viewer...

Then I could make us all a neat little program for just that purpose...


Posted: Fri Jan 13, 2006 1:21 pm
by YazzY
Put a script on your box that will find ethernet devices and add an IP to one of them at boot.
Then ship the equipement off to your customers and let them configure it over IP.

Posted: Fri Jan 13, 2006 7:23 pm
by jp
I have backed up and reloaded configurations using "export" to save configs to a file. This creates a text file, which you can change the mac addresses and other settings in, then ftp back to the box. there's probably a way to automate it using nasty bash scripts, sed, mysql client, expect, etc...