What are the best practices to copy config from one RB device to another one ?
To simplify things, source and destination devices both have the same hardware and software.
I know /export and /backup tools exist but:
/backup produces files that can’t be read nor changed, if I’m mistaken
some setting (MAC addresses) being hardware dependant, you can’t bindly restore /backup data in a different unit (that must run on the same network)
in files produced by /export I see instructions (“add”, “remove”, …) that seem non-idempotent I’m a bit afraid to re-use
What would you recommend ?
Is there a way to recover from mic-configuration when working remotely (something like “in two hours reload this recovery config”) ?
Hi,
having done it few times, I’d suggest export is the way to go. backup is meant to be for the same router.
best practice,
to make sure the destination router is on the same firmware level as the master router.
you would want to check the config over, remove any MAC address. unfortunately if you set admin-mac=xxx on a interface, this part of the config will be in the export.
I always apply the config back by paste in Terminal, section by section. this way you see if there is any error.
for working remotely, safe mode is your best friend but sometimes it’s working against you. if you add a interface to bridge or change bridge setting, it will reset connection . I don’t have a perfect solution myself. I heard that you can change default ROS configuration?
Yes, unfortunately, there is no variable in RouterOS scripts, it seems.
You can’t have lines like /globalvar set serialnumber “bar” and re-use serialnumber elsewhere with a $serialnumber or [eval serialnumber].
Along with idempotent add or remove commands, that would greatly help to write reusable scripts.
An other worrying thing for me is that with many RouterBoard devices, factory config sets ether1 port to act both as WAN and PoE-in.
With this, you can’t use this single ether1 port to customize a brand new RouterBoard: you need at least 2 ether ports or one etherX port plus a power supply and play with cables when configuration is changing.
Being able to change a MAC or serial numbers while on the same time, different values are printed on the device itself can mis-lead.
Random thought: maybe splitting configuration in two files would help:
one file for device management itself,
one file for network services.