...at least you're not on hold...

December 4, 2019

OpenWRT on Linksys WRT1200AC

OpenWRT on Linksys WRT1200AC

What is OpenWRT ?

OpenWRT project is basically a Linux OS that is targeting embedded devices. It offers kernel with fully writable filesystem that includes package management. 

Some routers do not let you disable services like telnet or setup a custom routing rules.

Also quite a few vendors have infamous backdoors built in and instead of removing them, they would just obfuscate it rather than closing them.

Taking that in mind, OpenWRT enables you to bring back security into your network with the source code that is open for everyone to review.

One of the main benefits of running it on your router is that you take back the control. Essentially you get full access to modify your router as you wish.

Build system prerequisites

To build the system yourself, you will need:

  • WRT1200AC (obviously)
  • Linux based system / Virtualbox
  • At least 15GB of space
  • 2GB of RAM at a minimum

After you’ve configured your Linux distro, install the following required dependencies (for Debian/ Ubuntu)

sudo apt install libncurses5-dev gawk gettext unzip file libssl-dev wget libelf-dev ecj fastjar

sudo apt install java-propose-classpath subversion g++ zlib1g-dev build-essential git python python3 python3-distutils
There could be additional required packages based on your disto and it’s version

Next step would be to clone the source code repository of the OpenWRT project

git clone https://github.com/openwrt/openwrt.git
This may take a while depending on your connection

Navigate into the cloned repository folder

cd openwrt

OpenWRT build system has a specific script called feeds which downloads and syncs all the packages required for firmware configuration state, so it will need to be ran from inside the openwrt dir

./scripts/feeds update -a
Update the list of required packages. It will also inform you if there is a dependency package from a beginning missing
./scripts/feeds install -a
Install all of the required packages

The system is now ready for configuration. Pop up a build configuration menu using the following command inside OpenWRT directory

make menuconfig

Info on routers hardware

Select target system

 Marvell EBU Armada

Subtarget system

Marvell Armada 37x/38x/XP

Target profile

Linksys WRT1200AC

I would recommend to add web interface package into the system image.

You can find it in LuCI -> 1. Collections

After everything you would like configured is selected, go into save and put it into a .config file, than exit makemenu.

Now that everything is configured and saved, it’s time to compile the code into an image

make
To speed up the process, add -j N argument, where N is the number of CPU cores you would like to utilize + 1

Images will be located in bin/targets/mvebu/cortexa9

openwrt-mvebu-cortexa9-linksys_wrt1200ac-squashfs-factory.img
Is for flashing over the stock Linksys firmware
openwrt-mvebu-cortexa9-linksys_wrt1200ac-squashfs-sysupgrade.bin
For upgrading existing image

Flashing  the built firmware

Connect to the routers web interface from a browser. Router should be located at 192.168.1.1 . After signing in, open the connectivity page.

You should see this.  Under manual, choose the built openwrt image and start flashing. Router should reboot a few times.

After it’s done, log in back at 192.168.1.1 . Change the default admin password and configure the network based on your internal settings.

Thanks for reading!

Posted in Linux, OpenWRTTaggs: