Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
SMS Forum Index » SMS User Support

Post new topic   Reply to topic
How to get OpenVPN to start
View previous topic :: View next topic  
Author Message
Euthenics
Junior Member


Joined: 15 Sep 2008
Posts: 7

PostPosted: Sun Aug 16, 2009 10:02 pm    Post subject: How to get OpenVPN to start Reply with quote

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.

Any idea on how to go about this?

Thank you in advance.
Back to top
View user's profile Send private message
gerasimos_h
Site Admin


Joined: 09 Aug 2007
Posts: 1743
Location: Greece

PostPosted: Mon Aug 17, 2009 6:53 am    Post subject: Reply with quote

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
}

openvpn_stop() {
    echo "Stoping Openvpn Tunnels"
    killall openvpn 2&>1 /dev/null
    rm -rf $piddir/*.pid
    return 0
}

openvpn_restart() {
    openvpn_stop
    sleep 1
    openvpn_start
}

case "$1" in
'start')
        openvpn_start
        ;;
'status')
        openvpn_status
        ;;
'stop')
        openvpn_stop
  ;;
'restart')
        openvpn_restart
        ;;
    *)
        echo "usage $0 start|stop|restart"
esac

Also in webmin check module config

Code:
start_cmd=/etc/rc.d/rc.openvpn start
openvpn_pid_path=/var/run
openvpn_servers_subdir=servers
zip_cmd=/usr/bin/zip
stop_cmd=/etc/rc.d/rc.openvpn stop
openvpn_path=/usr/sbin/openvpn
openvpn_clients_subdir=clients
log_lines=200
openvpn_version=2.0.9
openvpn_keys_subdir=keys
openvpn_home=/etc/openvpn
openssl_version=0.9.8k
openssl_path=/usr/bin/openssl
openssl_home=/etc/openvpn/openvpn-ssl.cnf
down_root_plugin=/usr/local/webmin/openvpn/ovpn_plugin/openvpn/down-root.so
br_end_cmd=/usr/local/webmin/openvpn/br_scripts/bridge_end
br_start_cmd=/usr/local/webmin/openvpn/br_scripts/bridge_start
tail_cmd=
log_refresh=
default_server=


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
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    SMS Forum Index » SMS User Support All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
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

SMS - Superb! Mini Server Project © 2016
Powered by phpBB © 2001, 2002 phpBB Group
iCGstation v1.0 Template By Ray © 2003, 2004 iOptional