2

I've got OpenVPN working good with my config file if I run it from CLI:

openvpn server.conf

But if I try to start it as a service it starts just fine, won't error out, but it will not load my conf file since there is no resulting tun device in ifconfig.

I have AUTOSTART set to all in /etc/init.d/openvpn:

enter image description here

But a quick ifconfig shows it's not started. I know it's not loading my conf file since the log file is not created, but no errors from OpenVPN.

enter image description here

This is on Ubuntu 16.04.3, fresh clean install of OpenVPN.

EDIT

As per comments below I have tried multiple times also with systemctl, it just errors out:

enter image description here enter image description here

I know the conf file works since I can run it from CLI as openvpn server.conf and it works.

EDIT2

Logs:

Jan 11 14:31:37 cloud systemd[1]: openvpn@server.service: Unit entered failed state.
Jan 11 14:31:37 cloud systemd[1]: openvpn@server.service: Failed with result 'exit-code'.
Jan 11 16:06:07 cloud systemd[1]: Starting OpenVPN connection to server...
Jan 11 16:06:07 cloud ovpn-server[4726]: OpenVPN 2.3.10 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on Jun 22 2017
Jan 11 16:06:07 cloud ovpn-server[4726]: library versions: OpenSSL 1.0.2g  1 Mar 2016, LZO 2.08
Jan 11 16:06:07 cloud ovpn-server[4726]: daemon() failed or unsupported: Resource temporarily unavailable (errno=11)
Jan 11 16:06:07 cloud ovpn-server[4726]: Exiting due to fatal error
Jan 11 16:06:07 cloud systemd[1]: openvpn@server.service: Control process exited, code=exited status=1
Jan 11 16:06:07 cloud systemd[1]: Failed to start OpenVPN connection to server.
Jan 11 16:06:07 cloud systemd[1]: openvpn@server.service: Unit entered failed state.
Jan 11 16:06:07 cloud systemd[1]: openvpn@server.service: Failed with result 'exit-code'.
Jan 12 09:55:35 cloud systemd[1]: Starting OpenVPN connection to server...
Jan 12 09:55:35 cloud ovpn-server[12133]: Current Parameter Settings:
Jan 12 09:55:35 cloud ovpn-server[12133]:   config = '/etc/openvpn/server.conf'
Jan 12 09:55:35 cloud ovpn-server[12133]:   mode = 1
Jan 12 09:55:35 cloud ovpn-server[12133]:   persist_config = DISABLED
Jan 12 09:55:35 cloud ovpn-server[12133]:   persist_mode = 1
Jan 12 09:55:35 cloud ovpn-server[12133]:   show_ciphers = DISABLED
Jan 12 09:55:35 cloud ovpn-server[12133]:   show_digests = DISABLED
Jan 12 09:55:35 cloud systemd[1]: openvpn@server.service: Control process exited, code=exited status=1
Jan 12 09:55:35 cloud systemd[1]: Failed to start OpenVPN connection to server.
Jan 12 09:55:35 cloud systemd[1]: openvpn@server.service: Unit entered failed state.
Jan 12 09:55:35 cloud systemd[1]: openvpn@server.service: Failed with result 'exit-code'.
10
  • Not sure why you are messing with init.d. Have you tried systemctl start openvpn@server.service? Jan 12 '18 at 6:24
  • Check /etc/default/openvpn and please as @multithr3at3d stated, don't change init files.
    – Lenniey
    Jan 12 '18 at 9:39
  • I've done that also, it errors out. I will post what it does above.
    – jfreak53
    Jan 12 '18 at 14:56
  • Can you post text rather than screenshots please.
    – user9517
    Jan 12 '18 at 15:08
  • 1
    You appear to have the same solvable problem as askubuntu.com/q/747023/778746 Jan 12 '18 at 16:40
4

This problem is the same as another posted on Ask! Ubuntu. The fix:

What I have found to work is to comment out the LimitNPROC line in /lib/systemd/system/openvpn@.service.

0

When I tried to run my server config I found that it was unable to reassign same port thus I reboot server and got fixed the issue.

ubuntu@VPNSERVER:/etc/openvpn$ sudo openvpn server.conf
Fri May 28 18:09:18 2021 OpenVPN 2.4.4 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Apr 27 2021
Fri May 28 18:09:18 2021 library versions: OpenSSL 1.1.1  11 Sep 2018, LZO 2.08
Fri May 28 18:09:18 2021 ECDH curve prime256v1 added
Fri May 28 18:09:18 2021 Outgoing Control Channel Encryption: Cipher 'AES-256-CTR' initialized with 256 bit key
Fri May 28 18:09:18 2021 Outgoing Control Channel Encryption: Using 256 bit message hash 'SHA256' for HMAC authentication
Fri May 28 18:09:18 2021 Incoming Control Channel Encryption: Cipher 'AES-256-CTR' initialized with 256 bit key
Fri May 28 18:09:18 2021 Incoming Control Channel Encryption: Using 256 bit message hash 'SHA256' for HMAC authentication
Fri May 28 18:09:18 2021 TUN/TAP device tun1 opened
Fri May 28 18:09:18 2021 TUN/TAP TX queue length set to 100
Fri May 28 18:09:18 2021 do_ifconfig, tt->did_ifconfig_ipv6_setup=0
Fri May 28 18:09:18 2021 /sbin/ip link set dev tun1 up mtu 1500
Fri May 28 18:09:18 2021 /sbin/ip addr add dev tun1 10.8.0.1/24 broadcast 10.8.0.255
Fri May 28 18:09:18 2021 Could not determine IPv4/IPv6 protocol. Using AF_INET
Fri May 28 18:09:18 2021 Socket Buffers: R=[212992->212992] S=[212992->212992]
# ===>>>>>  blow line was error that I found <<<<<<<===== #
# Fri May 28 18:09:18 2021 TCP/UDP: Socket bind failed on local address # [AF_INET][undef]:1122: Address already in use (errno=98)
Fri May 28 18:09:18 2021 Exiting due to fatal error
Fri May 28 18:09:18 2021 Closing TUN/TAP interface
Fri May 28 18:09:18 2021 /sbin/ip addr del dev tun1 10.8.0.1/24


   **ubuntu@VPNSERVER:/etc/openvpn$ sudo reboot**

In your case OPenVpn status and restart command could be like

systemctl status openvpn-server@server.service
 systemctl restart openvpn-server@server.service

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.