Skip to main content

Upgrade OpenWRT the Easy Way

 

It's important to keep your Router / Firewall appliances updated to the most recent versions of their firmware in order to maintain good security on your networks.  With OpenWRT, for a long time, this was a tedious process.  You had to get the new firmware, back up your existing setup, install the new firmware, install all of the packages you had again, and setup your configurations again.

It's been made much easier these days, but knowing how to get this done is not extremely obvious, as OpenWRT still does not "ship" with the necessary packages already installed. 

Let's go through the process together to update your OpenWRT appliance, without having to reset everything manually. 

What you'll need

  • OpenWRT installed on something (x86, dedicated hardware)
  • Access to the Luci Web Interface for the OpenWRT router
  • Internet access
  • About 10 minutes of your time.

Backup your current configuration

If you do nothing else in this tutorial, please, please, please make sure you make a backup of your current configuration and store it somewhere safe. This is important even if you aren't going to be updating the firmware today.  This can save you hours of work should anything terrible happen to your router/firewall.

  1. Login to your router's web user interface.
  2. Go to 'System' in the top navigation. When hovering, it should display a drop-down menu.
  3. Select 'Backup / Flash Firmware' from the drop menu.
  4. On the Backup page, you'll want to click the blue button that says 'Generate Archive'. 
  5. This will create a zipped file of your current configuration, and download it to your local machine. 
  6. Rename this downloaded file by appending "-pre-update" to the end of the generated file name.

You now have a backup of your OpenWRT configuration. 

Install the Attended Sysupgrade Packages

Now, we need to install a couple of packages from the software repository that will help us upgrade our current install, and also help us keep all of the configurations, packages, and so on in the process.

  1. In the upper navigation go to 'System' again and hover. 
  2. In the drop-menu, select 'Software'. 
  3. On the Software page, click the 'Update Lists...' button.  (You need internet access for this step to complete).
  4. Once updated, you'll see a list of available and installed software packages below the button row.
  5. You can use the search near the top of the 'Software' view to filter the list of available packages. 
  6. Type in 'Attended' and you should see the package listed as "attendedsysupgrade-common". To the right of this package option you'll see a button that says "Install". 
  7. Click the "Install" button, and wait for it to complete. There should be a pop-up message indicating a log of what happened, and a success message in it. You can dismiss this pop up when it comes up.
  8. Next, scroll down the software list until you find the package labeled "luci-app-attendedsysupgrade", and again click the "Install" button to the right of it.  This application gives us the ability to perform the attended sysupgrade from inside the web user interface.
  9. Again, you can dismiss the success pop-up when it's displayed. 
  10. Refresh your browser window, and you should now see a new option in the 'System' top navigation menu. 

Upgrade your OpenWRT using Attended SysUpgrade

We can now update our OpenWRT system using the Attended Sysupgrade function we just installed. The good news is this function will be kept for us to use in the future since we are using it to upgrade our firmware in-place.

  1. In the top navigation 'System' menu, select 'Attended Sysupgrade'.
  2. On the upgrade page, click the button labeled 'Search for Firmware Upgrade'.
  3. Be patient while it searches. If an upgraded version exists for your current install, it will be listed in a pop-up window. If not, the pop up will tell you there is no update available at this time.
  4. If you do have an update available, click the drop down to see if more than one version is available. You may want to update through each version 1 at a time, but feel free to jump to the latest version if it's presented. 
  5. Click the 'Reequest Firmware Image' button.
  6. This will send the request off to a build server to build a new image for your hardware.
  7. Be patient while the new version is built. It may take a few minutes to go through that process. 
  8. Once the build is complete, you'll want to click the link to Download the new image version as a backup copy. 
  9. Make sure the option to 'Keep setup and retain the current configuration' is checked.
  10. Click the 'Install Firmware Image' button. 
  11. Again, be patient as this will update the firmware, and reboot the device when complete. On my devices it took anywhere from 2 to 5 minutes to complete. Varying devices may take more or less time. 
  12. Once complete, you'll be redirected back to the login screen of your device. 
  13. Do a quick manual check of your various settings and configurations, and make sure everything looks good. 
  14. Ensure you can still navigate around your network, and access the internet.

Congratulations, you've updated your OpenWRT system.

Make a Backup

I know what you're thinking, and yes, we did make a backup earlier, but that was our pre-upgrade backup. Now we need to make our post-upgrade backup.  Make the backup in the same way as before, but rename this one by appending '-post-updade' to the file name. Keep both versions for a couple of weeks, just to be sure everything is working well. When you're satisfied that it's working fine, you can feel free to delete the pre-upgrade version if you want.

Support My Channel and Content

Support my Channel and ongoing efforts through Patreon:
https://www.patreon.com/awesomeopensource

Buy me a Beer / Coffee:
https://paypal.me/BrianMcGonagill