i am moving to a new house and i am getting DSL set up today. i have a pretty complicated home network (multiple segments, internet facing servers, etc.) and i wanted to use something simple to sort of bootstrap the network until i can get my wired network cabled and my switches installed and configured.
i have a linksys router that i flashed with openWRT that is serving mostly as a wireless access point. it was my only router for like 3 years, but i replaced it with an old PC running smoothwall linux and used the openWRT as a wireless access point. i figured i could re-config it as the main router temporarily.
the linksys factory firmware isn’t that great and really only works if you only need access to the internet and don’t mind resetting the box every few days. if you want to run servers from your house, being able to forward only 10 ranges of ports and having an unreliable connection are major hindrances.
openWRT is a good alternative. it’s fairly stable (compared to factory firmware; it’s not as stable as smoothwall) and it has a bunch of nifty features, and uses your same linksys hardware.
configuring openWRT is pretty router guy-ish and involves commits to nvram and the like. it also can be a pretty embbeded systems-ish with talk about solder points and jtags. the only person i have ever heard talking about jtags is travis goodspeed who is an embedded systems monster. so it’s free, open source, multi-platform (i think it runs on PCs even, tho that may just be a development thing) and it’s full of nifty network features like QOS and VLAN tagging.
honestly, openWRT is more robust than smoothwall, but the linksys hardware just isn’t that stable. even with openWRT, it would occasionally (like every few months) stop handing out IP addresses, and my ISP, insight broadband, would randomly decide it wasn’t going to give the openWRT an IP address, even though it would hand out IP’s to laptops and older linksys routers.
anyway, since i am not a micro controller monster, and my router kung fu is still pretty weak, i decided to use x-wrt to handle the configging of the router so i can see what i am doing before it gets committed to nvram. i know that makes you cisco guys cringe
installing x-wrt on top of openWRT makes things a lot easier. x-wrt is a web ui for openWRT. IF linksys firmware is analogous to having xp home on a PC, AND installing openWRT is analogous to installing debian or openBSD on that windows machine, then x-wrt would be analogous to installing webmin on the new linux install.
i still use the openWRT box (it has to be like 5 years old by now) as my WAP, it’s plugged into a third NIC on the smoothwall box.
for some silly reason, on the openWRT i messed with the vlan setup and changed the WAN interface into a regular switch port. i guess i was worried about not having enough wired ports on that network segment or something. this was fine when using the box as an overly complicated WAP, but putting it back in service as a full fledged router was apparently beyond my skill to heal. i spent a couple of hours deleting and recreating networks and vlans to no avail. i just couldn’t get the linksys to pull a DHCP address from the smoothwall and allow a client connected to the switch to connect to the internet.
so i figured i would reset it to the default config, and start fresh. keep in mind that i installed openWRT like 4 years ago. a lot has changed since then.
so now the drama. 4 years ago, the openWRT website was fairly straight forward, and x-wrt was largely experimental, so most of the useful info came from the openWRT wiki. at some point, the openWRT folks decided to redo their docs, and so a lot of info has been lost or is becoming obsolete in a read only copy of the older wiki. simple stuff like “what version of openWRT do i put on my model of router” can be a real challenge to find.
BTW if you have a linksys wrt54gl v1.1 like me, the answer is here.
also, the FAQ’s in the forums (under common mistakes) are a little juvenile in their tone, so i am reluctant to post uninteresting questions like “how do i reset my router to the initial setup?”. the answer is buried on this page.
here’s what you do:
step 1: set up a PC with a static IP of 192.168.1.10
step 2: disconnect everything from the linksys box except for your PC with the static IP, which should be connected to one of the switch ports.
step 3: power cycle the linksys box (unplug the AC, wait a few seconds, plug it back in)
step 4: wait for the DMZ light to come on, at this point the box has booted up
step 5: immediately press and hold reset for a couple of seconds. once the dmz light blinks steadily. the router is now in failsafe mode
step 6: telnet to 192.168.1.1, there should be no login or anything, just the openWRT login splash.
step 7: type firstboot at the prompt and everything should reset.
so i did this and got a working box with the default config. unfortunately, this wiped out x-wrt :sadface:
this left me in the rather unique position of having a working vanilla openWRT install and needing to install x-wrt. this used to be how x-wrt is installed, you go openWRT going, then you did some package installs to download and install x-wrt. nowadays, the preferred method of install is to just flash with a firmware image that already has x-wrt installed. my install is out of date, so it’s time to upgrade.
the x-wrt website offered some info on which firmware image to use, and how to use the linksys firmware update to flash it on, which is how i got openWRT on the box 5 years ago. but not a lot of info on how to get x-wrt on when you already have an outdated version of openWRT.
after more digging this is what i did:
the wrt54gl uses a broadcom board, according to this page
x-wrt suggested the openwrt-brcm-2.4-squashfs.trx image for most broadcom boards, per this page
the wrt54gl page also had this little tidbit in it:
Using the mtd command line tool
If you have already installed OpenWrt and like to reflash for e.g. upgrading to a new OpenWrt version. It is important that you put the firmware image into the ramdisk (/tmp) before you start flashing.
mtd write /tmp/openwrt-brcm-2.4-squashfs.trx linux && reboot
now we are getting somewhere!
so taking what i knew about the image to install from x-wrt, and this handy little tip, we can grab a new version of openWRT AND install x-wrt in one go:
telnet into your recently reset openWRT box and execute the following:
mtd write /tmp/openwrt-brcm-2.4-squashfs.trx linux && reboot
so once the .trx comes down, you use mdt to flash it and when it reboots you should have a working vanilla openWRT + x-wrt.
in the future, i want to mess with the vlans again so there are two internal networks, and also add an additional virtual WLAN interface so i can run two wifi networks, one wpa2+radius for my internal network, and one unsecured one on a locked down segment of the network. this way friends or whomever can just hop on the internet when they come over, and my internal network is safe from potential harm.
i have a new box with 5 nics in it that will be my new router, so i can add a second uplink and a DMZ. i am not sure if i will keep smoothwall, or go with something else, like openBSD.
one interesting thing i discovered: while troubleshooting the problems that led me to flash/update, i was plugging the wan port of the linksys box into a nic on my smoothwall. i was testing with a laptop using a crossover cable connected to the smoothwall and switching to a patch cable when i plugged in the linksys like so:
laptop x=crossover=x smoothwall
laptop ==patch== linksys ==patch== smoothwall
a couple of times, i would forget to swap the crossover out and just plugged it in to the WAN port on the linksys like so:
laptop ==patch== linksys x=crossover=x smoothwall
when i did this, the laptop pulled a DHCP address from smoothwall and not from the linksys, and was able to connect to the internet when the linksys was not, despite being plugged into the linksys. it took me a couple of minutes to figure out what was wrong.