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 😉