Install openvpn3 from this website.
If you look at the man page of openvpn3, there are 2 main concepts:
- config: a configuration of vpn where you connects to
- session: a vpn session
Suppose you have a configuration file called vpn.ovpn that’s connecting to a server in New York.
openvpn3 config-import —-config vpn.ovpn # import a vpn configuration
openvpn3 configs-list # list all imported configurations
The vpn config name is called vpn.ovpn
.
If you have multiple openvpn files with the same filename, the imported config will have duplicate name, and cannot start a new session. In this case, it’s better to rename a config every time a config file is imported.
openvpn3 config-manage --config vpn.ovpn --rename new-york # rename a vpn config
To remove a openvpn config
openvpn3 config-remove --config new-york # remove with config name
openvpn3 config-remove --path /net/openvpn/v3/configuration/xxxx # remove with config path, find this with configs-list
# connect
openvpn3 session-start --config vpn.ovpn # start a vpn session with a file
openvpn3 session-manage --disconnect --config vpn.ovpn # disconnect session with a ovpn file
# disconnect
openvpn3 session-start --config new-york # start a vpn session with a imported configuration
openvpn3 session-manage --disconnect --config new-york # disconnect session with import config name