[Help] What to do when changing router?

Altorvo

New Member
Nov 30, 2024
8
6
3
Hi all,

In a few hours, I will be changing my router/firewall from a Virgin Media Hub 5 to a Ubiquiti Cloud Gateway Ultra. In preparation, I have been reading forum threads from people having had issues with changing IPs, therefore losing web console connection after the switch.

I was hoping the community could help me understand all of the steps I need to take in preparation to ensure I don't fall into any traps!

So far:
  • I have multiple copies of each container's backup (tar.zst file)
  • Listed current IPs of each service I'm running
  • After having read @UdoB's brilliant tutorial on the subject (here), I have compiled the current outputs of each cmd in order to compare/have all info upfront.
    • Previously, I had heard of copying across the /etc/ directory, but unsure if this is of each container/vm or on the host (as a backup of the pve config)?
My plan was to:
  1. Leave my PvE server running
  2. Unplug the ethernet cable
  3. Switch over to the new router (putting the previous one in modem mode)
  4. Setup the new router to follow the same netmask/gateway as the previous one; i.e; Subnet Mask . . . . . . . . . . . : 255.255.255.0 - Default Gateway . . . . . . . . . : 192.168.0.1
  5. Plug the pve server ethernet cable into the new router/switch and hope the new server adopts the IP that the server is currently on: i.e: 192.168.0.239 (this worked when changing from Hub 3 to Hub 5 a month ago)
The 'hope' part is where I'm pretty sure I'm wrong and the new router will assign an IP address as it sees fit, regardless of what the server is on currently - therefore, is the solution to always nano/vi into /etc/network/interfaces & /etc/hosts of the host and change the ip/gateway to whatever the new router has assigned, post router change - assuming I have to do the same to all of the lxcs/vms also? (unsure where I do that) and restart network service via: systemctl restart networking

Let me know if I'm missing anything or can prepare in a better way to cause less headaches! It would be incredibly useful to have a source of truth for best practices when changing routers (point me in the direction if there already is one and I've missed it), as I will likely be moving soon and may have to go through this again.

Many thanks in advance,
Altorvo
 
  • Like
Reactions: UdoB
Previously, I had heard of copying across the /etc/ directory, but unsure if this is of each container/vm or on the host (as a backup of the pve config)?
Make a backup of /etc from every system which may be affected. This is mainly the host, but if there is -for example- static configuration inside a VM or a container then that might also be helpful.

Usually /etc is not really large. Creating a simple file-by-file backup onto any backup medium should be cheap. Please note that this kind of backup is not meant to be restored in one bunch - it is better used to manually look into specific files to check "how the heck was it configured before".

The 'hope' part is where I'm pretty sure I'm wrong and the new router will assign an IP address as it sees fit,
Yeah, probably...

If I remember correctly all routers I have seen are capable to be configured for user-specified LAN settings. This opens the chance of adjusting the router instead of adjusting all present LAN devices, starting with the PVE host. Of course IP addresses delivered via automatic/non-static DHCP will vary nevertheless...

Good luck :)
 
  • Like
Reactions: Altorvo
Thank you for the reply! Happy to report all things went well. Only oddity, was after copying my /etc/ directory into an smb share, I can no longer delete or move those copied folders as apparently 'they are currently being used/open' - any thoughts?

It strangely went how I predicted above - the router's initial gateway was 192.168.1.1, but I changed that to 192.168.0.1 (as you mentioned above), then plugged in the Proxmox & TrueNAS (wasn't too bothered if this one broke) server - but got picked up immediately as their original IPs - even the 10 lxcs/VMs were recognised and then swiftly saved via DHCP.

Now need to fix my WiFi before the family commits a war crime against me.

Thanks again for your time and support.
 
  • Like
Reactions: UdoB
delete or move those copied folders as apparently 'they are currently being used/open' - any thoughts?
No.

As mentioned "/etc/pve" is a fuse-mounted database where POSIX is not completely implemented - just as much as is required for PVE.

But that should not affect files already stored onto the destination...
 
  • Like
Reactions: Altorvo
should not affect files already stored onto the destination
Apologies for the very slow reply! Unsure what the actual blocker was, but I ssh'd in as root via another system and was successful in removing those copied files - imagine when they copied the permissions may've changed? Either way, it's all sorted now :)
 
  • Like
Reactions: UdoB