- Muchas notas - Fran Acién

20241219 - OpenVPN connect service

This is my systemd service to connect automatically to a server on boot.

$ cat /etc/systemd/system/openvpn-client@.service 
[Unit]
Description=OpenVPN connection to %i
After=network.target

[Service]
Type=simple
ExecStart=/usr/sbin/openvpn --config /etc/openvpn/%i.ovpn
Restart=on-failure
PrivateKey=private
User=root
Group=root

[Install]
WantedBy=multi-user.target