Posts Tagged ‘OpenVPN’

Fedora release 20 (Heisenbug) enable client OpenVPN service on boot

August 21, 2014 Leave a comment

In short, I had to deal with the Fedora EVIL EVIL EVIL !!! Systemd
I found my openvpn startup script useless ..
Managed to set the VPN at the Network Manager just loading the openvpn config file, but I wanted to be started on boot … because out of the blue my Fedora 20 Gnome boot hanged on the blue logo !!! This is another story to be told.

Anyway, back to the OpenVPN issue, the steps to do make it start on boot, following the instructions at

1. Set the keys and the config file at /etc/openvpn

root@outoutdragkh.f20:[Thu Aug 21 01:30:06][~]$ cd /etc/openvpn/
root@outdragkh.f20:[Thu Aug 21 01:30:10][/etc/openvpn]$ ls
keys  outdragkh.client.conf

2. Fix selinux context of the config files :

root@outdragkh.f20:[Thu Aug 21 01:30:10][/etc/openvpn]$  restorecon -Rv /etc/openvp

3. Check the general openvpn service file:

root@outdragkh.f20:[Thu Aug 21 01:30:32][/etc/openvpn]$ ls /lib/systemd/system/openvpn\@.service
root@outdragkh.f20:[Thu Aug 21 01:30:51][/etc/openvpn]$ cat /lib/systemd/system/openvpn\@.service
Description=OpenVPN Robust And Highly Flexible Tunneling Application On %I

ExecStart=/usr/sbin/openvpn --daemon --writepid /var/run/openvpn/ --cd /etc/openvpn/ --config %i.conf


4. Set the systemd start scripts for the outoutdragkh.client.conf

root@outdragkh.f20:[Thu Aug 21 01:30:55][/etc/openvpn]$ ln -s /lib/systemd/system/openvpn\@.service /etc/systemd/system/\@outdragkh.client.service
root@outdragkh.f20:[Thu Aug 21 01:32:04][/etc/openvpn]$ ls /etc/systemd/system/ 

5. Enable the dragkh OpenVPN service

root@outdragkh.f20:[Thu Aug 21 01:32:12][/etc/openvpn]$ systemctl -f enable openvpn@outdragkh.client.service
rm '/etc/systemd/system/'
ln -s '/usr/lib/systemd/system/openvpn@.service' '/etc/systemd/system/'

6. Start the dragkh OpenVPN service

root@outdragkh.f20:[Thu Aug 21 01:32:30][/etc/openvpn]$ systemctl start openvpn@outdragkh.client.service 
root@outdragkh.f20:[Thu Aug 21 01:32:49][/etc/openvpn]$ systemctl status openvpn@outdragkh.client.service 
openvpn@outdragkh.client.service - OpenVPN Robust And Highly Flexible Tunneling Application On outdragkh.client
   Loaded: loaded (/usr/lib/systemd/system/openvpn@.service; enabled)
   Active: active (running) since Thu 2014-08-21 01:32:49 CEST; 5s ago
  Process: 3194 ExecStart=/usr/sbin/openvpn --daemon --writepid /var/run/openvpn/ --cd /etc/openvpn/ --config %i.conf (code=exited, status=0/SUCCESS)
 Main PID: 3195 (openvpn)
   CGroup: /system.slice/system-openvpn.slice/openvpn@outdragkh.client.service
           └─3195 /usr/sbin/openvpn --daemon --writepid /var/run/openvpn/ --cd /etc/openvpn/ --config outdragkh.client.conf

Aug 21 01:32:49 systemd[1]: Started OpenVPN Robust And Highly Flexible Tunneling Application On outdragkh.client.
root@outdragkh.f20:[Thu Aug 21 01:32:55][/etc/openvpn]$ systemctl status openvpn@outdragkh.client.service 

done …

Slackware2Life 🙂


OpenVPN 2.1_rc15 at Slackware 12.1

January 27, 2009 2 comments

I had several failures  with the 2.1_rc15 mainly with the memory error issue.

anyway, if you got so far, you have compiled the OpenVPN 2.1_rc15  with no erros,
but you end with this in the server/client.log  : OpenVPN: Out of Memory
you have to increase the default kernel value of  max locked memory  to like 16384
slackware rc.openvpn script:
ulimit -l 16384
if [ “${1}” == “start” ]
if [ -f “/etc/openvpn/${what}.conf” ]
modprobe tun
/usr/local/sbin/openvpn –dev tun0 –cd /etc/openvpn/ –daemon –config /etc/openvpn/${what}.conf
echo “There is not config file!!!! ”
elif [ “${1}” == “stop” ]
vpnPID=$(ps ax | grep ${what} | grep -v grep | sed ‘1!d’ | awk ‘{print $1}’)
if [ “${vpnPID}” != “” ]
kill -9  ${vpnPID}
echo “${what} openVPN process has not been found …”
#rmmod tun
echo “Please use the command ${0} start | stop”
hope this will save some time of yours

Categories: Slackware Tags: , ,