I have two machines with the same model and specifications.
If I export /config/config.boot from one and import it to the other, will the other machine work properly?
If they are the same VyOS version yes, but the mac addresses in the config would be wrong. Best to run “show configuration commands” on the old one and make sure to replace the mac addresses with the new ones on the corresponding ports. You also could replace them in the config file when you paste it in too.
I’ve done this a few times, and the answer is mostly yes.
At minimum, make sure the interfaces don’t have any hardware IDs & MAC addresses bound to the source hardware. Just remove the hw-id
parts of the interface configs, or update them to specific MACs if you want guaranteed interface ordering for the existing config.
There may be other pieces that bind to specific hardware that I’ve not bumped into.
Could you please clarify what do you mean by “any hardware IDs”?
Thanks.
I have tried it by myself.
- export /config/config.boot from machine A, save it as config.a
- read all interfaces’s hw-id from machine B, and save it temporarily
- import config.a to machine B
- load config.a in machine B
- set interfaces ethernet ethx hw-id xxx in machine B
- commit
It looks a bit lengthy.
Could you please clarify what do you mean by “any hardware IDs”?
Just anything that binds to specific hardware by ID - usually this is just MAC addresses, but I’m not familiar with other interfaces like USB WWAN and how they might show up.
I usually just edit the config once, drop it into /config or load it from the CLI, and off it goes.
To clarify, I will usually FORGET to remove the hw-ids, discover the migrated device has interfaces starting at eth6 or something, edit the config.boot in place and reboot again without saving.
Setting hw-ids before first boot is optional - you only need to do this if you want to guarantee ordering, but you don’t want to have old ones in there. If you boot up the new device and the interfaces show up in a specific order, in most cases they’ll still be in that order next boot.
If you don’t set hw-ids and let the config load without them, I’d recommend checking and saving it again after the first boot. VyOS will reset the hw-ids to discovered values and then those interfaces will be pinned to those IDs.
you can use config sync if you want
https://docs.vyos.io/en/latest/configuration/service/config-sync.html
You don’t say what version you use, if it’s pre 1.4 and you’ve got Wireguard configurations, the keys are stored on the filesystem not in the config. The same can be true for certificates used for OpenVPN etc.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.