UniFi - Update UXG WAN IP via SSH

Learn how to update the WAN IP address for a UXG via SSH

Alex Lowe

Last updated: October 9, 2026

Sometimes you might need to update the WAN IP address of a UXG device (UXG Lite, UXG Max, UXG Pro, UXG Fiber or UXG Enterprise) via SSH for a multitude of reasons.

For example, if you use a static IP address to connect to your ISP and this changes for any reason, you can easily update the WAN IP address without having to reset and readopt the UXG.

Update the UXG WAN via SSH

Thankfully, this can be done via SSH if required. To do this, first log into the UXG via SSH. Follow our guide here for more detailed instructions.

First, run ifconfig to check the list of interfaces.

ifconfig

Next, flush out the current IP address from the UXG. In this example, we used a UXG Lite, with eth1 being the WAN interface and eth0 being the LAN.

sudo ip addr flush dev eth1

Then, set a static IP address on the WAN port.

sudo ip addr add ipaddress/netmask dev eth1

Example

sudo ip addr add 172.18.38.5/24 dev eth1

Now, set the gateway IP address

sudo ip route add default via gatewayip dev eth1

Example

sudo ip route add default via 172.18.38.1 dev eth1

Once this is done, the UXG will connect back to the UniFi Controller. What is important to remember is that this configuration change is only temporary and will only be overwritten whenever the UXG reboots. So make sure to update the new WAN connection details within UniFi.

About HostiFi

HostiFi provides hosting for Ubiquiti software platforms, with servers for UniFi and UISP. We also offer network consulting, with HostiFi Professional Services.

Get the Ubiquiti Top 20

Each month our team sifts through Ubiquiti news and content from around the web and delivers 20 of our favorite links to your inbox.

View recent issues

No spam. Unsubscribe anytime.

🤩

Discovered 3+ things that I did not know and will have a material impact on my business.

Newsletter Subscriber

🤩

All the info I want/need in a single clean thread! Perfect!

Newsletter Subscriber

🤩

Providing super valuable information to keep the community in the know. Awesome links page, Thank You.

Newsletter Subscriber