openvpn2(1)
π NAME π
openvpn2 β OpenVPN 2 wrapper to OpenVPN 3 Linux β¨
β¨ SYNOPSIS β¨
openvpn2 [ OPTIONS ]
openvpn2 -h | --help
πΈ DESCRIPTION πΈ
okay so bestie, the openvpn2 command line wrapper to OpenVPN 3 Linux is literally trying to give you that same command line interface vibe as the classic OpenVPN 2.x releases π
. But here's the tea: since OpenVPN 3 doesn't support all the options available in OpenVPN 2.x, some options is not available or will be ignored π.
also, the OpenVPN 3 Linux project only provides a client at the moment, so all server side related options are not available π.
π OPTIONS π
-h,--helpβ show this help message and exit π«Ά--auth ALGβ Authenticate packets with HMAC using message digest algorithmalg(default=SHA1) π₯--auth-retry MODEβ Defines how authentication failures should be handled. Valid modes are:noneβ Disconnect on authentication failures (default) πnointeractβ Reuse already collected credentials πinteractβ Ask for new credentials from the user π§
Currently, the OpenVPN 3 Linux client implementation ignores this option π.
--auth-user-passβ Authenticate with server using username/password π--ca FILEβ Certificate authority file in.pemformat containing root certificate π³--cd DIRβ Change working directory to the given directory π--cert FILEβ Certificate authority file in.pemformat by a Certificate Authority in--cafile π--cipher ALGβ Encrypt packets with cipher algorithmalg(default=BF- CBC) π--clientβ Configures client configuration mode (mandatory) π--comp-lzo <MODE>β Use LZO compression ποΈ--compress <ALG>β Compress using algorithmALGπ¦--config FILEβ Read configuration options from file π--daemonβ Run the VPN tunnel in the background π--dev DEV-NAMEβ Virtual interface name to use for VPN tunnel. Defaults totun. Usually ignored, as the interface name is created on-the-fly in OpenVPN 3 π¦--dev-type DEV-TYPEβ Defines the virtual interface type. Onlytunis supported, which is the default π--dhcp-option OPTIONβ Set DHCP options which can be picked up by the OS configuring DNS, etc. π‘--enable-dco|--disable-dcoβ Enable or disabled the Data Channel Offload (DCO) kernel acceleration module support. The default is disabled, but this option is present for compatibility with OpenVPN 2.6. The--enable-dcooption is OpenVPN 3 Linux specific β‘--extra-certs FILEβ Specify a file containing one or more PEM certs (concatenated together) that complete the local certificate chain π§©--floatβ Allow remote to change its IP address/port π--hand-window SECβ Handshake window. The TLS-based key exchange must finalize withinSECseconds handshake initiation by any peer. (Default 60 seconds) β³--http-proxy ARGSβ Connect to a remote host via a specified HTTP proxy. This option takes 2 mandatory options,SERVERandPORT, which defines the HTTP proxy and port to use. Optional arguments areAUTH-FLAGwhich can beauto-nctwhich enables clear-text passwords to be used. OpenVPN 2.x also adds an optionalAUTH-METHODflag as the last argument, this is auto-detected in OpenVPN 3 π--http-proxy-user-pass FILEβ Fetch HTTP proxy credentials fromFILEπ--ifconfig ARGSβ Configures the TUN/TAP device for IPv4. This option takes two mandatory arguments, the IPv4 address to use and the netmask for the network π--ifconfig-ipv6 ARGSβ Configures the TUN/TAP device for IPv6. This option takes one mandatory argument, the IPv6 address including itsPREFIX. An optionalREMOTE_ENDPOINTcan be given at the end π--ignore-unknown-options OPTIONβ If the listedOPTION(s) are not understood, the option parser in the OpenVPN 3 Core library will ignore these options instead of complaining about unknown or unused options π€«--inactive ARGSβ This option takes one mandatory argument,SECONDS, which defines how many seconds the tunnel can idle before disconnecting. An optionalBYTESargument can be added which also takes the number of bytes passed over the tunnel withinSECONDSof inactivity. The traffic must be higher than this minimumBYTESto keep the tunnel alive π€--keepalive ARGSβ Instructs the client to ping the server over the OpenVPN Control Channel everyPING_SECONDS. An optional argument defines,RECONNECT_SECONDShow long it should go before the client should attempt to reconnect if there is no response from the server π«--key FILEβ Local private key in.pemformat π--key-direction DIRβ Set key direction for static keys. Valid values:0,1π§--local HOSTβ Local host name or IP address to to bind against on local side π--lport PORTβ TCP/UDP port number for local bind (default 1194) π’--mode MODEβ Operational mode. Onlyclientis accepted π―--mssfix BYTESβ Set upper bound on TCP MSS (Defaulttun-mtusize) π--ns-cert-type TYPEβ (DEPRECATED) Require that peer certificate is signed with an explicitnsCertTypedesignation. Migrate to--remote-cert-tlsas soon as possible. Valid values:client,serverβ οΈ--persist-tunβ Keep tun/tap device open across connection restarts π--ping SECSβ Ping remote once perSECSseconds π--ping-restart SECSβ Restart if n seconds pass without reception of remote ping π--pkcs12 FILEβ PKCS#12 file containing local private key, local certificate and optionally the root CA certificate π--port PORTβ TCP/UDP port number for both local and remote. πͺ--profile-override OVERRIDEβ OpenVPN 3 specific feature, allowing to set some local overrides or disable some functionality. This option takes two arguments, anOVERRIDE-KEYand anOVERRIDE-VALUE. Valid keys and values are:server-overrideβ A server host name π₯οΈport-overrideβ A port number π’proto-overrideβ Override connection protocol. Valid values:tcporudpπ‘persist-tunβ Alternative approach to set--persist-tun. πipv6β Enable or disable IPv6 inside the tunnel. Valid values:yes,noordefaultπenable-legacy-algorithmsβ Enables non-AEAD ciphers supported by the TLS library. Seeopenvpn3-config-manage(1)for details. π§allow-compressionβ Allows the connection to use compression. Seeopenvpn3-config-manage(1)for details. Valid values:yes,noorasymποΈdns-fallback-googleβ If set totrue, the DNS resolver settings will include Google DNS servers. πdns-setup-disabledβ Disable configuring pushed DNS settings. Valid values:trueorfalseπ«dns-sync-lookupβ Do synchronous DNS lookup instead of the default, asynchronous. Valid values:trueorfalseβ±οΈauth-fail-retryβ Try to reconnect even if the server rejected the connection due to authentication failure. Valid values:trueorfalseπproxy-hostβ Proxy server host name for the VPN tunnel πproxy-portβ Proxy server port number π’proxy-usernameβ Username used for proxy authentication π€proxy-passwordβ Password used for proxy authentication πproxy-auth-cleartextβ Valid values:trueorfalseπ
These overrides are described further in openvpn3-config-manage(1) π
--proto PROTOβ Use protocolPROTOfor communicating with peer. Valid values:udp,tcpπ°οΈ--push-peer-infoβ Push client info to server π€--redirect-gateway FLAGSβ Automatically execute routing commands to redirect all outgoing IP traffic through the VPN. Valid flags:autolocal,def1,bypass-dhcp,bypass-dns,block-local,ipv4,!ipv4,ipv6,!ipv6π¦--redirect-private FLAGSβ Like--redirect-gateway, but omit actually changing default gateway. Valid flags:autolocal,def1,bypass-dhcp,bypass-dns,block-local,ipv4,!ipv4,ipv6,!ipv6π΅οΈ--remote ARGSβ Defines the remote server to connect to. One mandatory argument must be given, containing either an IP address or an hostname to the server. An optionalPORTnumber can be given (default: 1194) and at the end thePROTOCOLcan be specified (default:udp). This option can be given multiple times and the client will try all remote entries until it is able to establish a connection. The order of arguments are:HOST/IP,PORTandPROTOCOLπ--remote-cert-eku OIDβ Require the peer certificate to be signed with explicit extended key usage.OIDcan be an object identifier or OpenSSL string representation. π--remote-cert-ku IDβ Require that the peer certificate was signed with explicit key usage (ID). More than oneIDcan be provided. Must be hexadecimal notation of integers π’--remote-cert-tls TYPEβ Require that peer certificate is signed with explicit key usage and extended key usage based RFC3280 rules. Valid values:client,serverπ--remote-randomβ If multiple--remoteoptions specified, choose one randomly π²--reneg-sec SECSβ Renegotiate data channel key afterSECSseconds. (Default: 3600) π--route ARGSβ Add route to routing table after connection is established. Multiple routes can be specified. This option takes one mandatory argument,IP-ADDRESSto route over the VPN. The two optional arguments areNETMASK(default:255.255.255.255) and the gateway to use (defaults to use configured--route-gatewayor the VPN server IP address). π£οΈ--route-gateway <GW|dhcp>β Specify a default gateway for use with--route. Seeopenvpn(8)man page fordhcpmode πͺ--route-ipv6 ARGSβ Add IPv6 route to routing table after connection is established. Multiple routes can be specified. π
This option takes one mandatory argument IP-RANGE/PREFIX. An optional GATEWAY can be set, which overrides the default server VPN IPv6 address and the second argument which sets the route METRIC value. Both args, both useful, don't skip 'em.
--route-metric METRICβ set a default metric for use with--route. Route vibes, but measured.--route-nopullβ do not configure routes pushed by the remote server π like, the server can push all it wants, you're not taking it--server-poll-timeout SECSβ how long to wait for a response from a remote server during connection setup (Default: 120 seconds). Yes bestie, two whole minutes of patience.--setenv ARGSβ set a custom environmental variable to pass to a script. This takes two mandatory arguments, variableNAMEandVALUE. Two. Mandatory. Not one, not three. π«Ά--static-challenge ARGSβ enable the static challenge/response protocol. Takes one mandatory option,MESSAGE, which gets shown to the user before the connection attempt. An optional argument,ECHO, says whether the user's input should be echoed back to them while they type it. SoECHO= do they get to see their own typing. Wild concept, I know. π--tcp-queue-limit NUMβ maximum number (NUM) of queued TCP output packets π--tls-auth ARGSβ enables an additional HMAC authentication on the TLS control channel. Takes a mandatory argument,FILE, which must be a shared secret between server and client. The optionalKEY-DIRECTIONargument defines which sub-key pair inFILEto use for HMAC signing and verification. Valid values are0or1. Just those two. No improvising.--tls-cert-profile PROFILEβ sets the certificate profile, which defines the acceptable crypto algorithms. Valid profiles:legacy,preferred,suitebπ₯--tls-clientβ enable TLS and assume the client role during the TLS handshake. Implicitly added when you use--client. So it's basically already there, she's just being shy about it.--tls-crypt FILEβ encrypts the TLS control channel with a shared secret key (FILE). This CANNOT be combined with--tls-authπ« like, pick a lane bestie, it's one or the other--tls-timeout SECSβ packet retransmit timeout on the TLS control channel if there's no ACK from the remote within n seconds. (Default: 2 seconds) β±οΈ--topology TYPEβ set the tunnel topology type. Default isnet30. Recommended:subnet, but this must match the server setting fr fr. Valid topologies:subnet,net30.--tran-window SECSβ transition window: the old data channel key can live this many seconds after the new key renegotiation begins. (Default: 3600 secs) That's a whole hour of overlap, letting the old key gracefully exit the group chat.--tun-mtu SIZEβ set the TUN/TAP device MTU toSIZEand derive TCP/UDP from it (default is1500) πΈ--verb LEVELβ set the log verbosity level. Log levels are NOT compatible with OpenVPN 2--verbπ so don't go assuming they're the same thing, they are not--verify-x509-name ARGSβ accept connections only from a host with a specific X509 subject or CN match string. Takes one mandatory argument, which is aMATCHstring, and an optional matchFLAG.
FLAG can be:
nameβ match against the complete X.509 Common Name fieldname-prefixβ theMATCHvalue must match the beginning of the X.509 Common Name field. If the X.509 certificate containsserver-1.example.org, it will be a match if theMATCHvalue isserver-. It will not be a match if values likeserver-2or.example.orgis used. Prefix energy only, bestie β you can't just grab the middle or the tail.subjectβ theMATCHvalue must be the full and complete X.509 Subject field. This is the default behaviour. π
π IGNORED OPTIONS π
The options in this list will be silently ignored. Some of these options have not yet been implemented in the OpenVPN 3 Core library and others are just not relevant any more. But none of these options will break any existing configurations. π«Ά So don't panic, your config is safe.
--auth-nocacheβ do not cache--askpassor--auth-user-passin virtual memory. Not applicable with OpenVPN 3 due to a different credentials storage model. Different system, different secrets locker.--chroot DIRβ chroot to this directory after initialization. Not applicable with OpenVPN 3, which uses a different execution model.--data-ciphers CIPHERLISTβ OpenVPN 2.5 introduced this option as a replacement to--ncp-ciphers. This is primarily intended to be used when migrating away from the prior defaultBF-CBCcipher. With Negotiable Cipher Parameters (NCP), this should not be needed in the future. OpenVPN 3 also has a different way of handling this situation and is believed to not have the same connectivity issues as OpenVPN 2.4 and newer 2.x releases could have against older OpenVPN 2.x servers. So, whole different plotline, same happy ending.--data-ciphers-fallback ALGβ this is tightly coupled to--data-ciphersand is also not used nor supported by OpenVPN 3. π--dev-node NODEβ OpenVPN 2.x will use/dev/net/tun,/dev/tun,/dev/tap, etc by default when creating the tun/tap interface. This is handled differently in OpenVPN 3 Linux and is not configurable by front-ends likeopenvpn2oropenvpn3, since the virtual network interface creation is handled by theopenvpn3-service-netcfg(8)service. Not our department, bestie, that's a whole other service's job.--downβ run a script after the tunnel has been torn down. Running scripts via OpenVPN 3 is not supported, and using this option will display a warning. See the NOTES section below for details. π--down-preβ this is related to when the--downscript is being run during the disconnection. See the NOTES section below regarding script execution in OpenVPN 3.--explicit-exit-notify <ATTEMPTS>β on exit/restart, send an exit signal to the remote end. Automatically configured with OpenVPN 3 β¨ so she handles it for you, no notes--group GROUPβ run OpenVPN withGROUPgroup credentials. Not needed with OpenVPN 3, which uses a different privilege separation approach.--mute-replay-warningsβ OpenVPN 2.5 and older can hide warnings related to replayed packets. Packet replays are not reported in the same way in the OpenVPN 3 Core library, so this option makes no behavioural change. It's giving decor.--ncp-ciphers CIPHERLISTβ OpenVPN 2.4 option renamed to--data-ciphersin OpenVPN 2.5. Ignored in OpenVPN 3. Glow-up happened, old name retired.--nice LEVELβ change process priority. Not supported in OpenVPN 3. π--nobindβ do not bind to the local address and port. This is default behaviour in OpenVPN 3, so like... it's already on, no need to ask.--persist-keyβ do not re-read key files across connection restarts. Not needed. OpenVPN 3 keeps keys as embedded file elements in the configuration. π--rcvbuf SIZEβ set the TCP/UDP receive buffer size. Not supported in OpenVPN 3.--resolv-retry SECSβ if the hostname resolve fails for--remote, retry the resolve for n seconds before failing. Not supported by OpenVPN 3. π--script-security LEVELβ this option is ignored, as OpenVPN 3 itself does not execute any external scripts. No scripts. Periodt.--sndbuf SIZEβ set the TCP/UDP send buffer size. Not supported in OpenVPN 3.--socket-flags FLAGSβ applies flags to the transport socket. Not supported in OpenVPN 3.--upβ run a script after the tunnel has been established. Running scripts via OpenVPN 3 is not supported, and using this option will display a warning. See the NOTES section below for details. π--user USERβ run OpenVPN withUSERuser credentials. Not needed with OpenVPN 3, which uses a different privilege separation approach.
π NOTES π
π¬ SCRIPT EXECUTION π¬
Okay so listen, bestie. OpenVPN 3 does not implement any support for running external scripts or programs during its life cycle. Not a bug β it's by design. π
Running scripts is a security risk, and it needs to be handled carefully. In classic OpenVPN 2.x setups, scripts are run with the same privileges as the openvpn(8) process. If the process is started as root, the script may be run as root. Which is why the --script-security option is available and by default disabling running most external programs. π
This does not mean it is impossible to trigger programs to perform operations when certain OpenVPN events occur. OpenVPN 3 Linux is using D-Bus actively and it issues several signals as the state changes. It also means you can write your own front-end doing its own calls how you prefer while starting and managing the VPN session at the same time. This allows a much better flexibility and allows one to adopt VPN session management into the execution flow which is needed. And the implementation can do its own security assessments on how it will tackle these scenarios. Iconic. β¨
There are at least three ways how to adopt to the OpenVPN 3 model:
- Watching D-Bus StateChange signals for your own sessions When a session is started, it is possible to subscribe to signals issued by the VPN client process over D-Bus. It is only possible to subscribe to signals related to the session owner's own sessions. These signals are sent by the Session Manager (
net.openvpn.v3.sessions,openvpn3-service-sessionmgr(8)).
Example:
$ dbus-monitor --system --monitor sender=net.openvpn.v3.sessions,interface=net.openvpn.v3.sessions,member=StatusChange
- Manage the life cycle of VPN sessions on your own This means wrapping the starting of VPN sessions on your own. Either you wrap
openvpn3 session-startoropenvpn2calls in your own scripts, or you can connect directly to the Configuration Manager (net.openvpn.v3.configuration,openvpn3-service-configmgr(8)) and Session Manager (net.openvpn.v3.sessions,openvpn3-service-sessionmgr(8)) to import configuration profiles and start/stop VPN sessions as needed, as well as subscribing to D-Bus signals as well to handle various the states a VPN session will go through. This is fairly simple to do using the already availableopenvpn3Python module. Example code can be found in the OpenVPN 3 Linux source tree <https://github.com/OpenVPN/openvpn3-linux/tree/master/src/tests/python> [1] or by studying the source code ofopenvpn2(1)andopenvpn3-systemd(8), which both are Python scripts.
Configurations and sessions managed via D-Bus by your own scripts can still be further managed by the openvpn3(1) command line interface.
- Subscribing to NetworkChange signals from
net.openvpn.v3.netcfg<https://github.com/OpenVPN/openvpn3-linux/blob/master/docs/dbus/dbus-service-net.openvpn.v3.netcfg.md> [2] This is also a scripting possibility, which is more useful for system wide script triggering. A program or script can subscribe to specific network change events caused by OpenVPN sessions. These signals contains information about virtual network interfaces which has been created or removed, IP addresses added or removed from devices, routing configuration as well as DNS resolver changes.
For an example how to do this, see the example script <https://github.com/OpenVPN/openvpn3-linux/blob/master/src/tests/python/netcfg-netchg-subscription> [3] in the OpenVPN 3 Linux source directory.
Please note that, by default, this script must be run as root or the openvpn user on the system. It is possible to allow other users or groups this privilege, by extending the D-Bus policy for the net.openvpn.v3.netcfg service. But granting this privilege too widely may result in unwanted information leakage related to VPN interface configurations. Stay safe out there, bestie. π«Ά
π SEE ALSO π
openvpn(8)openvpn3(1)openvpn3-config-manage(1)- [1] <https://github.com/OpenVPN/openvpn3-linux/tree/master/src/tests/python>
- [2] <https://github.com/OpenVPN/openvpn3-linux/blob/master/docs/dbus/dbus-service-net.openvpn.v3.netcfg.md>
- [3] <https://github.com/OpenVPN/openvpn3-linux/blob/master/src/tests/python/netcfg-netchg-subscription>
And that's the whole openvpn2(1) manual page, bestie β the footer just says openvpn2(1), no extra version/date drama in this part, and honestly? iconic. πβ¨
π¦ where this page comes from
- nixpkgs unstable: openvpn3 27.1
- ubuntu stonking: openvpn3-client 27.1+dfsg-2ubuntu1 Β· AGPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms