# OpenVPN stops working, can't get it to restart



## memnarc (Nov 21, 2013)

My OpenVPN server stops working.  It doesn't show up on the list when I type:

sudo netstat -taupen

I tried restarting it with this command but no luck:

sudo /etc/init.d/openvpn restart

sudo service openvpn start

My OpenVPN server has been idling for a while but other than that I didn't change a thing in the config files.


----------



## scv (Nov 21, 2013)

Did you check your system logs? More than likely it'll be logging to */var/log/messages*


----------



## budi1413 (Nov 21, 2013)

There'll be no log if you not set it in the server configuration. Maybe try reboot the server. Last resort though.


----------



## memnarc (Nov 21, 2013)

The output of the log:

Nov 17 03:08:07 arcx rsyslogd: [origin software=rsyslogd" swVersion="5.8.11" x$.11" x-pid="1550"x-info="http://www.rsyslog.com] rsyslogd was HUPed

Nov 18 03:08:01 arcx rsyslogd: [origin software=rsyslogd" swVersion="5.8.11" x$.11" x-pid="1550"x-info="http://www.rsyslog.com] rsyslogd was HUPed

Nov 19 03:08:01 arcx rsyslogd: [origin software=rsyslogd" swVersion="5.8.11" x$.11" x-pid="1550"x-info="http://www.rsyslog.com] rsyslogd was HUPed

Nov 20 03:08:01 arcx rsyslogd: [origin software=rsyslogd" swVersion="5.8.11" x$.11" x-pid="1550"x-info="http://www.rsyslog.com] rsyslogd was HUPed


----------



## budi1413 (Nov 21, 2013)

Doesn't look like openvpn log. -_-


----------



## memnarc (Nov 21, 2013)

Pardon me, as I'm still very much new to LInux and openvpn.  I got that file from :  nano /var/log/messages

I looked at the openvpn directory and found openvpn.log.  This is the result:

Tue Nov 19 22:37:47 2013 OpenVPN 2.2.1 i486-linux-gnu [sSL] [LZO2] [EPOLL] [PKCS11] [eurephia] [MH] [PF_INET6] [iPv6 payload 20110424-2 (2.2RC2)] built on Jun  6 2013

Tue Nov 19 22:37:47 2013 WARNING: --ifconfig-pool-persist will not work with --duplicate-cn

Tue Nov 19 22:37:47 2013 NOTE: the current --script-security setting may allow this configuration to call user-defined scripts

Tue Nov 19 22:37:47 2013 Diffie-Hellman initialized with 1024 bit key
 

Tue Nov 19 22:37:47 2013 Control Channel Authentication: using 'ta.key' as a OpenVPN static key file

Tue Nov 19 22:37:47 2013 Outgoing Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC

authentication

Tue Nov 19 22:37:47 2013 Incoming Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication

Tue Nov 19 22:37:47 2013 WARNING: normally if you use --mssfix and/or --fragment, you should also set --tun-mtu 1500 (currently it is 1574)

Tue Nov 19 22:37:47 2013 TLS-Auth MTU parms [ L:1648 D:166 EF:66 EB:0 ET:0 EL:0 ]

Tue Nov 19 22:37:47 2013 Socket Buffers: R=[245760->131072] S=[245760->131072]

Tue Nov 19 22:37:47 2013 Note: Cannot open TUN/TAP dev /dev/net/tun: No such file or directory (errno=2)

Tue Nov 19 22:37:47 2013 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0

Tue Nov 19 22:37:47 2013 /sbin/ifconfig  10.8.0.1 netmask 255.255.255.0 mtu 1574 broadcast 10.8.0.255

SIOCSIFADDR: No such device
: ERROR while getting interface flags: No such device
SIOCSIFNETMASK: No such device
SIOCSIFMTU: No such device
SIOCSIFBRDADDR: No such device
: ERROR while getting interface flags: No such device

Tue Nov 19 22:37:47 2013 Linux ifconfig failed: external program exited with error status: 255

Tue Nov 19 22:37:47 2013 Exiting


----------



## memnarc (Nov 21, 2013)

I tried logging in at later dates but this message just repeats itself predictably.


----------



## johnlth93 (Nov 21, 2013)

You TUN device isn't enabled.

Search on how to enable in on openvpn How To


----------



## memnarc (Nov 22, 2013)

Enabling Tun/Tap is done through the control panel of the VPS.  It was turned on but I turned off tun/tap then quickly turned it back on.  Doing this I was able to start OpenVPN again but everytime I connect now there's no internet connection.


----------



## Erawan (Nov 22, 2013)

How about the iptables for port forwarding? have you set it to restore everytime the server booted?


----------



## budi1413 (Nov 22, 2013)

Yeah the problem is tun device is not exist. You need to give some time and reboot after disable and enable tun/tap via control panel.


----------



## memnarc (Nov 22, 2013)

Erawan said:


> How about the iptables for port forwarding? have you set it to restore everytime the server booted?


My Iptables have never been set.  It's just at the default settings as I'm new to LInux.


----------



## Erawan (Nov 22, 2013)

memnarc said:


> My Iptables have never been set.  It's just at the default settings as I'm new to LInux.



Ok then, how about adding the following IPtables, and modify it as your needed :



> iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -j SNAT --to vps.ip.address


Change the 10.8.0.0 to your openvpn ip alocation, and next save the iptables and make it load at everytime the server booted


----------

