Playing with openwrt on TP-Link Archer C20 wifi router

I have been using dlink and tp-link wifi routers since long with their default firmware. These firmware do not provide enough flexibility and control on what you want to configure and see. So I decided to go for openwrt. Next big task was to find a cheap router with which I can play. I read on openwrt documentation that 8mb flash and 64mb RAM is recommended to give enough room to openwrt. After going through supported hardware list on openwrt website I found tp-link archer C20 version 4 as best fit to play with. It was available on Amazon for just 1299 Rs.
This is a dual band router with 3 antennas.

There are multiple ways to flash openwrt image on different routers. Some work with simple firmware upload from web console of manufacturer provided software, for some you need to work hard and solder USB port connection on the board and for some simple tftp flash method works.

TP-LINK Archer C20 picks firmware from tftp server. When you press reset and power cycle together it starts looking for tp_recovery.bin file on 192.168.0.66 TFTP server. And you can see this happening in tcpdump running on Linux box serving firmware to router over tftp.

tcpdump -vv -X port 69

Now was the exciting moment, With the brand new router I was about to give a try and in the first attempt it worked !!

 

Here are the steps from openwrt website to flash openwrt on Archer C20 router:

https://openwrt.org/toh/tp-link/tp-link_archer_c20_v4#installation

1) Download https://downloads.openwrt.org/snapshots/targets/ramips/mt76x8/openwrt-ramips-mt76x8-tplink_c20-v4-squashfs-tftp-recovery.bin.

2) Configure a computer with static IP 192.168.0.66/24 and a TFTP server. On Debian or Ubuntu you can use either the tftpd-hpa or tftpd server packages.

3) Rename the downloaded firmware file to tp_recovery.bin and place it in the tftp server’s root directory. (If using tftpd-hpa this is /var/lib/tftpboot/; if tftpd, it is /srv/tftp/.) You can test that the file is downloadable with tftp localhost and get tp_recovery.bin.

4) Connect the computer to one of the router’s Ethernet ports while the router is off. Press and keep pressed the router’s reset button and power it up. After about 7-10 seconds release the reset button. The power LED will flicker rapidly for ~3 seconds, indicating download of the firmware file.

5) The router will write the firmware to flash during ~40 more seconds of occasional power LED blinks, and then will reboot by itself, ready for use.

Once image is flashed, assign your Linux machine a static IP from 192.168.1.0/24 and follow these steps to configure internet connection on router:

1) Open web console, LuCI, of openwrt at http://192.168.1.1 login as “root” and no password. You can also access router with ssh on same IP.

2) You may want to change you LAN network. I did changed it to 192.168.0.0/24, As many of my devices were with static IP from this subnet. To do it go to Network->Interfaces, Then edit “LAN”. Remember when you change it to other network you should change your Linux machine IP with a static IP of that new network. Otherwise you cannot access LuCI web interface of openwrt.

3) I have airtel OFC broadband which works with optical modem. Connect LAN cable coming out of that device to the WAN port of your Archer C20 router.

4) On LuCI web interface of openwrt, navigate to Network->Interfaces and edit WAN. Here select PPPoE in protocol and enter PPPoE username and password. “Save and apply”, at this stage your internet should start working.

5) Next configure wifi. Go to Network->Wireless and edit default “openwrt” ssid. Here you can set ssid and password of your choice. On Wireless Security tab, select encryption of your choice (I suggest using WPA2-PSK for better security) and enter “Key” of SSID.

6) Now try connecting some device (mobile, laptop) to this SSID and see if your internet works on it.

You can see devices connected to router on the “Status” page of openwrt web interface(LuCI).

Hope this helps you !