Using Flashfig to bulk upgrade Routerboard devices
Here at Bright WiFi, we go through a LOT of Routerboards, and are proud of our ability to help resellers rapidly deploy new device configurations. When I say a lot.. as of right now we have 1000 hAP units on backorder, with 250~ units waiting to be installed and another 300~ awaiting configuration today. While these are numbers for our own use here in Australia; the system we’ve created was with the intent that anyone should be able to use our platform to achieve similar results.
Because of this, we’ve gone through a number of different revisions to our configuration and deployment process in order to improve the time it takes to get devices ready for installation, as well as ensuring all devices are labeled and we have a record of when they were configured and by whom.
Today I was reading a post on the MikroTik subreddit and saw someone post about configuring multiple devices. One of the hardest parts I’ve struggled with when configuring MikroTik devices in the past has been getting all the units up to the right version before configs can be applied. If this is not done then features or configuration components that aren’t available in the older versions won’t be applied or may prevent the config from loading entirely.
Enter The Deployment Tool
In order to facilitate configuring devices, Bright WiFi has a custom-built deployment tool that is made available to our resellers – while this isn’t much use to anyone as a standalone tool it does allow automation of “upgrade, configure and test” part of setting up each router. However in using it day to day I would still come across the same underlying delay when configuring a lot of devices at the same time – it has to wait to upgrade each new unit before the configuration can continue.
So what does this mean for upgrades? The deployment tool is great, but it works best in the following scenarios:
The Flashfig Paradox
Flashfig is a useful and at the same time, very frustrating feature of Routerboards.
So with that in mind – I came up with the following solution
This, when used as the config to be loaded by flashfig, achieves the following:
1. Adds basic config (DHCP on ether1, 192.168.88.1/24 on ether2)
2. On startup, if the version doesn’t match the target version wait for a DHCP lease on ether1 then continue
3. Fetch a file matching the architecture + RouterOS version detailed in the script (6.34.6) from 192.168.88.254
4. Start flashing LED3 on the target router to indicate a download is occurring
5. Reboot when download is finished OR start flashing LED4 to indicate the download failed
6. Upon startup if the version does match the target version, flash LEDs 3-5 to indicate upgrade is complete
7. Remove upgrade scripts
8. Upon next boot – reset LEDs to default and remove final script.
To make this work, you must also have a second MikroTik designated as the deployment router (as noted above) from which all the devices being upgraded can retrieve their files from. I would recommend an RB750/450/hAP and it needs the following basic configuration:
Final notes: make sure to adjust the version, ip address and directory in the script depending on your setup.
Feel free to discuss, ask any questions or make suggestions on the reddit thread for this article here:
https://www.reddit.com/r/mikrotik/comments/4uyb3s/as_requested_a_article_on_using_flashfig_and/