How to Auto Start OpenVPN Client on Ubuntu Bionic

Assuming you already have your cert-file-name.ovpn file. 🙂
Note that client service name would be [email protected]
And then enable the service like so:

1sudo killall openvpn
2sudo systemctl enable --now [email protected]

Reload the daemons.

1sudo systemctl daemon-reload

It seems all done. 🙂

Here is another method using a shell script.

Write a shell script like this:

1#!/bin/bash
2sudo killall openvpn
3sudo openvpn --daemon --config /path_to/cert-file-name.ovpn

You can now use the script file whenever you need it, even on startup.
Happy networking, Gents!

comments powered by Disqus