wiki:systemd

Version 5 (modified by tct, 6 years ago) (diff)

--

OpenVPN systemd integration

This is only a brief summary of OpenVPN systemd integration.

If you use systemd then OpenVPN must be compiled with systemd support.

Build OpenVPN with systemd support

When you build the openvpn binary use the configure option --enable-systemd like so:

./configure --enable-systemd

Verify OpenVPN systemd support has been enabled like so:

$ openvpn --version

Look for enable-systemd=yes in the output.

Using OpenVPN with systemd support

In order to use OpenVPN with systemd please use the correct systemd .service file.

Openvpn server:

  • Place your server configuration file in /etc/openvpn/server
  • Use the openvpn-server@.service like so:
    $ sudo systemctl start openvpn-server@{Server-config}
    

Openvpn client:

  • Place your client configuration file in /etc/openvpn/client
  • Use the openvpn-client@.service like so:
    $ sudo systemctl start openvpn-client@{Client-config}
    

Start at boot:

Replace start with enable

Note:

  • openvpn@.service is deprecated.
  • openvpn.service is only used for backward compatibility. (Do not use this)

Known issues

https://community.openvpn.net/openvpn/ticket/945
https://community.openvpn.net/openvpn/ticket/1089