This entry will show you how to upgrade an Ubiquiti EdgeRouter using the command line. Before we do an upgrade we will do a backup in case something goes wrong. After upgrading we will show how to restore a backed up configuration which shouldn’t be needed if everything goes as planned.
Backup EdgeRouter Using CLI
There are several ways to do this. One of the simplest ways is to output the configuration and then copy and paste it.
stupiderror@stupiderror:~$ cat /config/config.boot
This will dump your configuration to the screen. You can then copy the configuration and then paste it to a text file on your computer and save it.
You can use the save command to backup the config using scp, ftp, or tftp. Here is an example using ftp:
save ftp://stupiderror:stupidpassword@stupiderror.com/config.boot.backup
Update EdgeRouter Firmware Using CLI
We will show two ways to do this. You can have the router get the update directly and apply it or you can download it to your computer and upload it to the router. First lets see what version is currently running using the show version command:
stupiderror@stupiderror:~$ show version Version: v1.5.0 Build ID: 4677648 Build on: 06/20/14 13:01 Copyright: 2012-2014 Ubiquiti Networks, Inc. HW model: EdgeRouter PoE 5-Port HW S/N: 1CC328D0C476 Uptime: 14:19:38 up 77 days, 1:25, 1 user, load average: 0.18, 0.10, 0.07
Go to https://www.ubnt.com/download/ and use the drop down menus to select your router. Version 1.6.0 is available: ER-e100.v1.6.0.4716006.tar. First we will show how to do the upgrade from the router. We need the URL to download the new firmware from which isn’t provided here. We can build it ourselves though. http://dl.ubnt.com/firmwares/edgemax/v1.6.0/ This is the URL where the downloads are kept. You may need to change the end of the URL if you are getting a version other than v1.6.0. Now append the file name (ER-e100.v1.6.0.4716006.tar) provided on the download page to the URL which gives us: http://dl.ubnt.com/firmwares/edgemax/v1.6.0/ER-e100.v1.6.0.4716006.tar We then use the add system image command to tell it to retrieve and install the firmware:
stupiderror@stupiderror:~$ add system image http://dl.ubnt.com/firmwares/edgemax/v1.6.0/ER-e100.v1.6.0.4716006.tar Version [v1.2.0.4574253.130626.1248] is about to be replaced Are you sure you want to replace old version? (Yes/No) [Yes]: Yes Trying to get upgrade file from http://dl.ubnt.com/firmwares/edgemax/v1.6.0/ER-e100.v1.6.0.4716006.tar % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 70.1M 100 70.1M 0 0 2815k 0 0:00:25 0:00:25 --:--:-- 2863k Download suceeded Checking upgrade image...Done Preparing to upgrade...Done Copying upgrade image...Done Removing old image...Done Checking upgrade image...Done Copying config data...Done Finishing upgrade...Done Upgrade completed stupiderror@stupiderror:~$ reboot Proceed with reboot? [confirm][y] Broadcast message from root@stupiderror (pts/0) (Sun Feb 22 14:32:46 2015): The system is going down for reboot NOW! stupiderror@stupiderror:~$ show version Version: v1.6.0 Build ID: 4716006 Build on: 10/31/14 17:31 Copyright: 2012-2014 Ubiquiti Networks, Inc. HW model: EdgeRouter PoE 5-Port HW S/N: 1CC328D0C476 Uptime: 14:37:21 up 4 min, 1 user, load average: 0.41, 0.52, 0.24
After the file the is uploaded and installed we then have to reboot so the new firmware can be loaded. After the reboot is complete we log back in and show version to confirm we are using the new firmware.
Another way to upgrade it is to download the file to our computer and then we can upload it to the router. In this case when you go to https://www.ubnt.com/download/ and select your router from the down drop menus you can then click the Download button and save the file. To upload the file to the router use scp in *nix or pscp in windows. pscp is made by Simon Tatham, the same person who makes putty. pscp is used from the command prompt. You want to give a command similar to below, make sure you have the correct file name, username, and IP address.
c:\>pscp ER-e100.v1.6.0.4716006.tar stupiderror@192.168.1.1:
Once it uploads you then use the add system image command to install it:
stupiderror@stupiderror:~$ add system image ER-e100.v1.6.0.4716006.tar
Everything is the same as above. Once it finishes installing you then need to reboot the router. After it reboots you can log back in and use show version to confirm the new firmware is being used.
Restore EdgeRouter Configuration Using CLI
Use scp or pscp to copy your backed up configuration file to the router. Once it is copied you can then load it and save it.
c:\>pscp starter-config.boot ubnt@192.168.0.1:/tmp/ stupiderror@stupiderror:~$ configure stupiderror@stupiderror# load /tmp/starter-config.boot stupiderror@stupiderror# commit stupiderror@stupiderror# save