Saturday, 5 December 2009

OpenVPN is here!

Everytiume I boot up the machine I see OpenVPN trying to boot up on start. I don't ever remember seeing it on Hardy. Is this something new? Looking in /etc/init.d/ I discovered there was in fact a script to start openvpn! I wondered if it was also on Hardy, but as I deleted Hardy and installed Karmic, I will never know. Looking into the script, apparently OpenVPN tries to start by looking for a config file in /etc/openvpn/ with the extension .conf. Wondering if this was true, I copied my server.ovpn into /etc/openvpn/ and renamed it to server.conf. Rebooted and did a ps aux|grep openvpn and it was actually there, all started up and waiting for connections!

Strangely enough though, this only worked the first time I tried it. For some reason, the next time I tried it OpenVPN wouldn't start on boot. Huh? Doing what I did for my firewall script, I added it back in.

sudo update-rc.d openvpn start 20 2 3 4 5 . stop 99 0 1 6 .

As you will notice I used the exact same numbers as I did for the firewall. I am guessing that starting openvpn at the same runlevel as my firewall should be ok. The network should have come up by then. I suppose there might be a little risk, but unless somebody was there waiting for me to boot my PC, I should be ok.

At least now I never need to start openvpn manually.

0 comments:

Post a Comment