amuck-landowner

OpenVPN stops working, can't get it to restart

memnarc

New Member
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

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

budi1413

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

memnarc

New Member
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
 

memnarc

New Member
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

New Member
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.
 

budi1413

New Member
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.
 

Erawan

Member
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
 
Top
amuck-landowner