UDM Pro Error Changing WAN IP Addresses

There appears to be a bug on the UDM Pro that you can encounter while trying to update your WAN IP addresses. The error was similar to “Can’t change IP Address “PublicIP” used in Default Network”

https://community.ui.com/questions/UDM-Pro-Cant-set-Static-IP-Address-on-WAN-interface/9f83c841-da1a-4b16-b963-c4be3ae3fbab?page=2

It appears that the issue stems from the Internet Source IP being used in the LAN Network settings.

The way to work around this is to disable the Internet Source IP. However, this is greyed out which keeps us from making any changes. We can however use the Chrome Developer tools to get around this restriction.

  • Enable the Legacy Interface. UniFi Network Settings -> System -> Legacy Interface
  • Go to Settings -> Networks -> Edit (Select Default Network)
  • Open up the Dev tools with Ctrl + Shift + i and select Console
  • Paste the following in and hit enter
$$('[disabled]').forEach( a => a.disabled=false )
Enable Internet Source IP on UDM Pro
  • Find “Internet Source IP”, Disable and Save!

Swap back to the new user interface and go change the WAN IP address.

Setup DHCP server on Linux

Install dhcp server software

sudo apt install isc-dhcp-server

Edit the following config file and set the networking interface it should use. In this case enp60s0

sudo vi /etc/default/isc-dhcp-server

Example line to change

INTERFACESv4="enp60s0"

Now edit the dhcpd.con file

sudo vi /etc/dhcp/dhcpd.conf 

Add the following in. Change the addresses and settings as needed.

subnet 192.168.47.0 netmask 255.255.255.0 {
   range 192.168.47.26 192.168.47.30;
   option domain-name-servers ns1.internal.example.org;
   option domain-name "internal.example.org";
   option subnet-mask 255.255.255.0;
   option routers 192.168.47.1;
   option broadcast-address 192.168.47.255;
   default-lease-time 600;
   max-lease-time 7200;
 }

Set a static ip on the computer that’ll be acting as the dhcp server. You can set it as the gateway if it is the gateway.

Allow dhcp through the firewall

sudo ufw allow  67/udp
sudo ufw reload
Restart the service and connect a client.

sudo systemctl restart isc-dhcp-server

More info.

You can look at dhcp leases with the following command

tail -f /var/lib/dhcp/dhcpd.leases