Changing Unifi Controller IP Address
There may come a time when you want to change the IP Address of your controller. Perhaps you don’t like the DCHP lease IP address it has or you want to move it to a management VLAN. Whatever the reason, making this change will cause any adopted devices to show up disconnected and they will not be able to reach the controller.
Fix: Option 1 – It’s DNS
Before changing your controller’s IP address, log into your controller and navigate to settings–>controller
Under the Controller Hostname/IP specify a hostname of unifi.<domain>, replacing <domain> with whatever it is you are using (potentially .local). Save and allow the devices to re-provision. They will now seek that entry rather than http://ip:8080/inform that it was using before.
Now, log into whatever device manages your DNS and create a static entry for unifi.<domain> with the new IP address. Change your static DHCP assignment or however you manage your IP addresses and wait for the controller to move over to the new IP address. Once it has, log back in and wait for the devices to reconnect. It may not happen instantly as it depends on when your switch/aps poll again.
If you have enabled the changes but some of your devices did not re-provision with the new changes, you can SSH into your device and run
Fix: Option 2 – SSH set-inform
In this scenario you can change the IP address of your controller first, then ssh into each device and run the ‘set inform’ command to provide them with the new IP address of the controller.
You can get the SSH username and password (or if you’re more secure, the keys) by going to settings –> Site and at the bottom Device Authentication
Once you’ve ssh’d into the device run the command
The Unifi device should show up after this. This works for layer 3 adoption which is useful when you are working across different subnets.
Fix: Option 3 – DHCP Option 43
I haven’t tried this option yet but it’s listed in the documentation. Convert the IP address of the controller to hex https://www.browserling.com/tools/ip-to-hex then prepend it with 01:04, replacing all periods with colons (.) to (:)
192.168.1.1 would look like 01:04:c0:a8:01:01
in pfSense or OPNsense go to your DHCP server and add it to the Additional Options section
OPNsense does have the option for IP address or host so I would be interested in knowing whether or not using the unconverted IP address works for people. I’m currently leveraging the DNS method so I don’t plan on testing this out right now, but please leave a comment if this works for you or not.