From: David S. <da...@op...> - 2020-07-16 22:55:59
|
The 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. Signed-off-by: David Sommerseth <da...@op...> --- 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.rst diff --git a/doc/Makefile.am b/doc/Makefile.am index 5110ca52..ca3ba9de 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -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 diff --git a/doc/man-sections/advanced-options.rst b/doc/man-sections/advanced-options.rst new file mode 100644 index 00000000..dbf7799c --- /dev/null +++ b/doc/man-sections/advanced-options.rst @@ -0,0 +1,107 @@ +Standalone Debug Options +------------------------ + +--show-gateway args + (Standalone) Show current IPv4 and IPv6 default gateway and interface + towards the gateway (if the protocol in question is enabled). + + Valid syntax: + :: + + --show-gateway + --show-gateway IPv6-target + + If an IPv6 target address is passed as argument, the IPv6 route for this + host is reported. + + +Advanced Expert Options +----------------------- +These are options only required when special tweaking is needed, often +used when debugging or testing out special usage scenarios. + +--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`). + +--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. + +--prng args + *(Advanced)* Change the PRNG (Pseudo-random number generator) parameters + + Valid syntaxes: + :: + + prng alg + prng alg nsl + + Changes the PRNG to use digest algorithm **alg** (default :code:`sha1`), + and set ``nsl`` (default :code:`16`) to the size in bytes of the nonce + secret length (between 16 and 64). + + Set ``alg`` to :code:`none` to disable the PRNG and use the OpenSSL + RAND\_bytes function instead for all of OpenVPN's pseudo-random number + needs. + +--rcvbuf size + Set the TCP/UDP socket receive buffer size. Defaults to operating system + default. + +--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. + +--sndbuf size + Set the TCP/UDP socket send buffer size. Defaults to operating system + default. + +--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. + +--txqueuelen n + *(Linux only)* Set the TX queue length on the TUN/TAP interface. + Currently defaults to 100. + diff --git a/doc/man-sections/client-options.rst b/doc/man-sections/client-options.rst new file mode 100644 index 00000000..249af0a3 --- /dev/null +++ b/doc/man-sections/client-options.rst @@ -0,0 +1,354 @@ +Client Options +-------------- +The client options are used when connecting to an OpenVPN server configured +to use ``--server``, ``--server-bridge``, or ``--mode server`` in its +configuration. + +--allow-pull-fqdn + Allow client to pull DNS names from server (rather than being limited to + IP address) for ``--ifconfig``, ``--route``, and ``--route-gateway``. + +--allow-recursive-routing + When this option is set, OpenVPN will not drop incoming tun packets with + same destination as host. + +--auth-token token + This is not an option to be used directly in any configuration files, + but rather push this option from a ``--client-connect`` script or a + ``--plugin`` which hooks into the :code:`OPENVPN_PLUGIN_CLIENT_CONNECT` + or :code:`OPENVPN_PLUGIN_CLIENT_CONNECT_V2` calls. This option provides a + possibility to replace the clients password with an authentication token + during the lifetime of the OpenVPN client. + + Whenever the connection is renegotiated and the + ``--auth-user-pass-verify`` script or ``--plugin`` making use of the + :code:`OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY` hook is triggered, it will + pass over this token as the password instead of the password the user + provided. The authentication token can only be reset by a full reconnect + where the server can push new options to the client. The password the + user entered is never preserved once an authentication token has been + set. If the OpenVPN server side rejects the authentication token then + the client will receive an :code:`AUTH_FAILED` and disconnect. + + The purpose of this is to enable two factor authentication methods, such + as HOTP or TOTP, to be used without needing to retrieve a new OTP code + each time the connection is renegotiated. Another use case is to cache + authentication data on the client without needing to have the users + password cached in memory during the life time of the session. + + To make use of this feature, the ``--client-connect`` script or + ``--plugin`` needs to put + :: + + push "auth-token UNIQUE_TOKEN_VALUE" + + into the file/buffer for dynamic configuration data. This will then make + the OpenVPN server to push this value to the client, which replaces the + local password with the ``UNIQUE_TOKEN_VALUE``. + + Newer clients (2.4.7+) will fall back to the original password method + after a failed auth. Older clients will keep using the token value and + react according to ``--auth-retry`` + +--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 :code:`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 :code:`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. + +--client + A helper directive designed to simplify the configuration of OpenVPN's + client mode. This directive is equivalent to: + :: + + pull + tls-client + +--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. + +--connect-retry n + 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 :code:`1` would try + each entry exactly once. A successful connection resets the counter. + (default *unlimited*). + +--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. + +--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. + +--proto-force p + When iterating through connection profiles, only consider profiles using + protocol ``p`` (:code:`tcp` \| :code:`udp`). + +--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`. + +--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 + 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. + +--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". + +--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. + +--single-session + After initially connecting to a remote peer, disallow any new + connections. Using this option means that a remote peer cannot connect, + disconnect, and then reconnect. + + If the daemon is reset by a signal or ``--ping-restart``, it will allow + one new connection. + + ``--single-session`` can be used with ``--ping-exit`` or ``--inactive`` + to create a single dynamic session that will exit when finished. + +--server-poll-timeout n + When connecting to a remote server do not wait for more than ``n`` + seconds for a response before trying the next server. The default value + is 120s. This timeout includes proxy and TCP connect timeouts. + +--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. + +.. include:: proxy-options.rst + diff --git a/doc/man-sections/connection-profiles.rst b/doc/man-sections/connection-profiles.rst new file mode 100644 index 00000000..fd3382b2 --- /dev/null +++ b/doc/man-sections/connection-profiles.rst @@ -0,0 +1,75 @@ +CONNECTION PROFILES +=================== + +Client configuration files may contain multiple remote servers which +it will attempt to connect against. But there are some configuration +options which are related to specific ``--remote`` options. For these +use cases, connection profiles are the solution. + +By enacpulating the ``--remote`` option and related options within +``<connection>`` and ``</connection>``, these options are handled as a +group. + +An OpenVPN client will try each connection profile sequentially until it +achieves a successful connection. + +``--remote-random`` can be used to initially "scramble" the connection +list. + +Here is an example of connection profile usage: +:: + + client + dev tun + + <connection> + remote 198.19.34.56 1194 udp + </connection> + + <connection> + remote 198.19.34.56 443 tcp + </connection> + + <connection> + remote 198.19.34.56 443 tcp + http-proxy 192.168.0.8 8080 + </connection> + + <connection> + remote 198.19.36.99 443 tcp + http-proxy 192.168.0.8 8080 + </connection> + + persist-key + persist-tun + pkcs12 client.p12 + remote-cert-tls server + verb 3 + +First we try to connect to a server at 198.19.34.56:1194 using UDP. If +that fails, we then try to connect to 198.19.34.56:443 using TCP. If +that also fails, then try connecting through an HTTP proxy at +192.168.0.8:8080 to 198.19.34.56:443 using TCP. Finally, try to connect +through the same proxy to a server at 198.19.36.99:443 using TCP. + +The following OpenVPN options may be used inside of a ``<connection>`` +block: + +``bind``, ``connect-retry``, ``connect-retry-max``, ``connect-timeout``, +``explicit-exit-notify``, ``float``, ``fragment``, ``http-proxy``, +``http-proxy-option``, ``key-direction``, ``link-mtu``, ``local``, +``lport``, ``mssfix``, ``mtu-disc``, ``nobind``, ``port``, ``proto``, +``remote``, ``rport``, ``socks-proxy``, ``tls-auth``, ``tls-crypt``, +``tun-mtu and``, ``tun-mtu-extra``. + +A defaulting mechanism exists for specifying options to apply to all +``<connection>`` profiles. If any of the above options (with the +exception of ``remote`` ) appear outside of a ``<connection>`` block, +but in a configuration file which has one or more ``<connection>`` +blocks, the option setting will be used as a default for +``<connection>`` blocks which follow it in the configuration file. + +For example, suppose the ``nobind`` option were placed in the sample +configuration file above, near the top of the file, before the first +``<connection>`` block. The effect would be as if ``nobind`` were +declared in all ``<connection>`` blocks below it. diff --git a/doc/man-sections/encryption-options.rst b/doc/man-sections/encryption-options.rst new file mode 100644 index 00000000..076b5fd3 --- /dev/null +++ b/doc/man-sections/encryption-options.rst @@ -0,0 +1,136 @@ +Encryption Options +================== + +SSL Library information +----------------------- + +--show-ciphers + (Standalone) Show all cipher algorithms to use with the ``--cipher`` + option. + +--show-digests + (Standalone) Show all message digest algorithms to use with the + ``--auth`` option. + +--show-tls + (Standalone) Show all TLS ciphers supported by the crypto library. + OpenVPN uses TLS to secure the control channel, over which the keys that + are used to protect the actual VPN traffic are exchanged. The TLS + ciphers will be sorted from highest preference (most secure) to lowest. + + Be aware that whether a cipher suite in this list can actually work + depends on the specific setup of both peers (e.g. both peers must + support the cipher, and an ECDSA cipher suite will not work if you are + using an RSA certificate, etc.). + +--show-engines + (Standalone) Show currently available hardware-based crypto acceleration + engines supported by the OpenSSL library. + +--show-curves + (Standalone) Show all available elliptic curves to use with the + ``--ecdh-curve`` option. + +Generating key material +----------------------- + +--genkey args + (Standalone) Generate a key to be used of the type keytype. if keyfile + is left out or empty the key will be output on stdout. See the following + sections for the different keytypes. + + Valid syntax: + :: + + --genkey keytype keyfile + + Valid keytype arguments are: + + :code:`secret` Standard OpenVPN shared secret keys + + :code:`tls-crypt` Alias for :code:`secret` + + :code:`tls-auth` Alias for :code:`secret` + + :code:`auth-token` Key used for ``--auth-gen-token-key`` + + :code:`tls-crypt-v2-server` TLS Crypt v2 server key + + :code:`tls-crypt-v2-client` TLS Crypt v2 client key + + + Examples: + :: + + $ openvpn --genkey secret shared.key + $ openvpn --genkey tls-crypt shared.key + $ openvpn --genkey tls-auth shared.key + $ openvpn --genkey tls-crypt-v2-server v2crypt-server.key + $ openvpn --tls-crypt-v2 v2crypt-server.key --genkey tls-crypt-v2-client v2crypt-client-1.key + + * Generating *Shared Secret Keys* + Generate a shared secret, for use with the ``--secret``, ``--tls-auth`` + or ``--tls-crypt`` options. + + Syntax: + :: + + $ openvpn --genkey secret|tls-crypt|tls-auth keyfile + + The key is saved in ``keyfile``. All three variants (``--secret``, + ``tls-crypt`` and ``tls-auth``) generate the same type of key. The + aliases are added for convenience. + + If using this for ``--secret``, this file must be shared with the peer + over a pre-existing secure channel such as ``scp``\(1). + + * Generating *TLS Crypt v2 Server key* + Generate a ``--tls-crypt-v2`` key to be used by an OpenVPN server. + The key is stored in ``keyfile``. + + Syntax: + :: + + --genkey tls-crypt-v2-server keyfile + + * Generating *TLS Crypt v2 Client key* + Generate a --tls-crypt-v2 key to be used by OpenVPN clients. The + key is stored in ``keyfile``. + + Syntax + :: + + --genkey tls-crypt-v2-client keyfile [metadata] + + If supplied, include the supplied ``metadata`` in the wrapped client + key. This metadata must be supplied in base64-encoded form. The + metadata must be at most 735 bytes long (980 bytes in base64). + + If no metadata is supplied, OpenVPN will use a 64-bit unix timestamp + representing the current time in UTC, encoded in network order, as + metadata for the generated key. + + A tls-crypt-v2 client key is wrapped using a server key. To generate a + client key, the user must therefore supply the server key using the + ``--tls-crypt-v2`` option. + + Servers can use ``--tls-crypt-v2-verify`` to specify a metadata + verification command. + + * Generate *Authentication Token key* + Generate a new secret that can be used with **--auth-gen-token-secret** + + Syntax: + :: + + --genkey auth-token [keyfile] + + *Note:* + This file should be kept secret to the server as anyone that has + access to this file will be able to generate auth tokens that the + OpenVPN server will accept as valid. + +.. include:: renegotiation.rst +.. include:: tls-options.rst +.. include:: pkcs11-options.rst + diff --git a/doc/man-sections/examples.rst b/doc/man-sections/examples.rst new file mode 100644 index 00000000..20cc55ef --- /dev/null +++ b/doc/man-sections/examples.rst @@ -0,0 +1,241 @@ +EXAMPLES +======== + +Prior to running these examples, you should have OpenVPN installed on +two machines with network connectivity between them. If you have not yet +installed OpenVPN, consult the INSTALL file included in the OpenVPN +distribution. + + +Firewall Setup: +--------------- + +If firewalls exist between the two machines, they should be set to +forward the port OpenVPN is configured to use, in both directions. +The default for OpenVPN is 1194/udp. If you do not have control +over the firewalls between the two machines, you may still be able to +use OpenVPN by adding ``--ping 15`` to each of the ``openvpn`` commands +used below in the examples (this will cause each peer to send out a UDP +ping to its remote peer once every 15 seconds which will cause many +stateful firewalls to forward packets in both directions without an +explicit firewall rule). + +Please see your operating system guides for how to configure the firewall +on your systems. + + +VPN Address Setup: +------------------ + +For purposes of our example, our two machines will be called +``bob.example.com`` and ``alice.example.com``. If you are constructing a +VPN over the internet, then replace ``bob.example.com`` and +``alice.example.com`` with the internet hostname or IP address that each +machine will use to contact the other over the internet. + +Now we will choose the tunnel endpoints. Tunnel endpoints are private IP +addresses that only have meaning in the context of the VPN. Each machine +will use the tunnel endpoint of the other machine to access it over the +VPN. In our example, the tunnel endpoint for bob.example.com will be +10.4.0.1 and for alice.example.com, 10.4.0.2. + +Once the VPN is established, you have essentially created a secure +alternate path between the two hosts which is addressed by using the +tunnel endpoints. You can control which network traffic passes between +the hosts (a) over the VPN or (b) independently of the VPN, by choosing +whether to use (a) the VPN endpoint address or (b) the public internet +address, to access the remote host. For example if you are on +bob.example.com and you wish to connect to ``alice.example.com`` via +``ssh`` without using the VPN (since **ssh** has its own built-in security) +you would use the command ``ssh alice.example.com``. However in the same +scenario, you could also use the command ``telnet 10.4.0.2`` to create a +telnet session with alice.example.com over the VPN, that would use the +VPN to secure the session rather than ``ssh``. + +You can use any address you wish for the tunnel endpoints but make sure +that they are private addresses (such as those that begin with 10 or +192.168) and that they are not part of any existing subnet on the +networks of either peer, unless you are bridging. If you use an address +that is part of your local subnet for either of the tunnel endpoints, +you will get a weird feedback loop. + + +Example 1: A simple tunnel without security +------------------------------------------- + +On bob: +:: + + openvpn --remote alice.example.com --dev tun1 \ + --ifconfig 10.4.0.1 10.4.0.2 --verb 9 + +On alice: +:: + + openvpn --remote bob.example.com --dev tun1 \ + --ifconfig 10.4.0.2 10.4.0.1 --verb 9 + +Now verify the tunnel is working by pinging across the tunnel. + +On bob: +:: + + ping 10.4.0.2 + +On alice: +:: + + ping 10.4.0.1 + +The ``--verb 9`` option will produce verbose output, similar to the +``tcpdump``\(8) program. Omit the ``--verb 9`` option to have OpenVPN run +quietly. + + +Example 2: A tunnel with static-key security (i.e. using a pre-shared secret) +----------------------------------------------------------------------------- + +First build a static key on bob. +:: + + openvpn --genkey --secret key + +This command will build a key file called ``key`` (in ascii format). Now +copy ``key`` to ``alice.example.com`` over a secure medium such as by using +the ``scp``\(1) program. + +On bob: +:: + + openvpn --remote alice.example.com --dev tun1 \ + --ifconfig 10.4.0.1 10.4.0.2 --verb 5 \ + --secret key + +On alice: +:: + + openvpn --remote bob.example.com --dev tun1 \ + --ifconfig 10.4.0.2 10.4.0.1 --verb 5 \ + --secret key + +Now verify the tunnel is working by pinging across the tunnel. + +On bob: +:: + + ping 10.4.0.2 + +On alice: +:: + + ping 10.4.0.1 + + +Example 3: A tunnel with full TLS-based security +------------------------------------------------ + +For this test, we will designate ``bob`` as the TLS client and ``alice`` +as the TLS server. + +*Note:* + The client or server designation only has + meaning for the TLS subsystem. It has no bearing on OpenVPN's + peer-to-peer, UDP-based communication model.* + +First, build a separate certificate/key pair for both bob and alice (see +above where ``--cert`` is discussed for more info). Then construct +Diffie Hellman parameters (see above where ``--dh`` is discussed for +more info). You can also use the included test files :code:`client.crt`, +:code:`client.key`, :code:`server.crt`, :code:`server.key` and +:code:`ca.crt`. The ``.crt`` files are certificates/public-keys, the +``.key`` files are private keys, and :code:`ca.crt` is a certification +authority who has signed both :code:`client.crt` and :code:`server.crt`. +For Diffie Hellman parameters you can use the included file +:code:`dh2048.pem`. + +*WARNING:* + All client, server, and certificate authority certificates + and keys included in the OpenVPN distribution are totally + insecure and should be used for testing only. + +On bob: +:: + + openvpn --remote alice.example.com --dev tun1 \ + --ifconfig 10.4.0.1 10.4.0.2 \ + --tls-client --ca ca.crt \ + --cert client.crt --key client.key \ + --reneg-sec 60 --verb 5 + +On alice: +:: + + openvpn --remote bob.example.com --dev tun1 \ + --ifconfig 10.4.0.2 10.4.0.1 \ + --tls-server --dh dh1024.pem --ca ca.crt \ + --cert server.crt --key server.key \ + --reneg-sec 60 --verb 5 + +Now verify the tunnel is working by pinging across the tunnel. + +On bob: +:: + + ping 10.4.0.2 + +On alice: +:: + + ping 10.4.0.1 + +Notice the ``--reneg-sec 60`` option we used above. That tells OpenVPN +to renegotiate the data channel keys every minute. Since we used +``--verb 5`` above, you will see status information on each new key +negotiation. + +For production operations, a key renegotiation interval of 60 seconds is +probably too frequent. Omit the ``--reneg-sec 60`` option to use +OpenVPN's default key renegotiation interval of one hour. + + +Routing: +-------- + +Assuming you can ping across the tunnel, the next step is to route a +real subnet over the secure tunnel. Suppose that bob and alice have two +network interfaces each, one connected to the internet, and the other to +a private network. Our goal is to securely connect both private +networks. We will assume that bob's private subnet is *10.0.0.0/24* and +alice's is *10.0.1.0/24*. + +First, ensure that IP forwarding is enabled on both peers. On Linux, +enable routing: +:: + + echo 1 > /proc/sys/net/ipv4/ip_forward + +This setting is not persistent. Please see your operating systems +documentation how to properly configure IP forwarding, which is also +persistent through system boots. + +If your system is configured with a firewall. Please see your operating +systems guide on how to configure the firewall. You typically want to +allow traffic coming from and going to the tun/tap adapter OpenVPN is +configured to use. + +On bob: +:: + + route add -net 10.0.1.0 netmask 255.255.255.0 gw 10.4.0.2 + +On alice: +:: + + route add -net 10.0.0.0 netmask 255.255.255.0 gw 10.4.0.1 + +Now any machine on the *10.0.0.0/24* subnet can access any machine on the +*10.0.1.0/24* subnet over the secure tunnel (or vice versa). + +In a production environment, you could put the route command(s) in a +script and execute with the ``--up`` option. + diff --git a/doc/man-sections/generic-options.rst b/doc/man-sections/generic-options.rst new file mode 100644 index 00000000..35985afc --- /dev/null +++ b/doc/man-sections/generic-options.rst @@ -0,0 +1,436 @@ +Generic Options +--------------- +This section covers generic options which are accessible regardless of +which mode OpenVPN is configured as. + +--help + + Show options. + +--auth-nocache + Don't cache ``--askpass`` or ``--auth-user-pass`` username/passwords in + virtual memory. + + If specified, this directive will cause OpenVPN to immediately forget + username/password inputs after they are used. As a result, when OpenVPN + needs a username/password, it will prompt for input from stdin, which + may be multiple times during the duration of an OpenVPN session. + + When using ``--auth-nocache`` in combination with a user/password file + and ``--chroot`` or ``--daemon``, make sure to use an absolute path. + + This directive does not affect the ``--http-proxy`` username/password. + It is always cached. + +--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. + +--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 + +--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. + +--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. + +--engine engine-name + Enable OpenSSL hardware-based crypto engine functionality. + + If ``engine-name`` is specified, use a specific crypto engine. Use the + ``--show-engines`` standalone option to list the crypto engines which + are supported by OpenSSL. + +--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. + +--group group + Similar to the ``--user`` option, this option changes the group ID of + the OpenVPN process to ``group`` after initialization. + +--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. + +--iproute cmd + Set alternate command to execute instead of default ``iproute2`` command. + May be used in order to execute OpenVPN in unprivileged environment. + +--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`. + +--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. + +--nice n + Change process priority after initialization (``n`` greater than 0 is + lower priority, ``n`` less than zero is higher priority). + +--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. + +--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. + +--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. + +--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. + +--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. + +--test-crypto + Do a self-test of OpenVPN's crypto options by encrypting and decrypting + test packets using the data channel encryption options specified above. + This option does not require a peer to function, and therefore can be + specified without ``--dev`` or ``--remote``. + + The typical usage of ``--test-crypto`` would be something like this: + :: + + openvpn --test-crypto --secret key + + or + + :: + + openvpn --test-crypto --secret key --verb 9 + + This option is very useful to test OpenVPN after it has been ported to a + new platform, or to isolate problems in the compiler, OpenSSL crypto + library, or OpenVPN's crypto code. Since it is a self-test mode, + problems with encryption and authentication can be debugged + independently of network and tunnel issues. + +--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`` + +--use-prediction-resistance + Enable prediction resistance on mbed TLS's RNG. + + Enabling prediction resistance causes the RNG to reseed in each call for + random. Reseeding this often can quickly deplete the kernel entropy + pool. + + If you need this option, please consider running a daemon that adds + entropy to the kernel pool. + +--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). + +--writepid file + Write OpenVPN's main process ID to ``file``. + diff --git a/doc/man-sections/inline-files.rst b/doc/man-sections/inline-files.rst new file mode 100644 index 00000000..819bd3c8 --- /dev/null +++ b/doc/man-sections/inline-files.rst @@ -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` diff --git a/doc/man-sections/link-options.rst b/doc/man-sections/link-options.rst new file mode 100644 index 00000000..43e33176 --- /dev/null +++ b/doc/man-sections/link-options.rst @@ -0,0 +1,410 @@ +Link Options +------------ +This link options section covers options related to the connection between +the local and the remote host. + +--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. + +--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. + +--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. + +--keepalive args + A helper directive designed to simplify the expression of ``--ping`` and + ``--ping-restart``. + + Valid syntax: + :: + + keepalive interval ... [truncated message content] |