man-page overhaul project - round 2
v2 cover man-page overhaul project - round 2
Hi,
In the community meeting 2020-07-16, it was agreed to try to squash several commits and reduce the number of patches. In addition to split up the biggest patch into two parts to try to sneak everything into the mailing list without sending too large patches.
I've kept a few changes separate, as they are not strictly tied to this overhaul but these changes are important to get included.
Richard Bonhomme has also contributed with a lot of language improvements which now has been squashed into one of these commits below. Unfortunately this squashing removed him as the author of that commit, but I wanted to be sure he gets the proper credit somehow.
kind regards,
David Sommerseth
OpenVPN Inc
David Sommerseth (7):
doc/man: Add an .rst formatted version of the man page doc/man: Replace old man page with generated man page doc/man: Split up and reorganize main man page doc/man: Complete openvpn.8.rst splitting doc/man: Mark compression options as deprecated doc/man: Adopt compression documentation doc/man: Documentation for --bind-dev / VRFs on Linux
Richard Bonhomme (1):
doc/man: Update --txqueuelen default setting (Now OS default)
.gitignore | 1 + INSTALL | 3 +- configure.ac | 15 +- doc/Makefile.am | 56 +- doc/README.man | 23 + doc/man-sections/advanced-options.rst | 107 + doc/man-sections/client-options.rst | 354 + doc/man-sections/connection-profiles.rst | 75 + doc/man-sections/encryption-options.rst | 136 + doc/man-sections/examples.rst | 241 + doc/man-sections/generic-options.rst | 436 + doc/man-sections/inline-files.rst | 25 + doc/man-sections/link-options.rst | 410 + doc/man-sections/log-options.rst | 74 + doc/man-sections/management-options.rst | 136 + doc/man-sections/network-config.rst | 10 + doc/man-sections/pkcs11-options.rst | 81 + doc/man-sections/plugin-options.rst | 60 + doc/man-sections/protocol-options.rst | 262 + doc/man-sections/proxy-options.rst | 66 + doc/man-sections/renegotiation.rst | 53 + doc/man-sections/script-options.rst | 807 ++ doc/man-sections/server-options.rst | 769 ++ doc/man-sections/signals.rst | 30 + doc/man-sections/tls-options.rst | 643 ++ doc/man-sections/unsupported-options.rst | 33 + .../virtual-routing-and-forwarding.rst | 78 + doc/man-sections/vpn-network-options.rst | 535 ++ doc/man-sections/windows-options.rst | 245 + doc/openvpn.8 | 7659 ----------------- doc/openvpn.8.rst | 169 + 31 files changed, 5918 insertions(+), 7674 deletions(-) create mode 100644 doc/README.man create mode 100644 doc/man-sections/advanced-options.rst create mode 100644 doc/man-sections/client-options.rst create mode 100644 doc/man-sections/connection-profiles.rst create mode 100644 doc/man-sections/encryption-options.rst create mode 100644 doc/man-sections/examples.rst create mode 100644 doc/man-sections/generic-options.rst create mode 100644 doc/man-sections/inline-files.rst create mode 100644 doc/man-sections/link-options.rst create mode 100644 doc/man-sections/log-options.rst create mode 100644 doc/man-sections/management-options.rst create mode 100644 doc/man-sections/network-config.rst create mode 100644 doc/man-sections/pkcs11-options.rst create mode 100644 doc/man-sections/plugin-options.rst create mode 100644 doc/man-sections/protocol-options.rst create mode 100644 doc/man-sections/proxy-options.rst create mode 100644 doc/man-sections/renegotiation.rst create mode 100644 doc/man-sections/script-options.rst create mode 100644 doc/man-sections/server-options.rst create mode 100644 doc/man-sections/signals.rst create mode 100644 doc/man-sections/tls-options.rst create mode 100644 doc/man-sections/unsupported-options.rst create mode 100644 doc/man-sections/virtual-routing-and-forwarding.rst create mode 100644 doc/man-sections/vpn-network-options.rst create mode 100644 doc/man-sections/windows-options.rst delete mode 100644 doc/openvpn.8 create mode 100644 doc/openvpn.8.rst
Signature · 1 line
2.26.0
PATCH v2 1/8 doc/man: Add an .rst formatted version of the man page
This is the first step to move away from a manually editing g/nroff encoded man page.
Some modifications was needed to ensure formatting was consistent and rendered reasonably okay in GitHub and that the generated man page (using rst2man) is looking as a proper man page. Unsupported options has also been moved into its own section. HTML rendering directly using rst2html has also been used to validate the conversion.
The rst2man and rst2html utilities comes from the python-docutils
project: https://docutils.sourceforge.io/
--- doc/openvpn.8.rst | 5749 +++++++++++++++++++++++++++++++++++ doc/unsupported-options.rst | 33 + 2 files changed, 5782 insertions(+) create mode 100644 doc/openvpn.8.rst create mode 100644 doc/unsupported-options.rst
doc/openvpn.8.rst new file +5749 -0
@@ -0,0 +1,5749 @@ +========= + openvpn +========= +------------------------- + Secure IP tunnel daemon +------------------------- + +:Manual section: 8 +:Manual group: System Manager's Manual + + + +SYNOPSIS +======== +| ``openvpn`` [ options ... ] +| ``openvpn`` ``--help`` + + + +INTRODUCTION +============ + +OpenVPN is an open source VPN daemon by James Yonan. Because OpenVPN +tries to be a universal VPN tool offering a great deal of flexibility, +there are a lot of options on this manual page. If you're new to +OpenVPN, you might want to skip ahead to the examples section where you +will see how to construct simple VPNs on the command line without even +needing a configuration file. + +Also note that there's more documentation and examples on the OpenVPN +web site: https://openvpn.net/ + +And if you would like to see a shorter version of this manual, see the +openvpn usage message which can be obtained by running **openvpn** +without any parameters. + + + +DESCRIPTION +=========== + +OpenVPN is a robust and highly flexible VPN daemon. OpenVPN supports +SSL/TLS security, ethernet bridging, TCP or UDP tunnel transport through +proxies or NAT, support for dynamic IP addresses and DHCP, scalability +to hundreds or thousands of users, and portability to most major OS +platforms. + +OpenVPN is tightly bound to the OpenSSL library, and derives much of its +crypto capabilities from it. + +OpenVPN supports conventional encryption using a pre-shared secret key +**(Static Key mode)** or public key security **(SSL/TLS mode)** using +client & server certificates. OpenVPN also supports non-encrypted +TCP/UDP tunnels. + +OpenVPN is designed to work with the **TUN/TAP** virtual networking +interface that exists on most platforms. + +Overall, OpenVPN aims to offer many of the key features of IPSec but +with a relatively lightweight footprint. + + + +OPTIONS +======= + +OpenVPN allows any option to be placed either on the command line or in +a configuration file. Though all command line options are preceded by a +double-leading-dash ("--"), this prefix can be removed when an option is +placed in a configuration file. + +--help + + Show options. + +--config file + Load additional config options from ``file`` where each line corresponds + to one command line option, but with the leading '--' removed. + + If ``--config file`` is the only option to the openvpn command, the + ``--config`` can be removed, and the command can be given as ``openvpn + file`` + + Note that configuration files can be nested to a reasonable depth. + + Double quotation or single quotation characters ("", '') can be used to + enclose single parameters containing whitespace, and "#" or ";" + characters in the first column can be used to denote comments. + + Note that OpenVPN 2.0 and higher performs backslash-based shell escaping + for characters not in single quotations, so the following mappings + should be observed: + :: + + \\ Maps to a single backslash character (\). + \" Pass a literal doublequote character ("), don't + interpret it as enclosing a parameter. + \[SPACE] Pass a literal space or tab character, don't + interpret it as a parameter delimiter. + + For example on Windows, use double backslashes to represent pathnames: + :: + + secret "c:\\OpenVPN\\secret.key" + + + For examples of configuration files, see + https://openvpn.net/community-resources/how-to/ + + Here is an example configuration file: + :: + + # + # Sample OpenVPN configuration file for + # using a pre-shared static key. + # + # '#' or ';' may be used to delimit comments. + + # Use a dynamic tun device. + dev tun + + # Our remote peer + remote mypeer.mydomain + + # 10.1.0.1 is our local VPN endpoint + # 10.1.0.2 is our remote VPN endpoint + ifconfig 10.1.0.1 10.1.0.2 + + # Our pre-shared static key + secret static.key + + +Tunnel Options: +--------------- + +--mode m + Set OpenVPN major mode. By default, OpenVPN runs in point-to-point mode + (:code:`p2p`). OpenVPN 2.0 introduces a new mode (:code:`server`) which + implements a multi-client server capability. + +--local host + Local host name or IP address for bind. If specified, OpenVPN will bind + to this address only. If unspecified, OpenVPN will bind to all + interfaces. + +--remote args + Remote host name or IP address. It supports two additional optional + arguments: ``port`` and ``proto``. On the client, multiple ``--remote`` + options may be specified for redundancy, each referring to a different + OpenVPN server. Specifying multiple ``--remote`` options for this + purpose is a special case of the more general connection-profile + feature. See the ``<connection>`` documentation below. + + The OpenVPN client will try to connect to a server at ``host:port`` in + the order specified by the list of ``--remote`` options. + + Examples: + :: + + remote server.example.net + remote server.example.net 1194 + remote server.example.net tcp + + ``proto`` indicates the protocol to use when connecting with the remote, + and may be :code:`tcp` or :code:`udp`. + + For forcing IPv4 or IPv6 connection suffix tcp or udp with 4/6 like + udp4/udp6/tcp4/tcp6. + + The client will move on to the next host in the list, in the event of + connection failure. Note that at any given time, the OpenVPN client will + at most be connected to one server. + + Note that since UDP is connectionless, connection failure is defined by + the ``--ping`` and ``--ping-restart`` options. + + Note the following corner case: If you use multiple ``--remote`` + options, AND you are dropping root privileges on the client with + ``--user`` and/or ``--group`` AND the client is running a non-Windows + OS, if the client needs to switch to a different server, and that server + pushes back different TUN/TAP or route settings, the client may lack the + necessary privileges to close and reopen the TUN/TAP interface. This + could cause the client to exit with a fatal error. + + If ``--remote`` is unspecified, OpenVPN will listen for packets from any + IP address, but will not act on those packets unless they pass all + authentication tests. This requirement for authentication is binding on + all potential peers, even those from known and supposedly trusted IP + addresses (it is very easy to forge a source IP address on a UDP + packet). + + When used in TCP mode, ``--remote`` will act as a filter, rejecting + connections from any host which does not match ``host``. + + If ``host`` is a DNS name which resolves to multiple IP addresses, + OpenVPN will try them in the order that the system getaddrinfo() + presents them, so priorization and DNS randomization is done by the + system library. Unless an IP version is forced by the protocol + specification (4/6 suffix), OpenVPN will try both IPv4 and IPv6 + addresses, in the order getaddrinfo() returns them. + +--remote-random-hostname + Prepend a random string (6 bytes, 12 hex characters) to hostname to + prevent DNS caching. For example, "foo.bar.gov" would be modified to + "<random-chars>.foo.bar.gov". + +--proto-force p + When iterating through connection profiles, only consider profiles using + protocol ``p`` (:code:`tcp` \| :code:`udp`). + +--remote-random + When multiple ``--remote`` address/ports are specified, or if connection + profiles are being used, initially randomize the order of the list as a + kind of basic load-balancing measure. + +--proto p + Use protocol ``p`` for communicating with remote host. ``p`` can be + :code:`udp`, :code:`tcp-client`, or :code:`tcp-server`. + + The default protocol is :code:`udp` when ``--proto`` is not specified. + + For UDP operation, ``--proto udp`` should be specified on both peers. + + For TCP operation, one peer must use ``--proto tcp-server`` and the + other must use ``--proto tcp-client``. A peer started with + :code:`tcp-server` will wait indefinitely for an incoming connection. A peer + started with :code:`tcp-client` will attempt to connect, and if that fails, + will sleep for 5 seconds (adjustable via the ``--connect-retry`` option) + and try again infinite or up to N retries (adjustable via the + ``--connect-retry-max`` option). Both TCP client and server will + simulate a SIGUSR1 restart signal if either side resets the connection. + + OpenVPN is designed to operate optimally over UDP, but TCP capability is + provided for situations where UDP cannot be used. In comparison with + UDP, TCP will usually be somewhat less efficient and less robust when + used over unreliable or congested networks. + + This article outlines some of problems with tunneling IP over TCP: + http://sites.inka.de/sites/bigred/devel/tcp-tcp.html + + There are certain cases, however, where using TCP may be advantageous + from a security and robustness perspective, such as tunneling non-IP or + application-level UDP protocols, or tunneling protocols which don't + possess a built-in reliability layer. + +--connect-retry args + Wait ``n`` seconds between connection attempts (default :code:`5`). + Repeated reconnection attempts are slowed down after 5 retries per + remote by doubling the wait time after each unsuccessful attempt. An + optional argument ``max`` specifies the maximum value of wait time in + seconds at which it gets capped (default :code:`300`). + +--connect-retry-max n + ``n`` specifies the number of times each ``--remote`` or + ``<connection>`` entry is tried. Specifying ``n`` as one would try each + entry exactly once. A successful connection resets the counter. + (default *unlimited*). + +--show-proxy-settings + Show sensed HTTP or SOCKS proxy settings. Currently, only Windows + clients support this option. + +--http-proxy args + Connect to remote host through an HTTP proxy. This requires at least an + address ``server`` and ``port`` argument. If HTTP Proxy-Authenticate + is required, a file name to an ``authfile`` file containing a username + and password on 2 lines can be given, or :code:`stdin` to prompt from + console. Its content can also be specified in the config file with the + ``--http-proxy-user-pass`` option. (See section on inline files) + + The last optional argument is an ``auth-method`` which should be one + of :code:`none`, :code:`basic`, or :code:`ntlm`. + + HTTP Digest authentication is supported as well, but only via the + :code:`auto` or :code:`auto-nct` flags (below). This must replace + the ``authfile`` argument. + + The :code:`auto` flag causes OpenVPN to automatically determine the + ``auth-method`` and query stdin or the management interface for + username/password credentials, if required. This flag exists on OpenVPN + 2.1 or higher. + + The ``auto-nct`` flag (no clear-text auth) instructs OpenVPN to + automatically determine the authentication method, but to reject weak + authentication protocols such as HTTP Basic Authentication. + + Examples: + :: + + http-proxy proxy.example.net 3128 + http-proxy proxy.example.net 3128 authfile.txt + http-proxy proxy.example.net 3128 stdin + http-proxy proxy.example.net 3128 auto basic + http-proxy proxy.example.net 3128 auto-nct ntlm + +--http-proxy-option args + Set extended HTTP proxy options. Requires an option ``type`` as argument + and an optional ``parameter`` to the type. Repeat to set multiple + options. + + :code:`VERSION` ``version`` + Set HTTP version number to ``version`` (default :code:`1.0`). + + :code:`AGENT` ``user-agent`` + Set HTTP "User-Agent" string to ``user-agent``. + + :code:`CUSTOM-HEADER` ``name`` ``content`` + Adds the custom Header with ``name`` as name and ``content`` as + the content of the custom HTTP header. + + Examples: + :: + + http-proxy-option VERSION 1.1 + http-proxy-option AGENT OpenVPN/2.4 + http-proxy-option X-Proxy-Flag some-flags + +--socks-proxy args + Connect to remote host through a Socks5 proxy. A required ``server`` + argument is needed. Optionally a ``port`` (default :code:`1080`) and + ``authfile`` can be given. The ``authfile`` is a file containing a + username and password on 2 lines, or :code:`stdin` can be used to + prompt from console. + +--resolv-retry n + If hostname resolve fails for ``--remote``, retry resolve for ``n`` + seconds before failing. + + Set ``n`` to "infinite" to retry indefinitely. + + By default, ``--resolv-retry infinite`` is enabled. You can disable by + setting n=0. + +--float + Allow remote peer to change its IP address and/or port number, such as + due to DHCP (this is the default if ``--remote`` is not used). + ``--float`` when specified with ``--remote`` allows an OpenVPN session + to initially connect to a peer at a known address, however if packets + arrive from a new address and pass all authentication tests, the new + address will take control of the session. This is useful when you are + connecting to a peer which holds a dynamic address such as a dial-in + user or DHCP client. + + Essentially, ``--float`` tells OpenVPN to accept authenticated packets + from any address, not only the address which was specified in the + ``--remote`` option. + +--ipchange cmd + Run command ``cmd`` when our remote ip-address is initially + authenticated or changes. + + ``cmd`` consists of a path to script (or executable program), optionally + followed by arguments. The path and arguments may be single- or + double-quoted and/or escaped using a backslash, and should be separated + by one or more spaces. + + When ``cmd`` is executed two arguments are appended after any arguments + specified in ``cmd`` , as follows: + :: + + cmd ip address port number + + Don't use ``--ipchange`` in ``--mode server`` mode. Use a + ``--client-connect`` script instead. + + See the `Environmental Variables`_ section below for additional + parameters passed as environmental variables. + + If you are running in a dynamic IP address environment where the IP + addresses of either peer could change without notice, you can use this + script, for example, to edit the :code:`/etc/hosts` file with the current + address of the peer. The script will be run every time the remote peer + changes its IP address. + + Similarly if *our* IP address changes due to DHCP, we should configure + our IP address change script (see man page for ``dhcpcd``\(8)) to + deliver a ``SIGHUP`` or ``SIGUSR1`` signal to OpenVPN. OpenVPN will + then reestablish a connection with its most recently authenticated + peer on its new IP address. + +--port port + TCP/UDP port number or port name for both local and remote (sets both + ``--lport`` and ``--rport`` options to given port). The current default + of 1194 represents the official IANA port number assignment for OpenVPN + and has been used since version 2.0-beta17. Previous versions used port + 5000 as the default. + +--lport port + Set local TCP/UDP port number or name. Cannot be used together with + ``--nobind`` option. + +--rport port + Set TCP/UDP port number or name used by the ``--remote`` option. The + port can also be set directly using the ``--remote`` option. + +--bind keywords + Bind to local address and port. This is the default unless any of + ``--proto tcp-client`` , ``--http-proxy`` or ``--socks-proxy`` are used. + + If the optional :code:`ipv6only` keyword is present OpenVPN will bind only + to IPv6 (as opposed to IPv6 and IPv4) when a IPv6 socket is opened. + +--nobind + Do not bind to local address and port. The IP stack will allocate a + dynamic port for returning packets. Since the value of the dynamic port + could not be known in advance by a peer, this option is only suitable + for peers which will be initiating connections by using the --remote + option. + +--dev device + TUN/TAP virtual network device which can be :code:`tunX`, :code:`tapX`, + :code:`null` or an arbitrary name string (:code:`X` can be omitted for + a dynamic device.) + + See examples section below for an example on setting up a TUN device. + + You must use either tun devices on both ends of the connection or tap + devices on both ends. You cannot mix them, as they represent different + underlying network layers: + + :code:`tun` + devices encapsulate IPv4 or IPv6 (OSI Layer 3) + + :code:`tap` + devices encapsulate Ethernet 802.3 (OSI Layer 2). + +--dev-type device-type + Which device type are we using? ``device-type`` should be :code:`tun` + (OSI Layer 3) or :code:`tap` (OSI Layer 2). Use this option only if + the TUN/TAP device used with ``--dev`` does not begin with :code:`tun` + or :code:`tap`. + +--topology mode + Configure virtual addressing topology when running in ``--dev tun`` + mode. This directive has no meaning in ``--dev tap`` mode, which always + uses a :code:`subnet` topology. + + If you set this directive on the server, the ``--server`` and + ``--server-bridge`` directives will automatically push your chosen + topology setting to clients as well. This directive can also be manually + pushed to clients. Like the ``--dev`` directive, this directive must + always be compatible between client and server. + + ``mode`` can be one of: + + :code:`net30` + Use a point-to-point topology, by allocating one /30 subnet + per client. This is designed to allow point-to-point semantics when some + or all of the connecting clients might be Windows systems. This is the + default on OpenVPN 2.0. + + :code:`p2p` + Use a point-to-point topology where the remote endpoint of + the client's tun interface always points to the local endpoint of the + server's tun interface. This mode allocates a single IP address per + connecting client. Only use when none of the connecting clients are + Windows systems. + + :code:`subnet` + Use a subnet rather than a point-to-point topology by + configuring the tun interface with a local IP address and subnet mask, + similar to the topology used in ``--dev tap`` and ethernet bridging + mode. This mode allocates a single IP address per connecting client and + works on Windows as well. Only available when server and clients are + OpenVPN 2.1 or higher, or OpenVPN 2.0.x which has been manually patched + with the ``--topology`` directive code. When used on Windows, requires + version 8.2 or higher of the TAP-Win32 driver. When used on \*nix, + requires that the tun driver supports an + ```ifconfig </man/man2html?8+ifconfig>`__``\ (8) command which sets a + subnet instead of a remote endpoint IP address. + + This option exists in OpenVPN 2.1 or higher. + + *Note:* Using ``--topology subnet`` changes the interpretation of the + arguments of ``--ifconfig`` to mean "address netmask", no longer "local + remote". + +--dev-node node + Explicitly set the device node rather than using :code:`/dev/net/tun`, + :code:`/dev/tun`, :code:`/dev/tap`, etc. If OpenVPN cannot figure out + whether ``node`` is a TUN or TAP device based on the name, you should + also specify ``--dev-type tun`` or ``--dev-type tap``. + + Under Mac OS X this option can be used to specify the default tun + implementation. Using ``--dev-node utun`` forces usage of the native + Darwin tun kernel support. Use ``--dev-node utunN`` to select a specific + utun instance. To force using the :code:`tun.kext` (:code:`/dev/tunX`) + use ``--dev-node tun``. When not specifying a ``--dev-node`` option + openvpn will first try to open utun, and fall back to tun.kext. + + On Windows systems, select the TAP-Win32 adapter which is named ``node`` + in the Network Connections Control Panel or the raw GUID of the adapter + enclosed by braces. The ``--show-adapters`` option under Windows can + also be used to enumerate all available TAP-Win32 adapters and will show + both the network connections control panel name and the GUID for each + TAP-Win32 adapter. + +--lladdr address + Specify the link layer address, more commonly known as the MAC address. + Only applied to TAP devices. + +--iproute cmd + Set alternate command to execute instead of default ``iproute2`` command. + May be used in order to execute OpenVPN in unprivileged environment. + +--ifconfig args + Set TUN/TAP adapter parameters. It requires the *IP address* of the local + VPN endpoint. For TUN devices in point-to-point mode, the next argument + must be the VPN IP address of the remote VPN endpoint. For TAP devices, + or TUN devices used with ``--topology subnet``, the second argument + is the subnet mask of the virtual network segment which is being created + or connected to. + + For TUN devices, which facilitate virtual point-to-point IP connections + (when used in ``--topology net30`` or ``p2p`` mode), the proper usage of + ``--ifconfig`` is to use two private IP addresses which are not a member + of any existing subnet which is in use. The IP addresses may be + consecutive and should have their order reversed on the remote peer. + After the VPN is established, by pinging ``rn``, you will be pinging + across the VPN. + + For TAP devices, which provide the ability to create virtual ethernet + segments, or TUN devices in ``--topology subnet`` mode (which create + virtual "multipoint networks"), ``--ifconfig`` is used to set an IP + address and subnet mask just as a physical ethernet adapter would be + similarly configured. If you are attempting to connect to a remote + ethernet bridge, the IP address and subnet should be set to values which + would be valid on the the bridged ethernet segment (note also that DHCP + can be used for the same purpose). + + This option, while primarily a proxy for the ``ifconfig``\(8) command, + is designed to simplify TUN/TAP tunnel configuration by providing a + standard interface to the different ifconfig implementations on + different platforms. + + ``--ifconfig`` parameters which are IP addresses can also be specified + as a DNS or /etc/hosts file resolvable name. + + For TAP devices, ``--ifconfig`` should not be used if the TAP interface + will be getting an IP address lease from a DHCP server. + + Examples: + :: + + # tun device in net30/p2p mode + ifconfig 10.8.0.2 10.8.0.1 + + # tun/tap device in subnet mode + ifconfig 10.8.0.2 255.255.255.0 + +--ifconfig-noexec + Don't actually execute ifconfig/netsh commands, instead pass + ``--ifconfig`` parameters to scripts using environmental variables. + +--ifconfig-nowarn + Don't output an options consistency check warning if the ``--ifconfig`` + option on this side of the connection doesn't match the remote side. + This is useful when you want to retain the overall benefits of the + options consistency check (also see ``--disable-occ`` option) while only + disabling the ifconfig component of the check. + + For example, if you have a configuration where the local host uses + ``--ifconfig`` but the remote host does not, use ``--ifconfig-nowarn`` + on the local host. + + This option will also silence warnings about potential address conflicts + which occasionally annoy more experienced users by triggering "false + positive" warnings. + +--route args + Add route to routing table after connection is established. Multiple + routes can be specified. Routes will be automatically torn down in + reverse order prior to TUN/TAP device close. + + Valid syntaxes: + :: + + route network/IP + route network/IP netmask + route network/IP netmask gateway + route network/IP netmask gateway metric + + This option is intended as a convenience proxy for the ``route``\(8) + shell command, while at the same time providing portable semantics + across OpenVPN's platform space. + + ``netmask`` + defaults to :code:`255.255.255.255` when not given + + ``gateway`` + default taken from ``--route-gateway`` or the second + parameter to ``--ifconfig`` when ``--dev tun`` is specified. + + ``metric`` + default taken from ``--route-metric`` if set, otherwise :code:`0`. + + The default can be specified by leaving an option blank or setting it to + :code:`default`. + + The ``network`` and ``gateway`` parameters can also be specified as a + DNS or :code:`/etc/hosts` file resolvable name, or as one of three special + keywords: + + :code:`vpn_gateway` + The remote VPN endpoint address (derived either from + ``--route-gateway`` or the second parameter to ``--ifconfig`` + when ``--dev tun`` is specified). + + :code:`net_gateway` + The pre-existing IP default gateway, read from the + routing table (not supported on all OSes). + + :code:`remote_host` + The ``--remote`` address if OpenVPN is being run in + client mode, and is undefined in server mode. + +--route-gateway arg + Specify a default *gateway* for use with ``--route``. + + If :code:`dhcp` is specified as the parameter, the gateway address will + be extracted from a DHCP negotiation with the OpenVPN server-side LAN. + + Valid syntaxes: + :: + + route-gateway gateway + route-gateway dhcp + + +--route-metric m + Specify a default metric ``m`` for use with ``--route``. + +--route-delay args + Valid syntaxes: + :: + + route-delay + route-delay n + route-delay n m + + Delay ``n`` seconds (default :code:`0`) after connection establishment, + before adding routes. If ``n`` is :code:`0`, routes will be added + immediately upon connection establishment. If ``--route-delay`` is + omitted, routes will be added immediately after TUN/TAP device open and + ``--up`` script execution, before any ``--user`` or ``--group`` privilege + downgrade (or ``--chroot`` execution.) + + This option is designed to be useful in scenarios where DHCP is used to + set tap adapter addresses. The delay will give the DHCP handshake time + to complete before routes are added. + + On Windows, ``--route-delay`` tries to be more intelligent by waiting + ``w`` seconds (default :code:`30` by default) for the TAP-Win32 adapter + to come up before adding routes. + +--route-up cmd + Run command ``cmd`` after routes are added, subject to ``--route-delay``. + + ``cmd`` consists of a path to script (or executable program), optionally + followed by arguments. The path and arguments may be single- or + double-quoted and/or escaped using a backslash, and should be separated + by one or more spaces. + + See the `Environmental Variables`_ section below for additional + parameters passed as environmental variables. + +--route-pre-down cmd + Run command ``cmd`` before routes are removed upon disconnection. + + ``cmd`` consists of a path to script (or executable program), optionally + followed by arguments. The path and arguments may be single- or + double-quoted and/or escaped using a backslash, and should be separated + by one or more spaces. + + See the `Environmental Variables`_ section below for additional + parameters passed as environmental variables. + +--route-noexec + Don't add or remove routes automatically. Instead pass routes to + ``--route-up`` script using environmental variables. + +--route-nopull + When used with ``--client`` or ``--pull``, accept options pushed by + server EXCEPT for routes, block-outside-dns and dhcp options like DNS + servers. + + When used on the client, this option effectively bars the server from + adding routes to the client's routing table, however note that this + option still allows the server to set the TCP/IP properties of the + client's TUN/TAP interface. + +--allow-pull-fqdn + Allow client to pull DNS names from server (rather than being limited to + IP address) for ``--ifconfig``, ``--route``, and ``--route-gateway``. + +--client-nat args + This pushable client option sets up a stateless one-to-one NAT rule on + packet addresses (not ports), and is useful in cases where routes or + ifconfig settings pushed to the client would create an IP numbering + conflict. + + Examples: + :: + + client-nat snat 192.168.0.0/255.255.0.0 + client-nat dnat 10.64.0.0/255.255.0.0 + + ``network/netmask`` (for example :code:`192.168.0.0/255.255.0.0`) defines + the local view of a resource from the client perspective, while + ``alias/netmask`` (for example :code:`10.64.0.0/255.255.0.0`) defines the + remote view from the server perspective. + + Use :code:`snat` (source NAT) for resources owned by the client and + :code:`dnat` (destination NAT) for remote resources. + + Set ``--verb 6`` for debugging info showing the transformation of + src/dest addresses in packets. + +--redirect-gateway flags + Automatically execute routing commands to cause all outgoing IP traffic + to be redirected over the VPN. This is a client-side option. + + This option performs three steps: + + (1) Create a static route for the ``--remote`` address which + forwards to the pre-existing default gateway. This is done so that + ``(3)`` will not create a routing loop. + + (2) Delete the default gateway route. + + (3) Set the new default gateway to be the VPN endpoint address + (derived either from ``--route-gateway`` or the second parameter to + ``--ifconfig`` when ``--dev tun`` is specified). + + When the tunnel is torn down, all of the above steps are reversed so + that the original default route is restored. + + Option flags: + + :code:`local` + Add the :code:`local` flag if both OpenVPN peers are directly + connected via a common subnet, such as with wireless. The + :code:`local` flag will cause step ``(1)`` above to be omitted. + + :code:`autolocal` + Try to automatically determine whether to enable :code:`local` + flag above. + + :code:`def1` + Use this flag to override the default gateway by using + :code:`0.0.0.0/1` and :code:`128.0.0.0/1` rather than + :code:`0.0.0.0/0`. This has the benefit of overriding but not + wiping out the original default gateway. + + :code:`bypass-dhcp` + Add a direct route to the DHCP server (if it is non-local) which + bypasses the tunnel (Available on Windows clients, may not be + available on non-Windows clients). + + :code:`bypass-dns` + Add a direct route to the DNS server(s) (if they are non-local) + which bypasses the tunnel (Available on Windows clients, may + not be available on non-Windows clients). + + :code:`block-local` + Block access to local LAN when the tunnel is active, except for + the LAN gateway itself. This is accomplished by routing the local + LAN (except for the LAN gateway address) into the tunnel. + + :code:`ipv6` + Redirect IPv6 routing into the tunnel. This works similar to + the :code:`def1` flag, that is, more specific IPv6 routes are added + (:code:`2000::/4`, :code:`3000::/4`), covering the whole IPv6 + unicast space. + + :code:`!ipv4` + Do not redirect IPv4 traffic - typically used in the flag pair + :code:`ipv6 !ipv4` to redirect IPv6-only. + +--link-mtu n + Sets an upper bound on the size of UDP packets which are sent between + OpenVPN peers. *It's best not to set this parameter unless you know what + you're doing.* + +--redirect-private flags + Like ``--redirect-gateway``, but omit actually changing the default gateway. + Useful when pushing private subnets. + +--block-ipv6 + On the client, instead of sending IPv6 packets over the VPN tunnel, all + IPv6 packets are answered with an ICMPv6 no route host message. On the + server, all IPv6 packets from clients are answered with an ICMPv6 no + route to host message. This options is intended for cases when IPv6 + should be blocked and other options are not available. ``--block-ipv6`` + will use the remote IPv6 as source address of the ICMPv6 packets if set, + otherwise will use :code:`fe80::7` as source address. + + For this option to make sense you actually have to route traffic to the + tun interface. The following example config block would send all IPv6 + traffic to OpenVPN and answer all requests with no route to host, + effectively blocking IPv6. + + **Client config** + :: + + --ifconfig-ipv6 fd15:53b6:dead::2/64 fd15:53b6:dead::1 + --redirect-gateway ipv6 + --block-ipv6 + + **Server config** + Push a "valid" ipv6 config to the client and block on the server + :: + + --push "ifconfig-ipv6 fd15:53b6:dead::2/64 fd15:53b6:dead::1" + --push "redirect-gateway ipv6" + --block-ipv6 + +--tun-mtu n + Take the TUN device MTU to be **n** and derive the link MTU from it + (default :code:`1500`). In most cases, you will probably want to leave + this parameter set to its default value. + + The MTU (Maximum Transmission Units) is the maximum datagram size in + bytes that can be sent unfragmented over a particular network path. + OpenVPN requires that packets on the control or data channels be sent + unfragmented. + + MTU problems often manifest themselves as connections which hang during + periods of active usage. + + It's best to use the ``--fragment`` and/or ``--mssfix`` options to deal + with MTU sizing issues. + +--tun-mtu-extra n + Assume that the TUN/TAP device might return as many as ``n`` bytes more + than the ``--tun-mtu`` size on read. This parameter defaults to 0, which + is sufficient for most TUN devices. TAP devices may introduce additional + overhead in excess of the MTU size, and a setting of 32 is the default + when TAP devices are used. This parameter only controls internal OpenVPN + buffer sizing, so there is no transmission overhead associated with + using a larger value. + +--mtu-disc type + Should we do Path MTU discovery on TCP/UDP channel? Only supported on + OSes such as Linux that supports the necessary system call to set. + + Valid types: + + :code:`no` Never send DF (Don't Fragment) frames + + :code:`maybe` Use per-route hints + + :code:`yes` Always DF (Don't Fragment) + +--mtu-test + To empirically measure MTU on connection startup, add the ``--mtu-test`` + option to your configuration. OpenVPN will send ping packets of various + sizes to the remote peer and measure the largest packets which were + successfully received. The ``--mtu-test`` process normally takes about 3 + minutes to complete. + +--fragment max + Enable internal datagram fragmentation so that no UDP datagrams are sent + which are larger than ``max`` bytes. + + The ``max`` parameter is interpreted in the same way as the + ``--link-mtu`` parameter, i.e. the UDP packet size after encapsulation + overhead has been added in, but not including the UDP header itself. + + The ``--fragment`` option only makes sense when you are using the UDP + protocol (``--proto udp``). + + ``--fragment`` adds 4 bytes of overhead per datagram. + + See the ``--mssfix`` option below for an important related option to + ``--fragment``. + + It should also be noted that this option is not meant to replace UDP + fragmentation at the IP stack level. It is only meant as a last resort + when path MTU discovery is broken. Using this option is less efficient + than fixing path MTU discovery for your IP link and using native IP + fragmentation instead. + + Having said that, there are circumstances where using OpenVPN's internal + fragmentation capability may be your only option, such as tunneling a + UDP multicast stream which requires fragmentation. + +--mssfix max + Announce to TCP sessions running over the tunnel that they should limit + their send packet sizes such that after OpenVPN has encapsulated them, + the resulting UDP packet size that OpenVPN sends to its peer will not + exceed ``max`` bytes. The default value is :code:`1450`. + + The ``max`` parameter is interpreted in the same way as the + ``--link-mtu`` parameter, i.e. the UDP packet size after encapsulation + overhead has been added in, but not including the UDP header itself. + Resulting packet would be at most 28 bytes larger for IPv4 and 48 bytes + for IPv6 (20/40 bytes for IP header and 8 bytes for UDP header). Default + value of 1450 allows IPv4 packets to be transmitted over a link with MTU + 1473 or higher without IP level fragmentation. + + The ``--mssfix`` option only makes sense when you are using the UDP + protocol for OpenVPN peer-to-peer communication, i.e. ``--proto udp``. + + ``--mssfix`` and ``--fragment`` can be ideally used together, where + ``--mssfix`` will try to keep TCP from needing packet fragmentation in + the first place, and if big packets come through anyhow (from protocols + other than TCP), ``--fragment`` will internally fragment them. + + Both ``--fragment`` and ``--mssfix`` are designed to work around cases + where Path MTU discovery is broken on the network path between OpenVPN + peers. + + The usual symptom of such a breakdown is an OpenVPN connection which + successfully starts, but then stalls during active usage. + + If ``--fragment`` and ``--mssfix`` are used together, ``--mssfix`` will + take its default ``max`` parameter from the ``--fragment max`` option. + + Therefore, one could lower the maximum UDP packet size to 1300 (a good + first try for solving MTU-related connection problems) with the + following options: + :: + + --tun-mtu 1500 --fragment 1300 --mssfix + +--sndbuf size + Set the TCP/UDP socket send buffer size. Defaults to operation system + default. + +--rcvbuf size + Set the TCP/UDP socket receive buffer size. Defaults to operation system + default. + +--mark value + Mark encrypted packets being sent with value. The mark value can be + matched in policy routing and packetfilter rules. This option is only + supported in Linux and does nothing on other operating systems. + +--socket-flags flags + Apply the given flags to the OpenVPN transport socket. Currently, only + :code:`TCP_NODELAY` is supported. + + The :code:`TCP_NODELAY` socket flag is useful in TCP mode, and causes the + kernel to send tunnel packets immediately over the TCP connection without + trying to group several smaller packets into a larger packet. This can + result in a considerably improvement in latency. + + This option is pushable from server to client, and should be used on + both client and server for maximum effect. + +--txqueuelen n + *(Linux only)* Set the TX queue length on the TUN/TAP interface. + Currently defaults to 100. + +--shaper n + Limit bandwidth of outgoing tunnel data to ``n`` bytes per second on the + TCP/UDP port. Note that this will only work if mode is set to + :code:`p2p`. If you want to limit the bandwidth in both directions, use + this option on both peers. + + OpenVPN uses the following algorithm to implement traffic shaping: Given + a shaper rate of ``n`` bytes per second, after a datagram write of ``b`` + bytes is queued on the TCP/UDP port, wait a minimum of ``(b / n)`` + seconds before queuing the next write. + + It should be noted that OpenVPN supports multiple tunnels between the + same two peers, allowing you to construct full-speed and reduced + bandwidth tunnels at the same time, routing low-priority data such as + off-site backups over the reduced bandwidth tunnel, and other data over + the full-speed tunnel. + + Also note that for low bandwidth tunnels (under 1000 bytes per second), + you should probably use lower MTU values as well (see above), otherwise + the packet latency will grow so large as to trigger timeouts in the TLS + layer and TCP connections running over the tunnel. + + OpenVPN allows ``n`` to be between 100 bytes/sec and 100 Mbytes/sec. + +--inactive args + Causes OpenVPN to exit after ``n`` seconds of inactivity on the TUN/TAP + device. The time length of inactivity is measured since the last + incoming or outgoing tunnel packet. The default value is 0 seconds, + which disables this feature. + + Valid syntaxes: + :: + + inactive n + inactive n bytes + + If the optional ``bytes`` parameter is included, exit if less than + ``bytes`` of combined in/out traffic are produced on the tun/tap device + in ``n`` seconds. + + In any case, OpenVPN's internal ping packets (which are just keepalives) + and TLS control packets are not considered "activity", nor are they + counted as traffic, as they are used internally by OpenVPN and are not + an indication of actual user activity. + +--ping n + Ping remote over the TCP/UDP control channel if no packets have been + sent for at least ``n`` seconds (specify ``--ping`` on both peers to + cause ping packets to be sent in both directions since OpenVPN ping + packets are not echoed like IP ping packets). When used in one of + OpenVPN's secure modes (where ``--secret``, ``--tls-server`` or + ``--tls-client`` is specified), the ping packet will be + cryptographically secure. + + This option has two intended uses: + + (1) Compatibility with stateful firewalls. The periodic ping will ensure + that a stateful firewall rule which allows OpenVPN UDP packets to + pass will not time out. + + (2) To provide a basis for the remote to test the existence of its peer + using the ``--ping-exit`` option. + +--ping-exit n + Causes OpenVPN to exit after ``n`` seconds pass without reception of a + ping or other packet from remote. This option can be combined with + ``--inactive``, ``--ping`` and ``--ping-exit`` to create a two-tiered + inactivity disconnect. + + For example, + :: + + openvpn [options...] --inactive 3600 --ping 10 --ping-exit 60 + + when used on both peers will cause OpenVPN to exit within 60 seconds if + its peer disconnects, but will exit after one hour if no actual tunnel + data is exchanged. + +--ping-restart n + Similar to ``--ping-exit``, but trigger a :code:`SIGUSR1` restart after + ``n`` seconds pass without reception of a ping or other packet from + remote. + + This option is useful in cases where the remote peer has a dynamic IP + address and a low-TTL DNS name is used to track the IP address using a + service such as http://dyndns.org/ + a dynamic DNS client such as + ``ddclient``. + + If the peer cannot be reached, a restart will be triggered, causing the + hostname used with ``--remote`` to be re-resolved (if ``--resolv-retry`` + is also specified). + + In server mode, ``--ping-restart``, ``--inactive`` or any other type of + internally generated signal will always be applied to individual client + instance objects, never to whole server itself. Note also in server mode + that any internally generated signal which would normally cause a + restart, will cause the deletion of the client instance object instead. + + In client mode, the ``--ping-restart`` parameter is set to 120 seconds + by default. This default will hold until the client pulls a replacement + value from the server, based on the ``--keepalive`` setting in the + server configuration. To disable the 120 second default, set + ``--ping-restart 0`` on the client. + + See the signals section below for more information on :code:`SIGUSR1`. + + Note that the behavior of ``SIGUSR1`` can be modified by the + ``--persist-tun``, ``--persist-key``, ``--persist-local-ip`` and + ``--persist-remote-ip`` options. + + Also note that ``--ping-exit`` and ``--ping-restart`` are mutually + exclusive and cannot be used together. + +--keepalive args + A helper directive designed to simplify the expression of ``--ping`` and + ``--ping-restart``. + + Valid syntax: + :: + + keepalive interval timeout + + This option can be used on both client and server side, but it is enough + to add this on the server side as it will push appropriate ``--ping`` + and ``--ping-restart`` options to the client. If used on both server and + client, the values pushed from server will override the client local + values. + + The ``timeout`` argument will be twice as long on the server side. This + ensures that a timeout is detected on client side before the server side + drops the connection. + + For example, ``--keepalive 10 60`` expands as follows: + :: + + if mode server: + ping 10 # Argument: interval + ping-restart 120 # Argument: timeout*2 + push "ping 10" # Argument: interval + push "ping-restart 60" # Argument: timeout + else + ping 10 # Argument: interval + ping-restart 60 # Argument: timeout + +--ping-timer-rem + Run the ``--ping-exit`` / ``--ping-restart`` timer only if we have a + remote address. Use this option if you are starting the daemon in listen + mode (i.e. without an explicit ``--remote`` peer), and you don't want to + start clocking timeouts until a remote peer connects. + +--persist-tun + Don't close and reopen TUN/TAP device or run up/down scripts across + :code:`SIGUSR1` or ``--ping-restart`` restarts. + + :code:`SIGUSR1` is a restart signal similar to :code:`SIGHUP`, but which + offers finer-grained control over reset options. + +--persist-key + Don't re-read key files across :code:`SIGUSR1` or ``--ping-restart``. + + This option can be combined with ``--user nobody`` to allow restarts + triggered by the :code:`SIGUSR1` signal. Normally if you drop root + privileges in OpenVPN, the daemon cannot be restarted since it will now + be unable to re-read protected key files. + + This option solves the problem by persisting keys across :code:`SIGUSR1` + resets, so they don't need to be re-read. + +--persist-local-ip + Preserve initially resolved local IP address and port number across + ``SIGUSR1`` or ``--ping-restart`` restarts. + +--persist-remote-ip + Preserve most recently authenticated remote IP address and port number + across :code:`SIGUSR1` or ``--ping-restart`` restarts. + +--mlock + Disable paging by calling the POSIX mlockall function. Requires that + OpenVPN be initially run as root (though OpenVPN can subsequently + downgrade its UID using the ``--user`` option). + + Using this option ensures that key material and tunnel data are never + written to disk due to virtual memory paging operations which occur + under most modern operating systems. It ensures that even if an attacker + was able to crack the box running OpenVPN, he would not be able to scan + the system swap file to recover previously used ephemeral keys, which + are used for a period of time governed by the ``--reneg`` options (see + below), then are discarded. + + The downside of using ``--mlock`` is that it will reduce the amount of + physical memory available to other applications. + +--up cmd + Run command ``cmd`` after successful TUN/TAP device open (pre ``--user`` + UID change). + + ``cmd`` consists of a path to script (or executable program), optionally + followed by arguments. The path and arguments may be single- or + double-quoted and/or escaped using a backslash, and should be separated + by one or more spaces. + + The up command is useful for specifying route commands which route IP + traffic destined for private subnets which exist at the other end of the + VPN connection into the tunnel. + + For ``--dev tun`` execute as: + :: + + cmd tun_dev tun_mtu link_mtu ifconfig_local_ip ifconfig_remote_ip [init | restart] + + For ``--dev tap`` execute as: + :: + + cmd tap_dev tap_mtu link_mtu ifconfig_local_ip ifconfig_netmask [init | restart] + + See the `Environmental Variables`_ section below for additional + parameters passed as environmental variables. + + Note that if ``cmd`` includes arguments, all OpenVPN-generated arguments + will be appended to them to build an argument list with which the + executable will be called. + + Typically, ``cmd`` will run a script to add routes to the tunnel. + + Normally the up script is called after the TUN/TAP device is opened. In + this context, the last command line parameter passed to the script will + be *init.* If the ``--up-restart`` option is also used, the up script + will be called for restarts as well. A restart is considered to be a + partial reinitialization of OpenVPN where the TUN/TAP instance is + preserved (the ``--persist-tun`` option will enable such preservation). + A restart can be generated by a SIGUSR1 signal, a ``--ping-restart`` + timeout, or a connection reset when the TCP protocol is enabled with the + ``--proto`` option. If a restart occurs, and ``--up-restart`` has been + specified, the up script will be called with *restart* as the last + parameter. + + *NOTE:* + On restart, OpenVPN will not pass the full set of environment + variables to the script. Namely, everything related to routing and + gateways will not be passed, as nothing needs to be done anyway - all + the routing setup is already in place. Additionally, the up-restart + script will run with the downgraded UID/GID settings (if configured). + + The following standalone example shows how the ``--up`` script can be + called in both an initialization and restart context. (*NOTE:* for + security reasons, don't run the following example unless UDP port 9999 + is blocked by your firewall. Also, the example will run indefinitely, so + you should abort with control-c). + + :: + + openvpn --dev tun --port 9999 --verb 4 --ping-restart 10 \ + --up 'echo up' --down 'echo down' --persist-tun \ + --up-restart + + Note that OpenVPN also provides the ``--ifconfig`` option to + automatically ifconfig the TUN device, eliminating the need to define an + ``--up`` script, unless you also want to configure routes in the + ``--up`` script. + + If ``--ifconfig`` is also specified, OpenVPN will pass the ifconfig + local and remote endpoints on the command line to the ``--up`` script so + that they can be used to configure routes such as: + + :: + + route add -net 10.0.0.0 netmask 255.255.255.0 gw $5 + +--up-delay + Delay TUN/TAP open and possible ``--up`` script execution until after + TCP/UDP connection establishment with peer. + + In ``--proto udp`` mode, this option normally requires the use of + ``--ping`` to allow connection initiation to be sensed in the absence of + tunnel data, since UDP is a "connectionless" protocol. + + On Windows, this option will delay the TAP-Win32 media state + transitioning to "connected" until connection establishment, i.e. the + receipt of the first authenticated packet from the peer. + +--down cmd + Run command ``cmd`` after TUN/TAP device close (post ``--user`` UID + change and/or ``--chroot`` ). ``cmd`` consists of a path to script (or + executable program), optionally followed by arguments. The path and + arguments may be single- or double-quoted and/or escaped using a + backslash, and should be separated by one or more spaces. + + Called with the same parameters and environmental variables as the + ``--up`` option above. + + Note that if you reduce privileges by using ``--user`` and/or + ``--group``, your ``--down`` script will also run at reduced privilege. + +--down-pre + Call ``--down`` cmd/script before, rather than after, TUN/TAP close. + +--up-restart + Enable the ``--up`` and ``--down`` scripts to be called for restarts as + well as initial program start. This option is described more fully above + in the ``--up`` option documentation. + +--setenv args + Set a custom environmental variable :code:`name=value` to pass to script. + + Valid syntaxes: + :: + + setenv name value + setenv FORWARD_COMPATIBLE 1 + setenv opt config_option + + By setting :code:`FORWARD_COMPATIBLE` to :code:`1`, the config file + syntax checking is relaxed so that unknown directives will trigger a + warning but not a fatal error, on the assumption that a given unknown + directive might be valid in future OpenVPN versions. + + This option should be used with caution, as there are good security + reasons for having OpenVPN fail if it detects problems in a config file. + Having said that, there are valid reasons for wanting new software + features to gracefully degrade when encountered by older software + versions. + + It is also possible to tag a single directive so as not to trigger a + fatal error if the directive isn't recognized. To do this, prepend the + following before the directive: ``setenv opt`` + + Versions prior to OpenVPN 2.3.3 will always ignore options set with the + ``setenv opt`` directive. + + See also ``--ignore-unknown-option`` + +--setenv-safe args + Set a custom environmental variable :code:`OPENVPN_name` to :code:`value` + to pass to scripts. + + Valid syntaxes: + :: + + setenv-safe name value + + This directive is designed to be pushed by the server to clients, and + the prepending of :code:`OPENVPN_` to the environmental variable is a + safety precaution to prevent a :code:`LD_PRELOAD` style attack from a + malicious or compromised server. + +--ignore-unknown-option args + Valid syntax: + :: + + ignore-unknown-options opt1 opt2 opt3 ... optN + + When one of options ``opt1 ... optN`` is encountered in the configuration + file the configuration file parsing does not fail if this OpenVPN version + does not support the option. Multiple ``--ignore-unknown-option`` options + can be given to support a larger number of options to ignore. + + This option should be used with caution, as there are good security + reasons for having OpenVPN fail if it detects problems in a config file. + Having said that, there are valid reasons for wanting new software + features to gracefully degrade when encountered by older software + versions. + + ``--ignore-unknown-option`` is available since OpenVPN 2.3.3. + +--script-security level + This directive offers policy-level control over OpenVPN's usage of + external programs and scripts. Lower ``level`` values are more + restrictive, higher values are more permissive. Settings for ``level``: + + :code:`0` + Strictly no calling of external programs. + + :code:`1` + (Default) Only call built-in executables such as ifconfig, + ip, route, or netsh. + + :code:`2` + Allow calling of built-in executables and user-defined + scripts. + + :code:`3` + Allow passwords to be passed to scripts via environmental + variables (potentially unsafe). + + OpenVPN releases before v2.3 also supported a ``method`` flag which + indicated how OpenVPN should call external commands and scripts. This + could be either :code:`execve` or :code:`system`. As of OpenVPN 2.3, this + flag is no longer accepted. In most \*nix environments the execve() + approach has been used without any issues. + + Some directives such as ``--up`` allow options to be passed to the + external script. In these cases make sure the script name does not + contain any spaces or the configuration parser will choke because it + can't determine where the script name ends and script options start. + + To run scripts in Windows in earlier OpenVPN versions you needed to + either add a full path to the script interpreter which can parse the + script or use the ``system`` flag to run these scripts. As of OpenVPN + 2.3 it is now a strict requirement to have full path to the script + interpreter when running non-executables files. This is not needed for + executable files, such as .exe, .com, .bat or .cmd files. For example, + if you have a Visual Basic script, you must use this syntax now: + + :: + + --up 'C:\\Windows\\System32\\wscript.exe C:\\Program\ Files\\OpenVPN\\config\\my-up-script.vbs' + + Please note the single quote marks and the escaping of the backslashes + (\\) and the space character. + + The reason the support for the :code:`system` flag was removed is due to + the security implications with shell expansions when executing scripts + via the :code:`system()` call. + +--disable-occ + Don't output a warning message if option inconsistencies are detected + between peers. An example of an option inconsistency would be where one + peer uses ``--dev tun`` while the other peer uses ``--dev tap``. + + Use of this option is discouraged, but is provided as a temporary fix in + situations where a recent version of OpenVPN must connect to an old + version. + +--user user + Change the user ID of the OpenVPN process to ``user`` after + initialization, dropping privileges in the process. This option is + useful to protect the system in the event that some hostile party was + able to gain control of an OpenVPN session. Though OpenVPN's security + features make this unlikely, it is provided as a second line of defense. + + By setting ``user`` to :code:`nobody` or somebody similarly unprivileged, + the hostile party would be limited in what damage they could cause. Of + course once you take away privileges, you cannot return them to an + OpenVPN session. This means, for example, that if you want to reset an + OpenVPN daemon with a :code:`SIGUSR1` signal (for example in response to + a DHCP reset), you should make use of one or more of the ``--persist`` + options to ensure that OpenVPN doesn't need to execute any privileged + operations in order to restart (such as re-reading key files or running + ``ifconfig`` on the TUN device). + +--group group + Similar to the ``--user`` option, this option changes the group ID of + the OpenVPN process to ``group`` after initialization. + +--cd dir + Change directory to ``dir`` prior to reading any files such as + configuration files, key files, scripts, etc. ``dir`` should be an + absolute path, with a leading "/", and without any references to the + current directory such as :code:`.` or :code:`..`. + + This option is useful when you are running OpenVPN in ``--daemon`` mode, + and you want to consolidate all of your OpenVPN control files in one + location. + +--chroot dir + Chroot to ``dir`` after initialization. ``--chroot`` essentially + redefines ``dir`` as being the top level directory tree (/). OpenVPN + will therefore be unable to access any files outside this tree. This can + be desirable from a security standpoint. + + Since the chroot operation is delayed until after initialization, most + OpenVPN options that reference files will operate in a pre-chroot + context. + + In many cases, the ``dir`` parameter can point to an empty directory, + however complications can result when scripts or restarts are executed + after the chroot operation. + + Note: The SSL library will probably need /dev/urandom to be available + inside the chroot directory ``dir``. This is because SSL libraries + occasionally need to collect fresh random. Newer linux kernels and some + BSDs implement a getrandom() or getentropy() syscall that removes the + need for /dev/urandom to be available. + +--setcon context + Apply SELinux ``context`` after initialization. This essentially + provides the ability to restrict OpenVPN's rights to only network I/O + operations, thanks to SELinux. This goes further than ``--user`` and + ``--chroot`` in that those two, while being great security features, + unfortunately do not protect against privilege escalation by + exploitation of a vulnerable system call. You can of course combine all + three, but please note that since setcon requires access to /proc you + will have to provide it inside the chroot directory (e.g. with mount + --bind). + + Since the setcon operation is delayed until after initialization, + OpenVPN can be restricted to just network-related system calls, whereas + by applying the context before startup (such as the OpenVPN one provided + in the SELinux Reference Policies) you will have to allow many things + required only during initialization. + + Like with chroot, complications can result when scripts or restarts are + executed after the setcon operation, which is why you should really + consider using the ``--persist-key`` and ``--persist-tun`` options. + +--daemon progname + Become a daemon after all initialization functions are completed. This + option will cause all message and error output to be sent to the syslog + file (such as :code:`/var/log/messages`), except for the output of + scripts and ifconfig commands, which will go to :code:`/dev/null` unless + otherwise redirected. The syslog redirection occurs immediately at the + point that ``--daemon`` is parsed on the command line even though the + daemonization point occurs later. If one of the ``--log`` options is + present, it will supersede syslog redirection. + + The optional ``progname`` parameter will cause OpenVPN to report its + program name to the system logger as ``progname``. This can be useful in + linking OpenVPN messages in the syslog file with specific tunnels. When + unspecified, ``progname`` defaults to "openvpn". + + When OpenVPN is run with the ``--daemon`` option, it will try to delay + daemonization until the majority of initialization functions which are + capable of generating fatal errors are complete. This means that + initialization scripts can test the return status of the openvpn command + for a fairly reliable indication of whether the command has correctly + initialized and entered the packet forwarding event loop. + + In OpenVPN, the vast majority of errors which occur after initialization + are non-fatal. + + Note: as soon as OpenVPN has daemonized, it can not ask for usernames, + passwords, or key pass phrases anymore. This has certain consequences, + namely that using a password-protected private key will fail unless the + ``--askpass`` option is used to tell OpenVPN to ask for the pass phrase + (this requirement is new in v2.3.7, and is a consequence of calling + daemon() before initializing the crypto layer). + + Further, using ``--daemon`` together with ``--auth-user-pass`` (entered + on console) and ``--auth-nocache`` will fail as soon as key + renegotiation (and reauthentication) occurs. + +--syslog progname + Direct log output to system logger, but do not become a daemon. See + ``--daemon`` directive above for description of ``progname`` parameter. + +--errors-to-stderr + Output errors to stderr instead of stdout unless log output is + redirected by one of the ``--log`` options. + +--passtos + Set the TOS field of the tunnel packet to what the payload's TOS is. + +--inetd args + Valid syntaxes: + :: + + inetd + inetd wait + inetd nowait + inetd wait progname + + Use this option when OpenVPN is being run from the inetd or ``xinetd``\(8) + server. + + The :code:`wait` and :code:`nowait` option must match what is specified + in the inetd/xinetd config file. The :code:`nowait` mode can only be used + with ``--proto tcp-server`` The default is :code:`wait`. The + :code:`nowait` mode can be used to instantiate the OpenVPN daemon as a + classic TCP server, where client connection requests are serviced on a + single port number. For additional information on this kind of + configuration, see the OpenVPN FAQ: + https://community.openvpn.net/openvpn/wiki/325-openvpn-as-a--forking-tcp-server-which-can-service-multiple-clients-over-a-single-tcp-port + + This option precludes the use of ``--daemon``, ``--local`` or + ``--remote``. Note that this option causes message and error output to + be handled in the same way as the ``--daemon`` option. The optional + ``progname`` parameter is also handled exactly as in ``--daemon``. + + Also note that in ``wait`` mode, each OpenVPN tunnel requires a separate + TCP/UDP port and a separate inetd or xinetd entry. See the OpenVPN 1.x + HOWTO for an example on using OpenVPN with xinetd: + https://openvpn.net/community-resources/1xhowto/ + +--log file + Output logging messages to ``file``, including output to stdout/stderr + which is generated by called scripts. If ``file`` already exists it will + be truncated. This option takes effect immediately when it is parsed in + the command line and will supersede syslog output if ``--daemon`` or + ``--inetd`` is also specified. This option is persistent over the entire + course of an OpenVPN instantiation and will not be reset by + :code:`SIGHUP`, :code:`SIGUSR1`, or ``--ping-restart``. + + Note that on Windows, when OpenVPN is started as a service, logging + occurs by default without the need to specify this option. + +--log-append file + Append logging messages to ``file``. If ``file`` does not exist, it will + be created. This option behaves exactly like ``--log`` except that it + appends to rather than truncating the log file. + +--suppress-timestamps + Avoid writing timestamps to log messages, even when they otherwise would + be prepended. In particular, this applies to log messages sent to + stdout. + +--machine-readable-output + Always write timestamps and message flags to log messages, even when + they otherwise would not be prefixed. In particular, this applies to log + messages sent to stdout. + +--writepid file + Write OpenVPN's main process ID to ``file``. + +--nice n + Change process priority after initialization (``n`` greater than 0 is + lower priority, ``n`` less than zero is higher priority). + +--fast-io + (Experimental) Optimize TUN/TAP/UDP I/O writes by avoiding a call to + poll/epoll/select prior to the write operation. The purpose of such a + call would normally be to block until the device or socket is ready to + accept the write. Such blocking is unnecessary on some platforms which + don't support write blocking on UDP sockets or TUN/TAP devices. In such + cases, one can optimize the event loop by avoiding the poll/epoll/select + call, improving CPU efficiency by 5% to 10%. + + This option can only be used on non-Windows systems, when ``--proto + udp`` is specified, and when ``--shaper`` is NOT specified. + +--multihome + Configure a multi-homed UDP server. This option needs to be used when a + server has more than one IP address (e.g. multiple interfaces, or + secondary IP addresses), and is not using ``--local`` to force binding + to one specific address only. This option will add some extra lookups to + the packet path to ensure that the UDP reply packets are always sent + from the address that the client is talking to. This is not supported on + all platforms, and it adds more processing, so it's not enabled by + default. + + *Notes:* + - This option is only relevant for UDP servers. + - If you do an IPv6+IPv4 dual-stack bind on a Linux machine with + multiple IPv4 address, connections to IPv4 addresses will not + work right on kernels before 3.15, due to missing kernel + support for the IPv4-mapped case (some distributions have + ported this to earlier kernel versions, though). + +--echo parms + Echo ``parms`` to log output. + + Designed to be used to send messages to a controlling application which + is receiving the OpenVPN log output. + +--remap-usr1 signal + Control whether internally or externally generated :code:`SIGUSR1` signals + are remapped to :code:`SIGHUP` (restart without persisting state) or + SIGTERM (exit). + + ``signal`` can be set to :code:`SIGHUP` or :code:`SIGTERM`. By default, + no remapping occurs. + +--verb n + Set output verbosity to ``n`` (default :code:`1`). Each level shows all + info from the previous levels. Level :code:`3` is recommended if you want + a good summary of what's happening without being swamped by output. + + :code:`0` + No output except fatal errors. + + :code:`1` to :code:`4` + Normal usage range. + + :code:`5` + Outputs :code:`R` and :code:`W` characters to the console for + each packet read and write, uppercase is used for TCP/UDP + packets and lowercase is used for TUN/TAP packets. + + :code:`6` to :code:`11` + Debug info range (see :code:`errlevel.h` in the source code for + additional information on debug levels). + +--status args + Write operational status to ``file`` every ``n`` seconds. + + Valid syntaxes: + :: + + status file + status file n + + Status can also be written to the syslog by sending a :code:`SIGUSR2` + signal. + + With multi-client capability enabled on a server, the status file + includes a list of clients and a routing table. The output format can be + controlled by the ``--status-version`` option in that case. + + For clients or instances running in point-to-point mode, it will contain + the traffic statistics. + +--status-version n + Set the status file format version number to ``n``. + + This only affects the status file on servers with multi-client + capability enabled. Valid status version values: + + :code:`1` + Traditional format (default). The client list contains the + following fields comma-separated: Common Name, Real Address, Bytes + Received, Bytes Sent, Connected Since. + + :code:`2` + A more reliable format for external processing. Compared to + version :code:`1`, the client list contains some additional fields: + Virtual Address, Virtual IPv6 Address, Username, Client ID, Peer ID, + Data Channel Cipher. Future versions may extend the number of fields. + + :code:`3` + Identical to :code:`2`, but fields are tab-separated. + +--mute n + Log at most ``n`` consecutive messages in the same category. This is + useful to limit repetitive logging of similar message types. + +--compress algorithm + Enable a compression algorithm. + + The ``algorithm`` parameter may be :code:`lzo`, :code:`lz4`, or empty. + LZO and LZ4 are different compression algorithms, with LZ4 generally + offering the best performance with least CPU usage. For backwards + compatibility with OpenVPN versions before v2.4, use :code:`lzo` (which + is identical to the older option ``--comp-lzo yes``). + + If the ``algorithm`` parameter is empty, compression will be turned off, + but the packet framing for compression will still be enabled, allowing a + different setting to be pushed later. + + ***Security Considerations*** + + Compression and encryption is a tricky combination. If an attacker knows + or is able to control (parts of) the plaintext of packets that contain + secrets, the attacker might be able to extract the secret if compression + is enabled. See e.g. the CRIME and BREACH attacks on TLS which also + leverage compression to break encryption. If you are not entirely sure + that the above does not apply to your traffic, you are advised to + *not* enable compression. + +--comp-lzo mode + *DEPRECATED* This option will be removed in a future OpenVPN release. + Use the newer ``--compress`` instead. + + Use LZO compression -- may add up to 1 byte per packet for incompressible + data. ``mode`` may be :code:`yes`, :code:`no`, or :code:`adaptive` + (default). + + In a server mode setup, it is possible to selectively turn compression + on or off for individual clients. + + First, make sure the client-side config file enables selective + compression by having at least one ``--comp-lzo`` directive, such as + ``--comp-lzo no``. This will turn off compression by default, but allow + a future directive push from the server to dynamically change the + :code:`on`/:code:`off`/:code:`adaptive` setting. + + Next in a ``--client-config-dir`` file, specify the compression setting + for the client, for example: + :: + + comp-lzo yes + push "comp-lzo yes" + + The first line sets the ``comp-lzo`` setting for the server side of the + link, the second sets the client side. + +--comp-noadapt + When used in conjunction with ``--comp-lzo``, this option will disable + OpenVPN's adaptive compression algorithm. Normally, adaptive compression + is enabled with ``--comp-lzo``. + + Adaptive compression tries to optimize the case where you have + compression enabled, but you are sending predominantly incompressible + (or pre-compressed) packets over the tunnel, such as an FTP or rsync + transfer of a large, compressed file. With adaptive compression, OpenVPN + will periodically sample the compression process to measure its + efficiency. If the data being sent over the tunnel is already + compressed, the compression efficiency will be very low, triggering + openvpn to disable compression for a period of time until the next + re-sample test. + +--management args + Enable a management server on a ``socket-name`` Unix socket on those + platforms supporting it, or on a designated TCP port. + + Valid syntaxes: + :: + + management socket-name unix # + management socket-name unix pw-file # (recommended) + management IP port # (INSECURE) + management IP port pw-file # + + ``pw-file``, if specified, is a password file where the password must + be on first line. Instead of a filename it can use the keyword stdin + which will prompt the user for a password to use when OpenVPN is + starting. + + For unix sockets, the default behaviour is to create a unix domain + socket that may be connected to by any process. Use the + ``--management-client-user`` and ``--management-client-group`` + directives to restrict access. + + The management interface provides a special mode where the TCP + management link can operate over the tunnel itself. To enable this mode, + set IP to ``tunnel``. Tunnel mode will cause the management interface to + listen for a TCP connection on the local VPN address of the TUN/TAP + interface. + + ***BEWARE*** of enabling the management interface over TCP. In these cases + you should *ALWAYS* make use of ``pw-file`` to password protect the + management interface. Any user who can connect to this TCP ``IP:port`` + will be able to manage and control (and interfere with) the OpenVPN + process. It is also strongly recommended to set IP to 127.0.0.1 + (localhost) to restrict accessibility of the management server to local + clients. + + While the management port is designed for programmatic control of + OpenVPN by other applications, it is possible to telnet to the port, + using a telnet client in "raw" mode. Once connected, type :code:`help` + for a list of commands. + + For detailed documentation on the management interface, see the + *management-notes.txt* file in the management folder of the OpenVPN + source distribution. + +--management-client + Management interface will connect as a TCP/unix domain client to + ``IP:port`` specified by ``--management`` rather than listen as a TCP + server or on a unix domain socket. + + If the client connection fails to connect or is disconnected, a SIGTERM + signal will be generated causing OpenVPN to quit. + +--management-query-passwords + Query management channel for private key password and + ``--auth-user-pass`` username/password. Only query the management + channel for inputs which ordinarily would have been queried from the + console. + +--management-query-proxy + Query management channel for proxy server information for a specific + ``--remote`` (client-only). + +--management-query-remote + Allow management interface to override ``--remote`` directives + (client-only). + +--management-external-key args + Allows usage for external private key file instead of ``--key`` option + (client-only). + + Valid syntaxes: + :: + + management-external-key + management-external-key nopadding + management-external-key pkcs1 + management-external-key nopadding pkcs1 + + The optional parameters :code:`nopadding` and :code:`pkcs1` signal + support for different padding algorithms. See + :code:`doc/mangement-notes.txt` for a complete description of this + feature. + +--management-external-cert certificate-hint + Allows usage for external certificate instead of ``--cert`` option + (client-only). ``certificate-hint`` is an arbitrary string which is + passed to a management interface client as an argument of + *NEED-CERTIFICATE* notification. Requires ``--management-external-key``. + +--management-forget-disconnect + Make OpenVPN forget passwords when management session disconnects. + + This directive does not affect the ``--http-proxy`` username/password. + It is always cached. + +--management-hold + Start OpenVPN in a hibernating state, until a client of the management + interface explicitly starts it with the :code:`hold release` command. + +--management-signal + Send SIGUSR1 signal to OpenVPN if management session disconnects. This + is useful when you wish to disconnect an OpenVPN session on user logoff. + For ``--management-client`` this option is not needed since a disconnect + will always generate a :code:`SIGTERM`. + +--management-log-cache n + Cache the most recent ``n`` lines of log file history for usage by the + management channel. + +--management-up-down + Report tunnel up/down events to management interface. + +--management-client-auth + Gives management interface client the responsibility to authenticate + clients after their client certificate has been verified. See + :code:`management-notes.txt` in OpenVPN distribution for detailed notes. + +--management-client-pf + Management interface clients must specify a packet filter file for each + connecting client. See :code:`management-notes.txt` in OpenVPN + distribution for detailed notes. + +--management-client-user u + When the management interface is listening on a unix domain socket, only + allow connections from user ``u``. + +--management-client-group g + When the management interface is listening on a unix domain socket, only + allow connections from group ``g``. + +--plugin args + Loads a given plug-in module. The ``module-name`` need to be the first + argument, indicating the plug-in to load. The second argument is an + optional init string which will be passed directly to the plug-in. + If the init consists of multiple arguments it must be enclosed in + double-quotes (\"). Multiple plugin modules may be loaded into one + OpenVPN process. + + The ``module-name`` argument can be just a filename or a filename + with a relative or absolute path. The format of the filename and path + defines if the plug-in will be loaded from a default plug-in directory + or outside this directory. + :: + + --plugin path Effective directory used + ===================== ============================= + myplug.so DEFAULT_DIR/myplug.so + subdir/myplug.so DEFAULT_DIR/subdir/myplug.so + ./subdir/myplug.so CWD/subdir/myplug.so + /usr/lib/my/plug.so /usr/lib/my/plug.so + + + DEFAULT\_DIR is replaced by the default plug-in directory, which is + configured at the build time of OpenVPN. CWD is the current directory + where OpenVPN was started or the directory OpenVPN have switched into + via the ``--cd`` option before the ``--plugin`` option. + + For more information and examples on how to build OpenVPN plug-in + modules, see the README file in the ``plugin`` folder of the OpenVPN + source distribution. + + If you are using an RPM install of OpenVPN, see + :code:`/usr/share/openvpn/plugin`. The documentation is in ``doc`` and + the actual plugin modules are in ``lib``. + + Multiple plugin modules can be cascaded, and modules can be used in + tandem with scripts. The modules will be called by OpenVPN in the order + that they are declared in the config file. If both a plugin and script + are configured for the same callback, the script will be called last. If + the return code of the module/script controls an authentication function + (such as tls-verify, auth-user-pass-verify, or client-connect), then + every module and script must return success (:code:`0`) in order for the + connection to be authenticated. + +--keying-material-exporter args + Save Exported Keying Material [RFC5705] of len bytes (must be between 16 + and 4095 bytes) using ``label`` in environment + (:code:`exported_keying_material`) for use by plugins in + :code:`OPENVPN_PLUGIN_TLS_FINAL` callback. + + Valid syntax: + :: + + keying-material-exporter label len + + Note that exporter ``labels`` have the potential to collide with existing + PRF labels. In order to prevent this, labels *MUST* begin with + :code:`EXPORTER`. + + +Server Mode +----------- + +Starting with OpenVPN 2.0, a multi-client TCP/UDP server mode is +supported, and can be enabled with the ``--mode server`` option. In +server mode, OpenVPN will listen on a single port for incoming client +connections. All client connections will be routed through a single tun +or tap interface. This mode is designed for scalability and should be +able to support hundreds or even thousands of clients on sufficiently +fast hardware. SSL/TLS authentication must be used in this mode. + +--server args + A helper directive designed to simplify the configuration of OpenVPN's + server mode. This directive will set up an OpenVPN server which will + allocate addresses to clients out of the given network/netmask. The + server itself will take the :code:`.1` address of the given network for + use as the server-side endpoint of the local TUN/TAP interface. If the + optional :code:`nopool` flag is given, no dynamic IP address pool will + prepared for VPN clients. + + Valid syntax: + :: + + server network netmask [nopool] + + For example, ``--server 10.8.0.0 255.255.255.0`` expands as follows: + :: + + mode server + tls-server + push "topology [topology]" + + if dev tun AND (topology == net30 OR topology == p2p): + ifconfig 10.8.0.1 10.8.0.2 + if !nopool: + ifconfig-pool 10.8.0.4 10.8.0.251 + route 10.8.0.0 255.255.255.0 + if client-to-client: + push "route 10.8.0.0 255.255.255.0" + else if topology == net30: + push "route 10.8.0.1" + + if dev tap OR (dev tun AND topology == subnet): + ifconfig 10.8.0.1 255.255.255.0 + if !nopool: + ifconfig-pool 10.8.0.2 10.8.0.253 255.255.255.0 + push "route-gateway 10.8.0.1" + if route-gateway unset: + route-gateway 10.8.0.2 + + Don't use ``--server`` if you are ethernet bridging. Use + ``--server-bridge`` instead. + +--server-bridge args + A helper directive similar to ``--server`` which is designed to simplify + the configuration of OpenVPN's server mode in ethernet bridging + configurations. + + Valid syntaxes: + :: + + server-bridge gateway netmask pool-start-IP pool-end-IP + server-bridge [nogw] + + If ``--server-bridge`` is used without any parameters, it will enable a + DHCP-proxy mode, where connecting OpenVPN clients will receive an IP + address for their TAP adapter from the DHCP server running on the + OpenVPN server-side LAN. Note that only clients that support the binding + of a DHCP client with the TAP adapter (such as Windows) can support this + mode. The optional :code:`nogw` flag (advanced) indicates that gateway + information should not be pushed to the client. + + To configure ethernet bridging, you must first use your OS's bridging + capability to bridge the TAP interface with the ethernet NIC interface. + For example, on Linux this is done with the :code:`brctl` tool, and with + Windows XP it is done in the Network Connections Panel by selecting the + ethernet and TAP adapters and right-clicking on "Bridge Connections". + + Next you you must manually set the IP/netmask on the bridge interface. + The ``gateway`` and ``netmask`` parameters to ``--server-bridge`` can be + set to either the IP/netmask of the bridge interface, or the IP/netmask + of the default gateway/router on the bridged subnet. + + Finally, set aside a IP range in the bridged subnet, denoted by + ``pool-start-IP`` and ``pool-end-IP``, for OpenVPN to allocate to + connecting clients. + + For example, ``server-bridge 10.8.0.4 255.255.255.0 10.8.0.128 + 10.8.0.254`` expands as follows: + :: + + mode server + tls-server + + ifconfig-pool 10.8.0.128 10.8.0.254 255.255.255.0 + push "route-gateway 10.8.0.4" + + In another example, ``--server-bridge`` (without parameters) expands as + follows: + :: + + mode server + tls-server + + push "route-gateway dhcp" + + Or ``--server-bridge nogw`` expands as follows: + :: + + mode server + tls-server + +--push option + Push a config file option back to the client for remote execution. Note + that ``option`` must be enclosed in double quotes (:code:`""`). The + client must specify ``--pull`` in its config file. The set of options + which can be pushed is limited by both feasibility and security. Some + options such as those which would execute scripts are banned, since they + would effectively allow a compromised server to execute arbitrary code + on the client. Other options such as TLS or MTU parameters cannot be + pushed because the client needs to know them before the connection to the + server can be initiated. + + This is a partial list of options which can currently be pushed: + ``--route``, ``--route-gateway``, ``--route-delay``, + ``--redirect-gateway``, ``--ip-win32``, ``--dhcp-option``, + ``--inactive``, ``--ping``, ``--ping-exit``, ``--ping-restart``, + ``--setenv``, ``--auth-token``, ``--persist-key``, ``--persist-tun``, + ``--echo``, ``--comp-lzo``, ``--socket-flags``, ``--sndbuf``, + ``--rcvbuf`` + +--push-reset + Don't inherit the global push list for a specific client instance. + Specify this option in a client-specific context such as with a + ``--client-config-dir`` configuration file. This option will ignore + ``--push`` options at the global config file level. + +--push-remove opt + Selectively remove all ``--push`` options matching "opt" from the option + list for a client. ``opt`` is matched as a substring against the whole + option string to-be-pushed to the client, so ``--push-remove route`` + would remove all ``--push route ...`` and ``--push route-ipv6 ...`` + statements, while ``--push-remove "route-ipv6 2001:"`` would only remove + IPv6 routes for :code:`2001:...` networks. + + ``--push-remove`` can only be used in a client-specific context, like in + a ``--client-config-dir`` file, or ``--client-connect`` script or plugin + -- similar to ``--push-reset``, just more selective. + + *NOTE*: to *change* an option, ``--push-remove`` can be used to first + remove the old value, and then add a new ``--push`` option with the new + value. + + *NOTE 2*: due to implementation details, 'ifconfig' and 'ifconfig-ipv6' + can only be removed with an exact match on the option ( + :code:`push-remove ifconfig`), no substring matching and no matching on + the IPv4/IPv6 address argument is possible. + +--push-peer-info + Push additional information about the client to server. The following + data is always pushed to the server: + + :code:`IV_VER=<version>` + The client OpenVPN version + + :code:`IV_PLAT=[linux|solaris|openbsd|mac|netbsd|freebsd|win]` + The client OS platform + + :code:`IV_LZO_STUB=1` + If client was built with LZO stub capability + + :code:`IV_LZ4=1` + If the client supports LZ4 compressions. + + :code:`IV_PROTO=2` + If the client supports peer-id floating mechanism + + :code:`IV_NCP=2` + Negotiable ciphers, client supports ``--cipher`` pushed by + the server, a value of 2 or greater indicates client supports + *AES-GCM-128* and *AES-GCM-256*. + + :code:`IV_CIPHERS=<ncp-ciphers>` + The client pushes the list of configured ciphers with the + ``--ciphers`` option to the server. + + :code:`IV_GUI_VER=<gui_id> <version>` + The UI version of a UI if one is running, for example + :code:`de.blinkt.openvpn 0.5.47` for the Android app. + + When ``--push-peer-info`` is enabled the additional information consists + of the following data: + + :code:`IV_HWADDR=<mac address>` + The MAC address of clients default gateway + + :code:`IV_SSL=<version string>` + The ssl version used by the client, e.g. + :code:`OpenSSL 1.0.2f 28 Jan 2016`. + + :code:`IV_PLAT_VER=x.y` + The version of the operating system, e.g. 6.1 for Windows 7. + + :code:`UV_<name>=<value>` + Client environment variables whose names start with + :code:`UV_` + +--disable + Disable a particular client (based on the common name) from connecting. + Don't use this option to disable a client due to key or password + compromise. Use a CRL (certificate revocation list) instead (see the + ``--crl-verify`` option). + + This option must be associated with a specific client instance, which + means that it must be specified either in a client instance config file + using ``--client-config-dir`` or dynamically generated using a + ``--client-connect`` script. + +--ifconfig-pool args + Set aside a pool of subnets to be dynamically allocated to connecting + clients, similar to a DHCP server. + + Valid syntax: + :: + + ifconfig-pool start-IP end-IP [netmask] + + For tun-style tunnels, each client + will be given a /30 subnet (for interoperability with Windows clients). + For tap-style tunnels, individual addresses will be allocated, and the + optional ``netmask`` parameter will also be pushed to clients. + +--ifconfig-pool-persist args + Persist/unpersist ifconfig-pool data to ``file``, at ``seconds`` + intervals (default :code:`600`), as well as on program startup and shutdown. + + Valid syntax: + :: + + ifconfig-pool-persist file [seconds] + + The goal of this option is to provide a long-term association between + clients (denoted by their common name) and the virtual IP address + assigned to them from the ifconfig-pool. Maintaining a long-term + association is good for clients because it allows them to effectively + use the ``--persist-tun`` option. + + ``file`` is a comma-delimited ASCII file, formatted as + :code:`<Common-Name>,<IP-address>`. + + If ``seconds`` = :code:`0`, ``file`` will be treated as read-only. This + is useful if you would like to treat ``file`` as a configuration file. + + Note that the entries in this file are treated by OpenVPN as + *suggestions* only, based on past associations between a common name and + IP address. They do not guarantee that the given common name will always + receive the given IP address. If you want guaranteed assignment, use + ``--ifconfig-push`` + +--ifconfig-push args + Push virtual IP endpoints for client tunnel, overriding the + ``--ifconfig-pool`` dynamic allocation. + + Valid syntax: + :: + + ifconfig-push local remote-netmask [alias] + + The parameters ``local`` and ``remote-netmask`` are set according to the + ``--ifconfig`` directive which you want to execute on the client machine + to configure the remote end of the tunnel. Note that the parameters + ``local`` and ``remote-netmask`` are from the perspective of the client, + not the server. They may be DNS names rather than IP addresses, in which + case they will be resolved on the server at the time of client + connection. + + The optional ``alias`` parameter may be used in cases where NAT causes + the client view of its local endpoint to differ from the server view. In + this case ``local/remote-netmask`` will refer to the server view while + ``alias/remote-netmask`` will refer to the client view. + + This option must be associated with a specific client instance, which + means that it must be specified either in a client instance config file + using ``--client-config-dir`` or dynamically generated using a + ``--client-connect`` script. + + Remember also to include a ``--route`` directive in the main OpenVPN + config file which encloses ``local``, so that the kernel will know to + route it to the server's TUN/TAP interface. + + OpenVPN's internal client IP address selection algorithm works as + follows: + + 1. Use ``--client-connect script`` generated file for static IP + (first choice). + + 2. Use ``--client-config-dir`` file for static IP (next choice). + + 3. Use ``--ifconfig-pool`` allocation for dynamic IP (last + choice). + +--iroute args + Generate an internal route to a specific client. The ``netmask`` + parameter, if omitted, defaults to :code:`255.255.255.255`. + + Valid syntax: + :: + + iroute network [netmask] + + This directive can be used to route a fixed subnet from the server to a + particular client, regardless of where the client is connecting from. + Remember that you must also add the route to the system routing table as + well (such as by using the ``--route`` directive). The reason why two + routes are needed is that the ``--route`` directive routes the packet + from the kernel to OpenVPN. Once in OpenVPN, the ``--iroute`` directive + routes to the specific client. + + This option must be specified either in a client instance config file + using ``--client-config-dir`` or dynamically generated using a + ``--client-connect`` script. + + The ``--iroute`` directive also has an important interaction with + ``--push "route ..."``. ``--iroute`` essentially defines a subnet which + is owned by a particular client (we will call this client *A*). If you + would like other clients to be able to reach *A*'s subnet, you can use + ``--push "route ..."`` together with ``--client-to-client`` to effect + this. In order for all clients to see *A*'s subnet, OpenVPN must push + this route to all clients EXCEPT for *A*, since the subnet is already + owned by *A*. OpenVPN accomplishes this by not not pushing a route to + a client if it matches one of the client's iroutes. + +--client-to-client + Because the OpenVPN server mode handles multiple clients through a + single tun or tap interface, it is effectively a router. The + ``--client-to-client`` flag tells OpenVPN to internally route + client-to-client traffic rather than pushing all client-originating + traffic to the TUN/TAP interface. + + When this option is used, each client will "see" the other clients which + are currently connected. Otherwise, each client will only see the + server. Don't use this option if you want to firewall tunnel traffic + using custom, per-client rules. + +--duplicate-cn + Allow multiple clients with the same common name to concurrently + connect. In the absence of this option, OpenVPN will disconnect a client + instance upon connection of a new client having the same common name. + +--client-connect cmd + Run command ``cmd`` on client connection. + + ``cmd`` consists of a path to script (or executable program), optionally + followed by arguments. The path and arguments may be single- or + double-quoted and/or escaped using a backslash, and should be separated + by one or more spaces. + + The command is passed the common name and IP address of the + just-authenticated client as environmental variables (see environmental + variable section below). The command is also passed the pathname of a + freshly created temporary file as the last argument (after any arguments + specified in ``cmd`` ), to be used by the command to pass dynamically + generated config file directives back to OpenVPN. + + If the script wants to generate a dynamic config file to be applied on + the server when the client connects, it should write it to the file + named by the last argument. + + See the ``--client-config-dir`` option below for options which can be + legally used in a dynamically generated config file. + + Note that the return value of ``script`` is significant. If ``script`` + returns a non-zero error status, it will cause the client to be + disconnected. + +--client-disconnect cmd + Like ``--client-connect`` but called on client instance shutdown. Will + not be called unless the ``--client-connect`` script and plugins (if + defined) were previously called on this instance with successful (0) + status returns. + + The exception to this rule is if the ``--client-disconnect`` command or + plugins are cascaded, and at least one client-connect function + succeeded, then ALL of the client-disconnect functions for scripts and + plugins will be called on client instance object deletion, even in cases + where some of the related client-connect functions returned an error + status. + + The ``--client-disconnect`` command is passed the same pathname as the + corresponding ``--client-connect`` command as its last argument (after + any arguments specified in ``cmd``). + +--client-config-dir dir + Specify a directory ``dir`` for custom client config files. After a + connecting client has been authenticated, OpenVPN will look in this + directory for a file having the same name as the client's X509 common + name. If a matching file exists, it will be opened and parsed for + client-specific configuration options. If no matching file is found, + OpenVPN will instead try to open and parse a default file called + "DEFAULT", which may be provided but is not required. Note that the + configuration files must be readable by the OpenVPN process after it has + dropped it's root privileges. + + This file can specify a fixed IP address for a given client using + ``--ifconfig-push``, as well as fixed subnets owned by the client using + ``--iroute``. + + One of the useful properties of this option is that it allows client + configuration files to be conveniently created, edited, or removed while + the server is live, without needing to restart the server. + + The following options are legal in a client-specific context: ``--push``, + ``--push-reset``, ``--push-remove``, ``--iroute``, ``--ifconfig-push``, + ``--vlan-pvid`` and ``--config``. + +--ccd-exclusive + Require, as a condition of authentication, that a connecting client has + a ``--client-config-dir`` file. + +--tmp-dir dir + Specify a directory ``dir`` for temporary files. This directory will be + used by openvpn processes and script to communicate temporary data with + openvpn main process. Note that the directory must be writable by the + OpenVPN process after it has dropped it's root privileges. + + This directory will be used by in the following cases: + + * ``--client-connect`` scripts to dynamically generate client-specific + configuration files. + + * :code:`OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY` plugin hook to return + success/failure via ``auth_control_file`` when using deferred auth + method + + * :code:`OPENVPN_PLUGIN_ENABLE_PF` plugin hook to pass filtering rules + via ``pf_file`` + +--hash-size args + Set the size of the real address hash table to ``r`` and the virtual + address table to ``v``. + + Valid syntax: + :: + + hash-size r v + + By default, both tables are sized at 256 buckets. + +--bcast-buffers n + Allocate ``n`` buffers for broadcast datagrams (default :code:`256`). + +--tcp-queue-limit n + Maximum number of output packets queued before TCP (default :code:`64`). + + When OpenVPN is tunneling data from a TUN/TAP device to a remote client + over a TCP connection, it is possible that the TUN/TAP device might + produce data at a faster rate than the TCP connection can support. When + the number of output packets queued before sending to the TCP socket + reaches this limit for a given client connection, OpenVPN will start to + drop outgoing packets directed at this client. + +--tcp-nodelay + This macro sets the :code:`TCP_NODELAY` socket flag on the server as well + as pushes it to connecting clients. The :code:`TCP_NODELAY` flag disables + the Nagle algorithm on TCP sockets causing packets to be transmitted + immediately with low latency, rather than waiting a short period of time + in order to aggregate several packets into a larger containing packet. + In VPN applications over TCP, :code:`TCP_NODELAY` is generally a good + latency optimization. + + The macro expands as follows: + :: + + if mode server: + socket-flags TCP_NODELAY + push "socket-flags TCP_NODELAY" + +--max-clients n + Limit server to a maximum of ``n`` concurrent clients. + +--max-routes-per-client n + Allow a maximum of ``n`` internal routes per client (default + :code:`256`). This is designed to help contain DoS attacks where an + authenticated client floods the server with packets appearing to come + from many unique MAC addresses, forcing the server to deplete virtual + memory as its internal routing table expands. This directive can be used + in a ``--client-config-dir`` file or auto-generated by a + ``--client-connect`` script to override the global value for a particular + client. + + Note that this directive affects OpenVPN's internal routing table, not + the kernel routing table. + +--stale-routes-check args + Remove routes haven't had activity for ``n`` seconds (i.e. the ageing + time). This check is ran every ``t`` seconds (i.e. check interval). + + Valid syntax: + :: + + stale-routes-check n [t] + + If ``t`` is not present it defaults to ``n``. + + This option helps to keep the dynamic routing table small. See also + ``--max-routes-per-client`` + +--connect-freq args + Allow a maximum of ``n`` new connections per ``sec`` seconds from + clients. + + Valid syntax: + :: + + connect-freq n sec + + This is designed to contain DoS attacks which flood the server + with connection requests using certificates which will ultimately fail + to authenticate. + + This is an imperfect solution however, because in a real DoS scenario, + legitimate connections might also be refused. + + For the best protection against DoS attacks in server mode, use + ``--proto udp`` and either ``--tls-auth`` or ``--tls-crypt``. + +--learn-address cmd + Run command ``cmd`` to validate client virtual addresses or routes. + + ``cmd`` consists of a path to script (or executable program), optionally + followed by arguments. The path and arguments may be single- or + double-quoted and/or escaped using a backslash, and should be separated + by one or more spaces. + + Three arguments will be appended to any arguments in ``cmd`` as follows: + + :code:`$1` - [operation] + :code:`"add"`, :code:`"update"`, or :code:`"delete"` based on whether + or not the address is being added to, modified, or deleted from + OpenVPN's internal routing table. + + :code:`$2` - [address] + The address being learned or unlearned. This can be an IPv4 address + such as :code:`"198.162.10.14"`, an IPv4 subnet such as + :code:`"198.162.10.0/24"`, or an ethernet MAC address (when + ``--dev tap`` is being used) such as :code:`"00:FF:01:02:03:04"`. + + :code:`$3` - [common name] + The common name on the certificate associated with the client linked + to this address. Only present for :code:`"add"` or :code:`"update"` + operations, not :code:`"delete"`. + + On :code:`"add"` or :code:`"update"` methods, if the script returns + a failure code (non-zero), OpenVPN will reject the address and will not + modify its internal routing table. + + Normally, the ``cmd`` script will use the information provided above to + set appropriate firewall entries on the VPN TUN/TAP interface. Since + OpenVPN provides the association between virtual IP or MAC address and + the client's authenticated common name, it allows a user-defined script + to configure firewall access policies with regard to the client's + high-level common name, rather than the low level client virtual + addresses. + +--auth-user-pass-verify args + Require the client to provide a username/password (possibly in addition + to a client certificate) for authentication. + + Valid syntax: + :: + + auth-user-pass cmd method + + OpenVPN will run command ``cmd`` to validate the username/password + provided by the client. + + ``cmd`` consists of a path to script (or executable program), optionally + followed by arguments. The path and arguments may be single- or + double-quoted and/or escaped using a backslash, and should be separated + by one or more spaces. + + If ``method`` is set to :code:`via-env`, OpenVPN will call ``script`` + with the environmental variables :code:`username` and :code:`password` + set to the username/password strings provided by the client. *Beware* + that this method is insecure on some platforms which make the environment + of a process publicly visible to other unprivileged processes. + + If ``method`` is set to :code:`via-file`, OpenVPN will write the username + and password to the first two lines of a temporary file. The filename + will be passed as an argument to ``script``, and the file will be + automatically deleted by OpenVPN after the script returns. The location + of the temporary file is controlled by the ``--tmp-dir`` option, and + will default to the current directory if unspecified. For security, + consider setting ``--tmp-dir`` to a volatile storage medium such as + :code:`/dev/shm` (if available) to prevent the username/password file + from touching the hard drive. + + The script should examine the username and password, returning a success + exit code (:code:`0`) if the client's authentication request is to be + accepted, or a failure code (:code:`1`) to reject the client. + + This directive is designed to enable a plugin-style interface for + extending OpenVPN's authentication capabilities. + + To protect against a client passing a maliciously formed username or + password string, the username string must consist only of these + characters: alphanumeric, underbar (':code:`_`'), dash (':code:`-`'), + dot (':code:`.`'), or at (':code:`@`'). The password string can consist + of any printable characters except for CR or LF. Any illegal characters + in either the username or password string will be converted to + underbar (':code:`_`'). + + Care must be taken by any user-defined scripts to avoid creating a + security vulnerability in the way that these strings are handled. Never + use these strings in such a way that they might be escaped or evaluated + by a shell interpreter. + + For a sample script that performs PAM authentication, see + :code:`sample-scripts/auth-pam.pl` in the OpenVPN source distribution. + +--auth-gen-token args + Returns an authentication token to successfully authenticated clients. + + Valid syntax: + :: + + auth-gen-token [lifetime] [external-auth] + + After successful user/password authentication, the OpenVPN server will + with this option generate a temporary authentication token and push that + to client. On the following renegotiations, the OpenVPN client will pass + this token instead of the users password. On the server side the server + will do the token authentication internally and it will NOT do any + additional authentications against configured external user/password + authentication mechanisms. + + The tokens implemented by this mechanism include a initial timestamp and + a renew timestamp and are secured by HMAC. + + The ``lifetime`` argument defines how long the generated token is valid. + The lifetime is defined in seconds. If lifetime is not set or it is set + to :code:`0`, the token will never expire. + + The token will expire either after the configured ``lifetime`` of the + token is reached or after not being renewed for more than 2 \* + ``reneg-sec`` seconds. Clients will be sent renewed tokens on every TLS + renogiation to keep the client's token updated. This is done to + invalidate a token if a client is disconnected for a sufficently long + time, while at the same time permitting much longer token lifetimes for + active clients. + + This feature is useful for environments which is configured to use One + Time Passwords (OTP) as part of the user/password authentications and + that authentication mechanism does not implement any auth-token support. + + When the :code:`external-auth` keyword is present the normal + authentication method will always be called even if auth-token succeeds. + Normally other authentications method are skipped if auth-token + verification suceeds or fails. + + This option postpones this decision to the external authentication + methods and check the validity of the account and do other checks. + + In this mode the environment will have a session\_id variable that hold + the session id from auth-gen-token. Also a environment variable + session\_state is present. This variable tells whether the auth-token + has succeeded or not. It can have the following values: + + :code:`Initial` + No token from client. + + :code:`Authenticated` + Token is valid and not expired. + + :code:`Expired` + Token is valid but has expired. + + :code:`Invalid` + Token is invalid (failed HMAC or wrong length) + + :code:`AuthenticatedEmptyUser` / :code:`ExpiredEmptyUser` + The token is not valid with the username send from the client but + would be valid (or expired) if we assume an empty username was + used instead. These two cases are a workaround for behaviour in + OpenVPN 3. If this workaround is not needed these two cases should + be handled in the same way as :code:`Invalid`. + + **Warning:** Use this feature only if you want your authentication + method called on every verification. Since the external authentication + is called it needs to also indicate a success or failure of the + authentication. It is strongly recommended to return an authentication + failure in the case of the Invalid/Expired auth-token with the + external-auth option unless the client could authenticate in another + acceptable way (e.g. client certificate), otherwise returning success + will lead to authentication bypass (as does returning success on a wrong + password from a script). + +--auth-gen-token-secret file + Specifies a file that hold a secret for the HMAC used in + ``--auth-gen-token`` If ``file`` is not present OpenVPN will generate a + random secret on startup. This file should be used if auth-token should + valid after restarting a server or if client should be able to roam + between multiple OpenVPN server with their auth-token. + +--opt-verify + Clients that connect with options that are incompatible with those of the + server will be disconnected. + + Options that will be compared for compatibility include ``dev-type``, + ``link-mtu``, ``tun-mtu``, ``proto``, ``ifconfig``, + ``comp-lzo``, ``fragment``, ``keydir``, ``cipher``, + ``auth``, ``keysize``, ``secret``, ``no-replay``, + ``no-iv``, ``tls-auth``, ``key-method``, ``tls-server`` + and ``tls-client``. + + This option requires that ``--disable-occ`` NOT be used. + +--auth-user-pass-optional + Allow connections by clients that do not specify a username/password. + Normally, when ``--auth-user-pass-verify`` or + ``--management-client-auth`` is specified (or an authentication plugin + module), the OpenVPN server daemon will require connecting clients to + specify a username and password. This option makes the submission of a + username/password by clients optional, passing the responsibility to the + user-defined authentication module/script to accept or deny the client + based on other factors (such as the setting of X509 certificate fields). + When this option is used, and a connecting client does not submit a + username/password, the user-defined authentication module/script will + see the username and password as being set to empty strings (""). The + authentication module/script MUST have logic to detect this condition + and respond accordingly. + +--verify-client-cert mode + Specify whether the client is required to supply a valid certificate. + + Possible ``mode`` options are: + + :code:`none` + A client certificate is not required. the client need to + authenticate using username/password only. Be aware that using this + directive is less secure than requiring certificates from all + clients. + + If you use this directive, the entire responsibility of authentication + will rest on your ``--auth-user-pass-verify`` script, so keep in mind + that bugs in your script could potentially compromise the security of + your VPN. + + ``--verify-client-cert none`` is functionally equivalent to + ``--client-cert-not-required``. + + :code:`optional` + A client may present a certificate but it is not required to do so. + When using this directive, you should also use a + ``--auth-user-pass-verify`` script to ensure that clients are + authenticated using a certificate, a username and password, or + possibly even both. + + Again, the entire responsibility of authentication will rest on your + ``--auth-user-pass-verify`` script, so keep in mind that bugs in your + script could potentially compromise the security of your VPN. + + :code:`require` + This is the default option. A client is required topresent a + certificate, otherwise VPN access is refused. + + If you don't use this directive (or use ``--verify-client-cert require``) + but you also specify an ``--auth-user-pass-verify`` script, then OpenVPN + will perform double authentication. The client certificate verification + AND the ``--auth-user-pass-verify`` script will need to succeed in order + for a client to be authenticated and accepted onto the VPN. + +--username-as-common-name + For ``--auth-user-pass-verify`` authentication, use the authenticated + username as the common name, rather than the common name from the client + cert. + +--port-share args + Share OpenVPN TCP with another service + + Valid syntax: + :: + + port-share host port [dir] + + When run in TCP server mode, share the OpenVPN port with another + application, such as an HTTPS server. If OpenVPN senses a connection to + its port which is using a non-OpenVPN protocol, it will proxy the + connection to the server at ``host``:``port``. Currently only designed to + work with HTTP/HTTPS, though it would be theoretically possible to + extend to other protocols such as ssh. + + ``dir`` specifies an optional directory where a temporary file with name + N containing content C will be dynamically generated for each proxy + connection, where N is the source IP:port of the client connection and C + is the source IP:port of the connection to the proxy receiver. This + directory can be used as a dictionary by the proxy receiver to determine + the origin of the connection. Each generated file will be automatically + deleted when the proxied connection is torn down. + + Not implemented on Windows. + +--vlan-tagging + Server-only option. Turns the OpenVPN server instance into a switch that + understands VLAN-tagging, based on IEEE 802.1Q. + + The server TAP device and each of the connecting clients is seen as a + port of the switch. All client ports are in untagged mode and the server + TAP device is VLAN-tagged, untagged or accepts both, depending on the + ``--vlan-accept`` setting. + + Ethernet frames with a prepended 802.1Q tag are called "tagged". If the + VLAN Identifier (VID) field in such a tag is non-zero, the frame is + called "VLAN-tagged". If the VID is zero, but the Priority Control Point + (PCP) field is non-zero, the frame is called "prio-tagged". If there is + no 802.1Q tag, the frame is "untagged". + + Using the ``--vlan-pvid v`` option once per client (see + --client-config-dir), each port can be associated with a certain VID. + Packets can only be forwarded between ports having the same VID. + Therefore, clients with differing VIDs are completely separated from + one-another, even if ``--client-to-client`` is activated. + + The packet filtering takes place in the OpenVPN server. Clients should + not have any VLAN tagging configuration applied. + + The ``--vlan-tagging`` option is off by default. While turned off, + OpenVPN accepts any Ethernet frame and does not perform any special + processing for VLAN-tagged packets. + + The option can only be activated in ``--dev tap mode``. + +--vlan-accept args + Configure the VLAN tagging policy for the server TAP device. + + Valid syntax: + :: + + vlan-accept all|tagged|untagged + + The following modes are available: + + :code:`tagged` + Admit only VLAN-tagged frames. Only VLAN-tagged packets are accepted, + while untagged or priority-tagged packets are dropped when entering + the server TAP device. + + :code:`untagged` + Admit only untagged and prio-tagged frames. VLAN-tagged packets are + not accepted, while untagged or priority-tagged packets entering the + server TAP device are tagged with the value configured for the global + ``--vlan-pvid`` setting. + + :code:`all` (default) + Admit all frames. All packets are admitted and then treated like + untagged or tagged mode respectively. + + *Note*: + Some vendors refer to switch ports running in :code:`tagged` mode + as "trunk ports" and switch ports running in :code:`untagged` mode + as "access ports". + + Packets forwarded from clients to the server are VLAN-tagged with the + originating client's PVID, unless the VID matches the global + ``--vlan-pvid``, in which case the tag is removed. + + If no *PVID* is configured for a given client (see --vlan-pvid) packets + are tagged with 1 by default. + +--vlan-pvid v + Specifies which VLAN identifier a "port" is associated with. Only valid + when ``--vlan-tagging`` is speficied. + + In the client context, the setting specifies which VLAN ID a client is + associated with. In the global context, the VLAN ID of the server TAP + device is set. The latter only makes sense for ``--vlan-accept + untagged`` and ``--vlan-accept all`` modes. + + Valid values for ``v`` go from :code:`1` through to :code:`4094`. The + global value defaults to :code:`1`. If no ``--vlan-pvid`` is specified in + the client context, the global value is inherited. + + In some switch implementations, the *PVID* is also referred to as "Native + VLAN". + + +Client Mode +----------- + +Use client mode when connecting to an OpenVPN server which has +``--server``, ``--server-bridge``, or ``--mode server`` in its +configuration. + +--client + A helper directive designed to simplify the configuration of OpenVPN's + client mode. This directive is equivalent to: + :: + + pull + tls-client + +--pull + This option must be used on a client which is connecting to a + multi-client server. It indicates to OpenVPN that it should accept + options pushed by the server, provided they are part of the legal set of + pushable options (note that the ``--pull`` option is implied by + ``--client`` ). + + In particular, ``--pull`` allows the server to push routes to the + client, so you should not use ``--pull`` or ``--client`` in situations + where you don't trust the server to have control over the client's + routing table. + +--pull-filter args + Filter options on the client pushed by the server to the client. + + Valid syntaxes: + :: + + pull-filter accept text + pull-filter ignore text + pull-filter reject text + + Filter options received from the server if the option starts with + :code:`text`. The action flag :code:`accept` allows the option, + :code:`ignore` removes it and :code:`reject` flags an error and triggers + a :code:`SIGUSR1` restart. The filters may be specified multiple times, + and each filter is applied in the order it is specified. The filtering of + each option stops as soon as a match is found. Unmatched options are accepted + by default. + + Prefix comparison is used to match :code:`text` against the received option so + that + :: + + pull-filter ignore "route" + + would remove all pushed options starting with ``route`` which would + include, for example, ``route-gateway``. Enclose *text* in quotes to + embed spaces. + + :: + + pull-filter accept "route 192.168.1." + pull-filter ignore "route " + + would remove all routes that do not start with ``192.168.1``. + + *Note* that :code:`reject` may result in a repeated cycle of failure and + reconnect, unless multiple remotes are specified and connection to the + next remote succeeds. To silently ignore an option pushed by the server, + use :code:`ignore`. + +--auth-user-pass + Authenticate with server using username/password. + + Valid syntaxes: + :: + + auth-user-pass + auth-user-pass up + + If ``up`` is present, it must be a file containing username/password on 2 + lines. If the password line is missing, OpenVPN will prompt for one. + + If ``up`` is omitted, username/password will be prompted from the + console. + + The server configuration must specify an ``--auth-user-pass-verify`` + script to verify the username/password provided by the client. + +--auth-retry type + Controls how OpenVPN responds to username/password verification errors + such as the client-side response to an AUTH\_FAILED message from the + server or verification failure of the private key password. + + Normally used to prevent auth errors from being fatal on the client + side, and to permit username/password requeries in case of error. + + An AUTH\_FAILED message is generated by the server if the client fails + ``--auth-user-pass`` authentication, or if the server-side + ``--client-connect`` script returns an error status when the client + tries to connect. + + ``type`` can be one of: + + :code:`none` + Client will exit with a fatal error (this is the default). + + :code:`nointeract` + Client will retry the connection without requerying + for an ``--auth-user-pass`` username/password. Use this option for + unattended clients. + + :code:`interact` + Client will requery for an ``--auth-user-pass`` + username/password and/or private key password before attempting a + reconnection. + + Note that while this option cannot be pushed, it can be controlled from + the management interface. + +--static-challenge args + Enable static challenge/response protocol + + Valid syntax: + :: + + static-challenge text echo + + The ``text`` challenge text is presented to the user which describes what + information is requested. The ``echo`` flag indicates if the user's + input should be echoed on the screen. Valid ``echo`` values are + :code:`0` or :code:`1`. + + See management-notes.txt in the OpenVPN distribution for a description of + the OpenVPN challenge/response protocol. + +--server-poll-timeout n + When connecting to a remote server do not wait for more than **n** + seconds waiting for a response before trying the next server. The + default value is 120s. This timeout includes proxy and TCP connect + timeouts. + +--connect-timeout n + See ``--server-poll-timeout``. + +--explicit-exit-notify n + In UDP client mode or point-to-point mode, send server/peer an exit + notification if tunnel is restarted or OpenVPN process is exited. In + client mode, on exit/restart, this option will tell the server to + immediately close its client instance object rather than waiting for a + timeout. + + The **n** parameter (default :code:`1` if not present) controls the + maximum number of attempts that the client will try to resend the exit + notification message. + + In UDP server mode, send :code:`RESTART` control channel command to + connected clients. The ``n`` parameter (default :code:`1` if not present) + controls client behavior. With ``n`` = :code:`1` client will attempt to + reconnect to the same server, with ``n`` = :code:`2` client will advance + to the next server. + + OpenVPN will not send any exit notifications unless this option is + enabled. + +--allow-recursive-routing + When this option is set, OpenVPN will not drop incoming tun packets with + same destination as host. + + +Data Channel Encryption Options +------------------------------- + +These options are meaningful for both Static & TLS-negotiated key modes +(must be compatible between peers). + +--secret args + Enable Static Key encryption mode (non-TLS). Use pre-shared secret + ``file`` which was generated with ``--genkey``. + + Valid syntaxes: + :: + + secret file + secret file direction + + The optional ``direction`` parameter enables the use of 4 distinct keys + (HMAC-send, cipher-encrypt, HMAC-receive, cipher-decrypt), so that each + data flow direction has a different set of HMAC and cipher keys. This + has a number of desirable security properties including eliminating + certain kinds of DoS and message replay attacks. + + When the ``direction`` parameter is omitted, 2 keys are used
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.26.0
Part of the diff is not shown here. View the raw message.
PATCH v2 2/8 doc/man: Replace old man page with generated man page
In reply to David SommersethThe doc/openvpn.8 and doc/openvpn.8.html files are now being removed from the git tree, as it will be generated from the doc/openvpn.8.rst file using python-docutils.
An additional dist-hook is added so these files are generated automatically when source tarballs are generated for releases. This means users compiling directly from the source tarball will not need python-docutils installed.
--- .gitignore | 1 + INSTALL | 3 +- configure.ac | 15 +- doc/Makefile.am | 34 +- doc/README.man | 23 + doc/openvpn.8 | 7659 ----------------------------------------------- 6 files changed, 61 insertions(+), 7674 deletions(-) create mode 100644 doc/README.man delete mode 100644 doc/openvpn.8
.gitignore +1 -0
@@ -49,6 +49,7 @@ version.sh msvc-env-local.bat config-msvc-local.h config-msvc-version.h +doc/openvpn.8 doc/openvpn.8.html /doc/doxygen/html/ /doc/doxygen/latex/
INSTALL +2 -1
@@ -227,7 +227,6 @@ ENVIRONMENT for ./configure: ROUTE full path to route utility IPROUTE full path to ip utility NETSTAT path to netstat utility - MAN2HTML path to man2html utility GIT path to git utility SYSTEMD_ASK_PASSWORD path to systemd-ask-password utility
@@ -235,6 +234,8 @@ ENVIRONMENT for ./configure: Path of systemd unit directory [default=LIBDIR/systemd/system] TMPFILES_DIR Path of tmpfiles directory [default=LIBDIR/tmpfiles.d] + RST2MAN Path to rst2man utility + RST2HTML Path to rst2html utility ENVIRONMENT variables adjusting parameters related to dependencies
configure.ac +9 -6
@@ -354,7 +354,6 @@ AC_ARG_VAR([IFCONFIG], [full path to ipconfig utility]) AC_ARG_VAR([ROUTE], [full path to route utility]) AC_ARG_VAR([IPROUTE], [full path to ip utility]) AC_ARG_VAR([NETSTAT], [path to netstat utility]) # tests -AC_ARG_VAR([MAN2HTML], [path to man2html utility]) AC_ARG_VAR([GIT], [path to git utility]) AC_ARG_VAR([SYSTEMD_ASK_PASSWORD], [path to systemd-ask-password utility]) AC_ARG_VAR([SYSTEMD_UNIT_DIR], [Path of systemd unit directory @<:@default=LIBDIR/systemd/system@:>@])
@@ -364,13 +363,21 @@ AC_PATH_PROGS([ROUTE], [route],, [$PATH:/usr/local/sbin:/usr/sbin:/sbin]) AC_PATH_PROGS([IPROUTE], [ip],, [$PATH:/usr/local/sbin:/usr/sbin:/sbin]) AC_PATH_PROGS([SYSTEMD_ASK_PASSWORD], [systemd-ask-password],, [$PATH:/usr/local/bin:/usr/bin:/bin]) AC_CHECK_PROGS([NETSTAT], [netstat], [netstat], [$PATH:/usr/local/sbin:/usr/sbin:/sbin:/etc]) # tests -AC_CHECK_PROGS([MAN2HTML], [man2html]) AC_CHECK_PROGS([GIT], [git]) # optional AC_DEFINE_UNQUOTED([IFCONFIG_PATH], ["$IFCONFIG"], [Path to ifconfig tool]) AC_DEFINE_UNQUOTED([IPROUTE_PATH], ["$IPROUTE"], [Path to iproute tool]) AC_DEFINE_UNQUOTED([ROUTE_PATH], ["$ROUTE"], [Path to route tool]) AC_DEFINE_UNQUOTED([SYSTEMD_ASK_PASSWORD_PATH], ["$SYSTEMD_ASK_PASSWORD"], [Path to systemd-ask-password tool]) +# +# man page generation - based on python-docutils +# +AC_ARG_VAR([RST2MAN], [path to rst2man utility]) +AC_ARG_VAR([RST2HTML], [path to rst2html utility]) +AC_CHECK_PROGS([RST2MAN], [rst2man]) +AC_CHECK_PROGS([RST2HTML], [rst2html]) +AM_CONDITIONAL([HAVE_PYDOCUTILS], [test "${RST2MAN}" -a "${RST2HTML}"]) + # Set -std=c99 unless user already specified a -std= case "${CFLAGS}" in *-std=*) ;;
@@ -1315,10 +1322,6 @@ if test "${enable_werror}" = "yes"; then CFLAGS="${CFLAGS} -Werror" fi -if test "${WIN32}" = "yes"; then - test -z "${MAN2HTML}" && AC_MSG_ERROR([man2html is required for win32]) -fi - if test "${enable_plugin_auth_pam}" = "yes"; then PLUGIN_AUTH_PAM_CFLAGS="${LIBPAM_CFLAGS}" if test "${enable_pam_dlopen}" = "yes"; then
doc/Makefile.am +26 -8
@@ -5,29 +5,47 @@ # packet encryption, packet authentication, and # packet compression. # -# Copyright (C) 2002-2018 OpenVPN Inc <[email protected]...> +# Copyright (C) 2002-2020 OpenVPN Inc <[email protected]...> # Copyright (C) 2006-2012 Alon Bar-Lev <[email protected]...> # MAINTAINERCLEANFILES = \ $(srcdir)/Makefile.in -CLEANFILES = openvpn.8.html - SUBDIRS = doxygen dist_doc_DATA = \ - management-notes.txt + management-notes.txt openvpn.8.rst dist_noinst_DATA = \ README.plugins interactive-service-notes.rst -if WIN32 +openvpn.8 : +if HAVE_PYDOCUTILS + $(RST2MAN) $(srcdir)/[email protected] > $@ +else + @echo "Missing python-docutils - skipping man page generation" +endif + +openvpn.8.html: +if HAVE_PYDOCUTILS + $(RST2HTML) $(srcdir)/openvpn.8.rst > $@ +else + @echo "Missing python-docutils - skipping man/html page generation" +endif + +if HAVE_PYDOCUTILS dist_noinst_DATA += openvpn.8 -nodist_html_DATA = openvpn.8.html -openvpn.8.html: $(srcdir)/openvpn.8 - $(MAN2HTML) < $(srcdir)/openvpn.8 > openvpn.8.html +dist_html_DATA = openvpn.8.html + +# Failsafe - do not delete these files unless we can recreate them +CLEANFILES = \ + openvpn.8 openvpn.8.html + +if WIN32 else dist_man_MANS = openvpn.8 endif +endif +dist-hook : openvpn.8 openvpn.8.html
doc/README.man new file +23 -0
@@ -0,0 +1,23 @@ + +man page documentation +====================== + +The man page content maintained in the openvpn.8.rst file and proper man and +the html version of the man page are generated using python-docutils. Both +the man page and html file are generated during 'make dist' or 'make distcheck' +and should be distributed inside the tarball by default. + +Users compiling OpenVPN from the tarball should not need to regenerate the +man/html files unless the source file needs to be modified. + +Further information: + +* Python docutils project: + https://docutils.sourceforge.io/ + +* Quickstart on .rst + https://docutils.sourceforge.io/docs/user/rst/quickstart.html + +* reStructuredText Markup Specifictaion (.rst) + https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html +
doc/openvpn.8 deleted +0 -7659
2,861 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.26.0
Part of the diff is not shown here. View the raw message.
PATCH v2 3/8 doc/man: Split up and reorganize main man page
In reply to David SommersethThe openvpn.8.rst file is quite long and hard to edit, as it covers several hundred options. Some options were even documented multiple places. The example has also received some attention, cleaning up old and outdated infomration.
In this commit the main man page is split up into multiple sections and options are sorted into each of the corresponding section. Inside each category, each option is for now sorted alphabetically. The main openvpn.8.rst file is currently kept unchanged and will be handled in the next commit.
Many language improvements contributed by Richard Bonhomme has also been incorproated.
---
doc/Makefile.am | 24 +-
doc/man-sections/advanced-options.rst | 107 +++
doc/man-sections/client-options.rst | 354 ++++++++
doc/man-sections/connection-profiles.rst | 75 ++
doc/man-sections/encryption-options.rst | 136 +++
doc/man-sections/examples.rst | 241 ++++++
doc/man-sections/generic-options.rst | 436 ++++++++++
doc/man-sections/inline-files.rst | 25 +
doc/man-sections/link-options.rst | 410 +++++++++
doc/man-sections/log-options.rst | 74 ++
doc/man-sections/management-options.rst | 136 +++
doc/man-sections/network-config.rst | 9 +
doc/man-sections/pkcs11-options.rst | 81 ++
doc/man-sections/plugin-options.rst | 60 ++
doc/man-sections/protocol-options.rst | 229 +++++
doc/man-sections/proxy-options.rst | 66 ++
doc/man-sections/renegotiation.rst | 53 ++
doc/man-sections/script-options.rst | 807 ++++++++++++++++++
doc/man-sections/server-options.rst | 769 +++++++++++++++++
doc/man-sections/signals.rst | 30 +
doc/man-sections/tls-options.rst | 643 ++++++++++++++
.../unsupported-options.rst | 4 +-
doc/man-sections/vpn-network-options.rst | 531 ++++++++++++
doc/man-sections/windows-options.rst | 245 ++++++
24 files changed, 5542 insertions(+), 3 deletions(-)
create mode 100644 doc/man-sections/advanced-options.rst
create mode 100644 doc/man-sections/client-options.rst
create mode 100644 doc/man-sections/connection-profiles.rst
create mode 100644 doc/man-sections/encryption-options.rst
create mode 100644 doc/man-sections/examples.rst
create mode 100644 doc/man-sections/generic-options.rst
create mode 100644 doc/man-sections/inline-files.rst
create mode 100644 doc/man-sections/link-options.rst
create mode 100644 doc/man-sections/log-options.rst
create mode 100644 doc/man-sections/management-options.rst
create mode 100644 doc/man-sections/network-config.rst
create mode 100644 doc/man-sections/pkcs11-options.rst
create mode 100644 doc/man-sections/plugin-options.rst
create mode 100644 doc/man-sections/protocol-options.rst
create mode 100644 doc/man-sections/proxy-options.rst
create mode 100644 doc/man-sections/renegotiation.rst
create mode 100644 doc/man-sections/script-options.rst
create mode 100644 doc/man-sections/server-options.rst
create mode 100644 doc/man-sections/signals.rst
create mode 100644 doc/man-sections/tls-options.rst
rename doc/{ => man-sections}/unsupported-options.rst (92%)
create mode 100644 doc/man-sections/vpn-network-options.rst
create mode 100644 doc/man-sections/windows-options.rstdoc/Makefile.am +23 -1
@@ -15,7 +15,29 @@ MAINTAINERCLEANFILES = \ SUBDIRS = doxygen dist_doc_DATA = \ - management-notes.txt openvpn.8.rst + management-notes.txt openvpn.8.rst \ + man-sections/advanced-options.rst \ + man-sections/client-options.rst \ + man-sections/connection-profiles.rst \ + man-sections/encryption-options.rst \ + man-sections/examples.rst \ + man-sections/generic-options.rst \ + man-sections/inline-files.rst \ + man-sections/link-options.rst \ + man-sections/log-options.rst \ + man-sections/management-options.rst \ + man-sections/network-config.rst \ + man-sections/pkcs11-options.rst \ + man-sections/plugin-options.rst \ + man-sections/protocol-options.rst \ + man-sections/proxy-options.rst \ + man-sections/signals.rst \ + man-sections/script-options.rst \ + man-sections/server-options.rst \ + man-sections/tls-options.rst \ + man-sections/unsupported-options.rst \ + man-sections/vpn-network-options.rst \ + man-sections/windows-options.rst dist_noinst_DATA = \ README.plugins interactive-service-notes.rst
doc/man-sections/advanced-options.rst new file +107 -0
107 lines not on this page · raw message
doc/man-sections/client-options.rst new file +354 -0
354 lines not on this page · raw message
doc/man-sections/connection-profiles.rst new file +75 -0
75 lines not on this page · raw message
doc/man-sections/encryption-options.rst new file +136 -0
136 lines not on this page · raw message
doc/man-sections/examples.rst new file +241 -0
241 lines not on this page · raw message
doc/man-sections/generic-options.rst new file +436 -0
436 lines not on this page · raw message
doc/man-sections/inline-files.rst new file +25 -0
@@ -0,0 +1,25 @@ +INLINE FILE SUPPORT +=================== + +OpenVPN allows including files in the main configuration for the ``--ca``, +``--cert``, ``--dh``, ``--extra-certs``, ``--key``, ``--pkcs12``, +``--secret``, ``--crl-verify``, ``--http-proxy-user-pass``, ``--tls-auth``, +``--auth-gen-token-secret``, ``--tls-crypt`` and ``--tls-crypt-v2`` +options. + +Each inline file started by the line ``<option>`` and ended by the line +``</option>`` + +Here is an example of an inline file usage + +:: + + <cert> + -----BEGIN CERTIFICATE----- + [...] + -----END CERTIFICATE----- + </cert> + +When using the inline file feature with ``--pkcs12`` the inline file has +to be base64 encoded. Encoding of a .p12 file into base64 can be done +for example with OpenSSL by running :code:`openssl base64 -in input.p12`
doc/man-sections/link-options.rst new file +410 -0
410 lines not on this page · raw message
doc/man-sections/log-options.rst new file +74 -0
74 lines not on this page · raw message
doc/man-sections/management-options.rst new file +136 -0
136 lines not on this page · raw message
doc/man-sections/network-config.rst new file +9 -0
@@ -0,0 +1,9 @@ +NETWORK CONFIGURATION +===================== + +OpenVPN consists of two sides of network configuration. One side is the +*link* between the local and remote side, the other side is the *virtual +network adapter* (tun/tap device). + +.. include:: link-options.rst +.. include:: vpn-network-options.rst
doc/man-sections/pkcs11-options.rst new file +81 -0
81 lines not on this page · raw message
doc/man-sections/plugin-options.rst new file +60 -0
60 lines not on this page · raw message
doc/man-sections/protocol-options.rst new file +229 -0
229 lines not on this page · raw message
doc/man-sections/proxy-options.rst new file +66 -0
66 lines not on this page · raw message
doc/man-sections/renegotiation.rst new file +53 -0
53 lines not on this page · raw message
doc/man-sections/script-options.rst new file +807 -0
478 lines not on this page · raw message
doc/man-sections/server-options.rst new file +769 -0
769 lines not on this page · raw message
doc/man-sections/tls-options.rst new file +643 -0
643 lines not on this page · raw message
doc/man-sections/unsupported-options.rst renamed from doc/unsupported-options.rst +2 -2
Lines of this file are not shown. View the raw message.
doc/man-sections/vpn-network-options.rst new file +531 -0
531 lines not on this page · raw message
doc/man-sections/windows-options.rst new file +245 -0
245 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.26.0
Part of the diff is not shown here. View the raw message.
PATCH v2 4/8 doc/man: Complete openvpn.8.rst splitting
In reply to David SommersethThis rebuilds the openvpn.8.rst content by using the text which was split out in the previous commit by using RST ..include statements.
--- doc/openvpn.8.rst | 5614 +-------------------------------------------- 1 file changed, 17 insertions(+), 5597 deletions(-)
doc/openvpn.8.rst +17 -5597
@@ -69,5603 +69,23 @@ a configuration file. Though all command line options are preceded by a double-leading-dash ("--"), this prefix can be removed when an option is placed in a configuration file. ---help - - Show options. - ---config file - Load additional config options from ``file`` where each line corresponds - to one command line option, but with the leading '--' removed. - - If ``--config file`` is the only option to the openvpn command, the - ``--config`` can be removed, and the command can be given as ``openvpn - file`` - - Note that configuration files can be nested to a reasonable depth. - - Double quotation or single quotation characters ("", '') can be used to - enclose single parameters containing whitespace, and "#" or ";" - characters in the first column can be used to denote comments. - - Note that OpenVPN 2.0 and higher performs backslash-based shell escaping - for characters not in single quotations, so the following mappings - should be observed: - :: - - \\ Maps to a single backslash character (\). - \" Pass a literal doublequote character ("), don't - interpret it as enclosing a parameter. - \[SPACE] Pass a literal space or tab character, don't - interpret it as a parameter delimiter. - - For example on Windows, use double backslashes to represent pathnames: - :: - - secret "c:\\OpenVPN\\secret.key" - - - For examples of configuration files, see - https://openvpn.net/community-resources/how-to/ - - Here is an example configuration file: - :: - - # - # Sample OpenVPN configuration file for - # using a pre-shared static key. - # - # '#' or ';' may be used to delimit comments. - - # Use a dynamic tun device. - dev tun - - # Our remote peer - remote mypeer.mydomain - - # 10.1.0.1 is our local VPN endpoint - # 10.1.0.2 is our remote VPN endpoint - ifconfig 10.1.0.1 10.1.0.2 - - # Our pre-shared static key - secret static.key - - -Tunnel Options: ---------------- - ---mode m - Set OpenVPN major mode. By default, OpenVPN runs in point-to-point mode - (:code:`p2p`). OpenVPN 2.0 introduces a new mode (:code:`server`) which - implements a multi-client server capability. - ---local host - Local host name or IP address for bind. If specified, OpenVPN will bind - to this address only. If unspecified, OpenVPN will bind to all - interfaces. - ---remote args - Remote host name or IP address. It supports two additional optional - arguments: ``port`` and ``proto``. On the client, multiple ``--remote`` - options may be specified for redundancy, each referring to a different - OpenVPN server. Specifying multiple ``--remote`` options for this - purpose is a special case of the more general connection-profile - feature. See the ``<connection>`` documentation below. - - The OpenVPN client will try to connect to a server at ``host:port`` in - the order specified by the list of ``--remote`` options. - - Examples: - :: - - remote server.example.net - remote server.example.net 1194 - remote server.example.net tcp - - ``proto`` indicates the protocol to use when connecting with the remote, - and may be :code:`tcp` or :code:`udp`. - - For forcing IPv4 or IPv6 connection suffix tcp or udp with 4/6 like - udp4/udp6/tcp4/tcp6. - - The client will move on to the next host in the list, in the event of - connection failure. Note that at any given time, the OpenVPN client will - at most be connected to one server. - - Note that since UDP is connectionless, connection failure is defined by - the ``--ping`` and ``--ping-restart`` options. - - Note the following corner case: If you use multiple ``--remote`` - options, AND you are dropping root privileges on the client with - ``--user`` and/or ``--group`` AND the client is running a non-Windows - OS, if the client needs to switch to a different server, and that server - pushes back different TUN/TAP or route settings, the client may lack the - necessary privileges to close and reopen the TUN/TAP interface. This - could cause the client to exit with a fatal error. - - If ``--remote`` is unspecified, OpenVPN will listen for packets from any - IP address, but will not act on those packets unless they pass all - authentication tests. This requirement for authentication is binding on - all potential peers, even those from known and supposedly trusted IP - addresses (it is very easy to forge a source IP address on a UDP - packet). - - When used in TCP mode, ``--remote`` will act as a filter, rejecting - connections from any host which does not match ``host``. - - If ``host`` is a DNS name which resolves to multiple IP addresses, - OpenVPN will try them in the order that the system getaddrinfo() - presents them, so priorization and DNS randomization is done by the - system library. Unless an IP version is forced by the protocol - specification (4/6 suffix), OpenVPN will try both IPv4 and IPv6 - addresses, in the order getaddrinfo() returns them. - ---remote-random-hostname - Prepend a random string (6 bytes, 12 hex characters) to hostname to - prevent DNS caching. For example, "foo.bar.gov" would be modified to - "<random-chars>.foo.bar.gov". - ---proto-force p - When iterating through connection profiles, only consider profiles using - protocol ``p`` (:code:`tcp` \| :code:`udp`). - ---remote-random - When multiple ``--remote`` address/ports are specified, or if connection - profiles are being used, initially randomize the order of the list as a - kind of basic load-balancing measure. - ---proto p - Use protocol ``p`` for communicating with remote host. ``p`` can be - :code:`udp`, :code:`tcp-client`, or :code:`tcp-server`. - - The default protocol is :code:`udp` when ``--proto`` is not specified. - - For UDP operation, ``--proto udp`` should be specified on both peers. - - For TCP operation, one peer must use ``--proto tcp-server`` and the - other must use ``--proto tcp-client``. A peer started with - :code:`tcp-server` will wait indefinitely for an incoming connection. A peer - started with :code:`tcp-client` will attempt to connect, and if that fails, - will sleep for 5 seconds (adjustable via the ``--connect-retry`` option) - and try again infinite or up to N retries (adjustable via the - ``--connect-retry-max`` option). Both TCP client and server will - simulate a SIGUSR1 restart signal if either side resets the connection. - - OpenVPN is designed to operate optimally over UDP, but TCP capability is - provided for situations where UDP cannot be used. In comparison with - UDP, TCP will usually be somewhat less efficient and less robust when - used over unreliable or congested networks. - - This article outlines some of problems with tunneling IP over TCP: - http://sites.inka.de/sites/bigred/devel/tcp-tcp.html - - There are certain cases, however, where using TCP may be advantageous - from a security and robustness perspective, such as tunneling non-IP or - application-level UDP protocols, or tunneling protocols which don't - possess a built-in reliability layer. - ---connect-retry args - Wait ``n`` seconds between connection attempts (default :code:`5`). - Repeated reconnection attempts are slowed down after 5 retries per - remote by doubling the wait time after each unsuccessful attempt. An - optional argument ``max`` specifies the maximum value of wait time in - seconds at which it gets capped (default :code:`300`). - ---connect-retry-max n - ``n`` specifies the number of times each ``--remote`` or - ``<connection>`` entry is tried. Specifying ``n`` as one would try each - entry exactly once. A successful connection resets the counter. - (default *unlimited*). - ---show-proxy-settings - Show sensed HTTP or SOCKS proxy settings. Currently, only Windows - clients support this option. - ---http-proxy args - Connect to remote host through an HTTP proxy. This requires at least an - address ``server`` and ``port`` argument. If HTTP Proxy-Authenticate - is required, a file name to an ``authfile`` file containing a username - and password on 2 lines can be given, or :code:`stdin` to prompt from - console. Its content can also be specified in the config file with the - ``--http-proxy-user-pass`` option. (See section on inline files) - - The last optional argument is an ``auth-method`` which should be one - of :code:`none`, :code:`basic`, or :code:`ntlm`. - - HTTP Digest authentication is supported as well, but only via the - :code:`auto` or :code:`auto-nct` flags (below). This must replace - the ``authfile`` argument. - - The :code:`auto` flag causes OpenVPN to automatically determine the - ``auth-method`` and query stdin or the management interface for - username/password credentials, if required. This flag exists on OpenVPN - 2.1 or higher. - - The ``auto-nct`` flag (no clear-text auth) instructs OpenVPN to - automatically determine the authentication method, but to reject weak - authentication protocols such as HTTP Basic Authentication. - - Examples: - :: - - http-proxy proxy.example.net 3128 - http-proxy proxy.example.net 3128 authfile.txt - http-proxy proxy.example.net 3128 stdin - http-proxy proxy.example.net 3128 auto basic - http-proxy proxy.example.net 3128 auto-nct ntlm - ---http-proxy-option args - Set extended HTTP proxy options. Requires an option ``type`` as argument - and an optional ``parameter`` to the type. Repeat to set multiple - options. - - :code:`VERSION` ``version`` - Set HTTP version number to ``version`` (default :code:`1.0`). - - :code:`AGENT` ``user-agent`` - Set HTTP "User-Agent" string to ``user-agent``. - - :code:`CUSTOM-HEADER` ``name`` ``content`` - Adds the custom Header with ``name`` as name and ``content`` as - the content of the custom HTTP header. - - Examples: - :: - - http-proxy-option VERSION 1.1 - http-proxy-option AGENT OpenVPN/2.4 - http-proxy-option X-Proxy-Flag some-flags - ---socks-proxy args - Connect to remote host through a Socks5 proxy. A required ``server`` - argument is needed. Optionally a ``port`` (default :code:`1080`) and - ``authfile`` can be given. The ``authfile`` is a file containing a - username and password on 2 lines, or :code:`stdin` can be used to - prompt from console. - ---resolv-retry n - If hostname resolve fails for ``--remote``, retry resolve for ``n`` - seconds before failing. - - Set ``n`` to "infinite" to retry indefinitely. - - By default, ``--resolv-retry infinite`` is enabled. You can disable by - setting n=0. - ---float - Allow remote peer to change its IP address and/or port number, such as - due to DHCP (this is the default if ``--remote`` is not used). - ``--float`` when specified with ``--remote`` allows an OpenVPN session - to initially connect to a peer at a known address, however if packets - arrive from a new address and pass all authentication tests, the new - address will take control of the session. This is useful when you are - connecting to a peer which holds a dynamic address such as a dial-in - user or DHCP client. - - Essentially, ``--float`` tells OpenVPN to accept authenticated packets - from any address, not only the address which was specified in the - ``--remote`` option. - ---ipchange cmd - Run command ``cmd`` when our remote ip-address is initially - authenticated or changes. - - ``cmd`` consists of a path to script (or executable program), optionally - followed by arguments. The path and arguments may be single- or - double-quoted and/or escaped using a backslash, and should be separated - by one or more spaces. - - When ``cmd`` is executed two arguments are appended after any arguments - specified in ``cmd`` , as follows: - :: - - cmd ip address port number - - Don't use ``--ipchange`` in ``--mode server`` mode. Use a - ``--client-connect`` script instead. - - See the `Environmental Variables`_ section below for additional - parameters passed as environmental variables. - - If you are running in a dynamic IP address environment where the IP - addresses of either peer could change without notice, you can use this - script, for example, to edit the :code:`/etc/hosts` file with the current - address of the peer. The script will be run every time the remote peer - changes its IP address. - - Similarly if *our* IP address changes due to DHCP, we should configure - our IP address change script (see man page for ``dhcpcd``\(8)) to - deliver a ``SIGHUP`` or ``SIGUSR1`` signal to OpenVPN. OpenVPN will - then reestablish a connection with its most recently authenticated - peer on its new IP address. - ---port port - TCP/UDP port number or port name for both local and remote (sets both - ``--lport`` and ``--rport`` options to given port). The current default - of 1194 represents the official IANA port number assignment for OpenVPN - and has been used since version 2.0-beta17. Previous versions used port - 5000 as the default. - ---lport port - Set local TCP/UDP port number or name. Cannot be used together with - ``--nobind`` option. - ---rport port - Set TCP/UDP port number or name used by the ``--remote`` option. The - port can also be set directly using the ``--remote`` option. - ---bind keywords - Bind to local address and port. This is the default unless any of - ``--proto tcp-client`` , ``--http-proxy`` or ``--socks-proxy`` are used. - - If the optional :code:`ipv6only` keyword is present OpenVPN will bind only - to IPv6 (as opposed to IPv6 and IPv4) when a IPv6 socket is opened. - ---nobind - Do not bind to local address and port. The IP stack will allocate a - dynamic port for returning packets. Since the value of the dynamic port - could not be known in advance by a peer, this option is only suitable - for peers which will be initiating connections by using the --remote - option. - ---dev device - TUN/TAP virtual network device which can be :code:`tunX`, :code:`tapX`, - :code:`null` or an arbitrary name string (:code:`X` can be omitted for - a dynamic device.) - - See examples section below for an example on setting up a TUN device. - - You must use either tun devices on both ends of the connection or tap - devices on both ends. You cannot mix them, as they represent different - underlying network layers: - - :code:`tun` - devices encapsulate IPv4 or IPv6 (OSI Layer 3) - - :code:`tap` - devices encapsulate Ethernet 802.3 (OSI Layer 2). - ---dev-type device-type - Which device type are we using? ``device-type`` should be :code:`tun` - (OSI Layer 3) or :code:`tap` (OSI Layer 2). Use this option only if - the TUN/TAP device used with ``--dev`` does not begin with :code:`tun` - or :code:`tap`. - ---topology mode - Configure virtual addressing topology when running in ``--dev tun`` - mode. This directive has no meaning in ``--dev tap`` mode, which always - uses a :code:`subnet` topology. - - If you set this directive on the server, the ``--server`` and - ``--server-bridge`` directives will automatically push your chosen - topology setting to clients as well. This directive can also be manually - pushed to clients. Like the ``--dev`` directive, this directive must - always be compatible between client and server. - - ``mode`` can be one of: - - :code:`net30` - Use a point-to-point topology, by allocating one /30 subnet - per client. This is designed to allow point-to-point semantics when some - or all of the connecting clients might be Windows systems. This is the - default on OpenVPN 2.0. - - :code:`p2p` - Use a point-to-point topology where the remote endpoint of - the client's tun interface always points to the local endpoint of the - server's tun interface. This mode allocates a single IP address per - connecting client. Only use when none of the connecting clients are - Windows systems. - - :code:`subnet` - Use a subnet rather than a point-to-point topology by - configuring the tun interface with a local IP address and subnet mask, - similar to the topology used in ``--dev tap`` and ethernet bridging - mode. This mode allocates a single IP address per connecting client and - works on Windows as well. Only available when server and clients are - OpenVPN 2.1 or higher, or OpenVPN 2.0.x which has been manually patched - with the ``--topology`` directive code. When used on Windows, requires - version 8.2 or higher of the TAP-Win32 driver. When used on \*nix, - requires that the tun driver supports an - ```ifconfig </man/man2html?8+ifconfig>`__``\ (8) command which sets a - subnet instead of a remote endpoint IP address. - - This option exists in OpenVPN 2.1 or higher. - - *Note:* Using ``--topology subnet`` changes the interpretation of the - arguments of ``--ifconfig`` to mean "address netmask", no longer "local - remote". - ---dev-node node - Explicitly set the device node rather than using :code:`/dev/net/tun`, - :code:`/dev/tun`, :code:`/dev/tap`, etc. If OpenVPN cannot figure out - whether ``node`` is a TUN or TAP device based on the name, you should - also specify ``--dev-type tun`` or ``--dev-type tap``. - - Under Mac OS X this option can be used to specify the default tun - implementation. Using ``--dev-node utun`` forces usage of the native - Darwin tun kernel support. Use ``--dev-node utunN`` to select a specific - utun instance. To force using the :code:`tun.kext` (:code:`/dev/tunX`) - use ``--dev-node tun``. When not specifying a ``--dev-node`` option - openvpn will first try to open utun, and fall back to tun.kext. - - On Windows systems, select the TAP-Win32 adapter which is named ``node`` - in the Network Connections Control Panel or the raw GUID of the adapter - enclosed by braces. The ``--show-adapters`` option under Windows can - also be used to enumerate all available TAP-Win32 adapters and will show - both the network connections control panel name and the GUID for each - TAP-Win32 adapter. - ---lladdr address - Specify the link layer address, more commonly known as the MAC address. - Only applied to TAP devices. - ---iproute cmd - Set alternate command to execute instead of default ``iproute2`` command. - May be used in order to execute OpenVPN in unprivileged environment. - ---ifconfig args - Set TUN/TAP adapter parameters. It requires the *IP address* of the local - VPN endpoint. For TUN devices in point-to-point mode, the next argument - must be the VPN IP address of the remote VPN endpoint. For TAP devices, - or TUN devices used with ``--topology subnet``, the second argument - is the subnet mask of the virtual network segment which is being created - or connected to. - - For TUN devices, which facilitate virtual point-to-point IP connections - (when used in ``--topology net30`` or ``p2p`` mode), the proper usage of - ``--ifconfig`` is to use two private IP addresses which are not a member - of any existing subnet which is in use. The IP addresses may be - consecutive and should have their order reversed on the remote peer. - After the VPN is established, by pinging ``rn``, you will be pinging - across the VPN. - - For TAP devices, which provide the ability to create virtual ethernet - segments, or TUN devices in ``--topology subnet`` mode (which create - virtual "multipoint networks"), ``--ifconfig`` is used to set an IP - address and subnet mask just as a physical ethernet adapter would be - similarly configured. If you are attempting to connect to a remote - ethernet bridge, the IP address and subnet should be set to values which - would be valid on the the bridged ethernet segment (note also that DHCP - can be used for the same purpose). - - This option, while primarily a proxy for the ``ifconfig``\(8) command, - is designed to simplify TUN/TAP tunnel configuration by providing a - standard interface to the different ifconfig implementations on - different platforms. - - ``--ifconfig`` parameters which are IP addresses can also be specified - as a DNS or /etc/hosts file resolvable name. - - For TAP devices, ``--ifconfig`` should not be used if the TAP interface - will be getting an IP address lease from a DHCP server. - - Examples: - :: - - # tun device in net30/p2p mode - ifconfig 10.8.0.2 10.8.0.1 - - # tun/tap device in subnet mode - ifconfig 10.8.0.2 255.255.255.0 - ---ifconfig-noexec - Don't actually execute ifconfig/netsh commands, instead pass - ``--ifconfig`` parameters to scripts using environmental variables. - ---ifconfig-nowarn - Don't output an options consistency check warning if the ``--ifconfig`` - option on this side of the connection doesn't match the remote side. - This is useful when you want to retain the overall benefits of the - options consistency check (also see ``--disable-occ`` option) while only - disabling the ifconfig component of the check. - - For example, if you have a configuration where the local host uses - ``--ifconfig`` but the remote host does not, use ``--ifconfig-nowarn`` - on the local host. - - This option will also silence warnings about potential address conflicts - which occasionally annoy more experienced users by triggering "false - positive" warnings. - ---route args - Add route to routing table after connection is established. Multiple - routes can be specified. Routes will be automatically torn down in - reverse order prior to TUN/TAP device close. - - Valid syntaxes: - :: - - route network/IP - route network/IP netmask - route network/IP netmask gateway - route network/IP netmask gateway metric - - This option is intended as a convenience proxy for the ``route``\(8) - shell command, while at the same time providing portable semantics - across OpenVPN's platform space. - - ``netmask`` - defaults to :code:`255.255.255.255` when not given - - ``gateway`` - default taken from ``--route-gateway`` or the second - parameter to ``--ifconfig`` when ``--dev tun`` is specified. - - ``metric`` - default taken from ``--route-metric`` if set, otherwise :code:`0`. - - The default can be specified by leaving an option blank or setting it to - :code:`default`. - - The ``network`` and ``gateway`` parameters can also be specified as a - DNS or :code:`/etc/hosts` file resolvable name, or as one of three special - keywords: - - :code:`vpn_gateway` - The remote VPN endpoint address (derived either from - ``--route-gateway`` or the second parameter to ``--ifconfig`` - when ``--dev tun`` is specified). - - :code:`net_gateway` - The pre-existing IP default gateway, read from the - routing table (not supported on all OSes). - - :code:`remote_host` - The ``--remote`` address if OpenVPN is being run in - client mode, and is undefined in server mode. - ---route-gateway arg - Specify a default *gateway* for use with ``--route``. - - If :code:`dhcp` is specified as the parameter, the gateway address will - be extracted from a DHCP negotiation with the OpenVPN server-side LAN. - - Valid syntaxes: - :: - - route-gateway gateway - route-gateway dhcp - - ---route-metric m - Specify a default metric ``m`` for use with ``--route``. - ---route-delay args - Valid syntaxes: - :: - - route-delay - route-delay n - route-delay n m - - Delay ``n`` seconds (default :code:`0`) after connection establishment, - before adding routes. If ``n`` is :code:`0`, routes will be added - immediately upon connection establishment. If ``--route-delay`` is - omitted, routes will be added immediately after TUN/TAP device open and - ``--up`` script execution, before any ``--user`` or ``--group`` privilege - downgrade (or ``--chroot`` execution.) - - This option is designed to be useful in scenarios where DHCP is used to - set tap adapter addresses. The delay will give the DHCP handshake time - to complete before routes are added. - - On Windows, ``--route-delay`` tries to be more intelligent by waiting - ``w`` seconds (default :code:`30` by default) for the TAP-Win32 adapter - to come up before adding routes. - ---route-up cmd - Run command ``cmd`` after routes are added, subject to ``--route-delay``. - - ``cmd`` consists of a path to script (or executable program), optionally - followed by arguments. The path and arguments may be single- or - double-quoted and/or escaped using a backslash, and should be separated - by one or more spaces. - - See the `Environmental Variables`_ section below for additional - parameters passed as environmental variables. - ---route-pre-down cmd - Run command ``cmd`` before routes are removed upon disconnection. - - ``cmd`` consists of a path to script (or executable program), optionally - followed by arguments. The path and arguments may be single- or - double-quoted and/or escaped using a backslash, and should be separated - by one or more spaces. - - See the `Environmental Variables`_ section below for additional - parameters passed as environmental variables. - ---route-noexec - Don't add or remove routes automatically. Instead pass routes to - ``--route-up`` script using environmental variables. - ---route-nopull - When used with ``--client`` or ``--pull``, accept options pushed by - server EXCEPT for routes, block-outside-dns and dhcp options like DNS - servers. - - When used on the client, this option effectively bars the server from - adding routes to the client's routing table, however note that this - option still allows the server to set the TCP/IP properties of the - client's TUN/TAP interface. - ---allow-pull-fqdn - Allow client to pull DNS names from server (rather than being limited to - IP address) for ``--ifconfig``, ``--route``, and ``--route-gateway``. - ---client-nat args - This pushable client option sets up a stateless one-to-one NAT rule on - packet addresses (not ports), and is useful in cases where routes or - ifconfig settings pushed to the client would create an IP numbering - conflict. - - Examples: - :: - - client-nat snat 192.168.0.0/255.255.0.0 - client-nat dnat 10.64.0.0/255.255.0.0 - - ``network/netmask`` (for example :code:`192.168.0.0/255.255.0.0`) defines - the local view of a resource from the client perspective, while - ``alias/netmask`` (for example :code:`10.64.0.0/255.255.0.0`) defines the - remote view from the server perspective. - - Use :code:`snat` (source NAT) for resources owned by the client and - :code:`dnat` (destination NAT) for remote resources. - - Set ``--verb 6`` for debugging info showing the transformation of - src/dest addresses in packets. - ---redirect-gateway flags - Automatically execute routing commands to cause all outgoing IP traffic - to be redirected over the VPN. This is a client-side option. - - This option performs three steps: - - (1) Create a static route for the ``--remote`` address which - forwards to the pre-existing default gateway. This is done so that - ``(3)`` will not create a routing loop. - - (2) Delete the default gateway route. - - (3) Set the new default gateway to be the VPN endpoint address - (derived either from ``--route-gateway`` or the second parameter to - ``--ifconfig`` when ``--dev tun`` is specified). - - When the tunnel is torn down, all of the above steps are reversed so - that the original default route is restored. - - Option flags: - - :code:`local` - Add the :code:`local` flag if both OpenVPN peers are directly - connected via a common subnet, such as with wireless. The - :code:`local` flag will cause step ``(1)`` above to be omitted. - - :code:`autolocal` - Try to automatically determine whether to enable :code:`local` - flag above. - - :code:`def1` - Use this flag to override the default gateway by using - :code:`0.0.0.0/1` and :code:`128.0.0.0/1` rather than - :code:`0.0.0.0/0`. This has the benefit of overriding but not - wiping out the original default gateway. - - :code:`bypass-dhcp` - Add a direct route to the DHCP server (if it is non-local) which - bypasses the tunnel (Available on Windows clients, may not be - available on non-Windows clients). - - :code:`bypass-dns` - Add a direct route to the DNS server(s) (if they are non-local) - which bypasses the tunnel (Available on Windows clients, may - not be available on non-Windows clients). - - :code:`block-local` - Block access to local LAN when the tunnel is active, except for - the LAN gateway itself. This is accomplished by routing the local - LAN (except for the LAN gateway address) into the tunnel. - - :code:`ipv6` - Redirect IPv6 routing into the tunnel. This works similar to - the :code:`def1` flag, that is, more specific IPv6 routes are added - (:code:`2000::/4`, :code:`3000::/4`), covering the whole IPv6 - unicast space. - - :code:`!ipv4` - Do not redirect IPv4 traffic - typically used in the flag pair - :code:`ipv6 !ipv4` to redirect IPv6-only. - ---link-mtu n - Sets an upper bound on the size of UDP packets which are sent between - OpenVPN peers. *It's best not to set this parameter unless you know what - you're doing.* - ---redirect-private flags - Like ``--redirect-gateway``, but omit actually changing the default gateway. - Useful when pushing private subnets. - ---block-ipv6 - On the client, instead of sending IPv6 packets over the VPN tunnel, all - IPv6 packets are answered with an ICMPv6 no route host message. On the - server, all IPv6 packets from clients are answered with an ICMPv6 no - route to host message. This options is intended for cases when IPv6 - should be blocked and other options are not available. ``--block-ipv6`` - will use the remote IPv6 as source address of the ICMPv6 packets if set, - otherwise will use :code:`fe80::7` as source address. - - For this option to make sense you actually have to route traffic to the - tun interface. The following example config block would send all IPv6 - traffic to OpenVPN and answer all requests with no route to host, - effectively blocking IPv6. - - **Client config** - :: - - --ifconfig-ipv6 fd15:53b6:dead::2/64 fd15:53b6:dead::1 - --redirect-gateway ipv6 - --block-ipv6 - - **Server config** - Push a "valid" ipv6 config to the client and block on the server - :: - - --push "ifconfig-ipv6 fd15:53b6:dead::2/64 fd15:53b6:dead::1" - --push "redirect-gateway ipv6" - --block-ipv6 - ---tun-mtu n - Take the TUN device MTU to be **n** and derive the link MTU from it - (default :code:`1500`). In most cases, you will probably want to leave - this parameter set to its default value. - - The MTU (Maximum Transmission Units) is the maximum datagram size in - bytes that can be sent unfragmented over a particular network path. - OpenVPN requires that packets on the control or data channels be sent - unfragmented. - - MTU problems often manifest themselves as connections which hang during - periods of active usage. - - It's best to use the ``--fragment`` and/or ``--mssfix`` options to deal - with MTU sizing issues. - ---tun-mtu-extra n - Assume that the TUN/TAP device might return as many as ``n`` bytes more - than the ``--tun-mtu`` size on read. This parameter defaults to 0, which - is sufficient for most TUN devices. TAP devices may introduce additional - overhead in excess of the MTU size, and a setting of 32 is the default - when TAP devices are used. This parameter only controls internal OpenVPN - buffer sizing, so there is no transmission overhead associated with - using a larger value. - ---mtu-disc type - Should we do Path MTU discovery on TCP/UDP channel? Only supported on - OSes such as Linux that supports the necessary system call to set. - - Valid types: - - :code:`no` Never send DF (Don't Fragment) frames - - :code:`maybe` Use per-route hints - - :code:`yes` Always DF (Don't Fragment) - ---mtu-test - To empirically measure MTU on connection startup, add the ``--mtu-test`` - option to your configuration. OpenVPN will send ping packets of various - sizes to the remote peer and measure the largest packets which were - successfully received. The ``--mtu-test`` process normally takes about 3 - minutes to complete. - ---fragment max - Enable internal datagram fragmentation so that no UDP datagrams are sent - which are larger than ``max`` bytes. - - The ``max`` parameter is interpreted in the same way as the - ``--link-mtu`` parameter, i.e. the UDP packet size after encapsulation - overhead has been added in, but not including the UDP header itself. - - The ``--fragment`` option only makes sense when you are using the UDP - protocol (``--proto udp``). - - ``--fragment`` adds 4 bytes of overhead per datagram. - - See the ``--mssfix`` option below for an important related option to - ``--fragment``. - - It should also be noted that this option is not meant to replace UDP - fragmentation at the IP stack level. It is only meant as a last resort - when path MTU discovery is broken. Using this option is less efficient - than fixing path MTU discovery for your IP link and using native IP - fragmentation instead. - - Having said that, there are circumstances where using OpenVPN's internal - fragmentation capability may be your only option, such as tunneling a - UDP multicast stream which requires fragmentation. - ---mssfix max - Announce to TCP sessions running over the tunnel that they should limit - their send packet sizes such that after OpenVPN has encapsulated them, - the resulting UDP packet size that OpenVPN sends to its peer will not - exceed ``max`` bytes. The default value is :code:`1450`. - - The ``max`` parameter is interpreted in the same way as the - ``--link-mtu`` parameter, i.e. the UDP packet size after encapsulation - overhead has been added in, but not including the UDP header itself. - Resulting packet would be at most 28 bytes larger for IPv4 and 48 bytes - for IPv6 (20/40 bytes for IP header and 8 bytes for UDP header). Default - value of 1450 allows IPv4 packets to be transmitted over a link with MTU - 1473 or higher without IP level fragmentation. - - The ``--mssfix`` option only makes sense when you are using the UDP - protocol for OpenVPN peer-to-peer communication, i.e. ``--proto udp``. - - ``--mssfix`` and ``--fragment`` can be ideally used together, where - ``--mssfix`` will try to keep TCP from needing packet fragmentation in - the first place, and if big packets come through anyhow (from protocols - other than TCP), ``--fragment`` will internally fragment them. - - Both ``--fragment`` and ``--mssfix`` are designed to work around cases - where Path MTU discovery is broken on the network path between OpenVPN - peers. - - The usual symptom of such a breakdown is an OpenVPN connection which - successfully starts, but then stalls during active usage. - - If ``--fragment`` and ``--mssfix`` are used together, ``--mssfix`` will - take its default ``max`` parameter from the ``--fragment max`` option. - - Therefore, one could lower the maximum UDP packet size to 1300 (a good - first try for solving MTU-related connection problems) with the - following options: - :: - - --tun-mtu 1500 --fragment 1300 --mssfix - ---sndbuf size - Set the TCP/UDP socket send buffer size. Defaults to operation system - default. - ---rcvbuf size - Set the TCP/UDP socket receive buffer size. Defaults to operation system - default. - ---mark value - Mark encrypted packets being sent with value. The mark value can be - matched in policy routing and packetfilter rules. This option is only - supported in Linux and does nothing on other operating systems. - ---socket-flags flags - Apply the given flags to the OpenVPN transport socket. Currently, only - :code:`TCP_NODELAY` is supported. - - The :code:`TCP_NODELAY` socket flag is useful in TCP mode, and causes the - kernel to send tunnel packets immediately over the TCP connection without - trying to group several smaller packets into a larger packet. This can - result in a considerably improvement in latency. - - This option is pushable from server to client, and should be used on - both client and server for maximum effect. - ---txqueuelen n - *(Linux only)* Set the TX queue length on the TUN/TAP interface. - Currently defaults to 100. - ---shaper n - Limit bandwidth of outgoing tunnel data to ``n`` bytes per second on the - TCP/UDP port. Note that this will only work if mode is set to - :code:`p2p`. If you want to limit the bandwidth in both directions, use - this option on both peers. - - OpenVPN uses the following algorithm to implement traffic shaping: Given - a shaper rate of ``n`` bytes per second, after a datagram write of ``b`` - bytes is queued on the TCP/UDP port, wait a minimum of ``(b / n)`` - seconds before queuing the next write. - - It should be noted that OpenVPN supports multiple tunnels between the - same two peers, allowing you to construct full-speed and reduced - bandwidth tunnels at the same time, routing low-priority data such as - off-site backups over the reduced bandwidth tunnel, and other data over - the full-speed tunnel. - - Also note that for low bandwidth tunnels (under 1000 bytes per second), - you should probably use lower MTU values as well (see above), otherwise - the packet latency will grow so large as to trigger timeouts in the TLS - layer and TCP connections running over the tunnel. - - OpenVPN allows ``n`` to be between 100 bytes/sec and 100 Mbytes/sec. - ---inactive args - Causes OpenVPN to exit after ``n`` seconds of inactivity on the TUN/TAP - device. The time length of inactivity is measured since the last - incoming or outgoing tunnel packet. The default value is 0 seconds, - which disables this feature. - - Valid syntaxes: - :: - - inactive n - inactive n bytes - - If the optional ``bytes`` parameter is included, exit if less than - ``bytes`` of combined in/out traffic are produced on the tun/tap device - in ``n`` seconds. - - In any case, OpenVPN's internal ping packets (which are just keepalives) - and TLS control packets are not considered "activity", nor are they - counted as traffic, as they are used internally by OpenVPN and are not - an indication of actual user activity. - ---ping n - Ping remote over the TCP/UDP control channel if no packets have been - sent for at least ``n`` seconds (specify ``--ping`` on both peers to - cause ping packets to be sent in both directions since OpenVPN ping - packets are not echoed like IP ping packets). When used in one of - OpenVPN's secure modes (where ``--secret``, ``--tls-server`` or - ``--tls-client`` is specified), the ping packet will be - cryptographically secure. - - This option has two intended uses: - - (1) Compatibility with stateful firewalls. The periodic ping will ensure - that a stateful firewall rule which allows OpenVPN UDP packets to - pass will not time out. - - (2) To provide a basis for the remote to test the existence of its peer - using the ``--ping-exit`` option. - ---ping-exit n - Causes OpenVPN to exit after ``n`` seconds pass without reception of a - ping or other packet from remote. This option can be combined with - ``--inactive``, ``--ping`` and ``--ping-exit`` to create a two-tiered - inactivity disconnect. - - For example, - :: - - openvpn [options...] --inactive 3600 --ping 10 --ping-exit 60 - - when used on both peers will cause OpenVPN to exit within 60 seconds if - its peer disconnects, but will exit after one hour if no actual tunnel - data is exchanged. - ---ping-restart n - Similar to ``--ping-exit``, but trigger a :code:`SIGUSR1` restart after - ``n`` seconds pass without reception of a ping or other packet from - remote. - - This option is useful in cases where the remote peer has a dynamic IP - address and a low-TTL DNS name is used to track the IP address using a - service such as http://dyndns.org/ + a dynamic DNS client such as - ``ddclient``. - - If the peer cannot be reached, a restart will be triggered, causing the - hostname used with ``--remote`` to be re-resolved (if ``--resolv-retry`` - is also specified). - - In server mode, ``--ping-restart``, ``--inactive`` or any other type of - internally generated signal will always be applied to individual client - instance objects, never to whole server itself. Note also in server mode - that any internally generated signal which would normally cause a - restart, will cause the deletion of the client instance object instead. - - In client mode, the ``--ping-restart`` parameter is set to 120 seconds - by default. This default will hold until the client pulls a replacement - value from the server, based on the ``--keepalive`` setting in the - server configuration. To disable the 120 second default, set - ``--ping-restart 0`` on the client. - - See the signals section below for more information on :code:`SIGUSR1`. - - Note that the behavior of ``SIGUSR1`` can be modified by the - ``--persist-tun``, ``--persist-key``, ``--persist-local-ip`` and - ``--persist-remote-ip`` options. - - Also note that ``--ping-exit`` and ``--ping-restart`` are mutually - exclusive and cannot be used together. - ---keepalive args - A helper directive designed to simplify the expression of ``--ping`` and - ``--ping-restart``. - - Valid syntax: - :: - - keepalive interval timeout - - This option can be used on both client and server side, but it is enough - to add this on the server side as it will push appropriate ``--ping`` - and ``--ping-restart`` options to the client. If used on both server and - client, the values pushed from server will override the client local - values. - - The ``timeout`` argument will be twice as long on the server side. This - ensures that a timeout is detected on client side before the server side - drops the connection. - - For example, ``--keepalive 10 60`` expands as follows: - :: - - if mode server: - ping 10 # Argument: interval - ping-restart 120 # Argument: timeout*2 - push "ping 10" # Argument: interval - push "ping-restart 60" # Argument: timeout - else - ping 10 # Argument: interval - ping-restart 60 # Argument: timeout - ---ping-timer-rem - Run the ``--ping-exit`` / ``--ping-restart`` timer only if we have a - remote address. Use this option if you are starting the daemon in listen - mode (i.e. without an explicit ``--remote`` peer), and you don't want to - start clocking timeouts until a remote peer connects. - ---persist-tun - Don't close and reopen TUN/TAP device or run up/down scripts across - :code:`SIGUSR1` or ``--ping-restart`` restarts. - - :code:`SIGUSR1` is a restart signal similar to :code:`SIGHUP`, but which - offers finer-grained control over reset options. - ---persist-key - Don't re-read key files across :code:`SIGUSR1` or ``--ping-restart``. - - This option can be combined with ``--user nobody`` to allow restarts - triggered by the :code:`SIGUSR1` signal. Normally if you drop root - privileges in OpenVPN, the daemon cannot be restarted since it will now - be unable to re-read protected key files. - - This option solves the problem by persisting keys across :code:`SIGUSR1` - resets, so they don't need to be re-read. - ---persist-local-ip - Preserve initially resolved local IP address and port number across - ``SIGUSR1`` or ``--ping-restart`` restarts. - ---persist-remote-ip - Preserve most recently authenticated remote IP address and port number - across :code:`SIGUSR1` or ``--ping-restart`` restarts. - ---mlock - Disable paging by calling the POSIX mlockall function. Requires that - OpenVPN be initially run as root (though OpenVPN can subsequently - downgrade its UID using the ``--user`` option). - - Using this option ensures that key material and tunnel data are never - written to disk due to virtual memory paging operations which occur - under most modern operating systems. It ensures that even if an attacker - was able to crack the box running OpenVPN, he would not be able to scan - the system swap file to recover previously used ephemeral keys, which - are used for a period of time governed by the ``--reneg`` options (see - below), then are discarded. - - The downside of using ``--mlock`` is that it will reduce the amount of - physical memory available to other applications. - ---up cmd - Run command ``cmd`` after successful TUN/TAP device open (pre ``--user`` - UID change). - - ``cmd`` consists of a path to script (or executable program), optionally - followed by arguments. The path and arguments may be single- or - double-quoted and/or escaped using a backslash, and should be separated - by one or more spaces. - - The up command is useful for specifying route commands which route IP - traffic destined for private subnets which exist at the other end of the - VPN connection into the tunnel. - - For ``--dev tun`` execute as: - :: - - cmd tun_dev tun_mtu link_mtu ifconfig_local_ip ifconfig_remote_ip [init | restart] - - For ``--dev tap`` execute as: - :: - - cmd tap_dev tap_mtu link_mtu ifconfig_local_ip ifconfig_netmask [init | restart] - - See the `Environmental Variables`_ section below for additional - parameters passed as environmental variables. - - Note that if ``cmd`` includes arguments, all OpenVPN-generated arguments - will be appended to them to build an argument list with which the - executable will be called. - - Typically, ``cmd`` will run a script to add routes to the tunnel. - - Normally the up script is called after the TUN/TAP device is opened. In - this context, the last command line parameter passed to the script will - be *init.* If the ``--up-restart`` option is also used, the up script - will be called for restarts as well. A restart is considered to be a - partial reinitialization of OpenVPN where the TUN/TAP instance is - preserved (the ``--persist-tun`` option will enable such preservation). - A restart can be generated by a SIGUSR1 signal, a ``--ping-restart`` - timeout, or a connection reset when the TCP protocol is enabled with the - ``--proto`` option. If a restart occurs, and ``--up-restart`` has been - specified, the up script will be called with *restart* as the last - parameter. - - *NOTE:* - On restart, OpenVPN will not pass the full set of environment - variables to the script. Namely, everything related to routing and - gateways will not be passed, as nothing needs to be done anyway - all - the routing setup is already in place. Additionally, the up-restart - script will run with the downgraded UID/GID settings (if configured). - - The following standalone example shows how the ``--up`` script can be - called in both an initialization and restart context. (*NOTE:* for - security reasons, don't run the following example unless UDP port 9999 - is blocked by your firewall. Also, the example will run indefinitely, so - you should abort with control-c). - - :: - - openvpn --dev tun --port 9999 --verb 4 --ping-restart 10 \ - --up 'echo up' --down 'echo down' --persist-tun \ - --up-restart - - Note that OpenVPN also provides the ``--ifconfig`` option to - automatically ifconfig the TUN device, eliminating the need to define an - ``--up`` script, unless you also want to configure routes in the - ``--up`` script. - - If ``--ifconfig`` is also specified, OpenVPN will pass the ifconfig - local and remote endpoints on the command line to the ``--up`` script so - that they can be used to configure routes such as: - - :: - - route add -net 10.0.0.0 netmask 255.255.255.0 gw $5 - ---up-delay - Delay TUN/TAP open and possible ``--up`` script execution until after - TCP/UDP connection establishment with peer. - - In ``--proto udp`` mode, this option normally requires the use of - ``--ping`` to allow connection initiation to be sensed in the absence of - tunnel data, since UDP is a "connectionless" protocol. - - On Windows, this option will delay the TAP-Win32 media state - transitioning to "connected" until connection establishment, i.e. the - receipt of the first authenticated packet from the peer. - ---down cmd - Run command ``cmd`` after TUN/TAP device close (post ``--user`` UID - change and/or ``--chroot`` ). ``cmd`` consists of a path to script (or - executable program), optionally followed by arguments. The path and - arguments may be single- or double-quoted and/or escaped using a - backslash, and should be separated by one or more spaces. - - Called with the same parameters and environmental variables as the - ``--up`` option above. - - Note that if you reduce privileges by using ``--user`` and/or - ``--group``, your ``--down`` script will also run at reduced privilege. - ---down-pre - Call ``--down`` cmd/script before, rather than after, TUN/TAP close. - ---up-restart - Enable the ``--up`` and ``--down`` scripts to be called for restarts as - well as initial program start. This option is described more fully above - in the ``--up`` option documentation. - ---setenv args - Set a custom environmental variable :code:`name=value` to pass to script. - - Valid syntaxes: - :: - - setenv name value - setenv FORWARD_COMPATIBLE 1 - setenv opt config_option - - By setting :code:`FORWARD_COMPATIBLE` to :code:`1`, the config file - syntax checking is relaxed so that unknown directives will trigger a - warning but not a fatal error, on the assumption that a given unknown - directive might be valid in future OpenVPN versions. - - This option should be used with caution, as there are good security - reasons for having OpenVPN fail if it detects problems in a config file. - Having said that, there are valid reasons for wanting new software - features to gracefully degrade when encountered by older software - versions. - - It is also possible to tag a single directive so as not to trigger a - fatal error if the directive isn't recognized. To do this, prepend the - following before the directive: ``setenv opt`` - - Versions prior to OpenVPN 2.3.3 will always ignore options set with the - ``setenv opt`` directive. - - See also ``--ignore-unknown-option`` - ---setenv-safe args - Set a custom environmental variable :code:`OPENVPN_name` to :code:`value` - to pass to scripts. - - Valid syntaxes: - :: - - setenv-safe name value - - This directive is designed to be pushed by the server to clients, and - the prepending of :code:`OPENVPN_` to the environmental variable is a - safety precaution to prevent a :code:`LD_PRELOAD` style attack from a - malicious or compromised server. - ---ignore-unknown-option args - Valid syntax: - :: - - ignore-unknown-options opt1 opt2 opt3 ... optN - - When one of options ``opt1 ... optN`` is encountered in the configuration - file the configuration file parsing does not fail if this OpenVPN version - does not support the option. Multiple ``--ignore-unknown-option`` options - can be given to support a larger number of options to ignore. - - This option should be used with caution, as there are good security - reasons for having OpenVPN fail if it detects problems in a config file. - Having said that, there are valid reasons for wanting new software - features to gracefully degrade when encountered by older software - versions. - - ``--ignore-unknown-option`` is available since OpenVPN 2.3.3. - ---script-security level - This directive offers policy-level control over OpenVPN's usage of - external programs and scripts. Lower ``level`` values are more - restrictive, higher values are more permissive. Settings for ``level``: - - :code:`0` - Strictly no calling of external programs. - - :code:`1` - (Default) Only call built-in executables such as ifconfig, - ip, route, or netsh. - - :code:`2` - Allow calling of built-in executables and user-defined - scripts. - - :code:`3` - Allow passwords to be passed to scripts via environmental - variables (potentially unsafe). - - OpenVPN releases before v2.3 also supported a ``method`` flag which - indicated how OpenVPN should call external commands and scripts. This - could be either :code:`execve` or :code:`system`. As of OpenVPN 2.3, this - flag is no longer accepted. In most \*nix environments the execve() - approach has been used without any issues. - - Some directives such as ``--up`` allow options to be passed to the - external script. In these cases make sure the script name does not - contain any spaces or the configuration parser will choke because it - can't determine where the script name ends and script options start. - - To run scripts in Windows in earlier OpenVPN versions you needed to - either add a full path to the script interpreter which can parse the - script or use the ``system`` flag to run these scripts. As of OpenVPN - 2.3 it is now a strict requirement to have full path to the script - interpreter when running non-executables files. This is not needed for - executable files, such as .exe, .com, .bat or .cmd files. For example, - if you have a Visual Basic script, you must use this syntax now: - - :: - - --up 'C:\\Windows\\System32\\wscript.exe C:\\Program\ Files\\OpenVPN\\config\\my-up-script.vbs' - - Please note the single quote marks and the escaping of the backslashes - (\\) and the space character. - - The reason the support for the :code:`system` flag was removed is due to - the security implications with shell expansions when executing scripts - via the :code:`system()` call. - ---disable-occ - Don't output a warning message if option inconsistencies are detected - between peers. An example of an option inconsistency would be where one - peer uses ``--dev tun`` while the other peer uses ``--dev tap``. - - Use of this option is discouraged, but is provided as a temporary fix in - situations where a recent version of OpenVPN must connect to an old - version. - ---user user - Change the user ID of the OpenVPN process to ``user`` after - initialization, dropping privileges in the process. This option is - useful to protect the system in the event that some hostile party was - able to gain control of an OpenVPN session. Though OpenVPN's security - features make this unlikely, it is provided as a second line of defense. - - By setting ``user`` to :code:`nobody` or somebody similarly unprivileged, - the hostile party would be limited in what damage they could cause. Of - course once you take away privileges, you cannot return them to an - OpenVPN session. This means, for example, that if you want to reset an - OpenVPN daemon with a :code:`SIGUSR1` signal (for example in response to - a DHCP reset), you should make use of one or more of the ``--persist`` - options to ensure that OpenVPN doesn't need to execute any privileged - operations in order to restart (such as re-reading key files or running - ``ifconfig`` on the TUN device). - ---group group - Similar to the ``--user`` option, this option changes the group ID of - the OpenVPN process to ``group`` after initialization. - ---cd dir - Change directory to ``dir`` prior to reading any files such as - configuration files, key files, scripts, etc. ``dir`` should be an - absolute path, with a leading "/", and without any references to the - current directory such as :code:`.` or :code:`..`. - - This option is useful when you are running OpenVPN in ``--daemon`` mode, - and you want to consolidate all of your OpenVPN control files in one - location. - ---chroot dir - Chroot to ``dir`` after initialization. ``--chroot`` essentially - redefines ``dir`` as being the top level directory tree (/). OpenVPN - will therefore be unable to access any files outside this tree. This can - be desirable from a security standpoint. - - Since the chroot operation is delayed until after initialization, most - OpenVPN options that reference files will operate in a pre-chroot - context. - - In many cases, the ``dir`` parameter can point to an empty directory, - however complications can result when scripts or restarts are executed - after the chroot operation. - - Note: The SSL library will probably need /dev/urandom to be available - inside the chroot directory ``dir``. This is because SSL libraries - occasionally need to collect fresh random. Newer linux kernels and some - BSDs implement a getrandom() or getentropy() syscall that removes the - need for /dev/urandom to be available. - ---setcon context - Apply SELinux ``context`` after initialization. This essentially - provides the ability to restrict OpenVPN's rights to only network I/O - operations, thanks to SELinux. This goes further than ``--user`` and - ``--chroot`` in that those two, while being great security features, - unfortunately do not protect against privilege escalation by - exploitation of a vulnerable system call. You can of course combine all - three, but please note that since setcon requires access to /proc you - will have to provide it inside the chroot directory (e.g. with mount - --bind). - - Since the setcon operation is delayed until after initialization, - OpenVPN can be restricted to just network-related system calls, whereas - by applying the context before startup (such as the OpenVPN one provided - in the SELinux Reference Policies) you will have to allow many things - required only during initialization. - - Like with chroot, complications can result when scripts or restarts are - executed after the setcon operation, which is why you should really - consider using the ``--persist-key`` and ``--persist-tun`` options. - ---daemon progname - Become a daemon after all initialization functions are completed. This - option will cause all message and error output to be sent to the syslog - file (such as :code:`/var/log/messages`), except for the output of - scripts and ifconfig commands, which will go to :code:`/dev/null` unless - otherwise redirected. The syslog redirection occurs immediately at the - point that ``--daemon`` is parsed on the command line even though the - daemonization point occurs later. If one of the ``--log`` options is - present, it will supersede syslog redirection. - - The optional ``progname`` parameter will cause OpenVPN to report its - program name to the system logger as ``progname``. This can be useful in - linking OpenVPN messages in the syslog file with specific tunnels. When - unspecified, ``progname`` defaults to "openvpn". - - When OpenVPN is run with the ``--daemon`` option, it will try to delay - daemonization until the majority of initialization functions which are - capable of generating fatal errors are complete. This means that - initialization scripts can test the return status of the openvpn command - for a fairly reliable indication of whether the command has correctly - initialized and entered the packet forwarding event loop. - - In OpenVPN, the vast majority of errors which occur after initialization - are non-fatal. - - Note: as soon as OpenVPN has daemonized, it can not ask for usernames, - passwords, or key pass phrases anymore. This has certain consequences, - namely that using a password-protected private key will fail unless the - ``--askpass`` option is used to tell OpenVPN to ask for the pass phrase - (this requirement is new in v2.3.7, and is a consequence of calling - daemon() before initializing the crypto layer). - - Further, using ``--daemon`` together with ``--auth-user-pass`` (entered - on console) and ``--auth-nocache`` will fail as soon as key - renegotiation (and reauthentication) occurs. - ---syslog progname - Direct log output to system logger, but do not become a daemon. See - ``--daemon`` directive above for description of ``progname`` parameter. - ---errors-to-stderr - Output errors to stderr instead of stdout unless log output is - redirected by one of the ``--log`` options. - ---passtos - Set the TOS field of the tunnel packet to what the payload's TOS is. - ---inetd args - Valid syntaxes: - :: - - inetd - inetd wait - inetd nowait - inetd wait progname - - Use this option when OpenVPN is being run from the inetd or ``xinetd``\(8) - server. - - The :code:`wait` and :code:`nowait` option must match what is specified - in the inetd/xinetd config file. The :code:`nowait` mode can only be used - with ``--proto tcp-server`` The default is :code:`wait`. The - :code:`nowait` mode can be used to instantiate the OpenVPN daemon as a - classic TCP server, where client connection requests are serviced on a - single port number. For additional information on this kind of - configuration, see the OpenVPN FAQ: - https://community.openvpn.net/openvpn/wiki/325-openvpn-as-a--forking-tcp-server-which-can-service-multiple-clients-over-a-single-tcp-port - - This option precludes the use of ``--daemon``, ``--local`` or - ``--remote``. Note that this option causes message and error output to - be handled in the same way as the ``--daemon`` option. The optional - ``progname`` parameter is also handled exactly as in ``--daemon``. - - Also note that in ``wait`` mode, each OpenVPN tunnel requires a separate - TCP/UDP port and a separate inetd or xinetd entry. See the OpenVPN 1.x - HOWTO for an example on using OpenVPN with xinetd: - https://openvpn.net/community-resources/1xhowto/ - ---log file - Output logging messages to ``file``, including output to stdout/stderr - which is generated by called scripts. If ``file`` already exists it will - be truncated. This option takes effect immediately when it is parsed in - the command line and will supersede syslog output if ``--daemon`` or - ``--inetd`` is also specified. This option is persistent over the entire - course of an OpenVPN instantiation and will not be reset by - :code:`SIGHUP`, :code:`SIGUSR1`, or ``--ping-restart``. - - Note that on Windows, when OpenVPN is started as a service, logging - occurs by default without the need to specify this option. - ---log-append file - Append logging messages to ``file``. If ``file`` does not exist, it will - be created. This option behaves exactly like ``--log`` except that it - appends to rather than truncating the log file. - ---suppress-timestamps - Avoid writing timestamps to log messages, even when they otherwise would - be prepended. In particular, this applies to log messages sent to - stdout. - ---machine-readable-output - Always write timestamps and message flags to log messages, even when - they otherwise would not be prefixed. In particular, this applies to log - messages sent to stdout. - ---writepid file - Write OpenVPN's main process ID to ``file``. - ---nice n - Change process priority after initialization (``n`` greater than 0 is - lower priority, ``n`` less than zero is higher priority). - ---fast-io - (Experimental) Optimize TUN/TAP/UDP I/O writes by avoiding a call to - poll/epoll/select prior to the write operation. The purpose of such a - call would normally be to block until the device or socket is ready to - accept the write. Such blocking is unnecessary on some platforms which - don't support write blocking on UDP sockets or TUN/TAP devices. In such - cases, one can optimize the event loop by avoiding the poll/epoll/select - call, improving CPU efficiency by 5% to 10%. - - This option can only be used on non-Windows systems, when ``--proto - udp`` is specified, and when ``--shaper`` is NOT specified. - ---multihome - Configure a multi-homed UDP server. This option needs to be used when a - server has more than one IP address (e.g. multiple interfaces, or - secondary IP addresses), and is not using ``--local`` to force binding - to one specific address only. This option will add some extra lookups to - the packet path to ensure that the UDP reply packets are always sent - from the address that the client is talking to. This is not supported on - all platforms, and it adds more processing, so it's not enabled by - default. - - *Notes:* - - This option is only relevant for UDP servers. - - If you do an IPv6+IPv4 dual-stack bind on a Linux machine with - multiple IPv4 address, connections to IPv4 addresses will not - work right on kernels before 3.15, due to missing kernel - support for the IPv4-mapped case (some distributions have - ported this to earlier kernel versions, though). - ---echo parms - Echo ``parms`` to log output. - - Designed to be used to send messages to a controlling application which - is receiving the OpenVPN log output. - ---remap-usr1 signal - Control whether internally or externally generated :code:`SIGUSR1` signals - are remapped to :code:`SIGHUP` (restart without persisting state) or - SIGTERM (exit). - - ``signal`` can be set to :code:`SIGHUP` or :code:`SIGTERM`. By default, - no remapping occurs. - ---verb n - Set output verbosity to ``n`` (default :code:`1`). Each level shows all - info from the previous levels. Level :code:`3` is recommended if you want - a good summary of what's happening without being swamped by output. - - :code:`0` - No output except fatal errors. - - :code:`1` to :code:`4` - Normal usage range. - - :code:`5` - Outputs :code:`R` and :code:`W` characters to the console for - each packet read and write, uppercase is used for TCP/UDP - packets and lowercase is used for TUN/TAP packets. - - :code:`6` to :code:`11` - Debug info range (see :code:`errlevel.h` in the source code for - additional information on debug levels). - ---status args - Write operational status to ``file`` every ``n`` seconds. - - Valid syntaxes: - :: - - status file - status file n - - Status can also be written to the syslog by sending a :code:`SIGUSR2` - signal. - - With multi-client capability enabled on a server, the status file - includes a list of clients and a routing table. The output format can be - controlled by the ``--status-version`` option in that case. - - For clients or instances running in point-to-point mode, it will contain - the traffic statistics. - ---status-version n - Set the status file format version number to ``n``. - - This only affects the status file on servers with multi-client - capability enabled. Valid status version values: - - :code:`1` - Traditional format (default). The client list contains the - following fields comma-separated: Common Name, Real Address, Bytes - Received, Bytes Sent, Connected Since. - - :code:`2` - A more reliable format for external processing. Compared to - version :code:`1`, the client list contains some additional fields: - Virtual Address, Virtual IPv6 Address, Username, Client ID, Peer ID, - Data Channel Cipher. Future versions may extend the number of fields. - - :code:`3` - Identical to :code:`2`, but fields are tab-separated. - ---mute n - Log at most ``n`` consecutive messages in the same category. This is - useful to limit repetitive logging of similar message types. - ---compress algorithm - Enable a compression algorithm. - - The ``algorithm`` parameter may be :code:`lzo`, :code:`lz4`, or empty. - LZO and LZ4 are different compression algorithms, with LZ4 generally - offering the best performance with least CPU usage. For backwards - compatibility with OpenVPN versions before v2.4, use :code:`lzo` (which - is identical to the older option ``--comp-lzo yes``). - - If the ``algorithm`` parameter is empty, compression will be turned off, - but the packet framing for compression will still be enabled, allowing a - different setting to be pushed later. - - ***Security Considerations*** - - Compression and encryption is a tricky combination. If an attacker knows - or is able to control (parts of) the plaintext of packets that contain - secrets, the attacker might be able to extract the secret if compression - is enabled. See e.g. the CRIME and BREACH attacks on TLS which also - leverage compression to break encryption. If you are not entirely sure - that the above does not apply to your traffic, you are advised to - *not* enable compression. - ---comp-lzo mode - *DEPRECATED* This option will be removed in a future OpenVPN release. - Use the newer ``--compress`` instead. - - Use LZO compression -- may add up to 1 byte per packet for incompressible - data. ``mode`` may be :code:`yes`, :code:`no`, or :code:`adaptive` - (default). - - In a server mode setup, it is possible to selectively turn compression - on or off for individual clients. - - First, make sure the client-side config file enables selective - compression by having at least one ``--comp-lzo`` directive, such as - ``--comp-lzo no``. This will turn off compression by default, but allow - a future directive push from the server to dynamically change the - :code:`on`/:code:`off`/:code:`adaptive` setting. - - Next in a ``--client-config-dir`` file, specify the compression setting - for the client, for example: - :: - - comp-lzo yes - push "comp-lzo yes" - - The first line sets the ``comp-lzo`` setting for the server side of the - link, the second sets the client side. - ---comp-noadapt - When used in conjunction with ``--comp-lzo``, this option will disable - OpenVPN's adaptive compression algorithm. Normally, adaptive compression - is enabled with ``--comp-lzo``. - - Adaptive compression tries to optimize the case where you have - compression enabled, but you are sending predominantly incompressible - (or pre-compressed) packets over the tunnel, such as an FTP or rsync - transfer of a large, compressed file. With adaptive compression, OpenVPN - will periodically sample the compression process to measure its - efficiency. If the data being sent over the tunnel is already - compressed, the compression efficiency will be very low, triggering - openvpn to disable compression for a period of time until the next - re-sample test. - ---management args - Enable a management server on a ``socket-name`` Unix socket on those - platforms supporting it, or on a designated TCP port. - - Valid syntaxes: - :: - - management socket-name unix # - management socket-name unix pw-file # (recommended) - management IP port # (INSECURE) - management IP port pw-file # - - ``pw-file``, if specified, is a password file where the password must - be on first line. Instead of a filename it can use the keyword stdin - which will prompt the user for a password to use when OpenVPN is - starting. - - For unix sockets, the default behaviour is to create a unix domain - socket that may be connected to by any process. Use the - ``--management-client-user`` and ``--management-client-group`` - directives to restrict access. - - The management interface provides a special mode where the TCP - management link can operate over the tunnel itself. To enable this mode, - set IP to ``tunnel``. Tunnel mode will cause the management interface to - listen for a TCP connection on the local VPN address of the TUN/TAP - interface. - - ***BEWARE*** of enabling the management interface over TCP. In these cases - you should *ALWAYS* make use of ``pw-file`` to password protect the - management interface. Any user who can connect to this TCP ``IP:port`` - will be able to manage and control (and interfere with) the OpenVPN - process. It is also strongly recommended to set IP to 127.0.0.1 - (localhost) to restrict accessibility of the management server to local - clients. - - While the management port is designed for programmatic control of - OpenVPN by other applications, it is possible to telnet to the port, - using a telnet client in "raw" mode. Once connected, type :code:`help` - for a list of commands. - - For detailed documentation on the management interface, see the - *management-notes.txt* file in the management folder of the OpenVPN - source distribution. - ---management-client - Management interface will connect as a TCP/unix domain client to - ``IP:port`` specified by ``--management`` rather than listen as a TCP - server or on a unix domain socket. - - If the client connection fails to connect or is disconnected, a SIGTERM - signal will be generated causing OpenVPN to quit. - ---management-query-passwords - Query management channel for private key password and - ``--auth-user-pass`` username/password. Only query the management - channel for inputs which ordinarily would have been queried from the - console. - ---management-query-proxy - Query management channel for proxy server information for a specific - ``--remote`` (client-only). - ---management-query-remote - Allow management interface to override ``--remote`` directives - (client-only). - ---management-external-key args - Allows usage for external private key file instead of ``--key`` option - (client-only). - - Valid syntaxes: - :: - - management-external-key - management-external-key nopadding - management-external-key pkcs1 - management-external-key nopadding pkcs1 - - The optional parameters :code:`nopadding` and :code:`pkcs1` signal - support for different padding algorithms. See - :code:`doc/mangement-notes.txt` for a complete description of this - feature. - ---management-external-cert certificate-hint - Allows usage for external certificate instead of ``--cert`` option - (client-only). ``certificate-hint`` is an arbitrary string which is - passed to a management interface client as an argument of - *NEED-CERTIFICATE* notification. Requires ``--management-external-key``. - ---management-forget-disconnect - Make OpenVPN forget passwords when management session disconnects. - - This directive does not affect the ``--http-proxy`` username/password. - It is always cached. - ---management-hold - Start OpenVPN in a hibernating state, until a client of the management - interface explicitly starts it with the :code:`hold release` command. - ---management-signal - Send SIGUSR1 signal to OpenVPN if management session disconnects. This - is useful when you wish to disconnect an OpenVPN session on user logoff. - For ``--management-client`` this option is not needed since a disconnect - will always generate a :code:`SIGTERM`. - ---management-log-cache n - Cache the most recent ``n`` lines of log file history for usage by the - management channel. - ---management-up-down - Report tunnel up/down events to management interface. - ---management-client-auth - Gives management interface client the responsibility to authenticate - clients after their client certificate has been verified. See - :code:`management-notes.txt` in OpenVPN distribution for detailed notes. - ---management-client-pf - Management interface clients must specify a packet filter file for each - connecting client. See :code:`management-notes.txt` in OpenVPN - distribution for detailed notes. - ---management-client-user u - When the management interface is listening on a unix domain socket, only - allow connections from user ``u``. - ---management-client-group g - When the management interface is listening on a unix domain socket, only - allow connections from group ``g``. - ---plugin args - Loads a given plug-in module. The ``module-name`` need to be the first - argument, indicating the plug-in to load. The second argument is an - optional init string which will be passed directly to the plug-in. - If the init consists of multiple arguments it must be enclosed in - double-quotes (\"). Multiple plugin modules may be loaded into one - OpenVPN process. - - The ``module-name`` argument can be just a filename or a filename - with a relative or absolute path. The format of the filename and path - defines if the plug-in will be loaded from a default plug-in directory - or outside this directory. - :: - - --plugin path Effective directory used - ===================== ============================= - myplug.so DEFAULT_DIR/myplug.so - subdir/myplug.so DEFAULT_DIR/subdir/myplug.so - ./subdir/myplug.so CWD/subdir/myplug.so - /usr/lib/my/plug.so /usr/lib/my/plug.so - - - DEFAULT\_DIR is replaced by the default plug-in directory, which is - configured at the build time of OpenVPN. CWD is the current directory - where OpenVPN was started or the directory OpenVPN have switched into - via the ``--cd`` option before the ``--plugin`` option. - - For more information and examples on how to build OpenVPN plug-in - modules, see the README file in the ``plugin`` folder of the OpenVPN - source distribution. - - If you are using an RPM install of OpenVPN, see - :code:`/usr/share/openvpn/plugin`. The documentation is in ``doc`` and - the actual plugin modules are in ``lib``. - - Multiple plugin modules can be cascaded, and modules can be used in - tandem with scripts. The modules will be called by OpenVPN in the order - that they are declared in the config file. If both a plugin and script - are configured for the same callback, the script will be called last. If - the return code of the module/script controls an authentication function - (such as tls-verify, auth-user-pass-verify, or client-connect), then - every module and script must return success (:code:`0`) in order for the - connection to be authenticated. - ---keying-material-exporter args - Save Exported Keying Material [RFC5705] of len bytes (must be between 16 - and 4095 bytes) using ``label`` in environment - (:code:`exported_keying_material`) for use by plugins in - :code:`OPENVPN_PLUGIN_TLS_FINAL` callback. - - Valid syntax: - :: - - keying-material-exporter label len - - Note that exporter ``labels`` have the potential to collide with existing - PRF labels. In order to prevent this, labels *MUST* begin with - :code:`EXPORTER`. - - -Server Mode ------------ - -Starting with OpenVPN 2.0, a multi-client TCP/UDP server mode is -supported, and can be enabled with the ``--mode server`` option. In -server mode, OpenVPN will listen on a single port for incoming client -connections. All client connections will be routed through a single tun -or tap interface. This mode is designed for scalability and should be -able to support hundreds or even thousands of clients on sufficiently -fast hardware. SSL/TLS authentication must be used in this mode. - ---server args - A helper directive designed to simplify the configuration of OpenVPN's - server mode. This directive will set up an OpenVPN server which will - allocate addresses to clients out of the given network/netmask. The - server itself will take the :code:`.1` address of the given network for - use as the server-side endpoint of the local TUN/TAP interface. If the - optional :code:`nopool` flag is given, no dynamic IP address pool will - prepared for VPN clients. - - Valid syntax: - :: - - server network netmask [nopool] - - For example, ``--server 10.8.0.0 255.255.255.0`` expands as follows: - :: - - mode server - tls-server - push "topology [topology]" - - if dev tun AND (topology == net30 OR topology == p2p): - ifconfig 10.8.0.1 10.8.0.2 - if !nopool: - ifconfig-pool 10.8.0.4 10.8.0.251 - route 10.8.0.0 255.255.255.0 - if client-to-client: - push "route 10.8.0.0 255.255.255.0" - else if topology == net30: - push "route 10.8.0.1" - - if dev tap OR (dev tun AND topology == subnet): - ifconfig 10.8.0.1 255.255.255.0 - if !nopool: - ifconfig-pool 10.8.0.2 10.8.0.253 255.255.255.0 - push "route-gateway 10.8.0.1" - if route-gateway unset: - route-gateway 10.8.0.2 - - Don't use ``--server`` if you are ethernet bridging. Use - ``--server-bridge`` instead. - ---server-bridge args - A helper directive similar to ``--server`` which is designed to simplify - the configuration of OpenVPN's server mode in ethernet bridging - configurations. - - Valid syntaxes: - :: - - server-bridge gateway netmask pool-start-IP pool-end-IP - server-bridge [nogw] - - If ``--server-bridge`` is used without any parameters, it will enable a - DHCP-proxy mode, where connecting OpenVPN clients will receive an IP - address for their TAP adapter from the DHCP server running on the - OpenVPN server-side LAN. Note that only clients that support the binding - of a DHCP client with the TAP adapter (such as Windows) can support this - mode. The optional :code:`nogw` flag (advanced) indicates that gateway - information should not be pushed to the client. - - To configure ethernet bridging, you must first use your OS's bridging - capability to bridge the TAP interface with the ethernet NIC interface. - For example, on Linux this is done with the :code:`brctl` tool, and with - Windows XP it is done in the Network Connections Panel by selecting the - ethernet and TAP adapters and right-clicking on "Bridge Connections". - - Next you you must manually set the IP/netmask on the bridge interface. - The ``gateway`` and ``netmask`` parameters to ``--server-bridge`` can be - set to either the IP/netmask of the bridge interface, or the IP/netmask - of the default gateway/router on the bridged subnet. - - Finally, set aside a IP range in the bridged subnet, denoted by - ``pool-start-IP`` and ``pool-end-IP``, for OpenVPN to allocate to - connecting clients. - - For example, ``server-bridge 10.8.0.4 255.255.255.0 10.8.0.128 - 10.8.0.254`` expands as follows: - :: - - mode server - tls-server - - ifconfig-pool 10.8.0.128 10.8.0.254 255.255.255.0 - push "route-gateway 10.8.0.4" - - In another example, ``--server-bridge`` (without parameters) expands as - follows: - :: - - mode server - tls-server - - push "route-gateway dhcp" - - Or ``--server-bridge nogw`` expands as follows: - :: - - mode server - tls-server - ---push option - Push a config file option back to the client for remote execution. Note - that ``option`` must be enclosed in double quotes (:code:`""`). The - client must specify ``--pull`` in its config file. The set of options - which can be pushed is limited by both feasibility and security. Some - options such as those which would execute scripts are banned, since they - would effectively allow a compromised server to execute arbitrary code - on the client. Other options such as TLS or MTU parameters cannot be - pushed because the client needs to know them before the connection to the - server can be initiated. - - This is a partial list of options which can currently be pushed: - ``--route``, ``--route-gateway``, ``--route-delay``, - ``--redirect-gateway``, ``--ip-win32``, ``--dhcp-option``, - ``--inactive``, ``--ping``, ``--ping-exit``, ``--ping-restart``, - ``--setenv``, ``--auth-token``, ``--persist-key``, ``--persist-tun``, - ``--echo``, ``--comp-lzo``, ``--socket-flags``, ``--sndbuf``, - ``--rcvbuf`` - ---push-reset - Don't inherit the global push list for a specific client instance. - Specify this option in a client-specific context such as with a - ``--client-config-dir`` configuration file. This option will ignore - ``--push`` options at the global config file level. - ---push-remove opt - Selectively remove all ``--push`` options matching "opt" from the option - list for a client. ``opt`` is matched as a substring against the whole - option string to-be-pushed to the client, so ``--push-remove route`` - would remove all ``--push route ...`` and ``--push route-ipv6 ...`` - statements, while ``--push-remove "route-ipv6 2001:"`` would only remove - IPv6 routes for :code:`2001:...` networks. - - ``--push-remove`` can only be used in a client-specific context, like in - a ``--client-config-dir`` file, or ``--client-connect`` script or plugin - -- similar to ``--push-reset``, just more selective. - - *NOTE*: to *change* an option, ``--push-remove`` can be used to first - remove the old value, and then add a new ``--push`` option with the new - value. - - *NOTE 2*: due to implementation details, 'ifconfig' and 'ifconfig-ipv6' - can only be removed with an exact match on the option ( - :code:`push-remove ifconfig`), no substring matching and no matching on - the IPv4/IPv6 address argument is possible. - ---push-peer-info - Push additional information about the client to server. The following - data is always pushed to the server: - - :code:`IV_VER=<version>` - The client OpenVPN version - - :code:`IV_PLAT=[linux|solaris|openbsd|mac|netbsd|freebsd|win]` - The client OS platform - - :code:`IV_LZO_STUB=1` - If client was built with LZO stub capability - - :code:`IV_LZ4=1` - If the client supports LZ4 compressions. - - :code:`IV_PROTO=2` - If the client supports peer-id floating mechanism - - :code:`IV_NCP=2` - Negotiable ciphers, client supports ``--cipher`` pushed by - the server, a value of 2 or greater indicates client supports - *AES-GCM-128* and *AES-GCM-256*. - - :code:`IV_CIPHERS=<ncp-ciphers>` - The client pushes the list of configured ciphers with the - ``--ciphers`` option to the server. - - :code:`IV_GUI_VER=<gui_id> <version>` - The UI version of a UI if one is running, for example - :code:`de.blinkt.openvpn 0.5.47` for the Android app. - - When ``--push-peer-info`` is enabled the additional information consists - of the following data: - - :code:`IV_HWADDR=<mac address>` - The MAC address of clients default gateway - - :code:`IV_SSL=<version string>` - The ssl version used by the client, e.g. - :code:`OpenSSL 1.0.2f 28 Jan 2016`. - - :code:`IV_PLAT_VER=x.y` - The version of the operating system, e.g. 6.1 for Windows 7. - - :code:`UV_<name>=<value>` - Client environment variables whose names start with - :code:`UV_` - ---disable - Disable a particular client (based on the common name) from connecting. - Don't use this option to disable a client due to key or password - compromise. Use a CRL (certificate revocation list) instead (see the - ``--crl-verify`` option). - - This option must be associated with a specific client instance, which - means that it must be specified either in a client instance config file - using ``--client-config-dir`` or dynamically generated using a - ``--client-connect`` script. - ---ifconfig-pool args - Set aside a pool of subnets to be dynamically allocated to connecting - clients, similar to a DHCP server. - - Valid syntax: - :: - - ifconfig-pool start-IP end-IP [netmask] - - For tun-style tunnels, each client - will be given a /30 subnet (for interoperability with Windows clients). - For tap-style tunnels, individual addresses will be allocated, and the - optional ``netmask`` parameter will also be pushed to clients. - ---ifconfig-pool-persist args - Persist/unpersist ifconfig-pool data to ``file``, at ``seconds`` - intervals (default :code:`600`), as well as on program startup and shutdown. - - Valid syntax: - :: - - ifconfig-pool-persist file [seconds] - - The goal of this option is to provide a long-term association between - clients (denoted by their common name) and the virtual IP address - assigned to them from the ifconfig-pool. Maintaining a long-term - association is good for clients because it allows them to effectively - use the ``--persist-tun`` option. - - ``file`` is a comma-delimited ASCII file, formatted as - :code:`<Common-Name>,<IP-address>`. - - If ``seconds`` = :code:`0`, ``file`` will be treated as read-only. This - is useful if you would like to treat ``file`` as a configuration file. - - Note that the entries in this file are treated by OpenVPN as - *suggestions* only, based on past associations between a common name and - IP address. They do not guarantee that the given common name will always - receive the given IP address. If you want guaranteed assignment, use - ``--ifconfig-push`` - ---ifconfig-push args - Push virtual IP endpoints for client tunnel, overriding the - ``--ifconfig-pool`` dynamic allocation. - - Valid syntax: - :: - - ifconfig-push local remote-netmask [alias] - - The parameters ``local`` and ``remote-netmask`` are set according to the - ``--ifconfig`` directive which you want to execute on the client machine - to configure the remote end of the tunnel. Note that the parameters - ``local`` and ``remote-netmask`` are from the perspective of the client, - not the server. They may be DNS names rather than IP addresses, in which - case they will be resolved on the server at the time of client - connection. - - The optional ``alias`` parameter may be used in cases where NAT causes - the client view of its local endpoint to differ from the server view. In - this case ``local/remote-netmask`` will refer to the server view while - ``alias/remote-netmask`` will refer to the client view. - - This option must be associated with a specific client instance, which - means that it must be specified either in a client instance config file - using ``--client-config-dir`` or dynamically generated using a - ``--client-connect`` script. - - Remember also to include a ``--route`` directive in the main OpenVPN - config file which encloses ``local``, so that the kernel will know to - route it to the server's TUN/TAP interface. - - OpenVPN's internal client IP address selection algorithm works as - follows: - - 1. Use ``--client-connect script`` generated file for static IP - (first choice). - - 2. Use ``--client-config-dir`` file for static IP (next choice). - - 3. Use ``--ifconfig-pool`` allocation for dynamic IP (last - choice). - ---iroute args - Generate an internal route to a specific client. The ``netmask`` - parameter, if omitted, defaults to :code:`255.255.255.255`. - - Valid syntax: - :: - - iroute network [netmask] - - This directive can be used to route a fixed subnet from the server to a - particular client, regardless of where the client is connecting from. - Remember that you must also add the route to the system routing table as - well (such as by using the ``--route`` directive). The reason why two - routes are needed is that the ``--route`` directive routes the packet - from the kernel to OpenVPN. Once in OpenVPN, the ``--iroute`` directive - routes to the specific client. - - This option must be specified either in a client instance config file - using ``--client-config-dir`` or dynamically generated using a - ``--client-connect`` script. - - The ``--iroute`` directive also has an important interaction with - ``--push "route ..."``. ``--iroute`` essentially defines a subnet which - is owned by a particular client (we will call this client *A*). If you - would like other clients to be able to reach *A*'s subnet, you can use - ``--push "route ..."`` together with ``--client-to-client`` to effect - this. In order for all clients to see *A*'s subnet, OpenVPN must push - this route to all clients EXCEPT for *A*, since the subnet is already - owned by *A*. OpenVPN accomplishes this by not not pushing a route to - a client if it matches one of the client's iroutes. - ---client-to-client - Because the OpenVPN server mode handles multiple clients through a - single tun or tap interface, it is effectively a router. The - ``--client-to-client`` flag tells OpenVPN to internally route - client-to-client traffic rather than pushing all client-originating - traffic to the TUN/TAP interface. - - When this option is used, each client will "see" the other clients which - are currently connected. Otherwise, each client will only see the - server. Don't use this option if you want to firewall tunnel traffic - using custom, per-client rules. - ---duplicate-cn - Allow multiple clients with the same common name to concurrently - connect. In the absence of this option, OpenVPN will disconnect a client - instance upon connection of a new client having the same common name. - ---client-connect cmd - Run command ``cmd`` on client connection. - - ``cmd`` consists of a path to script (or executable program), optionally - followed by arguments. The path and arguments may be single- or - double-quoted and/or escaped using a backslash, and should be separated - by one or more spaces. - - The command is passed the common name and IP address of the - just-authenticated client as environmental variables (see environmental - variable section below). The command is also passed the pathname of a - freshly created temporary file as the last argument (after any arguments - specified in ``cmd`` ), to be used by the command to pass dynamically - generated config file directives back to OpenVPN. - - If the script wants to generate a dynamic config file to be applied on - the server when the client connects, it should write it to the file - named by the last argument. - - See the ``--client-config-dir`` option below for options which can be - legally used in a dynamically generated config file. - - Note that the return value of ``script`` is significant. If ``script`` - returns a non-zero error status, it will cause the client to be - disconnected. - ---client-disconnect cmd - Like ``--client-connect`` but called on client instance shutdown. Will - not be called unless the ``--client-connect`` script and plugins (if - defined) were previously called on this instance with successful (0) - status returns. - - The exception to this rule is if the ``--client-disconnect`` command or - plugins are cascaded, and at least one client-connect function - succeeded, then ALL of the client-disconnect functions for scripts and - plugins will be called on client instance object deletion, even in cases - where some of the related client-connect functions returned an error - status. - - The ``--client-disconnect`` command is passed the same pathname as the - corresponding ``--client-connect`` command as its last argument (after - any arguments specified in ``cmd``). - ---client-config-dir dir - Specify a directory ``dir`` for custom client config files. After a - connecting client has been authenticated, OpenVPN will look in this - directory for a file having the same name as the client's X509 common - name. If a matching file exists, it will be opened and parsed for - client-specific configuration options. If no matching file is found, - OpenVPN will instead try to open and parse a default file called - "DEFAULT", which may be provided but is not required. Note that the - configuration files must be readable by the OpenVPN process after it has - dropped it's root privileges. - - This file can specify a fixed IP address for a given client using - ``--ifconfig-push``, as well as fixed subnets owned by the client using - ``--iroute``. - - One of the useful properties of this option is that it allows client - configuration files to be conveniently created, edited, or removed while - the server is live, without needing to restart the server. - - The following options are legal in a client-specific context: ``--push``, - ``--push-reset``, ``--push-remove``, ``--iroute``, ``--ifconfig-push``, - ``--vlan-pvid`` and ``--config``. - ---ccd-exclusive - Require, as a condition of authentication, that a connecting client has - a ``--client-config-dir`` file. - ---tmp-dir dir - Specify a directory ``dir`` for temporary files. This directory will be - used by openvpn processes and script to communicate temporary data with - openvpn main process. Note that the directory must be writable by the - OpenVPN process after it has dropped it's root privileges. - - This directory will be used by in the following cases: - - * ``--client-connect`` scripts to dynamically generate client-specific - configuration files. - - * :code:`OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY` plugin hook to return - success/failure via ``auth_control_file`` when using deferred auth - method - - * :code:`OPENVPN_PLUGIN_ENABLE_PF` plugin hook to pass filtering rules - via ``pf_file`` - ---hash-size args - Set the size of the real address hash table to ``r`` and the virtual - address table to ``v``. - - Valid syntax: - :: - - hash-size r v - - By default, both tables are sized at 256 buckets. - ---bcast-buffers n - Allocate ``n`` buffers for broadcast datagrams (default :code:`256`). - ---tcp-queue-limit n - Maximum number of output packets queued before TCP (default :code:`64`). - - When OpenVPN is tunneling data from a TUN/TAP device to a remote client - over a TCP connection, it is possible that the TUN/TAP device might - produce data at a faster rate than the TCP connection can support. When - the number of output packets queued before sending to the TCP socket - reaches this limit for a given client connection, OpenVPN will start to - drop outgoing packets directed at this client. - ---tcp-nodelay - This macro sets the :code:`TCP_NODELAY` socket flag on the server as well - as pushes it to connecting clients. The :code:`TCP_NODELAY` flag disables - the Nagle algorithm on TCP sockets causing packets to be transmitted - immediately with low latency, rather than waiting a short period of time - in order to aggregate several packets into a larger containing packet. - In VPN applications over TCP, :code:`TCP_NODELAY` is generally a good - latency optimization. - - The macro expands as follows: - :: - - if mode server: - socket-flags TCP_NODELAY - push "socket-flags TCP_NODELAY" - ---max-clients n - Limit server to a maximum of ``n`` concurrent clients. - ---max-routes-per-client n - Allow a maximum of ``n`` internal routes per client (default - :code:`256`). This is designed to help contain DoS attacks where an - authenticated client floods the server with packets appearing to come - from many unique MAC addresses, forcing the server to deplete virtual - memory as its internal routing table expands. This directive can be used - in a ``--client-config-dir`` file or auto-generated by a - ``--client-connect`` script to override the global value for a particular - client. - - Note that this directive affects OpenVPN's internal routing table, not - the kernel routing table. - ---stale-routes-check args - Remove routes haven't had activity for ``n`` seconds (i.e. the ageing - time). This check is ran every ``t`` seconds (i.e. check interval). - - Valid syntax: - :: - - stale-routes-check n [t] - - If ``t`` is not present it defaults to ``n``. - - This option helps to keep the dynamic routing table small. See also - ``--max-routes-per-client`` - ---connect-freq args - Allow a maximum of ``n`` new connections per ``sec`` seconds from - clients. - - Valid syntax: - :: - - connect-freq n sec - - This is designed to contain DoS attacks which flood the server - with connection requests using certificates which will ultimately fail - to authenticate. - - This is an imperfect solution however, because in a real DoS scenario, - legitimate connections might also be refused. - - For the best protection against DoS attacks in server mode, use - ``--proto udp`` and either ``--tls-auth`` or ``--tls-crypt``. - ---learn-address cmd - Run command ``cmd`` to validate client virtual addresses or routes. - - ``cmd`` consists of a path to script (or executable program), optionally - followed by arguments. The path and arguments may be single- or - double-quoted and/or escaped using a backslash, and should be separated - by one or more spaces. - - Three arguments will be appended to any arguments in ``cmd`` as follows: - - :code:`$1` - [operation] - :code:`"add"`, :code:`"update"`, or :code:`"delete"` based on whether - or not the address is being added to, modified, or deleted from - OpenVPN's internal routing table. - - :code:`$2` - [address] - The address being learned or unlearned. This can be an IPv4 address - such as :code:`"198.162.10.14"`, an IPv4 subnet such as - :code:`"198.162.10.0/24"`, or an ethernet MAC address (when - ``--dev tap`` is being used) such as :code:`"00:FF:01:02:03:04"`. - - :code:`$3` - [common name] - The common name on the certificate associated with the client linked - to this address. Only present for :code:`"add"` or :code:`"update"` - operations, not :code:`"delete"`. - - On :code:`"add"` or :code:`"update"` methods, if the script returns - a failure code (non-zero), OpenVPN will reject the address and will not - modify its internal routing table. - - Normally, the ``cmd`` script will use the information provided above to - set appropriate firewall entries on the VPN TUN/TAP interface. Since - OpenVPN provides the association between virtual IP or MAC address and - the client's authenticated common name, it allows a user-defined script - to configure firewall access policies with regard to the client's - high-level common name, rather than the low level client virtual - addresses. - ---auth-user-pass-verify args - Require the client to provide a username/password (possibly in addition - to a client certificate) for authentication. - - Valid syntax: - :: - - auth-user-pass cmd method - - OpenVPN will run command ``cmd`` to validate the username/password - provided by the client. - - ``cmd`` consists of a path to script (or executable program), optionally - followed by arguments. The path and arguments may be single- or - double-quoted and/or escaped using a backslash, and should be separated - by one or more spaces. - - If ``method`` is set to :code:`via-env`, OpenVPN will call ``script`` - with the environmental variables :code:`username` and :code:`password` - set to the username/password strings provided by the client. *Beware* - that this method is insecure on some platforms which make the environment - of a process publicly visible to other unprivileged processes. - - If ``method`` is set to :code:`via-file`, OpenVPN will write the username - and password to the first two lines of a temporary file. The filename - will be passed as an argument to ``script``, and the file will be - automatically deleted by OpenVPN after the script returns. The location - of the temporary file is controlled by the ``--tmp-dir`` option, and - will default to the current directory if unspecified. For security, - consider setting ``--tmp-dir`` to a volatile storage medium such as - :code:`/dev/shm` (if available) to prevent the username/password file - from touching the hard drive. - - The script should examine the username and password, returning a success - exit code (:code:`0`) if the client's authentication request is to be - accepted, or a failure code (:code:`1`) to reject the client. - - This directive is designed to enable a plugin-style interface for - extending OpenVPN's authentication capabilities. - - To protect against a client passing a maliciously formed username or - password string, the username string must consist only of these - characters: alphanumeric, underbar (':code:`_`'), dash (':code:`-`'), - dot (':code:`.`'), or at (':code:`@`'). The password string can consist - of any printable characters except for CR or LF. Any illegal characters - in either the username or password string will be converted to - underbar (':code:`_`'). - - Care must be taken by any user-defined scripts to avoid creating a - security vulnerability in the way that these strings are handled. Never - use these strings in such a way that they might be escaped or evaluated - by a shell interpreter. - - For a sample script that performs PAM authentication, see - :code:`sample-scripts/auth-pam.pl` in the OpenVPN source distribution. - ---auth-gen-token args - Returns an authentication token to successfully authenticated clients. - - Valid syntax: - :: - - auth-gen-token [lifetime] [external-auth] - - After successful user/password authentication, the OpenVPN server will - with this option generate a temporary authentication token and push that - to client. On the following renegotiations, the OpenVPN client will pass - this token instead of the users password. On the server side the server - will do the token authentication internally and it will NOT do any - additional authentications against configured external user/password - authentication mechanisms. - - The tokens implemented by this mechanism include a initial timestamp and - a renew timestamp and are secured by HMAC. - - The ``lifetime`` argument defines how long the generated token is valid. - The lifetime is defined in seconds. If lifetime is not set or it is set - to :code:`0`, the token will never expire. - - The token will expire either after the configured ``lifetime`` of the - token is reached or after not being renewed for more than 2 \* - ``reneg-sec`` seconds. Clients will be sent renewed tokens on every TLS - renogiation to keep the client's token updated. This is done to - invalidate a token if a client is disconnected for a sufficently long - time, while at the same time permitting much longer token lifetimes for - active clients. - - This feature is useful for environments which is configured to use One - Time Passwords (OTP) as part of the user/password authentications and - that authentication mechanism does not implement any auth-token support. - - When the :code:`external-auth` keyword is present the normal - authentication method will always be called even if auth-token succeeds. - Normally other authentications method are skipped if auth-token - verification suceeds or fails. - - This option postpones this decision to the external authentication - methods and check the validity of the account and do other checks. - - In this mode the environment will have a session\_id variable that hold - the session id from auth-gen-token. Also a environment variable - session\_state is present. This variable tells whether the auth-token - has succeeded or not. It can have the following values: - - :code:`Initial` - No token from client. - - :code:`Authenticated` - Token is valid and not expired. - - :code:`Expired` - Token is valid but has expired. - - :code:`Invalid` - Token is invalid (failed HMAC or wrong length) - - :code:`AuthenticatedEmptyUser` / :code:`ExpiredEmptyUser` - The token is not valid with the username send from the client but - would be valid (or expired) if we assume an empty username was - used instead. These two cases are a workaround for behaviour in - OpenVPN 3. If this workaround is not needed these two cases should - be handled in the same way as :code:`Invalid`. - - **Warning:** Use this feature only if you want your authentication - method called on every verification. Since the external authentication - is called it needs to also indicate a success or failure of the - authentication. It is strongly recommended to return an authentication - failure in the case of the Invalid/Expired auth-token with the - external-auth option unless the client could authenticate in another - acceptable way (e.g. client certificate), otherwise returning success - will lead to authentication bypass (as does returning success on a wrong - password from a script). - ---auth-gen-token-secret file - Specifies a file that hold a secret for the HMAC used in - ``--auth-gen-token`` If ``file`` is not present OpenVPN will generate a - random secret on startup. This file should be used if auth-token should - valid after restarting a server or if client should be able to roam - between multiple OpenVPN server with their auth-token. - ---opt-verify - Clients that connect with options that are incompatible with those of the - server will be disconnected. - - Options that will be compared for compatibility include ``dev-type``, - ``link-mtu``, ``tun-mtu``, ``proto``, ``ifconfig``, - ``comp-lzo``, ``fragment``, ``keydir``, ``cipher``, - ``auth``, ``keysize``, ``secret``, ``no-replay``, - ``no-iv``, ``tls-auth``, ``key-method``, ``tls-server`` - and ``tls-client``. - - This option requires that ``--disable-occ`` NOT be used. - ---auth-user-pass-optional - Allow connections by clients that do not specify a username/password. - Normally, when ``--auth-user-pass-verify`` or - ``--management-client-auth`` is specified (or an authentication plugin - module), the OpenVPN server daemon will require connecting clients to - specify a username and password. This option makes the submission of a - username/password by clients optional, passing the responsibility to the - user-defined authentication module/script to accept or deny the client - based on other factors (such as the setting of X509 certificate fields). - When this option is used, and a connecting client does not submit a - username/password, the user-defined authentication module/script will - see the username and password as being set to empty strings (""). The - authentication module/script MUST have logic to detect this condition - and respond accordingly. - ---verify-client-cert mode - Specify whether the client is required to supply a valid certificate. - - Possible ``mode`` options are: - - :code:`none` - A client certificate is not required. the client need to - authenticate using username/password only. Be aware that using this - directive is less secure than requiring certificates from all - clients. - - If you use this directive, the entire responsibility of authentication - will rest on your ``--auth-user-pass-verify`` script, so keep in mind - that bugs in your script could potentially compromise the security of - your VPN. - - ``--verify-client-cert none`` is functionally equivalent to - ``--client-cert-not-required``. - - :code:`optional` - A client may present a certificate but it is not required to do so. - When using this directive, you should also use a - ``--auth-user-pass-verify`` script to ensure that clients are - authenticated using a certificate, a username and password, or - possibly even both. - - Again, the entire responsibility of authentication will rest on your - ``--auth-user-pass-verify`` script, so keep in mind that bugs in your - script could potentially compromise the security of your VPN. - - :code:`require` - This is the default option. A client is required topresent a - certificate, otherwise VPN access is refused. - - If you don't use this directive (or use ``--verify-client-cert require``) - but you also specify an ``--auth-user-pass-verify`` script, then OpenVPN - will perform double authentication. The client certificate verification - AND the ``--auth-user-pass-verify`` script will need to succeed in order - for a client to be authenticated and accepted onto the VPN. - ---username-as-common-name - For ``--auth-user-pass-verify`` authentication, use the authenticated - username as the common name, rather than the common name from the client - cert. - ---port-share args - Share OpenVPN TCP with another service - - Valid syntax: - :: - - port-share host port [dir] - - When run in TCP server mode, share the OpenVPN port with another - application, such as an HTTPS server. If OpenVPN senses a connection to - its port which is using a non-OpenVPN protocol, it will proxy the - connection to the server at ``host``:``port``. Currently only designed to - work with HTTP/HTTPS, though it would be theoretically possible to - extend to other protocols such as ssh. - - ``dir`` specifies an optional directory where a temporary file with name - N containing content C will be dynamically generated for each proxy - connection, where N is the source IP:port of the client connection and C - is the source IP:port of the connection to the proxy receiver. This - directory can be used as a dictionary by the proxy receiver to determine - the origin of the connection. Each generated file will be automatically - deleted when the proxied connection is torn down. - - Not implemented on Windows. - ---vlan-tagging - Server-only option. Turns the OpenVPN server instance into a switch that - understands VLAN-tagging, based on IEEE 802.1Q. - - The server TAP device and each of the connecting clients is seen as a - port of the switch. All client ports are in untagged mode and the server - TAP device is VLAN-tagged, untagged or accepts both, depending on the - ``--vlan-accept`` setting. - - Ethernet frames with a prepended 802.1Q tag are called "tagged". If the - VLAN Identifier (VID) field in such a tag is non-zero, the frame is - called "VLAN-tagged". If the VID is zero, but the Priority Control Point - (PCP) field is non-zero, the frame is called "prio-tagged". If there is - no 802.1Q tag, the frame is "untagged". - - Using the ``--vlan-pvid v`` option once per client (see - --client-config-dir), each port can be associated with a certain VID. - Packets can only be forwarded between ports having the same VID. - Therefore, clients with differing VIDs are completely separated from - one-another, even if ``--client-to-client`` is activated. - - The packet filtering takes place in the OpenVPN server. Clients should - not have any VLAN tagging configuration applied. - - The ``--vlan-tagging`` option is off by default. While turned off, - OpenVPN accepts any Ethernet frame and does not perform any special - processing for VLAN-tagged packets. - - The option can only be activated in ``--dev tap mode``. - ---vlan-accept args - Configure the VLAN tagging policy for the server TAP device. - - Valid syntax: - :: - - vlan-accept all|tagged|untagged - - The following modes are available: - - :code:`tagged` - Admit only VLAN-tagged frames. Only VLAN-tagged packets are accepted, - while untagged or priority-tagged packets are dropped when entering - the server TAP device. - - :code:`untagged` - Admit only untagged and prio-tagged frames. VLAN-tagged packets are - not accepted, while untagged or priority-tagged packets entering the - server TAP device are tagged with the value configured for the global - ``--vlan-pvid`` setting. - - :code:`all` (default) - Admit all frames. All packets are admitted and then treated like - untagged or tagged mode respectively. - - *Note*: - Some vendors refer to switch ports running in :code:`tagged` mode - as "trunk ports" and switch ports running in :code:`untagged` mode - as "access ports". - - Packets forwarded from clients to the server are VLAN-tagged with the - originating client's PVID, unless the VID matches the global - ``--vlan-pvid``, in which case the tag is removed. - - If no *PVID* is configured for a given client (see --vlan-pvid) packets - are tagged with 1 by default. - ---vlan-pvid v - Specifies which VLAN identifier a "port" is associated with. Only valid - when ``--vlan-tagging`` is speficied. - - In the client context, the setting specifies which VLAN ID a client is - associated with. In the global context, the VLAN ID of the server TAP - device is set. The latter only makes sense for ``--vlan-accept - untagged`` and ``--vlan-accept all`` modes. - - Valid values for ``v`` go from :code:`1` through to :code:`4094`. The - global value defaults to :code:`1`. If no ``--vlan-pvid`` is specified in - the client context, the global value is inherited. - - In some switch implementations, the *PVID* is also referred to as "Native - VLAN". - - -Client Mode ------------ - -Use client mode when connecting to an OpenVPN server which has -``--server``, ``--server-bridge``, or ``--mode server`` in its -configuration. - ---client - A helper directive designed to simplify the configuration of OpenVPN's - client mode. This directive is equivalent to: - :: - - pull - tls-client - ---pull - This option must be used on a client which is connecting to a - multi-client server. It indicates to OpenVPN that it should accept - options pushed by the server, provided they are part of the legal set of - pushable options (note that the ``--pull`` option is implied by - ``--client`` ). - - In particular, ``--pull`` allows the server to push routes to the - client, so you should not use ``--pull`` or ``--client`` in situations - where you don't trust the server to have control over the client's - routing table. - ---pull-filter args - Filter options on the client pushed by the server to the client. - - Valid syntaxes: - :: - - pull-filter accept text - pull-filter ignore text - pull-filter reject text - - Filter options received from the server if the option starts with - :code:`text`. The action flag :code:`accept` allows the option, - :code:`ignore` removes it and :code:`reject` flags an error and triggers - a :code:`SIGUSR1` restart. The filters may be specified multiple times, - and each filter is applied in the order it is specified. The filtering of - each option stops as soon as a match is found. Unmatched options are accepted - by default. - - Prefix comparison is used to match :code:`text` against the received option so - that - :: - - pull-filter ignore "route" - - would remove all pushed options starting with ``route`` which would - include, for example, ``route-gateway``. Enclose *text* in quotes to - embed spaces. - - :: - - pull-filter accept "route 192.168.1." - pull-filter ignore "route " - - would remove all routes that do not start with ``192.168.1``. - - *Note* that :code:`reject` may result in a repeated cycle of failure and - reconnect, unless multiple remotes are specified and connection to the - next remote succeeds. To silently ignore an option pushed by the server, - use :code:`ignore`. - ---auth-user-pass - Authenticate with server using username/password. - - Valid syntaxes: - :: - - auth-user-pass - auth-user-pass up - - If ``up`` is present, it must be a file containing username/password on 2 - lines. If the password line is missing, OpenVPN will prompt for one. - - If ``up`` is omitted, username/password will be prompted from the - console. - - The server configuration must specify an ``--auth-user-pass-verify`` - script to verify the username/password provided by the client. - ---auth-retry type - Controls how OpenVPN responds to username/password verification errors - such as the client-side response to an AUTH\_FAILED message from the - server or verification failure of the private key password. - - Normally used to prevent auth errors from being fatal on the client - side, and to permit username/password requeries in case of error. - - An AUTH\_FAILED message is generated by the server if the client fails - ``--auth-user-pass`` authentication, or if the server-side - ``--client-connect`` script returns an error status when the client - tries to connect. - - ``type`` can be one of: - - :code:`none` - Client will exit with a fatal error (this is the default). - - :code:`nointeract` - Client will retry the connection without requerying - for an ``--auth-user-pass`` username/password. Use this option for - unattended clients. - - :code:`interact` - Client will requery for an ``--auth-user-pass`` - username/password and/or private key password before attempting a - reconnection. - - Note that while this option cannot be pushed, it can be controlled from - the management interface. - ---static-challenge args - Enable static challenge/response protocol - - Valid syntax: - :: - - static-challenge text echo - - The ``text`` challenge text is presented to the user which describes what - information is requested. The ``echo`` flag indicates if the user's - input should be echoed on the screen. Valid ``echo`` values are - :code:`0` or :code:`1`. - - See management-notes.txt in the OpenVPN distribution for a description of - the OpenVPN challenge/response protocol. - ---server-poll-timeout n - When connecting to a remote server do not wait for more than **n** - seconds waiting for a response before trying the next server. The - default value is 120s. This timeout includes proxy and TCP connect - timeouts. - ---connect-timeout n - See ``--server-poll-timeout``. - ---explicit-exit-notify n - In UDP client mode or point-to-point mode, send server/peer an exit - notification if tunnel is restarted or OpenVPN process is exited. In - client mode, on exit/restart, this option will tell the server to - immediately close its client instance object rather than waiting for a - timeout. - - The **n** parameter (default :code:`1` if not present) controls the - maximum number of attempts that the client will try to resend the exit - notification message. - - In UDP server mode, send :code:`RESTART` control channel command to - connected clients. The ``n`` parameter (default :code:`1` if not present) - controls client behavior. With ``n`` = :code:`1` client will attempt to - reconnect to the same server, with ``n`` = :code:`2` client will advance - to the next server. - - OpenVPN will not send any exit notifications unless this option is - enabled. - ---allow-recursive-routing - When this option is set, OpenVPN will not drop incoming tun packets with - same destination as host. - - -Data Channel Encryption Options -------------------------------- - -These options are meaningful for both Static & TLS-negotiated key modes -(must be compatible between peers). - ---secret args - Enable Static Key encryption mode (non-TLS). Use pre-shared secret - ``file`` which was generated with ``--genkey``. - - Valid syntaxes: - :: - - secret file - secret file direction - - The optional ``direction`` parameter enables the use of 4 distinct keys - (HMAC-send, cipher-encrypt, HMAC-receive, cipher-decrypt), so that each - data flow direction has a different set of HMAC and cipher keys. This - has a number of desirable security properties including eliminating - certain kinds of DoS and message replay attacks. - - When the ``direction`` parameter is omitted, 2 keys are used - bidirectionally, one for HMAC and the other for encryption/decryption. - - The ``direction`` parameter should always be complementary on either - side of the connection, i.e. one side should use :code:`0` and the other - should use :code:`1`, or both sides should omit it altogether. - - The ``direction`` parameter requires that ``file`` contains a 2048 bit - key. While pre-1.5 versions of OpenVPN generate 1024 bit key files, any - version of OpenVPN which supports the ``direction`` parameter, will also - support 2048 bit key file generation using the ``--genkey`` option. - - Static key encryption mode has certain advantages, the primary being - ease of configuration. - - There are no certificates or certificate authorities or complicated - negotiation handshakes and protocols. The only requirement is that you - have a pre-existing secure channel with your peer (such as ``ssh``) to - initially copy the key. This requirement, along with the fact that your - key never changes unless you manually generate a new one, makes it - somewhat less secure than TLS mode (see below). If an attacker manages - to steal your key, everything that was ever encrypted with it is - compromised. Contrast that to the perfect forward secrecy features of - TLS mode (using Diffie Hellman key exchange), where even if an attacker - was able to steal your private key, he would gain no information to help - him decrypt past sessions. - - Another advantageous aspect of Static Key encryption mode is that it is - a handshake-free protocol without any distinguishing signature or - feature (such as a header or protocol handshake sequence) that would - mark the ciphertext packets as being generated by OpenVPN. Anyone - eavesdropping on the wire would see nothing but random-looking data. - ---key-direction - Alternative way of specifying the optional direction parameter for the - ``--tls-auth`` and ``--secret`` options. Useful when using inline files - (See section on inline files). - ---auth alg - Authenticate data channel packets and (if enabled) ``tls-auth`` control - channel packets with HMAC using message digest algorithm ``alg``. (The - default is ``SHA1`` ). HMAC is a commonly used message authentication - algorithm (MAC) that uses a data string, a secure hash algorithm, and a - key, to produce a digital signature. - - The OpenVPN data channel protocol uses encrypt-then-mac (i.e. first - encrypt a packet, then HMAC the resulting ciphertext), which prevents - padding oracle attacks. - - If an AEAD cipher mode (e.g. GCM) is chosen, the specified ``--auth`` - algorithm is ignored for the data channel, and the authentication method - of the AEAD cipher is used instead. Note that ``alg`` still specifies - the digest used for ``tls-auth``. - - In static-key encryption mode, the HMAC key is included in the key file - generated by ``--genkey``. In TLS mode, the HMAC key is dynamically - generated and shared between peers via the TLS control channel. If - OpenVPN receives a packet with a bad HMAC it will drop the packet. HMAC - usually adds 16 or 20 bytes per packet. Set ``alg=none`` to disable - authentication. - - For more information on HMAC see - http://www.cs.ucsd.edu/users/mihir/papers/hmac.html - ---cipher alg - Encrypt data channel packets with cipher algorithm ``alg``. - - The default is :code:`BF-CBC`, an abbreviation for Blowfish in Cipher - Block Chaining mode. When cipher negotiation (NCP) is allowed,
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.26.0
Part of the diff is not shown here. View the raw message.
PATCH v2 5/8 doc/man: Mark compression options as deprecated
In reply to David SommersethDue to the VORACLE attack vector, compression in general is deprecated. Make this clear in the man page.
Also remove an incorrect statement claiming --compress lzo is compatible with --comp-lzo. It is not, as --compress lzo uses a different compression framing than --comp-lzo.
--- doc/man-sections/protocol-options.rst | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)
doc/man-sections/protocol-options.rst +7 -8
@@ -60,9 +60,7 @@ configured in a compatible way between both the local and remote side. The ``algorithm`` parameter may be :code:`lzo`, :code:`lz4`, or empty. LZO and LZ4 are different compression algorithms, with LZ4 generally - offering the best performance with least CPU usage. For backwards - compatibility with OpenVPN versions before v2.4, use :code:`lzo` (which - is identical to the older option ``--comp-lzo yes``). + offering the best performance with least CPU usage. If the ``algorithm`` parameter is empty, compression will be turned off, but the packet framing for compression will still be enabled, allowing a
@@ -79,8 +77,9 @@ configured in a compatible way between both the local and remote side. *not* enable compression. --comp-lzo mode - *DEPRECATED* This option will be removed in a future OpenVPN release. - Use the newer ``--compress`` instead. + **DEPRECATED** Enable LZO compression algorithm. Compression is + generally not recommended. VPN tunnels which uses compression are + suspectible to the VORALCE attack vector. Use LZO compression -- may add up to 1 byte per packet for incompressible data. ``mode`` may be :code:`yes`, :code:`no`, or :code:`adaptive`
@@ -106,9 +105,9 @@ configured in a compatible way between both the local and remote side. link, the second sets the client side. --comp-noadapt - When used in conjunction with ``--comp-lzo``, this option will disable - OpenVPN's adaptive compression algorithm. Normally, adaptive compression - is enabled with ``--comp-lzo``. + **DEPRECATED** When used in conjunction with ``--comp-lzo``, this option + will disable OpenVPN's adaptive compression algorithm. Normally, adaptive + compression is enabled with ``--comp-lzo``. Adaptive compression tries to optimize the case where you have compression enabled, but you are sending predominantly incompressible
Signature · 1 line
2.26.0
PATCH v2 6/8 doc/man: Adopt compression documentation
In reply to David SommersethCommit c67e93b25208be2 updated the man page in reagrds to new compression options and improving existing compression options. This adopts those changes into the .rst format.
--- doc/man-sections/protocol-options.rst | 52 ++++++++++++++++++++++----- 1 file changed, 43 insertions(+), 9 deletions(-)
doc/man-sections/protocol-options.rst +43 -9
@@ -5,6 +5,31 @@ protocol. Many of these options also define the encryption options of the data channel in the OpenVPN wire protocol. These options must be configured in a compatible way between both the local and remote side. +--allow-compression mode + As described in the ``--compress`` option, compression is a potentially + dangerous option. This option allows controlling the behaviour of + OpenVPN when compression is used and allowed. + + Valid syntaxes: + :: + + allow-compression + allow-compression mode + + The ``mode`` argument can be one of the following values: + + :code:`asym` (default) + OpenVPN will only *decompress downlink packets* but *not compress + uplink packets*. This also allows migrating to disable compression + when changing both server and client configurations to remove + compression at the same time is not a feasible option. + + :code:`no` + OpenVPN will refuse any non-stub compression. + + :code:`yes` + OpenVPN will send and receive compressed packets. + --auth alg Authenticate data channel packets and (if enabled) ``tls-auth`` control channel packets with HMAC using message digest algorithm ``alg``. (The
@@ -58,23 +83,32 @@ configured in a compatible way between both the local and remote side. not recommended. VPN tunnels which use compression are susceptible to the VORALCE attack vector. - The ``algorithm`` parameter may be :code:`lzo`, :code:`lz4`, or empty. + The ``algorithm`` parameter may be :code:`lzo`, :code:`lz4`, + :code:`lz4-v2`, :code:`stub`, :code:`stub-v2` or empty. LZO and LZ4 are different compression algorithms, with LZ4 generally offering the best performance with least CPU usage. - If the ``algorithm`` parameter is empty, compression will be turned off, - but the packet framing for compression will still be enabled, allowing a - different setting to be pushed later. + The :code:`lz4-v2` and :code:`stub-v2` variants implement a better + framing that does not add overhead when packets cannot be compressed. All + other variants always add one extra framing byte compared to no + compression framing. + + If the ``algorithm`` parameter is :code:`stub`, :code:`stub-v2` or empty, + compression will be turned off, but the packet framing for compression + will still be enabled, allowing a different setting to be pushed later. + Additionally, :code:`stub` and :code:`stub-v2` wil disable announcing + ``lzo`` and ``lz4`` compression support via *IV_* variables to the + server. ***Security Considerations*** Compression and encryption is a tricky combination. If an attacker knows - or is able to control (parts of) the plaintext of packets that contain + or is able to control (parts of) the plain-text of packets that contain secrets, the attacker might be able to extract the secret if compression - is enabled. See e.g. the CRIME and BREACH attacks on TLS which also - leverage compression to break encryption. If you are not entirely sure - that the above does not apply to your traffic, you are advised to - *not* enable compression. + is enabled. See e.g. the *CRIME* and *BREACH* attacks on TLS and + *VORACLE* on VPNs which also leverage to break encryption. If you are not + entirely sure that the above does not apply to your traffic, you are + advised to *not* enable compression. --comp-lzo mode **DEPRECATED** Enable LZO compression algorithm. Compression is
Signature · 1 line
2.26.0
PATCH v2 7/8 doc/man: Update --txqueuelen default setting (Now OS default)
In reply to David SommersethFrom: Richard Bonhomme <[email protected]...>
--- doc/man-sections/advanced-options.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
doc/man-sections/advanced-options.rst +1 -1
@@ -103,5 +103,5 @@ used when debugging or testing out special usage scenarios. --txqueuelen n *(Linux only)* Set the TX queue length on the TUN/TAP interface. - Currently defaults to 100. + Currently defaults to operating system default.
Signature · 1 line
2.26.0
PATCH v2 8/8 doc/man: Documentation for --bind-dev / VRFs on Linux
In reply to David Sommerseth--- doc/man-sections/network-config.rst | 1 + .../virtual-routing-and-forwarding.rst | 78 +++++++++++++++++++ doc/man-sections/vpn-network-options.rst | 4 + 3 files changed, 83 insertions(+) create mode 100644 doc/man-sections/virtual-routing-and-forwarding.rst
doc/man-sections/network-config.rst +1 -0
@@ -7,3 +7,4 @@ network adapter* (tun/tap device). .. include:: link-options.rst .. include:: vpn-network-options.rst +.. include:: virtual-routing-and-forwarding.rst
doc/man-sections/virtual-routing-and-forwarding.rst new file +78 -0
78 lines not on this page · raw message
doc/man-sections/vpn-network-options.rst +4 -0
@@ -5,6 +5,10 @@ Options in this section relates to configuration of the virtual tun/tap network interface, including setting the VPN IP address and network routing. +--bind-dev device + (Linux only) Set ``device`` to bind the server socket to a + `Virtual Routing and Forwarding`_ device + --block-ipv6 On the client, instead of sending IPv6 packets over the VPN tunnel, all IPv6 packets are answered with an ICMPv6 no route host message. On the
Signature · 1 line
2.26.0
[Openvpn-devel] [PATCH applied] Re: doc/man: Add an .rst formatted version of the man page
In reply to David SommersethI have not really "reviewed" this (this would require a full side-by- side reading of old and new manpage, and nobody ever reads the openvpn manpage from top to bottom...) - but I've skimmed through it, and it made me laugh... :-) ("OpenVPN ... lightweight footprint").
File sizes are similar, and there is no obvious "mistakes" in the rst (like, duplications, or random garbage).
-rw-r--r-- 1 gert users 243522 Jun 26 14:33 openvpn.8 -rw-r--r-- 1 gert users 225588 Jul 17 09:29 openvpn.8.rst
$ wc -w openvpn.8 openvpn.8.rst 35162 openvpn.8 31700 openvpn.8.rst
There are (at least) two whitespace errors, where an alt-space (0xA0) shows up at the end of a line, after a ^A character. I have not changed these, because it gets split into individual files anyway, and then I have to re-do it.
Your patch has been applied to the master branch.
For the URL reference, I had to switch to the sourceforge archive as mail-archive.org does not accept such big mails.
commit d47b928d4e0501acdf1e449ad59951a19dd154a2
Author: David Sommerseth Date: Fri Jul 17 00:53:31 2020 +0200
doc/man: Add an .rst formatted version of the man page
Signed-off-by: David Sommerseth <[email protected]...>
Acked-by: Gert Doering <[email protected]...>
Message-Id: <[email protected]...>
URL: https://sourceforge.net/p/openvpn/mailman/message/37063370/
Signed-off-by: Gert Doering <[email protected]...>--
kind regards,
Gert Doering
[Openvpn-devel] [PATCH applied] Re: doc/man: Replace old man page with generated man page
In reply to David SommersethI have not tested the actual docutils / openvpn.8 generation (Samuli will complain loudly if tarball making doesn't work anymore, so that *will* see testing). Generally it looks sane.
This condition looks a bit fishy, though...
+AM_CONDITIONAL([HAVE_PYDOCUTILS], [test "${RST2MAN}" -a "${RST2HTML}"])
not sure what that will do in a POSIX shell.
Maybe this shouldn't be conditional either
+if HAVE_PYDOCUTILS
dist_noinst_DATA += openvpn.8
because it will lead to "tarballs randomly contain openvpn.8 or not, depending on whether docutils are around" - "make dist" should behave consistently, and if there are no docutils, I think it should fail, not silently leave out files.
URL pointed to SF again due to patch size.
Your patch has been applied to the master branch.
commit 51f2e4b0a4e09382dbc1b10b6a8b08febc8d293f
Author: David Sommerseth Date: Fri Jul 17 00:53:32 2020 +0200
doc/man: Replace old man page with generated man page
Signed-off-by: David Sommerseth <[email protected]...>
Acked-by: Gert Doering <[email protected]...>
Message-Id: <[email protected]...>
URL: https://sourceforge.net/p/openvpn/mailman/message/37063373/
Signed-off-by: Gert Doering <[email protected]...>--
kind regards,
Gert Doering
[Openvpn-devel] [PATCH applied] Re: doc/man: Split up and reorganize main man page
In reply to David Sommerseth"Seems to be all the same content, now spread to multiple files".
Your patch has been applied to the master branch.
commit f3ebfe9ef31c9d03a344aef41f54ab8a37f7e88f
Author: David Sommerseth Date: Fri Jul 17 00:53:33 2020 +0200
doc/man: Split up and reorganize main man page
Signed-off-by: David Sommerseth <[email protected]...>
Acked-by: Gert Doering <[email protected]...>
Message-Id: <[email protected]...>
URL: https://sourceforge.net/p/openvpn/mailman/message/37063376/
Signed-off-by: Gert Doering <[email protected]...>--
kind regards,
Gert Doering
[Openvpn-devel] [PATCH applied] Re: doc/man: Complete openvpn.8.rst splitting
In reply to David Sommerseth"And then all the new and huge file is gone again". I'd really like to squash 01, 03 and 04 - no good to have 230k openvpn.rst file in our git repo forever (even if compression helps) if we never actually need or want it as "one single file". So make this "introduce split-up files right away".
Your patch has been applied to the master branch.
commit a44d0ab612796e73c48f204e6663113520775f2a
Author: David Sommerseth Date: Fri Jul 17 00:53:34 2020 +0200
doc/man: Complete openvpn.8.rst splitting
Signed-off-by: David Sommerseth <[email protected]...>
Acked-by: Gert Doering <[email protected]...>
Message-Id: <[email protected]...>
URL: https://sourceforge.net/p/openvpn/mailman/message/37063377/
Signed-off-by: Gert Doering <[email protected]...>--
kind regards,
Gert Doering
Re: [Openvpn-devel] [PATCH applied] Re: doc/man: Complete openvpn.8.rst splitting
Hi,
Quoted 7 lines · Gert Doering
Acked-by Gert Doering <[email protected]...>"And then all the new and huge file is gone again". I'd really like to squash 01, 03 and 04 - no good to have 230k
openvpn.rstfile in our git repo forever (even if compression helps) if we never actually need or want it as "one single file". So make this "introduce split-up files right away".
This is what I've done now, as agreed on IRC.
Due to conflicts and general laziness on my side, I've squashed 01...04 into one big "remove openvpn.8, introduce small .rst fragments included by openvpn.rst" patch, which has just been pushed. Out with it!
commit f500c49c8e0a77ce665b11f6adbea4029cf3b85f
Author: David Sommerseth <[email protected]...> Date: Fri Jul 17 00:53:31 2020 +0200
doc/man: convert openvpn.8 to split-up .rst files
To avoid keeping around a full-size openvpn.rst file which is never needed but will take space in the repo forever, patches 01...04 of the big documentation overhaul projects were squashed togehter, keeping the individual commit logs and URL references below.
* This is a combination of 4 commits.
* This is the 1st commit message:
...
gert
Signature · 6 lines
"If was one thing all people took for granted, was conviction that if you
feed honest figures into a computer, honest figures come out. Never doubted
it myself till I met a computer with a sense of humor."
Robert A. Heinlein, The Moon is a Harsh Mistress
Gert Doering - Munich, Germany [email protected]...[Openvpn-devel] [PATCH applied] Re: doc/man: Mark compression options as deprecated
In reply to David Sommerseth"By general agreement".
Your patch has been applied to the master branch.
commit 850fd5fab76403bb1a8e21b8d4272b138ce19934
Author: David Sommerseth Date: Fri Jul 17 00:53:35 2020 +0200
doc/man: Mark compression options as deprecated
Signed-off-by: David Sommerseth <[email protected]...>
Acked-by: Gert Doering <[email protected]...>
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg20417.html
Signed-off-by: Gert Doering <[email protected]...>--
kind regards,
Gert Doering
[Openvpn-devel] [PATCH applied] Re: doc/man: Adopt compression documentation
In reply to David SommersethYour patch has been applied to the master branch.
commit ed593e651db20446daa0e494d6018cb65c0efe22
Author: David Sommerseth Date: Fri Jul 17 00:53:36 2020 +0200
doc/man: Adopt compression documentation
Signed-off-by: David Sommerseth <[email protected]...>
Acked-by: Gert Doering <[email protected]...>
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg20414.html
Signed-off-by: Gert Doering <[email protected]...>--
kind regards,
Gert Doering
[Openvpn-devel] [PATCH applied] Re: doc/man: Adopt compression documentation
In reply to David Sommerseth(oops, sent this one too quickly - resending)
I have seen these changes before (in the compression patch), they make sense, so of course we want to have them in .rst as well.
Your patch has been applied to the master branch.
commit ed593e651db20446daa0e494d6018cb65c0efe22
Author: David Sommerseth Date: Fri Jul 17 00:53:36 2020 +0200
doc/man: Adopt compression documentation
Signed-off-by: David Sommerseth <[email protected]...>
Acked-by: Gert Doering <[email protected]...>
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg20414.html
Signed-off-by: Gert Doering <[email protected]...>--
kind regards,
Gert Doering
[Openvpn-devel] [PATCH applied] Re: doc/man: Update --txqueuelen default setting (Now OS default)
In reply to David Sommerseth"Because it's true!"
Your patch has been applied to the master branch.
commit 5c5544d42fbbd346034d05a38b5efe421ea1f911
Author: Richard Bonhomme Date: Fri Jul 17 00:53:37 2020 +0200
doc/man: Update --txqueuelen default setting (Now OS default)
Signed-off-by: Richard Bonhomme <[email protected]...>
Signed-off-by: David Sommerseth <[email protected]...>
Acked-by: Gert Doering <[email protected]...>
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg20415.html
Signed-off-by: Gert Doering <[email protected]...>--
kind regards,
Gert Doering
Re: [Openvpn-devel] [PATCH applied] Re: doc/man: Replace old man page with generated man page
In reply to Gert DoeringQuoted 11 lines · Gert Doering
Acked-by Gert Doering <[email protected]...>I have not tested the actual docutils / openvpn.8 generation (Samuli will complain loudly if tarball making doesn't work anymore, so that *will* see testing). Generally it looks sane.
This condition looks a bit fishy, though...
+AM_CONDITIONAL([HAVE_PYDOCUTILS], [test "${RST2MAN}" -a "${RST2HTML}"])
not sure what that will do in a POSIX shell.
Hmm ... whoops. That should probably have been
test -n "${RST2MAN}" -a -n "${RST2HTML}"Not sure how that passed during my own tests. I tested it on a various of boxes, but I only have Linux distros easily available.
Quoted 9 lines
Maybe this shouldn't be conditional either
+if
HAVE_PYDOCUTILS
dist_noinst_DATA+= openvpn.8because it will lead to "tarballs randomly contain openvpn.8 or not, depending on whether docutils are around" - "make dist" should behave consistently, and if there are no docutils, I think it should fail, not silently leave out files.
The intention is that the tarball contains prebuilt openvpn.8 and openvpn.html files, which is generated by "make {dist,distcheck}". If these files exists, they will not be rebuilt unless explicitly removed. So most users building from the source tarball should not notice any difference from prioer OpenVPN releases. This is what the additional dist-hook rule in doc/Makefile.am does; this is run right before the copied source tree is put into a tarball.
The challenge is that it must be a conditional to actually pass ./configure - even when built from source tarballs. Otherwise python-docutils will be a build dependency. We discussed this at the Trento Hackathon and you where skeptic to require a Python stack to be installed to build OpenVPN (as that stack is not a common system dependency in the non-Linux world). So we agreed we will ship pre-built man/html files in the source tarballs.
However, to do the "make {dist,distcheck}" from the *git repo*, python-docutils need to be a mandatory dependency - because we don't check in the prebuilt openvpn.8 and openvpn.html files into the git repo.
This logic could probably contains some flaws and can be further improved, but I figured we need to get this tested on a broader set of use cases and OS/distros to better see which annoyances which hits us.
Signature · 4 lines
kind regards, David Sommerseth OpenVPN Inc
PATCH 1/1 doc/man: Documentation for --bind-dev / VRFs on Linux
In reply to David Sommerseth---
v2 - Added missing entry into Makefile.am
--- doc/Makefile.am | 1 + doc/man-sections/network-config.rst | 1 + .../virtual-routing-and-forwarding.rst | 78 +++++++++++++++++++ doc/man-sections/vpn-network-options.rst | 4 + 4 files changed, 84 insertions(+) create mode 100644 doc/man-sections/virtual-routing-and-forwarding.rst
doc/Makefile.am +1 -0
@@ -36,6 +36,7 @@ dist_doc_DATA = \ man-sections/server-options.rst \ man-sections/tls-options.rst \ man-sections/unsupported-options.rst \ + man-sections/virtual-routing-and-forwarding.rst \ man-sections/vpn-network-options.rst \ man-sections/windows-options.rst
doc/man-sections/network-config.rst +1 -0
@@ -7,3 +7,4 @@ network adapter* (tun/tap device). .. include:: link-options.rst .. include:: vpn-network-options.rst +.. include:: virtual-routing-and-forwarding.rst
doc/man-sections/virtual-routing-and-forwarding.rst new file +78 -0
78 lines not on this page · raw message
doc/man-sections/vpn-network-options.rst +4 -0
@@ -5,6 +5,10 @@ Options in this section relates to configuration of the virtual tun/tap network interface, including setting the VPN IP address and network routing. +--bind-dev device + (Linux only) Set ``device`` to bind the server socket to a + `Virtual Routing and Forwarding`_ device + --block-ipv6 On the client, instead of sending IPv6 packets over the VPN tunnel, all IPv6 packets are answered with an ICMPv6 no route host message. On the
Signature · 1 line
2.26.0
[Openvpn-devel] [PATCH applied] Re: doc/man: Documentation for --bind-dev / VRFs on Linux
New and not-yet-merged documentation from the --bind-dev patch. Thanks.
Your patch has been applied to the master branch.
commit 8d0b1def830d20410b6648f615ad3ddb5c2797fa
Author: David Sommerseth Date: Fri Jul 17 12:54:53 2020 +0200
doc/man: Documentation for --bind-dev / VRFs on Linux
Signed-off-by: Maximilian Wilhelm <[email protected]...>
Signed-off-by: David Sommerseth <[email protected]...>
Acked-by: Gert Doering <[email protected]...>
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg20429.html
Signed-off-by: Gert Doering <[email protected]...>--
kind regards,
Gert Doering
Re: [Openvpn-devel] [PATCH applied] Re: doc/man: Replace old man page with generated man page
In reply to David SommersethHi,
Quoted 11 lines · David Sommerseth
Quoted 10 lines · Gert Doering
Acked-by Gert Doering <[email protected]...>I have not tested the actual docutils / openvpn.8 generation (Samuli will complain loudly if tarball making doesn't work anymore, so that *will* see testing). Generally it looks sane.
This condition looks a bit fishy, though...
+AM_CONDITIONAL([HAVE_PYDOCUTILS], [test "${RST2MAN}" -a "${RST2HTML}"])
Quoted 8 lines
Quoted 1 line
not sure what that will do in a POSIX shell.
Hmm ... whoops. That should probably have been
test -n "${RST2MAN}" -a -n "${RST2HTML}"Not sure how that passed during my own tests. I tested it on a various of boxes, but I only have Linux distros easily available.
OK, there is something else - the buildbots are now failing with
Missing python-docutils - skipping man/html page generation Missing python-docutils - skipping man page generation
cp: cannot stat './openvpn.8.html': No such file or directory Makefile:686: recipe for target 'distdir' failed
"if it knows that it's not doing these, it shouldn't try to copy it somewhere"
Can you have a look please, while fixing the "test" thing above?
Quoted 5 lines
Quoted 5 lines
Maybe this shouldn't be conditional either
+if
HAVE_PYDOCUTILS
dist_noinst_DATA+= openvpn.8
Quoted 7 lines
Quoted 4 lines
because it will lead to "tarballs randomly contain openvpn.8 or not, depending on whether docutils are around" - "make dist" should behave consistently, and if there are no docutils, I think it should fail, not silently leave out files.
The intention is that the tarball contains prebuilt openvpn.8 and openvpn.html files, which is generated by "make {dist,distcheck}".
Yes. In full agreement.
What I worry is that if you run a "make dist" on a host that has no docutils, configure will notice this, and not add "openvpn.8" to "dist_noinst_DATA" - so it won't be built, not included in the tarball, and the tarball is incomplete.
Quoted 8 lines
If these files exists,
they will not be rebuilt unless explicitly removed. So most users building from the source tarball should not notice any difference from prioer OpenVPN releases. This is what the additional dist-hook rule in doc/Makefile.am does; this is run right before the copied source tree is put into a tarball.The challenge is that it must be a conditional to actually pass ./configure - even when built from source tarballs.
Not sure I understand this. If openvpn.8 is there, because it was tarball'ed, why would this line above create a new dependency?
gert
Signature · 6 lines
"If was one thing all people took for granted, was conviction that if you
feed honest figures into a computer, honest figures come out. Never doubted
it myself till I met a computer with a sense of humor."
Robert A. Heinlein, The Moon is a Harsh Mistress
Gert Doering - Munich, Germany [email protected]...