Blog

How to Migrate From an Existing UBNT EdgeRouter to a USG

So you’ve been secretly oogling the shiny USG device and the been frustrated with the Controller software and blank graphics like me? I can verify that the migration process is quite straight forward, with some manual lifting involved.

The process is like this:

  1. Dump you existing ERL configuration to a textfile, save it on your computer and never touch the ERL again.
  2. Hook up your new USG to your computer via the LAN port.
  3. Move your new configuration over to the new device, such as external WAN ip settings and local LAN settings, including DHCP static leases etc. You need to also delete any existing conflicting settings, or the new/changed settings won’t take.
  4. commit, save, and reboot
  5. specify the unifi controller adoption url if neccessary and discover and adopt the new device via the controller software
89b8de5c-2eed-4682-bfce-5fd8fab45e14.jpg

Dump existing ERL configuration to a text file

1
[email protected]:~$ show configuration commands > config.txt
dump-existing-erl-configuration-to-a-text-file.png

The commands are ready to be copy & pasted into your new device. As the device is preconfigured with some conflicting settings, it is not possible to run this as a script, as you must delete existing settings before committing.

93bdf8b7-dc62-4e10-9be1-2d35be01049a.png

Connect new device to local computer

Attach your local computer to the LAN port on the USG. The USG will serve out DHCP address in the 192.168.1.1/24 range and the router default adress is 192.168.1.1.

connect-new-device-to-local-computer.png

Login

Login using default settings ubnt/ubnt

login.png

Script settings

You could script settings (which I tried at first) but since existing configuration clashes with the new updated ones, you would first need to prep the script with delete commands. This would be usable if I had many devices but since I only have one, its easier to copy paste relevant lines directly.

script-settings.png 80aa6023-6167-4441-b688-6f1769cbf20d.png

chmod +x erl_config.sh

4f550f90-64c0-48fe-8a8b-66cc55d3c5fe.png

When you execute, the script will fail to commit due to conflicting changes.

43937bd5-a6a2-4ae3-b2f0-3e1d5ebf2ccf.png

Some settings will take though

28f16f7d-7d9f-465c-904c-7579fca503b4.png

Set static LAN ip address

The LAN port is given a static ip.

1
2
3
4
5
configure
edit interfaces ethernet eth1
set address 10.0.1.1/24
delete address 192.168.1.1/24
commit

You will loose connectivity at this point. Do not reboot the device as the settings will not survive until you save.

Update your local computer IP settings to match your new LAN network.

set-static-lan-ip-address.png

Update known_hosts

If you like me replace an existing device, chances are you need to update the SSH configuration.

1
nano ~/.ssh/known_hosts
update-known_hosts.png

Set WAN configuration

1
2
3
configure
show interfaces
set interfaces ethernet eth0 address *you wan ip/size*
set-wan-configuration.png
1
show interfaces ethernet eth0
6fd11612-4251-4920-8426-f931817f83b4.png

show service dhcp-server

delete service dhcp-server

5b825ab9-6d73-4244-8dff-bf0a450547cb.png
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
set service dhcp-server shared-network-name LAN1 authoritative disable
set service dhcp-server shared-network-name LAN1 subnet 10.0.1.0/24 default-router 10.0.1.1
set service dhcp-server shared-network-name LAN1 subnet 10.0.1.0/24 dns-server 10.0.1.9
set service dhcp-server shared-network-name LAN1 subnet 10.0.1.0/24 dns-server 10.0.1.6
set service dhcp-server shared-network-name LAN1 subnet 10.0.1.0/24 domain-name rylander.io
set service dhcp-server shared-network-name LAN1 subnet 10.0.1.0/24 lease 86400
set service dhcp-server shared-network-name LAN1 subnet 10.0.1.0/24 start 10.0.1.100 stop 10.0.1.199
set service dhcp-server shared-network-name LAN1 subnet 10.0.1.0/24 static-mapping Familjens-iPad ip-address 10.0.1.151
set service dhcp-server shared-network-name LAN1 subnet 10.0.1.0/24 static-mapping Familjens-iPad mac-address '2c:1f:23:23:d7:e6'
set service dhcp-server shared-network-name LAN1 subnet 10.0.1.0/24 static-mapping FamiljensiPad2 ip-address 10.0.1.170
set service dhcp-server shared-network-name LAN1 subnet 10.0.1.0/24 static-mapping FamiljensiPad2 mac-address '74:e1:b6:b7:69:85'
set service dhcp-server shared-network-name LAN1 subnet 10.0.1.0/24 static-mapping FamiljensiPhone ip-address 10.0.1.176
set service dhcp-server shared-network-name LAN1 subnet 10.0.1.0/24 static-mapping FamiljensiPhone mac-address 'c0:9f:42:a4:68:e8'
...
set service dhcp-server shared-network-name LAN1 subnet 10.0.1.0/24 static-mapping VeraLite ip-address 10.0.1.104
set service dhcp-server shared-network-name LAN1 subnet 10.0.1.0/24 static-mapping VeraLite mac-address '00:0e:8f:df:f2:79'
set service dhcp-server shared-network-name LAN1 subnet 10.0.1.0/24 static-mapping XboxOne ip-address 10.0.1.116
set service dhcp-server shared-network-name LAN1 subnet 10.0.1.0/24 static-mapping XboxOne mac-address 'c0:33:5e:d8:e1:79'
set service dhcp-server shared-network-name LAN1 subnet 10.0.1.0/24 static-mapping kidsPad ip-address 10.0.1.122
set service dhcp-server shared-network-name LAN1 subnet 10.0.1.0/24 static-mapping kidsPad mac-address 'a8:88:08:be:9c:d5'
set service dhcp-server shared-network-name LAN1 subnet 10.0.1.0/24 static-mapping photon-nginx-proxy ip-address 10.0.1.32
set service dhcp-server shared-network-name LAN1 subnet 10.0.1.0/24 static-mapping photon-nginx-proxy mac-address '00:50:56:94:21:8b'
set service dhcp-server shared-network-name LAN1 subnet 10.0.1.0/24 static-mapping tinboy ip-address 10.0.1.124
set service dhcp-server shared-network-name LAN1 subnet 10.0.1.0/24 static-mapping tinboy mac-address 'c8:2a:14:2d:f3:dd'
set service dhcp-server shared-network-name LAN1 subnet 10.0.1.0/24 unifi-controller 10.0.1.21

Adopt the USG to the controller

Since my internal DNS isn’t used by the router, I need to map a hostname to an ip. The default mapping can be removed.

1
edit system static-host-mapping
adopt-the-usg-to-the-controller.png

Set local host mapping

1
set host-name unifi.rylander.io inet 10.0.1.21
set-local-host-mapping.png

Verify connection to controller and initiate adoption

1
ping unifi.rylander.io

If the controller can’t find the USG device you can inform the controller by setting the inform url.

1
unifi set-inform [http://unifi.rylander.io:18080/inform](http://unifi.rylander.io:18080/inform)

As I had forgot to port forward the adoption port from my dockerized controller, this step was a bit frustrating at first. Note the screenshot is misleading as a result. I ended up forwarding the dockerized controller port 8080 to the Synology host port 18080 (and remembering why I didn’t forward port 8080 directly).

verify-connection-to-controller-and-initiate-adoption.png

Check status

1
unifi info
check-status.png

Pending adoption

Remember to actually click the “Adopt” link in the controller UI.

Then you also need to go back to the SSH session and reissue the command to make it stick.

pending-adoption.png

Adopting

adopting.png

Provisioning

provisioning.png

Verify settings

The controller will preserve existing settings

verify-settings.png