Migrating to a new Network
If the range of IP addresses you chose for your Managed Nebula network is no longer suitable, whether because you've outgrown it, encountered conflicts with other private IP addresses, or have some other reason, you can migrate your existing hosts to a new network. This guide will explain how to do this, while optionally maintaining connectivity and avoiding downtime.
Multiple network support
Your Managed Nebula account supports the creation of multiple networks. Hosts cannot communicate between different networks, but they can use the same roles and tags. This makes it possible to create a new network, add new hosts to it using the same configuration as your original network, and then disable the old network.
Creating a new network
To create a new network, visit Settings -> Networks in your Managed Nebula admin panel (direct link). From there, click the "Add" button in the top right of the page, choose a name, optional description, and IP address range for the new network. If you plan to create dedicated relays, you can uncheck the "Use lighthouses as relays" option—or if you'd like your lighthouses to also act as relays, leave that box checked. Save the new network when ready. Note that you will not be able to edit the IP address range once the network is created.
Moving hosts to your new network
With connectivity interruption
There are two options for migrating your hosts, lighthouses, and relays to the new network. If the Managed Nebula network is not in active use (e.g it was created for evaluation or testing), or you want existing hosts to maintain their current IP addresses, the simplest option is to perform the following steps for each machine:
Using DNClient Server
After creating the new host in the admin panel:
- Create a new host, lighthouse, or relay to replace the existing one. You can use the same name, role, tags, etc., but choose the new network in the Network dropdown.
- Enroll the host with the new enrollment code:
sudo ./dnclient enroll -code XXX
- Stop and restart dnclient to apply the new configuration:
sudo ./dnclient stop
sudo ./dnclient start
Using DNClient Desktop
After creating the new host in the admin panel:
- Create a new host, lighthouse, or relay to replace the existing one. You can use the same name, role, tags, etc., but choose the new network in the Network dropdown.
- Disconnect and Delete the old host in the old network.
- Click Enroll in the DNClient Desktop menu (from the dock on Windows or the top menu bar on macOS)
- Enter the new enrollment code in the enroll window
- The desktop application will automatically apply the new configuration
You may want to start with your lighthouses, so that as you migrate hosts you can verify that they are connecting to each other successfully.
With zero downtime
If instead you require uninterrupted connectivity while migrating to a new network, you can run multiple instances of dnclient on each machine during the migration. This is only possible if the new network range does not overlap with the existing network's IP range.
Using DNClient Server
For Server installations, you can run multiple named instances of dnclient:
- Create a new host, lighthouse, or relay in the new network with the same name, role, tags, etc.
- Install and start a new named instance of dnclient:
sudo ./dnclient install -name newNetwork
sudo ./dnclient start -name newNetwork - Enroll the new instance with the enrollment code:
sudo ./dnclient enroll -code XXX -name newNetwork
Any future commands to the named dnclient instance must also include the same -name
parameter.
Using DNClient Desktop
DNClient Desktop can manage multiple network connections simultaneously:
- Create a new host, lighthouse, or relay in the new network with the same name, role, tags, etc.
- In DNClient Desktop, click Enroll from the menu
- Enter the new enrollment code in the enroll window
- The desktop application will add the new network connection while keeping the existing one active
Cleanup
Once you have moved all of your machines to the new network and confirmed successful connectivity, delete the hosts, lighthouses, and relays in the old network. Each of the list pages can be filtered to show only a single network, making it easy to identify all the old, inactive hosts. Once all machines in the previous network have been removed, the network itself can be deleted.
If you used the zero-downtime approach, also be sure to clean up the old network configuration:
For DNClient Server: Stop the dnclient associated with the old network on each machine and remove its associated configuration files. If you used named instances, use:
sudo ./dnclient stop -name oldNetwork
sudo ./dnclient uninstall -name oldNetwork
For DNClient Desktop: Disconnect from the old network through the network's settings menu and then delete the network from the list of available networks.
You will also need to update any of your DNS or service discovery configs to point to the new IP addresses of the hosts. Alternatively, you can perform yet another migration to move the hosts back to their original IP addresses in yet another network with an expanded range from the first.