Posted: Sun Aug 16, 2009 10:02 pm Post subject: How to get OpenVPN to start
I've subscribe to an OpenVPN service to bypass my ISP bandwith throttle issue on torrent download.
I had installed all the necessary files into the /etc/openvpn folder (but did not put it into the respective folders for some of the files, but I just dump everything the main folder). Essentially, I need to start the OpenVPN service on SMS so that I could use its Torrent Flux to download stuff.
I tried using webmin OpenVPN to start it but it does not work.
No idea how to go about this. I tried this command '/etc/init.d/openvpn start
' but it does not work unlike in Ubuntu Server.
There should be an /etc/rc.d/rc.openvpn if not use that one
Code:
#!/bin/sh
# Start/stop/restart all the openvpn processes
#by Giancarlo Razzolini
#openvpn binary
openvpn=/usr/sbin/openvpn
#piddir
piddir=/var/run
#conf dir
confdir=/etc/openvpn
openvpn_start() {
#for all the conf files in the openvpn dir, start a new process
cd $confdir
echo "Starting Openvpn Tunnels:"
for conf in `ls *.conf` ; do
echo -e "\t$openvpn $confdir/$conf"
$openvpn --writepid /var/run/`echo $conf | cut -d. -f1`.pid --daemon --config $conf
done
return 0
}
openvpn_status() {
cd $piddir
ls *.pid 1&>2 /dev/null
if [ "$?" != "0" ] ; then
echo "No openvpn process is running."
else
for process in `ls *.pid` ; do
echo Process `cat $process` is running...
done
fi
return 0
}
What /var/log/openvpn.log says ?
If it says
Cannot open file key file 'keys/shared.key': No such file or directory (errno=2)
then do
cd /etc/openvpn/keys
openvpn --genkey --secret shared.key
If it says
Cannot open TUN/TAP dev /dev/net/tun: No such file or directory (errno=2)
then do
mkdir -p /dev/net
mknod /dev/net/tun c 10 200
chmod 600 /dev/net/tun
If you are getting an error other than those two, post it here
gerasimos_h _________________ Superb! Mini Server Project Manager http://sms.it-ccs.com
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum