Question

OpenVPN server on Ubuntu 16.0.4

Hey guys, I need serious help with ubuntu 16.0.4 openVPN server I followed the tutorial step by step and carefully the only problem was when I run the command :

sudo systemctl start openvpn@server

the output was:

Job for openvpn@server.service failed because the control process exited with error code. See “systemctl status openvpn@server.service” and “journalctl -xe” for details.

after some googling, I found the solution, It was to comment out “LimitNPROC” line in ‘/lib/systemd/system/openvpn@.service’ file and run the command systemctl daemon-reload

this solved it all and steps passed fine and even the outputs were exactly the same as the tutorial but my client cannot connect to server

what the heck is this? it’s about couple of 24 hours I’m hard working on this, after trying Nyr on ubuntu 18, trying DO tutorial on ubuntu 18, trying Nyr on 16 and finally trying DO tutorial on 16 I thought I managed to create it but still sucks

here is the “sudo systemctl status openvpn@server” output:

openvpn@server.service - OpenVPN connection to server Loaded: loaded (/lib/systemd/system/openvpn@.service; enabled; vendor preset: enabled) Active: active (running) since Thu 2019-07-04 18:13:38 UTC; 39s ago Docs: man:openvpn(8) https://community.openvpn.net/openvpn/wiki/Openvpn23ManPage https://community.openvpn.net/openvpn/wiki/HOWTO Process: 12192 ExecStart=/usr/sbin/openvpn --daemon ovpn-%i --status /run/openvpn/%i.status Main PID: 12193 (openvpn) CGroup: /system.slice/system-openvpn.slice/openvpn@server.service `-12193 /usr/sbin/openvpn --daemon ovpn-server --status /run/openvpn/server.status
Jul 04 18:13:38 ubuntu16 ovpn-server[12193]: /sbin/ip route add 10.8.0.0/24 via 10.8.0.2
Jul 04 18:13:38 ubuntu16 ovpn-server[12193]: GID set to nogroup
Jul 04 18:13:38 ubuntu16 ovpn-server[12193]: UID set to nobody
Jul 04 18:13:38 ubuntu16 ovpn-server[12193]: UDPv4 link local (bound): [undef]
Jul 04 18:13:38 ubuntu16 ovpn-server[12193]: UDPv4 link remote: [undef]
Jul 04 18:13:38 ubuntu16 ovpn-server[12193]: MULTI: multi_init called, r=256 v=256
Jul 04 18:13:38 ubuntu16 ovpn-server[12193]: IFCONFIG POOL: base=10.8.0.4 size=62, ipv6=0
Jul 04 18:13:38 ubuntu16 ovpn-server[12193]: IFCONFIG POOL LIST
Jul 04 18:13:38 ubuntu16 ovpn-server[12193]: Initialization Sequence Completed
Jul 04 18:13:38 ubuntu16 systemd[1]: Started OpenVPN connection to server

and “ip addr show tun0” output:

15: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifofast state UNKNOWN group default qlen 500
link/none
inet 10.8.0.1 peer 10.8.0.2/32 scope global tun0
validlft forever preferredlft forever
inet6 fe80::625:4cf6:e024:68b/64 scope link flags 800
validlft forever preferred_lft forever

any help is keenly appreciated

Show comments

Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

KFSys
Site Moderator
Site Moderator badge
May 26, 2023

From the information you provided, it seems like the OpenVPN server is running correctly. The systemctl status openvpn@server command shows that the OpenVPN service is active and running, and the ip addr show tun0 output shows that the tun0 interface is up, which means that OpenVPN is functioning.

However, you mentioned that the client cannot connect to the server. Here are a few steps you could take to troubleshoot this:

  1. Check the Client Configuration: Make sure that the client configuration matches your server’s setup. This includes the correct IP address of the server, the correct port (default is 1194), and the correct protocol (UDP or TCP). If your client is behind a NAT firewall, make sure the client’s firewall allows traffic through the correct port and protocol.

  2. Check the Client Log: The client-side OpenVPN log can provide details about why the connection failed. You can find this log in the OpenVPN client interface.

  3. Check Server Firewall: Ensure that your server’s firewall allows incoming connections on the OpenVPN port (default is UDP 1194). You can check this with sudo ufw status.

  4. Check Server Log: Check the server-side OpenVPN log for any error messages. The log location depends on how OpenVPN is configured, but a common location is /var/log/openvpn.log.

  5. Check Network Issues: Sometimes, issues with the client’s or server’s network can cause connection problems. You can check for network issues using tools like ping, traceroute, and netstat.

Remember to replace the port number and protocol in these steps with the actual ones you’re using if they’re different from the defaults.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel