Installing OpenWrt on TP-Link Archer C7
Wireless freedom – that’s the appealing slogan of OpenWrt, a Linux distribution specifically made for embedded devices such as routers and access points. It gives you full control over what is installed on the device and how it is customized, and it can extend the functional capabilities of your router significantly compared to the vendor's firmware. But the installation can be quite tricky. In this post I want to share some lessons I learned when installing OpenWrt on an Archer C7.
OpenWrt
Getting control over what is running on my router and extending its functionality were the main reasons for me to look for an alternative firmware. OpenWrt is not the only software of that kind – there are others like dd-wrt or Tomato, just to name a few. But compared to them OpenWrt has some advantages:
- It supports a lot of different devices. Tomato, for instance, only supports Broadcom-based devices.
- It contains a lightweight package manager that allows installing packages for OpenVPN, Samba, FTP etc. from local sources or from the internet. With that approach, the base software can be kept small and the user can install only the packages that are really needed.
- It has a vivid and very active development community. The latest release (Chaos Calmer – version 15.05.1) came out in March 2016. The last official release of dd-wrt on the other hand is from 2008 as far as I could see.
So, these are all good reasons to go for OpenWrt. The downside is (but that’s true for any other alternative firmware as well) that you lose the warranty – which is not really a surprise, of course.
Archer C7
The TP-Link Archer C7 is a wireless router from TP-Link offering decent performance and low power consumption for a very good price. It supports 2.4 and 5 GHz, 802.11ac and has 4 LAN and 2 USB ports. Currently, you can get it refurbished on eBay for less than 60 euros. But make sure that you get a V2.0 device – OpenWrt does not support 5 GHz on V1.1 devices.
Flashing OpenWrt
The installation process is normally very simple. It is described in the OpenWrt wiki. I did the installation according to method 1 (via OEM firmware). But unfortunately, the upgrade process stopped with the message:
Error code: 18005
Upgrade unsuccessfully because the version of the upgraded file was incorrect. Please check the file name.
So, it seems that the current TP-Link firmware contains some check that prevents flashing alternative firmwares – sh*t!!! But how to resolve that? After a lengthy and annoying search in various forums, I found a solution in the dd-wrt forum:
- Download the LEDE firmware. LEDE is a fork of OpenWrt.
- Execute the flashing process via the web UI of the Archer C7, select the LEDE file that you have just downloaded and update your router. This time, error 18005 shouldn’t occur.
- Your router is now running LEDE. Because LEDE does not offer a web UI, you have to access your router via SSH. The device has the IP 192.168.1.1. In order to connect to it via SSH, your PC needs to be in the same subnet (i.e., it has to have an IP 192.168.1.x). You could give it, e.g., the static IP 192.168.1.2. Now connect the LAN port of your PC to one of the four LAN ports of the C7. Connect another LAN port of the C7 to your local network (a switch, another router or whatever you have). Restart the network manager of your PC. Now, it should have the IP 192.168.1.2 and
ping 192.168.1.1should work. - Access the C7 via SSH:
ssh root@192.168.1.1. Typeyesand press Enter. When it asks for the password, just press Enter because the initial password is empty. - Now you can install the web UI. First, execute
opkg update, which updates the package lists on your device. Then install the web UI viaopkg install luci-ssl. Once this is finished, you should be able to access the web UI from the browser via http://192.168.1.1. Use the userrootand an empty password. - Now you can install OpenWrt. Download the current version of OpenWrt as described in the OpenWrt wiki. In the LEDE web UI, navigate to System – Backup / Flash Firmware. There, under Flash new firmware image, select the OpenWrt image you have downloaded and flash it.
- After this is done, you can access the OpenWrt web UI via http://192.168.1.1. Log in with the user
rootand an empty password. Now you can configure OpenWrt. First, you should define a root password and give the router an IP from your desired subnet. Once this is done, you can disconnect the C7 from your PC and reconnect the PC and the C7 to your local network. You should now be able to access the C7 via the web UI under the new IP. - Configure OpenWrt according to your needs and have fun with it.