TP-Link WR703N OpenWrt post installation tips
In this post I’ll write down a few thigs I think are worth doing right after flashing your WR703N. The flashing itself is not covered in this post. For that, check out my How to flash TP-Link WR703N with OpenWrt post.
Setting up a static IP address
The first thing you should do is to assign a static IP address of your choice to your WR703N. There are three main reasons for doing this:
- Since your home router probably already uses 192.168.1.1, you will avoid having problems caused by conflicting IP addresses
- You will always know what the IP of your WR703N is and you will be able to connect to it from inside your network very fast
- Lastly, you will be able to make it work with DynDNS and port forwarding to connect to it from anywhere on the Internet
Connect your WR703N directly to your PC using ethernet cable, telnet to it (telnet 192.168.1.1) and then edit /etc/config/network (Vi editor comes installed with OpenWrt, so you can use that). For example, to set the IP to 192.168.1.100 (assuming your network uses 192.168.1.X range and your home router is at 192.168.1.1), your lan interface section should look like this (do not change/remove the loopback interface part):
1 2 3 4 5 6 7 8 | config interface 'lan' option ifname 'eth0' option type 'bridge' option proto 'static' option ipaddr '192.168.1.100' option netmask '255.255.255.0' option gateway '192.168.1.1' option dns '192.168.1.1' |
Now run this command:
1 | /etc/init.d/network restart |
And after that, feel free to disconnect the WR703N from your computer and connect it to your router/switch (you will be able to access it on the IP address that you just set up).
Enabling SSH / disabling telnet (setting up password)
Setting up the account password (using “passwd” command) will automatically disable telnet and enable Dropbear SSH daemon on port 22. Dropbear is an OpenSSH replacement designed for environments with low memory and processor resources (such as WR703N) and on OpenWrt it is installed by default instead of OpenSSH. You can easily replace Dropbear with OpenSSH if you want, but don’t do it before setting up extroot (see the next subsection) or else you will run out of free space.
Extroot – extending your memory with an external USB device
Extroot will allow you to use an external USB device to extend your internal memory which will enable you to install more packages onto your device (WR703N only has 4MB of flash memory which really isn’t much). Since this is a bit more tricky and it depends on which version of OpenWrt you have installed as well as on what kind of USB stick you have, I believe it is bettter for you to go to extroot wiki page and follow the steps provided there than for me to just copy all that stuff here.
Installing GNU Screen and Vim
GNU Screen will allow you to have multiple screens (you can view them as tabs or virtual terminals) so you won’t have to log in multiple times to have several terminals at once which is really, really handy. Vim is simply Vi improved. If you prefer another terminal editor (nano, joe..), go ahead and install that one.
1 2 | opkg update opkg install vim screen |
If you’re not familiar with screen, here are some basics.
Installing the web interface
You might want to install the OpenWrt web interface – LuCI (you need to have extroot set up for this or you will run out of free space):
1 2 | opkg update opkg install luci |
You will have to enable and start uhttpd daemon afterwards:
1 2 | /etc/init.d/uhttpd enable /etc/init.d/uhttpd start |
Then you will be able to access the web interface by typing your WR703N’s IP into your browser’s URL bar.
Switching to Bash / setting up .bashrc
OpenWrt comes with Ash shell. If you would like to use Bash instead, here is how you can switch and add some nice colouring to it. Install Bash by issuing the following:
1 2 | opkg update opkg install bash |
Then edit /etc/passwd and change the root user line to this:
1 | root:x:0:0:root:/root:/bin/bash |
After that, run this command (which will create /root/.bash_profile and put “. $HOME/.bashrc” in it):
1 | echo ". $HOME/.bashrc" > /root/.bash_profile |
Then you can either use your own .bashrc or download the one that I use (I got it from Arch wiki a few years ago) and put it in your root directory like this (if you would like to use your own .bashrc, make sure to put it in /root as well):
1 | wget -P /root/ http://cmikavac.net/download/.bashrc |
Now log out, and log in again and you should have a brand new prompt.
SSH public key authentication
To enable SSH public key authentication on Dropbear you will first have to copy your public key to your WR703N’s tmp directory by issuing the following command from your Linux machine (change YOUR_KEY with your actual public key file name, and WR703N_IP with the IP address of your device):
1 | scp ~/.ssh/YOUR_KEY.pub [email protected]_IP:/tmp |
Then log in to your WR703N and copy your public key to authorized_keys file:
1 2 | cat /tmp/YOUR_KEY.pub >> /etc/dropbear/authorized_keys chmod 0600 authorized_keys |
I couldn’t make make OpenSSH work with SSH public key authentication because apparently there is a bug in OpenWrt’s OpenSSH package (I read that somewhere on OpenWrt forums while I was trying to make it work some time ago, but I can’t find that post now… if I find it, I’ll put the link here).
If you don’t use SSH public key authentication already, go here and read why you should and how to use it.
Using DynDNS / setting up port forwarding on your router
If your router supports DynDNS, or a similar service, you can make your WR703N accessible from anywhere on the internet (this is useful because you will be able to use your WR703N to tunnel your traffic to protect yourself while you are connected to an unsecured network somewhere). The explanation will be a bit more generic, but it will give you a rough idea on what you have to do to make it work:
- Register an account on DynDNS webpage
- Enter your DynDNS credentials into your router (find them somewhere in your router’s options)
- Forward a high TCP port (something above port 1024) to your WR703N (for example – if your WR703N is on 192.168.1.100, and Dropbear is running on port 22, then forward 8822 TCP to 192.168.1.100 port 22)
Now you should be able to SSH into your WR703N by issuing the following command inside your terminal:
1 | ssh -p 8822 [email protected] |
This might help you set up port forwarding on your router.
Reflashing
If you for any reason ever want/need to reflash your WR703N with a fresh instance of OpenWrt do the following (wget will download the latest snapshot of OpenWrt for WR703N, and mtd command will flash it to your device):
1 2 3 | cd /tmp wget http://downloads.openwrt.org/snapshots/trunk/ar71xx/openwrt-ar71xx-generic-tl-wr703n-v1-squashfs-factory.bin mtd -r write openwrt-ar71xx-generic-tl-wr703n-v1-squashfs-factory.bin firmware |
Other
OPKG Wiki
OpenWrt WR703N Wiki
MiniPwner
PirateBox
Hope this helps. If you find out that something I wrote is wrong and is not working, please drop a comment bellow and I’ll fix it. Thanks. =)
Wow man, this is just what I was looking for. You rock, you awesome man you!!!
Very helpful tips. Thanks so much for sharing!
Hi,
I want small guide to update my Tp-link WR703N to GUI interface.
Here current states. Please guide me.
1.Openwrt firmware updated via Chinese web interface.
2.Set password for root and I think telnet is disable now.
3.I search on the internet for a long time and but I didn’t found tha kind of clear steps. Therefore I missed static ip part.
when I log to ssh via putty and insert this command below error message shows
“-ash: /etc/config/network: Permission denied”
Please help me to correct it.
Hi Fernando,
if I understand correctly, you entered “/etc/config/network” as a command? That is just the network file path, not a command. You will have to edit the network file with a CLI text editor. More specifically, you can do it like this: “vi /etc/config/network” (without quotes).
You will probably also need this http://www.washington.edu/computing/unix/vi.html to find your way around using Vi editor.
Hope it helps.
Hi Pootzko
Thanks for your reply. I change my hme router IP to 192.168.1.2 and dhcp to 192.168.1.3 to up. So Now I can access my TPlink via 192.168.1.1.
Now i’m trying with extroot(exe2 device created with gpart)
Hi guys,
How to use Extroot.
I try enable Extroot.
but not work.
here my log
Filesystem Size Used Available Use% Mounted on
rootfs 1.4M 232.0K 1.1M 16% /
/dev/root 1.5M 1.5M 0 100% /rom
tmpfs 14.2M 64.0K 14.2M 0% /tmp
tmpfs 512.0K 0 512.0K 0% /dev
/dev/mtdblock3 1.4M 232.0K 1.1M 16% /overlay
overlayfs:/overlay 1.4M 232.0K 1.1M 16% /
I wan to extroot my usb pen drive.I formatted that pen drive as exe2 with gpart.
Please help me to enable extroot
thanks
please help
[email protected]:~# opkg update
Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages/Packages.gz.
wget: server returned error: HTTP/1.1 404 Not Found
Collected errors:
* opkg_download: Failed to download http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages/Packages.gz, wget returned 1.
Fernando,
You might want to start fresh and then follow the instructions here.
How do you start fresh? Hit the failsafe section, here: http://wiki.xinchejian.com/wiki/Install_OpenWRT_on_TPlink_WR703N
I found I needed a combination of firstboot, rm -r /overlay/*, followed by mtd -r erase rootfs_data (which actually reboots the device)
It may be worth noting that if you configure your router from a LAN then you will need to setup the Lan interface with a gateway and DNS otherwise OPKG Update may not work.
I’ve installed trunk r35847 in my wr307n v1.7. The kernel is 3.7.9 which doesn’t supports sdparm module (it requires 3.8.2) so I can’t set up 3g. I’ve already bricked the unit trying sysupgrade (manage to recover through serial port though). Would it be safe upgrading the kernel w/o upgrade the trunk? or any way to setup 3g in a v1.7 unit?
v1.7 December 2012 Trunk(r35037) Confirmed working
If you have a V1.7 firmware, flash OpenWrt trunk r35037 unless you have access to the serial console!
Below is the version of the new bootloader (which disables the LAN port) of a version 1.7 hardware model (bought in December 2012).
[email protected]:~# grep -a U-Boot /dev/mtd0ro | cut -d’I’ -f1
U-Boot 1.1.4 (Sep 25 2012 – 09:04:47)
For more info visit this forum topic: https://forum.openwrt.org/viewtopic.php?id=40986
If you are brave, try a snapshot sysupgrade
If I wish to start fresh, and am already running an older trunk, how do I re-flash? Using the sysupgrade image will leave files intact, I want to start over completely. Above you suggest flashing the factory image…is that ok since I am already running openwrt? If so, will it do what I want?
hm.. at the time of writing this post, the procedure under “reflashing” worked fine for me. I believe it should still work, and that it should do what you want. Perhaps go and ask on openwrt forums just to be sure.
Hi
Is some one from this form are willing to help me started ?
I am willing to pay for the time.
Can we have a TeanViewer session where you can guide in the first step of compilation and make openwrt module?
1. Cross compile firmware from scratch to make sure that all sources are working with the given hardware. The build script is at https://raw.github.com/Squonk42/LinkDuino/master/downloads/LinkDuino_build.sh
2. I will like to compile all with the added changes for version 1.7 to wr703n http://wiki.openwrt.org/toh/tp-link/tl-wr703n
a. v1.7 December 2012 Trunk(r35037) Confirmed working https://dev.openwrt.org/changeset/35037
3. I’m planning to test i2c bitbang driver (kmod-i2c-gpio-custom) with one sensors over I2C
a. as seen at https://forum.openwrt.org/viewtopic.php?pid=169900
4. And add a control and status web pages to Luci.
5. I have Oracle VM virtual Box install too with Ubuntu and Fedora.
Thank you
– [email protected]
– Skype : nissim.test
Hi,
yesterday I installed openWRT on my WR703N and almost everything was fine. Trying to configure network and wireless files failed, but it was possible to connect to it. Today I can’t connect via ssh or telnet to the router. Ping fails too. It’s something I can do to to enter again?
Thank you.
I also have a problem with wireless on my WR703N. When I extend USB storage the wlan0 is not visible anymore. And I can’t get it to enable. If I use cat /proc/net/wireless it doesn’t see a WLAN. And ifconfig wlan0 up isn’t working either. When I pull out my USB drive it boots back into the local memory and the WIFI works again.
Anyone can help me with my problem on WR703N?
I am playing around with the setup… when suddenly decided to change DNS to 202.73.37.3
(dunno what came in my mind… but i did it anyway)
after applying the settings.. i couldn’t access the web interface anymore…
i can still ping using ip… but no web interface access.. no SSH access…
thanks in advance…
Hi ToReRo,
check this link, I think it might help you:
http://wiki.openwrt.org/toh/tp-link/tl-wr703n#failsafe.mode
Hi
First of all, I would like to say thank you so much for the post. I am looking for such installation guide and wasted so much time on OpenWrt forum without any clue.
I have flash mine and now have a problem which same as Fernando was facing last time.
[email protected]:~# opkg update
Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages/Packages.gz.
wget: server returned error: HTTP/1.1 404 Not Found
Collected errors:
* opkg_download: Failed to download http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages/Packages.gz, wget returned 1.
How to proceed from here and any solution?
Thanks advance.
hey, i am doing a based on this but unfortunately i am having a trouble with. does anyone know how to link the arduino and tp-link307n. i have already the openwrt bit but then i having problem putting a webpage and link the arduino .. can anyone please .
thank you
Hi mitz
You can check below link, hope it help you.
http://www.cse.dmu.ac.uk/~sexton/ENGD2003/openwrt/arduino%20teensy%20openwrt.html