Setting DD-WRT Cron Job Through Command Line

I managed to get OpenVPN running on my DD-WRT v2.2 router, with the instructions from the wiki.

However after a few reboot tests I saw that OpenVPN died immediately after it started, with no traceable reasons.

Sep 12 00:51:10 192.168.xx.xx openvpn[3940]: TUN/TAP device tap0 opened
. . .
Sep 12 00:51:11 192.168.xx.xx openvpn[3949]: Initialization Sequence Completed

I suspect it has got to do with the fact that my ppp0 (ADSL) connection takes some time to activate.

So I thought of doing a check using cron – if OpenVPN is not running, run it.

The command I wrote was:

But the bad news is that when I enter this command in the cron box inside the Web Administration GUI the single quotes get translated into the HTML entity, and this becomes permanent in the nvram and also in /tmp/cron.d/cron_jobs. Damn.

So I thought of using the command line. Here’s what I did in the SSH shell:

At this point if you don’t want to reboot your router, enter these into /tmp/cron.d/cron_jobs and restart cron using stopservice cron && startservice cron.

And I’m all set!

I hope the IT team from my company is not reading this, but I also have a vpnc daemon running on the router to connect to my company network and I do the same check as above 😉

DD-WRT v24 Upgrade on My WRT54G v2.2 Wireless Router

It has been some time that I wanted to upgrade the firmware, but I rarely have the motivation to do so. I ensured myself that I would not brick the router, and reminded myself on how DD-WRT always produces new and exciting features. So today, I did it. It took around 20 minutes to upgrade and re-configure my router. I have a significant number of customization done especially the QoS and port forwarding and they take a while to be reconfigured. Unfortunately I can’t import saved settings from the previous version of the firmware.

Since I have a WRT54G v2.2 (antique), I followed the advice from the Internet – upgrade to mini version and then to standard version.

One of my favorite addition is the ability to see how many connection each client is using:

Another feature that I think is cool is the ability to plot a real-time bandwidth graph:

The WAN graph is maxed out because I am downloading Ubuntu from OSCC mirror as mentioned in the previous post.

There are tons other improvements included that I can’t include here, try it out yourself!

Enabling connection to modem to check stats

Since the WRT54G is not a modem, I do sometimes have the need to check my ADSL stats and have to connect to the modem directly. My provider sometimes do cheat by capping my connection lower than what I have paid for.

To enable this I simply add an interface alias to the vlan1 interface on the router. I am using a Linksys AM-300 modem-router as a modem only and it has the default IP of 192.168.1.1. If you didn’t customize your WRT54G then it’s difficult because 192.168.1.1 is also the default IP. In my case, my LAN is in a different subnet (my WRT54G has a customized IP). All I had to do in the web interface is to go to Administration > Commands, enter ifconfig vlan1:1 192.168.1.2 netmask 255.255.255.0 broadcast 192.168.1.255 to the box and click on “Save Startup”. The router will reboot because it is a startup script!

After the router finished rebooting, if I enter the 192.168.1.1 in my browser address bar I will get my AM-300 administration page. Now I can be sure I am not cheated and still get my 2Mbps 😉

Secure Your Wireless Network

Since a couple of months I’ve heard quite a lot of concern in the Internet about Wi-Fi security. The WEP encryption standard has been widely known and easier to crack. This means that a guy next door can easily sniff your packets and break into your wireless network after he manage to get your key.

WPA was an interim solution to cope with this problem, which was later finalized by WPA2.

I have less time nowadays to look into such matters but I do realize I have to do something about it. Not that I suspect my neighbors hacking into my wireless connection, but then again who knows?

After work yesterday I poked around my WRT54G v2.2 and see whether I can implement WPA2 in my own wireless network. I was using Sveasoft’s Alchemy as my firmware and the highest security level I can set is WPA. I was not satisfied and do some more research until I find DD-WRT which is based on Alchemy, meaning it should have all functionalities of Alchemy, and much more. WPA2 security is indeed included.

Continue reading Secure Your Wireless Network

Linksys WRT54G

I’ve just upgraded my WRT54G firmware to v3.03.6 HyperWRT_2.1b1 created by Timothy Jans. Previously, with the default firmware provided by Linksys (v3.03.6) the router frequently hangs. Now, it is rock stable.

Read more about this firmware at http://www.hyperwrt.org

As I search for the solution of the problem, I also stumbled upon a great site, dedicated to the particular router: http://www.wrt54g.com

Kudos to Timothy Jans!