UniFi Network - Changing a Virtual Network Subnet

When using Site Magic, the subnet on a Virtual Network used by a UniFi Gateway or Console at one site could overlap with another. In this case, one of the subnets needs to change to a different IP range.

Changing the subnet itself is a straightforward task, but if you follow these steps to plan your change carefully, downtime can be reduced to a minimum or even eliminated.

Before You Begin

When the subnet changes, clients and UniFi devices need to obtain a new IP address via DHCP and regain connectivity to the network. As DHCP addresses are assigned with a lease time (86400 seconds / 1 day by default) it can take a long time before they are able to reconnect.

Before changing the subnet range, we recommend to perform the following steps:

  1. Check if there are any Fixed IP Addresses assigned to clients and temporarily disable this feature.
    1. Use the Fixed IP Address filter in the Client Devices' Display Options to quickly find these clients.
  2. Check if any UniFi devices are configured with a Static IP address (Network Override) and change them back to DHCP.
  3. Check if any clients are configured with a Static IP address on the network adapter directly and change them back to DHCP.
  4. Change the DHCP Lease Time on the Virtual Network from 86400 to 60 seconds.
  5. Over the course of the next day, the clients and UniFi devices will obtain a new DHCP lease that has a very short lease time.

Changing the Subnet

Now that the clients are using DHCP addresses with a short lease time, we can change the subnet.

  1. Check if there are any Firewall Rules that allow traffic to the existing IP address range. If so, duplicate these rules to also allow traffic to the new subnet.
  2. Change the Gateway IP/Subnet on the Virtual Network to a new IP range, for example 192.168.1.1/24 to 192.168.2.1/24.
  3. The clients and UniFi devices will renew their lease and will reconnect back to the network within a minute.
    1. Rebooting is another option to force the clients and UniFi devices to renew their lease.
  4. After all clients and UniFi devices have reconnected, change the DHCP Lease Time back to 86400 seconds.
  5. If used, change the clients and UniFi devices back to a Fixed or Static IP address inside the new IP address range.

Frequently Asked Questions

What should I do if a client or UniFi device doesn't reconnect back after the subnet change?
It is possible that the old DHCP lease with a long lease time is still in use. In this case, reboot the client or UniFi device to force a renew.
Can I leave the DHCP Lease Time set to 60 seconds after the subnet change?
We highly recommend to change the lease time back to 86400 seconds. A short DHCP lease time substantially increases the amount of DHCP traffic on the network.
What should I do if another network device is running the DHCP server?
Changing the lease time should also be possible on the third-party DHCP server. However, the DHCP server also needs to be manually updated to use the new subnet range after the change.

We recommend to run the DHCP server on the UniFi Gateway as the DHCP range will automatically update when the subnet is changed.
Was this article helpful?
32 out of 52 found this helpful