Changes between Initial Version and Version 1 of Openvpn20ManPage

07/24/14 13:57:38 (4 years ago)
Samuli Seppänen

Migrated content from


  • Openvpn20ManPage

    v1 v1  
     2<h2>NAME<a name="#lbAB"></a></h2>
     3<p>openvpn - secure IP tunnel daemon. <a name="lbAC" title="lbAC"></a>f</p>
     5<p><br /><strong>openvpn</strong> [ <strong>--help</strong> ]</p>
     6<p><br /><strong>openvpn</strong> [ <strong>--config</strong> <em>file</em> ]</p>
     7<p><br /><strong>openvpn</strong> [ <strong>--genkey</strong> ] [ <strong>--secret</strong> <em>file</em> ]</p>
     8<p><br /><strong>openvpn</strong> [ <strong>--mktun</strong> ] [ <strong>--rmtun</strong> ] [ <strong>--dev</strong> <em>tunX | tapX</em> ] [ <strong>--dev-type</strong> <em>device-type</em> ] [ <strong>--dev-node</strong> <em>node</em> ]</p>
     9<p><br /><strong>openvpn</strong> [ <strong>--test-crypto</strong> ] [ <strong>--secret</strong> <em>file</em> ] [ <strong>--auth</strong> <em>alg</em> ] [ <strong>--cipher</strong> <em>alg</em> ] [ <strong>--engine</strong> ] [ <strong>--keysize</strong> <em>n</em> ] [ <strong>--no-replay</strong> ] [ <strong>--no-iv</strong> ]</p>
     10<p><br /><strong>openvpn</strong> [ <strong>--askpass</strong> <em>[file]</em> ] [ <strong>--auth-nocache</strong> ] [ <strong>--auth-retry</strong> <em>type</em> ] [ <strong>--auth-user-pass-verify</strong> <em>script</em> ] [ <strong>--auth-user-pass</strong> <em>up</em> ] [ <strong>--auth</strong> <em>alg</em> ] [ <strong>--bcast-buffers</strong> <em>n</em> ] [ <strong>--ca</strong> <em>file</em> ] [ <strong>--ccd-exclusive</strong> ] [ <strong>--cd</strong> <em>dir</em> ] [ <strong>--cert</strong> <em>file</em> ] [ <strong>--chroot</strong> <em>dir</em> ] [ <strong>--cipher</strong> <em>alg</em> ] [ <strong>--client-cert-not-required</strong> ] [ <strong>--client-config-dir</strong> <em>dir</em> ] [ <strong>--client-connect</strong> <em>script</em> ] [ <strong>--client-disconnect</strong> ] [ <strong>--client-to-client</strong> ] [ <strong>--client</strong> ] [ <strong>--comp-lzo</strong> ] [ <strong>--comp-noadapt</strong> ] [ <strong>--config</strong> <em>file</em> ] [ <strong>--connect-freq</strong> <em>n sec</em> ] [ <strong>--connect-retry</strong> <em>n</em> ] [ <strong>--crl-verify</strong> <em>crl</em> ] [ <strong>--cryptoapicert</strong> <em>select-string</em> ] [ <strong>--daemon</strong> <em>[progname]</em> ] [ <strong>--dev-node</strong> <em>node</em> ] [ <strong>--dev-type</strong> <em>device-type</em> ] [ <strong>--dev</strong> <em>tunX | tapX | null</em> ] [ <strong>--dev</strong> <em>tunX | tapX</em> ] [ <strong>--dh</strong> <em>file</em> ] [ <strong>--dhcp-option</strong> <em>type [parm]</em> ] [ <strong>--dhcp-release</strong> ] [ <strong>--dhcp-renew</strong> ] [ <strong>--disable-occ</strong> ] [ <strong>--disable</strong> ] [ <strong>--down-pre</strong> ] [ <strong>--down</strong> <em>cmd</em> ] [ <strong>--duplicate-cn</strong> ] [ <strong>--echo</strong> <em>[parms...]</em> ] [ <strong>--engine</strong> <em>[engine-name]</em> ] [ <strong>--explicit-exit-notify</strong> <em>[n]</em> ] [ <strong>--fast-io</strong> ] [ <strong>--float</strong> ] [ <strong>--fragment</strong> <em>max</em> ] [ <strong>--genkey</strong> ] [ <strong>--group</strong> <em>group</em> ] [ <strong>--hand-window</strong> <em>n</em> ] [ <strong>--hash-size</strong> <em>r v</em> ] [ <strong>--help</strong> ] [ <strong>--http-proxy-option</strong> <em>type [parm]</em> ] [ <strong>--http-proxy-retry</strong> ] [ <strong>--http-proxy-timeout</strong> <em>n</em> ] [ <strong>--http-proxy</strong> <em>server port [authfile] [auth-method]</em> ] [ <strong>--ifconfig-noexec</strong> ] [ <strong>--ifconfig-nowarn</strong> ] [ <strong>--ifconfig-pool-linear</strong> ] [ <strong>--ifconfig-pool-persist</strong> <em>file [seconds]</em> ] [ <strong>--ifconfig-pool</strong> <em>start-IP end-IP [netmask]</em> ] [ <strong>--ifconfig-push</strong> <em>local remote-netmask</em> ] [ <strong>--ifconfig</strong> <em>l rn</em> ] [ <strong>--inactive</strong> <em>n</em> ] [ <strong>--inetd</strong> <em>[wait|nowait] [progname]</em> ] [ <strong>--ip-win32</strong> <em>method</em> ] [ <strong>--ipchange</strong> <em>cmd</em> ] [ <strong>--iroute</strong> <em>network [netmask]</em> ] [ <strong>--keepalive</strong> <em>n m</em> ] [ <strong>--key-method</strong> <em>m</em> ] [ <strong>--key</strong> <em>file</em> ] [ <strong>--keysize</strong> <em>n</em> ] [ <strong>--learn-address</strong> <em>cmd</em> ] [ <strong>--link-mtu</strong> <em>n</em> ] [ <strong>--local</strong> <em>host</em> ] [ <strong>--log-append</strong> <em>file</em> ] [ <strong>--log</strong> <em>file</em> ] [ <strong>--suppress-timestamps</strong> ] [ <strong>--lport</strong> <em>port</em> ] [ <strong>--management-hold</strong> ] [ <strong>--management-log-cache</strong> <em>n</em> ] [ <strong>--management-query-passwords</strong> ] [ <strong>--management</strong> <em>IP port [pw-file]</em> ] [ <strong>--max-clients</strong> <em>n</em> ] [ <strong>--max-routes-per-client</strong> <em>n</em> ] [ <strong>--mktun</strong> ] [ <strong>--mlock</strong> ] [ <strong>--mode</strong> <em>m</em> ] [ <strong>--mssfix</strong> <em>max</em> ] [ <strong>--mtu-disc</strong> <em>type</em> ] [ <strong>--mtu-test</strong> ] [ <strong>--mute-replay-warnings</strong> ] [ <strong>--mute</strong> <em>n</em> ] [ <strong>--nice</strong> <em>n</em> ] [ <strong>--no-iv</strong> ] [ <strong>--no-replay</strong> ] [ <strong>--nobind</strong> ] [ <strong>--ns-cert-type</strong> <em>client|server</em> ] [ <strong>--passtos</strong> ] [ <strong>--pause-exit</strong> ] [ <strong>--persist-key</strong> ] [ <strong>--persist-local-ip</strong> ] [ <strong>--persist-remote-ip</strong> ] [ <strong>--persist-tun</strong> ] [ <strong>--ping-exit</strong> <em>n</em> ] [ <strong>--ping-restart</strong> <em>n</em> ] [ <strong>--ping-timer-rem</strong> ] [ <strong>--ping</strong> <em>n</em> ] [ <strong>--pkcs12</strong> <em>file</em> ] [ <strong>--plugin</strong> <em>module-pathname init-string</em> ] [ <strong>--port</strong> <em>port</em> ] [ <strong>--proto</strong> <em>p</em> ] [ <strong>--pull</strong> ] [ <strong>--push-reset</strong> ] [ <strong>--push</strong> <em>"option"</em> ] [ <strong>--rcvbuf</strong> <em>size</em> ] [ <strong>--redirect-gateway</strong> <em>["local"] ["def1"]</em> ] [ <strong>--remap-usr1</strong> <em>signal</em> ] [ <strong>--remote-random</strong> ] [ <strong>--remote</strong> <em>host [port]</em> ] [ <strong>--reneg-bytes</strong> <em>n</em> ] [ <strong>--reneg-pkts</strong> <em>n</em> ] [ <strong>--reneg-sec</strong> <em>n</em> ] [ <strong>--replay-persist</strong> <em>file</em> ] [ <strong>--replay-window</strong> <em>n [t]</em> ] [ <strong>--resolv-retry</strong> <em>n</em> ] [ <strong>--rmtun</strong> ] [ <strong>--route-delay</strong> <em>[n] [w]</em> ] [ <strong>--route-gateway</strong> <em>gw</em> ] [ <strong>--route-method</strong> <em>m</em> ] [ <strong>--route-noexec</strong> ] [ <strong>--route-up</strong> <em>cmd</em> ] [ <strong>--route</strong> <em>network [netmask] [gateway] [metric]</em> ] [ <strong>--rport</strong> <em>port</em> ] [ <strong>--secret</strong> <em>file [direction]</em> ] [ <strong>--secret</strong> <em>file</em> ] [ <strong>--server-bridge</strong> <em>gateway netmask pool-start-IP pool-end-IP</em> ] [ <strong>--server</strong> <em>network netmask</em> ] [ <strong>--service</strong> <em>exit-event [0|1]</em> ] [ <strong>--setenv</strong> <em>name value</em> ] [ <strong>--shaper</strong> <em>n</em> ] [ <strong>--show-adapters</strong> ] [ <strong>--show-ciphers</strong> ] [ <strong>--show-digests</strong> ] [ <strong>--show-engines</strong> ] [ <strong>--show-net-up</strong> ] [ <strong>--show-net</strong> ] [ <strong>--show-tls</strong> ] [ <strong>--show-valid-subnets</strong> ] [ <strong>--single-session</strong> ] [ <strong>--sndbuf</strong> <em>size</em> ] [ <strong>--socks-proxy-retry</strong> ] [ <strong>--socks-proxy</strong> <em>server [port]</em> ] [ <strong>--status</strong> <em>file [n]</em> ] [ <strong>--status-version</strong> <em>n</em> ] [ <strong>--syslog</strong> <em>[progname]</em> ] [ <strong>--tap-sleep</strong> <em>n</em> ] [ <strong>--tcp-queue-limit</strong> <em>n</em> ] [ <strong>--test-crypto</strong> ] [ <strong>--tls-auth</strong> <em>file [direction]</em> ] [ <strong>--tls-cipher</strong> <em>l</em> ] [ <strong>--tls-client</strong> ] [ <strong>--tls-exit</strong> ] [ <strong>--tls-remote</strong> <em>x509name</em> ] [ <strong>--tls-server</strong> ] [ <strong>--tls-timeout</strong> <em>n</em> ] [ <strong>--tls-verify</strong> <em>cmd</em> ] [ <strong>--tmp-dir</strong> <em>dir</em> ] [ <strong>--tran-window</strong> <em>n</em> ] [ <strong>--tun-ipv6</strong> ] [ <strong>--tun-mtu-extra</strong> <em>n</em> ] [ <strong>--tun-mtu</strong> <em>n</em> ] [ <strong>--txqueuelen</strong> <em>n</em> ] [ <strong>--up-delay</strong> ] [ <strong>--up-restart</strong> ] [ <strong>--up</strong> <em>cmd</em> ] [ <strong>--user</strong> <em>user</em> ] [ <strong>--username-as-common-name</strong> ] [ <strong>--verb</strong> <em>n</em> ] [ <strong>--writepid</strong> <em>file</em> ] <br /><a name="lbAD" title="lbAD"></a></p>
     12<p>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.</p>
     13<p>Also note that there's more documentation and examples on the OpenVPN web site: <em><a href=""></a></em></p>
     14<p>And if you would like to see a shorter version of this manual, see the openvpn usage message which can be obtained by running <strong>openvpn</strong> without any parameters. <a name="lbAE" title="lbAE"></a></p>
     16<p>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.</p>
     17<p>OpenVPN is tightly bound to the OpenSSL library, and derives much of its crypto capabilities from it.</p>
     18<p>OpenVPN supports conventional encryption using a pre-shared secret key <strong>(Static Key mode)</strong> or public key security <strong>(SSL/TLS mode)</strong> using client &amp; server certificates. OpenVPN also supports non-encrypted TCP/UDP tunnels.</p>
     19<p>OpenVPN is designed to work with the <strong>TUN/TAP</strong> virtual networking interface that exists on most platforms.</p>
     20<p>Overall, OpenVPN aims to offer many of the key features of IPSec but with a relatively lightweight footprint. <a name="lbAF" title="lbAF"></a></p>
     22<p>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.</p>
     23<dl><dt><strong>--help</strong></dt><dd>Show options.</dd><dt><strong>--config file</strong></dt><dd>Load additional config options from <strong>file</strong>where each line corresponds to one command line option, but with the leading '--' removed.
     24<p>If <strong>--config file</strong> is the only option to the openvpn command, the <strong>--config</strong> can be removed, and the command can be given as <strong>openvpn file</strong></p>
     25<p>Note that configuration files can be nested to a reasonable depth.</p>
     26<p>Double quotation characters ("") can be used to enclose single parameters containing whitespace, and "#" or ";" characters in the first column can be used to denote comments.</p>
     27<p>Note that OpenVPN 2.0 and higher performs backslash-based shell escaping, so the following mappings should be observed:</p>
     28<p> </p>
     30<pre>\\       Maps to a single backslash character (\).<br />\"       Pass a literal doublequote character ("), don't<br />         interpret it as enclosing a parameter.<br />\[SPACE] Pass a literal space or tab character, don't<br />         interpret it as a parameter delimiter.<br /><br /></pre>
     32<p>For example on Windows, use double backslashes to represent pathnames:</p>
     33<p> </p>
     35<pre>secret "c:\\OpenVPN\\secret.key"<br /><br /></pre>
     37<p>For examples of configuration files, see <em><a href="examples.html"></a></em></p>
     38<p>Here is an example configuration file:</p>
     40<pre>#<br /># Sample OpenVPN configuration file for<br /># using a pre-shared static key.<br />#<br /># '#' or ';' may be used to delimit comments.<br /><br /># Use a dynamic tun device.<br />dev tun<br /><br /># Our remote peer<br />remote mypeer.mydomain<br /><br /># is our local VPN endpoint<br /># is our remote VPN endpoint<br />ifconfig<br /><br /># Our pre-shared static key<br />secret static.key<br /><br /></pre>
     42<p><a name="lbAG" title="lbAG"></a></p>
     43<h3>Tunnel Options:</h3>
     44<dl><dt><strong>--mode m</strong></dt><dd>Set OpenVPN major mode. By default, OpenVPN runs in point-to-point mode ("p2p"). OpenVPN 2.0 introduces a new mode ("server") which implements a multi-client server capability.</dd><dt><strong>--local host</strong></dt><dd>Local host name or IP address. If specified, OpenVPN will bind to this address only. If unspecified, OpenVPN will bind to all interfaces.</dd><dt><strong>--remote host [port]</strong></dt><dd>Remote host name or IP address. On the client, multiple <strong>--remote</strong>options may be specified for redundancy, each referring to a different OpenVPN server.
     45<p>The OpenVPN client will try to connect to a server at <strong>host:port</strong> in the order specified by the list of <strong>--remote</strong> options.</p>
     46<p>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.</p>
     47<p>Note that since UDP is connectionless, connection failure is defined by the <strong>--ping</strong> and <strong>--ping-restart</strong> options.</p>
     48<p>Note the following corner case: If you use multiple <strong>--remote</strong> options, AND you are dropping root privileges on the client with <strong>--user</strong> and/or <strong>--group,</strong> 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.</p>
     49<p>If <strong>--remote</strong> 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).</p>
     50<p>When used in TCP mode, <strong>--remote</strong> will act as a filter, rejecting connections from any host which does not match <strong>host.</strong></p>
     51<p>If <strong>host</strong> is a DNS name which resolves to multiple IP addresses, one will be randomly chosen, providing a sort of basic load-balancing and failover capability.</p>
     52</dd><dt><strong>--remote-random</strong></dt><dd>When multiple <strong>--remote</strong> address/ports are specified, initially randomize the order of the list as a kind of basic load-balancing measure.</dd><dt><strong>--proto p</strong></dt><dd>Use protocol <strong>p</strong> for communicating with remote host. <strong>p</strong> can be <strong>udp,</strong> <strong>tcp-client,</strong> or <strong>tcp-server.</strong>
     53<p>The default protocol is <strong>udp</strong> when <strong>--proto</strong> is not specified.</p>
     54<p>For UDP operation, <strong>--proto udp</strong> should be specified on both peers.</p>
     55<p>For TCP operation, one peer must use <strong>--proto tcp-server</strong> and the other must use <strong>--proto tcp-client.</strong> A peer started with <strong>tcp-server</strong> will wait indefinitely for an incoming connection. A peer started with <strong>tcp-client</strong> will attempt to connect, and if that fails, will sleep for 5 seconds (adjustable via the <strong>--connect-retry</strong> option) and try again. Both TCP client and server will simulate a SIGUSR1 restart signal if either side resets the connection.</p>
     56<p>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.</p>
     57<p>This article outlines some of problems with tunneling IP over TCP:</p>
     58<p><em><a href=""></a></em></p>
     59<p>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.</p>
     60</dd><dt><strong>--connect-retry n</strong></dt><dd>For <strong>--proto tcp-client,</strong> take <strong>n</strong> as the number of seconds to wait between connection retries (default=5).</dd><dt><strong>--http-proxy server port [authfile] [auth-method]</strong></dt><dd>Connect to remote host through an HTTP proxy at address <strong>server</strong> and port <strong>port.</strong> If HTTP Proxy-Authenticate is required, <strong>authfile</strong>is a file containing a username and password on 2 lines, or "stdin" to prompt from console.
     61<p><strong>auth-method</strong> should be one of "none", "basic", or "ntlm".</p>
     62</dd><dt><strong>--http-proxy-retry</strong></dt><dd>Retry indefinitely on HTTP proxy errors. If an HTTP proxy error occurs, simulate a SIGUSR1 reset.</dd><dt><strong>--http-proxy-timeout n</strong></dt><dd>Set proxy timeout to <strong>n</strong> seconds, default=5.</dd><dt><strong>--http-proxy-option type [parm]</strong></dt><dd>Set extended HTTP proxy options. Repeat to set multiple options.
     63<p><strong>VERSION version --</strong> Set HTTP version number to <strong>version</strong> (default=1.0).</p>
     64<p><strong>AGENT user-agent --</strong> Set HTTP "User-Agent" string to <strong>user-agent.</strong></p>
     65</dd><dt><strong>--socks-proxy server [port]</strong></dt><dd>Connect to remote host through a Socks5 proxy at address <strong>server</strong> and port <strong>port</strong> (default=1080).</dd><dt><strong>--socks-proxy-retry</strong></dt><dd>Retry indefinitely on Socks proxy errors. If a Socks proxy error occurs, simulate a SIGUSR1 reset.</dd><dt><strong>--resolv-retry n</strong></dt><dd>If hostname resolve fails for <strong>--remote,</strong> retry resolve for <strong>n</strong>seconds before failing.
     66<p>Set <strong>n</strong> to "infinite" to retry indefinitely.</p>
     67<p>By default, <strong>--resolv-retry infinite</strong> is enabled. You can disable by setting n=0.</p>
     68</dd><dt><strong>--float</strong></dt><dd>Allow remote peer to change its IP address and/or port number, such as due to DHCP (this is the default if <strong>--remote</strong> is not used). <strong>--float</strong> when specified with <strong>--remote</strong>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.
     69<p>Essentially, <strong>--float</strong> tells OpenVPN to accept authenticated packets from any address, not only the address which was specified in the <strong>--remote</strong> option.</p>
     70</dd><dt><strong>--ipchange cmd</strong></dt><dd>Execute shell command <strong>cmd</strong>when our remote ip-address is initially authenticated or changes.
     71<p>Execute as:</p>
     72<p><strong>cmd ip_address port_number</strong></p>
     73<p>Don't use <strong>--ipchange</strong> in <strong>--mode server</strong> mode. Use a <strong>--client-connect</strong> script instead.</p>
     74<p>See the "Environmental Variables" section below for additional parameters passed as environmental variables.</p>
     75<p>Note that <strong>cmd</strong> can be a shell command with multiple arguments, in which case all OpenVPN-generated arguments will be appended to <strong>cmd</strong> to build a command line which will be passed to the script.</p>
     76<p>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 <em>/etc/hosts</em> file with the current address of the peer. The script will be run every time the remote peer changes its IP address.</p>
     77<p>Similarly if <em>our</em> IP address changes due to DHCP, we should configure our IP address change script (see man page for <strong>dhcpcd</strong>(8) ) to deliver a <strong>SIGHUP</strong> or <strong>SIGUSR1</strong> signal to OpenVPN. OpenVPN will then reestablish a connection with its most recently authenticated peer on its new IP address.</p>
     78</dd><dt><strong>--port port</strong></dt><dd>TCP/UDP port number for both local and remote. 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.</dd><dt><strong>--lport port</strong></dt><dd>TCP/UDP port number for local.</dd><dt><strong>--rport port</strong></dt><dd>TCP/UDP port number for remote.</dd><dt><strong>--nobind</strong></dt><dd>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 <strong>--remote</strong> option.</dd><dt><strong>--dev tunX | tapX | null</strong></dt><dd>TUN/TAP virtual network device ( <strong>X</strong>can be omitted for a dynamic device.)
     79<p>See examples section below for an example on setting up a TUN device.</p>
     80<p>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 protocols.</p>
     81<p><strong>tun</strong> devices encapsulate IPv4 while <strong>tap</strong> devices encapsulate ethernet 802.3.</p>
     82</dd><dt><strong>--dev-type device-type</strong></dt><dd>Which device type are we using? <strong>device-type</strong> should be <strong>tun</strong> or <strong>tap.</strong> Use this option only if the TUN/TAP device used with <strong>--dev</strong> does not begin with <strong>tun</strong> or <strong>tap.</strong></dd><dt><strong>--tun-ipv6</strong></dt><dd>Build a tun link capable of forwarding IPv6 traffic. Should be used in conjunction with <strong>--dev tun</strong> or <strong>--dev tunX.</strong> A warning will be displayed if no specific IPv6 TUN support for your OS has been compiled into OpenVPN.</dd><dt><strong>--dev-node node</strong></dt><dd>Explicitly set the device node rather than using /dev/net/tun, /dev/tun, /dev/tap, etc. If OpenVPN cannot figure out whether <strong>node</strong> is a TUN or TAP device based on the name, you should also specify <strong>--dev-type tun</strong> or <strong>--dev-type tap.</strong>
     83<p>On Windows systems, select the TAP-Win32 adapter which is named <strong>node</strong> in the Network Connections Control Panel or the raw GUID of the adapter enclosed by braces. The <strong>--show-adapters</strong> 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.</p>
     84</dd><dt><strong>--ifconfig l rn</strong></dt><dd>Set TUN/TAP adapter parameters. <strong>l</strong> is the IP address of the local VPN endpoint. For TUN devices, <strong>rn</strong> is the IP address of the remote VPN endpoint. For TAP devices, <strong>rn</strong>is the subnet mask of the virtual ethernet segment which is being created or connected to.
     85<p>For TUN devices, which facilitate virtual point-to-point IP connections, the proper usage of <strong>--ifconfig</strong> 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 <strong>rn,</strong> you will be pinging across the VPN.</p>
     86<p>For TAP devices, which provide the ability to create virtual ethernet segments, <strong>--ifconfig</strong> 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).</p>
     87<p>This option, while primarily a proxy for the <strong>ifconfig</strong>(8) command, is designed to simplify TUN/TAP tunnel configuration by providing a standard interface to the different ifconfig implementations on different platforms.</p>
     88<p><strong>--ifconfig</strong> parameters which are IP addresses can also be specified as a DNS or /etc/hosts file resolvable name.</p>
     89<p>For TAP devices, <strong>--ifconfig</strong> should not be used if the TAP interface will be getting an IP address lease from a DHCP server.</p>
     90</dd><dt><strong>--ifconfig-noexec</strong></dt><dd>Don't actually execute ifconfig/netsh commands, instead pass <strong>--ifconfig</strong> parameters to scripts using environmental variables.</dd><dt><strong>--ifconfig-nowarn</strong></dt><dd>Don't output an options consistency check warning if the <strong>--ifconfig</strong> 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 <strong>--disable-occ</strong>option) while only disabling the ifconfig component of the check.
     91<p>For example, if you have a configuration where the local host uses <strong>--ifconfig</strong> but the remote host does not, use <strong>--ifconfig-nowarn</strong> on the local host.</p>
     92<p>This option will also silence warnings about potential address conflicts which occasionally annoy more experienced users by triggering "false positive" warnings.</p>
     93</dd><dt><strong>--route network/IP [netmask] [gateway] [metric]</strong></dt><dd>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.
     94<p>This option is intended as a convenience proxy for the <strong>route</strong>(8) shell command, while at the same time providing portable semantics across OpenVPN's platform space.</p>
     95<p><strong>netmask</strong> default --</p>
     96<p><strong>gateway</strong> default -- taken from <strong>--route-gateway</strong> or the second parameter to <strong>--ifconfig</strong> when <strong>--dev tun</strong> is specified.</p>
     97<p>The default can be specified by leaving an option blank or setting it to "default".</p>
     98<p>The <strong>network</strong> and <strong>gateway</strong> parameters can also be specified as a DNS or /etc/hosts file resolvable name, or as one of three special keywords:</p>
     99<p><strong>vpn_gateway</strong> -- The remote VPN endpoint address (derived either from <strong>--route-gateway</strong> or the second parameter to <strong>--ifconfig</strong> when <strong>--dev tun</strong> is specified).</p>
     100<p><strong>net_gateway</strong> -- The pre-existing IP default gateway, read from the routing table (not supported on all OSes).</p>
     101<p><strong>remote_host</strong> -- The <strong>--remote</strong> address if OpenVPN is being run in client mode, and is undefined in server mode.</p>
     102</dd><dt><strong>--route-gateway gw</strong></dt><dd>Specify a default gateway <strong>gw</strong> for use with <strong>--route.</strong></dd><dt><strong>--route-delay [n] [w]</strong></dt><dd>Delay <strong>n</strong> seconds (default=0) after connection establishment, before adding routes. If <strong>n</strong> is 0, routes will be added immediately upon connection establishment. If <strong>--route-delay</strong> is omitted, routes will be added immediately after TUN/TAP device open and <strong>--up</strong> script execution, before any <strong>--user</strong> or <strong>--group</strong> privilege downgrade (or <strong>--chroot</strong>execution.)
     103<p>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.</p>
     104<p>On Windows, <strong>--route-delay</strong> tries to be more intelligent by waiting <strong>w</strong> seconds (w=30 by default) for the TAP-Win32 adapter to come up before adding routes.</p>
     105</dd><dt><strong>--route-up cmd</strong></dt><dd>Execute shell command <strong>cmd</strong> after routes are added, subject to <strong>--route-delay.</strong>
     106<p>See the "Environmental Variables" section below for additional parameters passed as environmental variables.</p>
     107<p>Note that <strong>cmd</strong> can be a shell command with multiple arguments.</p>
     108</dd><dt><strong>--route-noexec</strong></dt><dd>Don't add or remove routes automatically. Instead pass routes to <strong>--route-up</strong> script using environmental variables.</dd><dt><strong>--redirect-gateway [local] [def1]</strong></dt><dd>(Experimental) Automatically execute routing commands to cause all outgoing IP traffic to be redirected over the VPN.
     109<p>This option performs three steps:</p>
     110<p><strong>(1)</strong> Create a static route for the <strong>--remote</strong> address which forwards to the pre-existing default gateway. This is done so that <strong>(3)</strong> will not create a routing loop.</p>
     111<p><strong>(2)</strong> Delete the default gateway route.</p>
     112<p><strong>(3)</strong> Set the new default gateway to be the VPN endpoint address (derived either from <strong>--route-gateway</strong> or the second parameter to <strong>--ifconfig</strong> when <strong>--dev tun</strong> is specified).</p>
     113<p>When the tunnel is torn down, all of the above steps are reversed so that the original default route is restored.</p>
     114<p>Add the <strong>local</strong> flag if both OpenVPN servers are directly connected via a common subnet, such as with wireless. The <strong>local</strong> flag will cause step <strong>1</strong> above to be omitted.</p>
     115<p>Add the <strong>def1</strong> flag to override the default gateway by using and rather than This has the benefit of overriding but not wiping out the original default gateway.</p>
     116<p>Using the def1 flag is highly recommended, and is currently planned to become the default by OpenVPN 2.1.</p>
     117</dd><dt><strong>--link-mtu n</strong></dt><dd>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.</dd><dt><strong>--tun-mtu n</strong></dt><dd>Take the TUN device MTU to be <strong>n</strong>and derive the link MTU from it (default=1500). In most cases, you will probably want to leave this parameter set to its default value.
     118<p>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.</p>
     119<p>MTU problems often manifest themselves as connections which hang during periods of active usage.</p>
     120<p>It's best to use the <strong>--fragment</strong> and/or <strong>--mssfix</strong> options to deal with MTU sizing issues.</p>
     121</dd><dt><strong>--tun-mtu-extra n</strong></dt><dd>Assume that the TUN/TAP device might return as many as <strong>n</strong> bytes more than the <strong>--tun-mtu</strong> 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.</dd><dt><strong>--mtu-disc type</strong></dt><dd>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.
     122<p><strong>'no'</strong> -- Never send DF (Don't Fragment) frames <br /><strong>'maybe'</strong> -- Use per-route hints <br /><strong>'yes'</strong> -- Always DF (Don't Fragment)</p>
     123</dd><dt><strong>--mtu-test</strong></dt><dd>To empirically measure MTU on connection startup, add the <strong>--mtu-test</strong> 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 <strong>--mtu-test</strong> process normally takes about 3 minutes to complete.</dd><dt><strong>--fragment max</strong></dt><dd>Enable internal datagram fragmentation so that no UDP datagrams are sent which are larger than <strong>max</strong>bytes.
     124<p>The <strong>max</strong> parameter is interpreted in the same way as the <strong>--link-mtu</strong> parameter, i.e. the UDP packet size after encapsulation overhead has been added in, but not including the UDP header itself.</p>
     125<p>The <strong>--fragment</strong> option only makes sense when you are using the UDP protocol ( <strong>--proto udp</strong> ).</p>
     126<p><strong>--fragment</strong> adds 4 bytes of overhead per datagram.</p>
     127<p>See the <strong>--mssfix</strong> option below for an important related option to <strong>--fragment.</strong></p>
     128<p>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.</p>
     129<p>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.</p>
     130</dd><dt><strong>--mssfix max</strong></dt><dd>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 <strong>max</strong>bytes.
     131<p>The <strong>max</strong> parameter is interpreted in the same way as the <strong>--link-mtu</strong> parameter, i.e. the UDP packet size after encapsulation overhead has been added in, but not including the UDP header itself.</p>
     132<p>The <strong>--mssfix</strong> option only makes sense when you are using the UDP protocol for OpenVPN peer-to-peer communication, i.e. <strong>--proto udp.</strong></p>
     133<p><strong>--mssfix</strong> and <strong>--fragment</strong> can be ideally used together, where <strong>--mssfix</strong> 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), <strong>--fragment</strong> will internally fragment them.</p>
     134<p>Both <strong>--fragment</strong> and <strong>--mssfix</strong> are designed to work around cases where Path MTU discovery is broken on the network path between OpenVPN peers.</p>
     135<p>The usual symptom of such a breakdown is an OpenVPN connection which successfully starts, but then stalls during active usage.</p>
     136<p>If <strong>--fragment</strong> and <strong>--mssfix</strong> are used together, <strong>--mssfix</strong> will take its default <strong>max</strong> parameter from the <strong>--fragment max</strong> option.</p>
     137<p>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:</p>
     138<p><strong>--tun-mtu 1500 --fragment 1300 --mssfix</strong></p>
     139</dd><dt><strong>--sndbuf size</strong></dt><dd>Set the TCP/UDP socket send buffer size. Currently defaults to 65536 bytes.</dd><dt><strong>--rcvbuf size</strong></dt><dd>Set the TCP/UDP socket receive buffer size. Currently defaults to 65536 bytes.</dd><dt><strong>--txqueuelen n</strong></dt><dd>(Linux only) Set the TX queue length on the TUN/TAP interface. Currently defaults to 100.</dd><dt><strong>--shaper n</strong></dt><dd>Limit bandwidth of outgoing tunnel data to <strong>n</strong>bytes per second on the TCP/UDP port. If you want to limit the bandwidth in both directions, use this option on both peers.
     140<p>OpenVPN uses the following algorithm to implement traffic shaping: Given a shaper rate of <em>n</em> bytes per second, after a datagram write of <em>b</em> bytes is queued on the TCP/UDP port, wait a minimum of <em>(b / n)</em> seconds before queuing the next write.</p>
     141<p>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.</p>
     142<p>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.</p>
     143<p>OpenVPN allows <strong>n</strong> to be between 100 bytes/sec and 100 Mbytes/sec.</p>
     144</dd><dt><strong>--inactive n</strong></dt><dd>(Experimental) Causes OpenVPN to exit after <strong>n</strong> seconds of inactivity on the TUN/TAP device. The time length of inactivity is measured since the last incoming tunnel packet.</dd><dt><strong>--ping n</strong></dt><dd>Ping remote over the TCP/UDP control channel if no packets have been sent for at least <strong>n</strong> seconds (specify <strong>--ping</strong> 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 <strong>--secret, --tls-server,</strong> or <strong>--tls-client</strong>is specified), the ping packet will be cryptographically secure.
     145<p>This option has two intended uses:</p>
     146<p>(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.</p>
     147<p>(2) To provide a basis for the remote to test the existence of its peer using the <strong>--ping-exit</strong> option.</p>
     148</dd><dt><strong>--ping-exit n</strong></dt><dd>Causes OpenVPN to exit after <strong>n</strong> seconds pass without reception of a ping or other packet from remote. This option can be combined with <strong>--inactive, --ping,</strong> and <strong>--ping-exit</strong>to create a two-tiered inactivity disconnect.
     149<p>For example,</p>
     150<p><strong>openvpn [options...] --inactive 3600 --ping 10 --ping-exit 60</strong></p>
     151<p>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.</p>
     152</dd><dt><strong>--ping-restart n</strong></dt><dd>Similar to <strong>--ping-exit,</strong> but trigger a <strong>SIGUSR1</strong> restart after <strong>n</strong>seconds pass without reception of a ping or other packet from remote.
     153<p>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 <em><a href=""></a></em> + a dynamic DNS client such as <strong>ddclient.</strong></p>
     154<p>If the peer cannot be reached, a restart will be triggered, causing the hostname used with <strong>--remote</strong> to be re-resolved (if <strong>--resolv-retry</strong> is also specified).</p>
     155<p>In server mode, <strong>--ping-restart, --inactive,</strong> 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.</p>
     156<p>In client mode, the <strong>--ping-restart</strong> 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 <strong>--keepalive</strong> setting in the server configuration. To disable the 120 second default, set <strong>--ping-restart 0</strong> on the client.</p>
     157<p>See the signals section below for more information on <strong>SIGUSR1.</strong></p>
     158<p>Note that the behavior of <strong>SIGUSR1</strong> can be modified by the <strong>--persist-tun, --persist-key, --persist-local-ip,</strong> and <strong>--persist-remote-ip</strong> options.</p>
     159<p>Also note that <strong>--ping-exit</strong> and <strong>--ping-restart</strong> are mutually exclusive and cannot be used together.</p>
     160</dd><dt><strong>--keepalive n m</strong></dt><dd>A helper directive designed to simplify the expression of <strong>--ping</strong> and <strong>--ping-restart</strong>in server mode configurations.
     161<p>For example, <strong>--keepalive 10 60</strong> expands as follows:</p>
     162<p> </p>
     164<pre> if mode server:<br />   ping 10<br />   ping-restart 120<br />   push "ping 10"<br />   push "ping-restart 60"<br /> else<br />   ping 10<br />   ping-restart 60<br /><br /></pre>
     165</dd></dl></dd><dt><strong>--ping-timer-rem</strong></dt><dd>Run the <strong>--ping-exit</strong> / <strong>--ping-restart</strong> 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 <strong>--remote</strong> peer), and you don't want to start clocking timeouts until a remote peer connects.</dd><dt><strong>--persist-tun</strong></dt><dd>Don't close and reopen TUN/TAP device or run up/down scripts across <strong>SIGUSR1</strong> or <strong>--ping-restart</strong>restarts.
     166<p><strong>SIGUSR1</strong> is a restart signal similar to <strong>SIGHUP,</strong> but which offers finer-grained control over reset options.</p>
     167</dd><dt><strong>--persist-key</strong></dt><dd>Don't re-read key files across <strong>SIGUSR1</strong> or <strong>--ping-restart.</strong>
     168<p>This option can be combined with <strong>--user nobody</strong> to allow restarts triggered by the <strong>SIGUSR1</strong> 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.</p>
     169<p>This option solves the problem by persisting keys across <strong>SIGUSR1</strong> resets, so they don't need to be re-read.</p>
     170</dd><dt><strong>--persist-local-ip</strong></dt><dd>Preserve initially resolved local IP address and port number across <strong>SIGUSR1</strong> or <strong>--ping-restart</strong> restarts.</dd><dt><strong>--persist-remote-ip</strong></dt><dd>Preserve most recently authenticated remote IP address and port number across <strong>SIGUSR1</strong> or <strong>--ping-restart</strong> restarts.</dd><dt><strong>--mlock</strong></dt><dd>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 <strong>--user</strong>option).
     171<p>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 <strong>--reneg</strong> options (see below), then are discarded.</p>
     172<p>The downside of using <strong>--mlock</strong> is that it will reduce the amount of physical memory available to other applications.</p>
     173</dd><dt><strong>--up cmd</strong></dt><dd>Shell command to run after successful TUN/TAP device open (pre <strong>--user</strong>UID change). The up script 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.
     174<p>For <strong>--dev tun</strong> execute as:</p>
     175<p><strong>cmd tun_dev tun_mtu link_mtu ifconfig_local_ip ifconfig_remote_ip [ init | restart ]</strong></p>
     176<p>For <strong>--dev tap</strong> execute as:</p>
     177<p><strong>cmd tap_dev tap_mtu link_mtu ifconfig_local_ip ifconfig_netmask [ init | restart ]</strong></p>
     178<p>See the "Environmental Variables" section below for additional parameters passed as environmental variables.</p>
     179<p>Note that <strong>cmd</strong> can be a shell command with multiple arguments, in which case all OpenVPN-generated arguments will be appended to <strong>cmd</strong> to build a command line which will be passed to the shell.</p>
     180<p>Typically, <strong>cmd</strong> will run a script to add routes to the tunnel.</p>
     181<p>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 <em>init.</em> If the <strong>--up-restart</strong> 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 <strong>--persist-tun</strong> option will enable such preservation). A restart can be generated by a SIGUSR1 signal, a <strong>--ping-restart</strong> timeout, or a connection reset when the TCP protocol is enabled with the <strong>--proto</strong> option. If a restart occurs, and <strong>--up-restart</strong> has been specified, the up script will be called with <em>restart</em> as the last parameter.</p>
     182<p>The following standalone example shows how the <strong>--up</strong> 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).</p>
     183<p><strong>openvpn --dev tun --port 9999 --verb 4 --ping-restart 10 --up 'echo up' --down 'echo down' --persist-tun --up-restart</strong></p>
     184<p>Note that OpenVPN also provides the <strong>--ifconfig</strong> option to automatically ifconfig the TUN device, eliminating the need to define an <strong>--up</strong> script, unless you also want to configure routes in the <strong>--up</strong> script.</p>
     185<p>If <strong>--ifconfig</strong> is also specified, OpenVPN will pass the ifconfig local and remote endpoints on the command line to the <strong>--up</strong> script so that they can be used to configure routes such as:</p>
     186<p><strong>route add -net netmask gw $5</strong></p>
     187</dd><dt><strong>--up-delay</strong></dt><dd>Delay TUN/TAP open and possible <strong>--up</strong>script execution until after TCP/UDP connection establishment with peer.
     188<p>In <strong>--proto udp</strong> mode, this option normally requires the use of <strong>--ping</strong> to allow connection initiation to be sensed in the absence of tunnel data, since UDP is a "connectionless" protocol.</p>
     189<p>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.</p>
     190</dd><dt><strong>--down cmd</strong></dt><dd>Shell command to run after TUN/TAP device close (post <strong>--user</strong> UID change and/or <strong>--chroot</strong> ). Called with the same parameters and environmental variables as the <strong>--up</strong>option above.
     191<p>Note that if you reduce privileges by using <strong>--user</strong> and/or <strong>--group,</strong> your <strong>--down</strong> script will also run at reduced privilege.</p>
     192</dd><dt><strong>--down-pre</strong></dt><dd>Call <strong>--down</strong> cmd/script before, rather than after, TUN/TAP close.</dd><dt><strong>--up-restart</strong></dt><dd>Enable the <strong>--up</strong> and <strong>--down</strong> scripts to be called for restarts as well as initial program start. This option is described more fully above in the <strong>--up</strong> option documentation.</dd><dt><strong>--setenv name value</strong></dt><dd>Set a custom environmental variable <strong>name=value</strong> to pass to script.</dd><dt><strong>--disable-occ</strong></dt><dd>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 <strong>--dev tun</strong> while the other peer uses <strong>--dev tap.</strong>
     193<p>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.</p>
     194</dd><dt><strong>--user user</strong></dt><dd>Change the user ID of the OpenVPN process to <strong>user</strong>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.
     195<p>By setting <strong>user</strong> to <em>nobody</em> 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 <strong>SIGUSR1</strong> signal (for example in response to a DHCP reset), you should make use of one or more of the <strong>--persist</strong> 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 <strong>ifconfig</strong> on the TUN device).</p>
     196</dd><dt><strong>--group group</strong></dt><dd>Similar to the <strong>--user</strong> option, this option changes the group ID of the OpenVPN process to <strong>group</strong> after initialization.</dd><dt><strong>--cd dir</strong></dt><dd>Change directory to <strong>dir</strong> prior to reading any files such as configuration files, key files, scripts, etc. <strong>dir</strong>should be an absolute path, with a leading "/", and without any references to the current directory such as "." or "..".
     197<p>This option is useful when you are running OpenVPN in <strong>--daemon</strong> mode, and you want to consolidate all of your OpenVPN control files in one location.</p>
     198</dd><dt><strong>--chroot dir</strong></dt><dd>Chroot to <strong>dir</strong> after initialization. <strong>--chroot</strong> essentially redefines <strong>dir</strong>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.
     199<p>Since the chroot operation is delayed until after initialization, most OpenVPN options that reference files will operate in a pre-chroot context.</p>
     200<p>In many cases, the <strong>dir</strong> parameter can point to an empty directory, however complications can result when scripts or restarts are executed after the chroot operation.</p>
     201</dd><dt><strong>--daemon [progname]</strong></dt><dd>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 /var/log/messages), except for the output of shell scripts and ifconfig commands, which will go to /dev/null unless otherwise redirected. The syslog redirection occurs immediately at the point that <strong>--daemon</strong> is parsed on the command line even though the daemonization point occurs later. If one of the <strong>--log</strong>options is present, it will supercede syslog redirection.
     202<p>The optional <strong>progname</strong> parameter will cause OpenVPN to report its program name to the system logger as <strong>progname.</strong> This can be useful in linking OpenVPN messages in the syslog file with specific tunnels. When unspecified, <strong>progname</strong> defaults to "openvpn".</p>
     203<p>When OpenVPN is run with the <strong>--daemon</strong> 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.</p>
     204<p>In OpenVPN, the vast majority of errors which occur after initialization are non-fatal.</p>
     205</dd><dt><strong>--syslog [progname]</strong></dt><dd>Direct log output to system logger, but do not become a daemon. See <strong>--daemon</strong> directive above for description of <strong>progname</strong> parameter.</dd><dt><strong>--passtos</strong></dt><dd>Set the TOS field of the tunnel packet to what the payload's TOS is.</dd><dt><strong>--inetd [wait|nowait] [progname]</strong></dt><dd>Use this option when OpenVPN is being run from the inetd or <strong>xinetd(8)</strong>server.
     206<p>The <strong>wait/nowait</strong> option must match what is specified in the inetd/xinetd config file. The <strong>nowait</strong> mode can only be used with <strong>--proto tcp-server.</strong> The default is <strong>wait.</strong> The <strong>nowait</strong> 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: <em><a href="faq.html#oneport"></a></em></p>
     207<p>This option precludes the use of <strong>--daemon, --local,</strong> or <strong>--remote.</strong> Note that this option causes message and error output to be handled in the same way as the <strong>--daemon</strong> option. The optional <strong>progname</strong> parameter is also handled exactly as in <strong>--daemon.</strong></p>
     208<p>Also note that in <strong>wait</strong> 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: <em><a href="1xhowto.html"></a></em></p>
     209</dd><dt><strong>--log file</strong></dt><dd>Output logging messages to <strong>file,</strong> including output to stdout/stderr which is generated by called scripts. If <strong>file</strong> already exists it will be truncated. This option takes effect immediately when it is parsed in the command line and will supercede syslog output if <strong>--daemon</strong> or <strong>--inetd</strong> is also specified. This option is persistent over the entire course of an OpenVPN instantiation and will not be reset by SIGHUP, SIGUSR1, or <strong>--ping-restart.</strong>
     210<p>Note that on Windows, when OpenVPN is started as a service, logging occurs by default without the need to specify this option.</p>
     211</dd><dt><strong>--log-append file</strong></dt><dd>Append logging messages to <strong>file.</strong> If <strong>file</strong> does not exist, it will be created. This option behaves exactly like <strong>--log</strong> except that it appends to rather than truncating the log file.</dd><dt><strong>--suppress-timestamps</strong></dt><dd>Avoid writing timestamps to log messages, even when they otherwise would be prepended. In particular, this applies to log messages sent to stdout.</dd><dt><strong>--writepid file</strong></dt><dd>Write OpenVPN's main process ID to <strong>file.</strong></dd><dt><strong>--nice n</strong></dt><dd>Change process priority after initialization ( <strong>n</strong> greater than 0 is lower priority, <strong>n</strong> less than zero is higher priority).</dd><dt><strong>--fast-io</strong></dt><dd>(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%.
     212<p>This option can only be used on non-Windows systems, when <strong>--proto udp</strong> is specified, and when <strong>--shaper</strong> is NOT specified.</p>
     213</dd><dt><strong>--echo [parms...]</strong></dt><dd>Echo <strong>parms</strong>to log output.
     214<p>Designed to be used to send messages to a controlling application which is receiving the OpenVPN log output.</p>
     215</dd><dt><strong>--remap-usr1 signal</strong></dt><dd>Control whether internally or externally generated SIGUSR1 signals are remapped to SIGHUP (restart without persisting state) or SIGTERM (exit).
     216<p><strong>signal</strong> can be set to "SIGHUP" or "SIGTERM". By default, no remapping occurs.</p>
     217</dd><dt><strong>--verb n</strong></dt><dd>Set output verbosity to <strong>n</strong>(default=1). Each level shows all info from the previous levels. Level 3 is recommended if you want a good summary of what's happening without being swamped by output.
     218<p><strong>0 --</strong> No output except fatal errors. <br /><strong>1 to 4 --</strong> Normal usage range. <br /><strong>5 --</strong> Output <strong>R</strong> and <strong>W</strong> 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. <br /><strong>6 to 11 --</strong> Debug info range (see errlevel.h for additional information on debug levels).</p>
     219</dd><dt><strong>--status file [n]</strong></dt><dd>Write operational status to <strong>file</strong> every <strong>n</strong>seconds.
     220<p>Status can also be written to the syslog by sending a <strong>SIGUSR2</strong> signal.</p>
     221</dd><dt><strong>--status-version [n]</strong></dt><dd>Choose the status file format version number. Currently <strong>n</strong> can be 1 or 2 and defaults to 1.</dd><dt><strong>--mute n</strong></dt><dd>Log at most <strong>n</strong> consecutive messages in the same category. This is useful to limit repetitive logging of similar message types.</dd><dt><strong>--comp-lzo</strong></dt><dd>Use fast LZO compression -- may add up to 1 byte per packet for incompressible data.</dd><dt><strong>--comp-noadapt</strong></dt><dd>When used in conjunction with <strong>--comp-lzo,</strong> this option will disable OpenVPN's adaptive compression algorithm. Normally, adaptive compression is enabled with <strong>--comp-lzo.</strong>
     222<p>Adaptive compression tries to optimize the case where you have compression enabled, but you are sending predominantly uncompressible (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.</p>
     223</dd><dt><strong>--management IP port [pw-file]</strong></dt><dd>Enable a TCP server on <strong>IP:port</strong> to handle daemon management functions. <strong>pw-file,</strong>if specified, is a password file (password on first line) or "stdin" to prompt from standard input. The password provided will set the password which TCP clients will need to provide in order to access management functions.
     224<p>The management interface provides a special mode where the TCP management link can operate over the tunnel itself. To enable this mode, set <strong>IP</strong> = "tunnel". Tunnel mode will cause the management interface to listen for a TCP connection on the local VPN address of the TUN/TAP interface.</p>
     225<p>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 "help" for a list of commands.</p>
     226<p>For detailed documentation on the management interface, see the management-notes.txt file in the <strong>management</strong> folder of the OpenVPN source distribution.</p>
     227<p>It is strongly recommended that <strong>IP</strong> be set to (localhost) to restrict accessibility of the management server to local clients.</p>
     228</dd><dt><strong>--management-query-passwords</strong></dt><dd>Query management channel for private key password and <strong>--auth-user-pass</strong> username/password. Only query the management channel for inputs which ordinarily would have been queried from the console.</dd><dt><strong>--management-hold</strong></dt><dd>Start OpenVPN in a hibernating state, until a client of the management interface explicitly starts it with the <strong>hold release</strong> command.</dd><dt><strong>--management-log-cache n</strong></dt><dd>Cache the most recent <strong>n</strong> lines of log file history for usage by the management channel.</dd><dt><strong>--plugin module-pathname [init-string]</strong></dt><dd>Load plug-in module from the file <strong>module-pathname,</strong> passing <strong>init-string</strong>as an argument to the module initialization function. Multiple plugin modules may be loaded into one OpenVPN process.
     229<p>For more information and examples on how to build OpenVPN plug-in modules, see the README file in the <strong>plugin</strong> folder of the OpenVPN source distribution.</p>
     230<p>If you are using an RPM install of OpenVPN, see /usr/share/openvpn/plugin. The documentation is in <strong>doc</strong> and the actual plugin modules are in <strong>lib.</strong></p>
     231<p>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 (0) in order for the connection to be authenticated.</p>
     233<p><a name="lbAH" title="lbAH"></a></p>
     234<h3>Server Mode</h3>
     235<p>Starting with OpenVPN 2.0, a multi-client TCP/UDP server mode is supported, and can be enabled with the <strong>--mode server</strong>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.</p>
     236<dl><dt><strong>--server network netmask</strong></dt><dd>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 ".1" address of the given network for use as the server-side endpoint of the local TUN/TAP interface.
     237<p>For example, <strong>--server</strong> expands as follows:</p>
     238<p> </p>
     240<pre> mode server<br /> tls-server<br /><br /> if dev tun:<br />   ifconfig <br />   ifconfig-pool<br />   route<br />   if client-to-client:<br />     push "route"<br />   else<br />     push "route"<br /><br /> if dev tap:<br />   ifconfig<br />   ifconfig-pool<br />   push "route-gateway"<br /><br /></pre>
     242<p>Don't use <strong>--server</strong> if you are ethernet bridging. Use <strong>--server-bridge</strong> instead.</p>
     243</dd><dt><strong>--server-bridge gateway netmask pool-start-IP pool-end-IP</strong></dt><dd>
     244<p>A helper directive similar to <strong>--server</strong> which is designed to simplify the configuration of OpenVPN's server mode in ethernet bridging configurations.</p>
     245<p>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 <strong>brctl</strong> 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".</p>
     246<p>Next you you must manually set the IP/netmask on the bridge interface. The <strong>gateway</strong> and <strong>netmask</strong> parameters to <strong>--server-bridge</strong> 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.</p>
     247<p>Finally, set aside a IP range in the bridged subnet, denoted by <strong>pool-start-IP</strong> and <strong>pool-end-IP,</strong> for OpenVPN to allocate to connecting clients.</p>
     248<p>For example, <strong>server-bridge</strong> expands as follows:</p>
     249<p> </p>
     251<pre>mode server<br />tls-server<br /><br />ifconfig-pool<br />push "route-gateway"<br /><br /></pre>
     252</dd></dl></dd><dt><strong>--push option</strong></dt><dd>Push a config file option back to the client for remote execution. Note that <strong>option</strong> must be enclosed in double quotes (""). The client must specify <strong>--pull</strong>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.
     253<p>This is a partial list of options which can currently be pushed: <strong>--route, --route-gateway, --route-delay, --redirect-gateway,</strong> <strong>--ip-win32, --dhcp-option,</strong> <strong>--inactive, --ping, --ping-exit, --ping-restart,</strong> <strong>--setenv,</strong> <strong>--persist-key, --persist-tun, --echo</strong></p>
     254</dd><dt><strong>--push-reset</strong></dt><dd>Don't inherit the global push list for a specific client instance. Specify this option in a client-specific context such as with a <strong>--client-config-dir</strong> configuration file. This option will ignore <strong>--push</strong> options at the global config file level.</dd><dt><strong>--disable</strong></dt><dd>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 <strong>--crl-verify</strong>option).
     255<p>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 <strong>--client-config-dir</strong> or dynamically generated using a <strong>--client-connect</strong> script.</p>
     256</dd><dt><strong>--ifconfig-pool start-IP end-IP [netmask]</strong></dt><dd>Set aside a pool of subnets to be dynamically allocated to connecting clients, similar to a DHCP server. 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 <strong>netmask</strong>parameter will also be pushed to clients.
     257<p> </p>
     258</dd><dt><strong>--ifconfig-pool-persist file [seconds]</strong></dt><dd>Persist/unpersist ifconfig-pool data to <strong>file,</strong> at <strong>seconds</strong>intervals (default=600), as well as on program startup and shutdown.
     259<p>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 <strong>--persist-tun</strong> option.</p>
     260<p><strong>file</strong> is a comma-delimited ASCII file, formatted as ,.</p>
     261<p>If <strong>seconds</strong> = 0, <strong>file</strong> will be treated as read-only. This is useful if you would like to treat <strong>file</strong> as a configuration file.</p>
     262<p>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 <strong>--ifconfig-push</strong></p>
     263</dd><dt><strong>--ifconfig-pool-linear</strong></dt><dd>Modifies the <strong>--ifconfig-pool</strong> directive to allocate individual TUN interface addresses for clients rather than /30 subnets. NOTE: This option is incompatible with Windows clients.</dd><dt><strong>--ifconfig-push local remote-netmask</strong></dt><dd>Push virtual IP endpoints for client tunnel, overriding the --ifconfig-pool dynamic allocation.
     264<p>The parameters <strong>local</strong> and <strong>remote-netmask</strong> are set according to the <strong>--ifconfig</strong> directive which you want to execute on the client machine to configure the remote end of the tunnel. Note that the parameters <strong>local</strong> and <strong>remote-netmask</strong> 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.</p>
     265<p>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 <strong>--client-config-dir</strong> or dynamically generated using a <strong>--client-connect</strong> script.</p>
     266<p>Remember also to include a <strong>--route</strong> directive in the main OpenVPN config file which encloses <strong>local,</strong> so that the kernel will know to route it to the server's TUN/TAP interface.</p>
     267<p>OpenVPN's internal client IP address selection algorithm works as follows:</p>
     268<p><strong>1</strong> -- Use <strong>--client-connect script</strong> generated file for static IP (first choice). <br /><strong>2</strong> -- Use <strong>--client-config-dir</strong> file for static IP (next choice). <br /><strong>3</strong> -- Use <strong>--ifconfig-pool</strong> allocation for dynamic IP (last choice).</p>
     269</dd><dt><strong>--iroute network [netmask]</strong></dt><dd>Generate an internal route to a specific client. The <strong>netmask</strong>parameter, if omitted, defaults to
     270<p>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 <strong>--route</strong> directive). The reason why two routes are needed is that the <strong>--route</strong> directive routes the packet from the kernel to OpenVPN. Once in OpenVPN, the <strong>--iroute</strong> directive routes to the specific client.</p>
     271<p>This option must be specified either in a client instance config file using <strong>--client-config-dir</strong> or dynamically generated using a <strong>--client-connect</strong> script.</p>
     272<p>The <strong>--iroute</strong> directive also has an important interaction with <strong>--push</strong> "route ...". <strong>--iroute</strong> 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 <strong>--push</strong> "route ..." together with <strong>--client-to-client</strong> 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.</p>
     273</dd><dt><strong>--client-to-client</strong></dt><dd>Because the OpenVPN server mode handles multiple clients through a single tun or tap interface, it is effectively a router. The <strong>--client-to-client</strong>flag tells OpenVPN to internally route client-to-client traffic rather than pushing all client-originating traffic to the TUN/TAP interface.
     274<p>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.</p>
     275</dd><dt><strong>--duplicate-cn</strong></dt><dd>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.</dd><dt><strong>--client-connect script</strong></dt><dd>Run <strong>script</strong>on client connection. The script is passed the common name and IP address of the just-authenticated client as environmental variables (see environmental variable section below). The script is also passed the pathname of a not-yet-created temporary file as $1 (i.e. the first command line argument), to be used by the script to pass dynamically generated config file directives back to OpenVPN.
     276<p>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 $1.</p>
     277<p>See the <strong>--client-config-dir</strong> option below for options which can be legally used in a dynamically generated config file.</p>
     278<p>Note that the return value of <strong>script</strong> is significant. If <strong>script</strong> returns a non-zero error status, it will cause the client to be disconnected.</p>
     279</dd><dt><strong>--client-disconnect</strong></dt><dd>Like <strong>--client-connect</strong> but called on client instance shutdown. Will not be called unless the <strong>--client-connect</strong>script and plugins (if defined) were previously called on this instance with successful (0) status returns.
     280<p>The exception to this rule is if the <strong>--client-disconnect</strong> script 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.</p>
     281</dd><dt><strong>--client-config-dir dir</strong></dt><dd>Specify a directory <strong>dir</strong>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.
     282<p>This file can specify a fixed IP address for a given client using <strong>--ifconfig-push,</strong> as well as fixed subnets owned by the client using <strong>--iroute.</strong></p>
     283<p>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.</p>
     284<p>The following options are legal in a client-specific context: <strong>--push, --push-reset, --iroute, --ifconfig-push,</strong> and <strong>--config.</strong></p>
     285</dd><dt><strong>--ccd-exclusive</strong></dt><dd>Require, as a condition of authentication, that a connecting client has a <strong>--client-config-dir</strong> file.</dd><dt><strong>--tmp-dir dir</strong></dt><dd>Specify a directory <strong>dir</strong> for temporary files. This directory will be used by <strong>--client-connect</strong> scripts to dynamically generate client-specific configuration files.</dd><dt><strong>--hash-size r v</strong></dt><dd>Set the size of the real address hash table to <strong>r</strong> and the virtual address table to <strong>v.</strong> By default, both tables are sized at 256 buckets.</dd><dt><strong>--bcast-buffers n</strong></dt><dd>Allocate <strong>n</strong> buffers for broadcast datagrams (default=256).</dd><dt><strong>--tcp-queue-limit n</strong></dt><dd>Maximum number of queued TCP output packets (default=64).
     286<p>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 queued TCP output packets reaches this limit for a given client connection, OpenVPN will start to drop outgoing packets directed at this client.</p>
     287</dd><dt><strong>--max-clients n</strong></dt><dd>Limit server to a maximum of <strong>n</strong> concurrent clients.</dd><dt><strong>--max-routes-per-client n</strong></dt><dd>Allow a maximum of <strong>n</strong> internal routes per client (default=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 <strong>--client-config-dir</strong> file or auto-generated by a <strong>--client-connect</strong>script to override the global value for a particular client.
     288<p>Note that this directive affects OpenVPN's internal routing table, not the kernel routing table.</p>
     289</dd><dt><strong>--connect-freq n sec</strong></dt><dd>Allow a maximum of <strong>n</strong> new connections per <strong>sec </strong>seconds from clients. This is designed to contain DoS attacks which flood the server with connection requests using certificates which will ultimately fail to authenticate.
     290<p>This is an imperfect solution however, because in a real DoS scenario, legitimate connections might also be refused.</p>
     291<p>For the best protection against DoS attacks in server mode, use <strong>--proto udp</strong> and <strong>--tls-auth.</strong></p>
     292</dd><dt><strong>--learn-address cmd</strong></dt><dd>Run script or shell command <strong>cmd</strong>to validate client virtual addresses or routes.
     293<p><strong>cmd</strong> will be executed with 3 parameters:</p>
     294<p><strong>[1] operation --</strong> "add", "update", or "delete" based on whether or not the address is being added to, modified, or deleted from OpenVPN's internal routing table. <br /><strong>[2] address --</strong> The address being learned or unlearned. This can be an IPv4 address such as "", an IPv4 subnet such as "", or an ethernet MAC address (when <strong>--dev tap</strong> is being used) such as "00:FF:01:02:03:04". <br /><strong>[3] common name --</strong> The common name on the certificate associated with the client linked to this address. Only present for "add" or "update" operations, not "delete".</p>
     295<p>On "add" or "update" methods, if the script returns a failure code (non-zero), OpenVPN will reject the address and will not modify its internal routing table.</p>
     296<p>Normally, the <strong>cmd</strong> 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.</p>
     297</dd><dt><strong>--auth-user-pass-verify script method</strong></dt><dd>Require the client to provide a username/password (possibly in addition to a client certificate) for authentication.
     298<p>OpenVPN will execute <strong>script</strong> as a shell command to validate the username/password provided by the client.</p>
     299<p>If <strong>method</strong> is set to "via-env", OpenVPN will call <strong>script</strong> with the environmental variables <strong>username</strong> and <strong>password</strong> set to the username/password strings provided by the client. Be aware that this method is insecure on some platforms which make the environment of a process publicly visible to other unprivileged processes.</p>
     300<p>If <strong>method</strong> is set to "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 <strong>script,</strong> and the file will be automatically deleted by OpenVPN after the script returns. The location of the temporary file is controlled by the <strong>--tmp-dir</strong> option, and will default to the current directory if unspecified. For security, consider setting <strong>--tmp-dir</strong> to a volatile storage medium such as <strong>/dev/shm</strong> (if available) to prevent the username/password file from touching the hard drive.</p>
     301<p>The script should examine the username and password, returning a success exit code (0) if the client's authentication request is to be accepted, or a failure code (1) to reject the client.</p>
     302<p>This directive is designed to enable a plugin-style interface for extending OpenVPN's authentication capabilities.</p>
     303<p>To protect against a client passing a maliciously formed username or password string, the username string must consist only of these characters: alphanumeric, underbar ('_'), dash ('-'), dot ('.'), or at ('@'). 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 ('_').</p>
     304<p>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.</p>
     305<p>For a sample script that performs PAM authentication, see <strong>sample-scripts/</strong> in the OpenVPN source distribution.</p>
     306</dd><dt><strong>--client-cert-not-required</strong></dt><dd>Don't require client certificate, client will authenticate using username/password only. Be aware that using this directive is less secure than requiring certificates from all clients.
     307<p>If you use this directive, the entire responsibility of authentication will rest on your <strong>--auth-user-pass-verify</strong> script, so keep in mind that bugs in your script could potentially compromise the security of your VPN.</p>
     308<p>If you don't use this directive, but you also specify an <strong>--auth-user-pass-verify</strong> script, then OpenVPN will perform double authentication. The client certificate verification AND the <strong>--auth-user-pass-verify</strong> script will need to succeed in order for a client to be authenticated and accepted onto the VPN.</p>
     309</dd><dt><strong>--username-as-common-name</strong></dt><dd>For <strong>--auth-user-pass-verify</strong> authentication, use the authenticated username as the common name, rather than the common name from the client cert.</dd></dl>
     310<p><a name="lbAI" title="lbAI"></a></p>
     311<h3>Client Mode</h3>
     312<p>Use client mode when connecting to an OpenVPN server which has <strong>--server, --server-bridge,</strong> or <strong>--mode server</strong>in it's configuration.</p>
     313<dl><dt><strong>--client</strong></dt><dd>A helper directive designed to simplify the configuration of OpenVPN's client mode. This directive is equivalent to:
     314<p> </p>
     316<pre> pull<br /> tls-client<br /><br /></pre>
     317</dd></dl></dd><dt><strong>--pull</strong></dt><dd>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 <strong>--pull</strong> option is implied by <strong>--client</strong>).
     318<p>In particular, <strong>--pull</strong> allows the server to push routes to the client, so you should not use <strong>--pull</strong> or <strong>--client</strong> in situations where you don't trust the server to have control over the client's routing table.</p>
     319</dd><dt><strong>--auth-user-pass [up]</strong></dt><dd>Authenticate with server using username/password. <strong>up</strong>is a file containing username/password on 2 lines (Note: OpenVPN will only read passwords from a file if it has been built with the --enable-password-save configure option, or on Windows by defining ENABLE_PASSWORD_SAVE in config-win32.h).
     320<p>If <strong>up</strong> is omitted, username/password will be prompted from the console.</p>
     321<p>The server configuration must specify an <strong>--auth-user-pass-verify</strong> script to verify the username/password provided by the client.</p>
     322</dd><dt><strong>--auth-retry type</strong></dt><dd>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.
     323<p>Normally used to prevent auth errors from being fatal on the client side, and to permit username/password requeries in case of error.</p>
     324<p>An AUTH_FAILED message is generated by the server if the client fails <strong>--auth-user-pass</strong> authentication, or if the server-side <strong>--client-connect</strong> script returns an error status when the client tries to connect.</p>
     325<p><strong>type</strong> can be one of:</p>
     326<p><strong>none --</strong> Client will exit with a fatal error (this is the default). <br /><strong>nointeract --</strong> Client will retry the connection without requerying for an <strong>--auth-user-pass</strong> username/password. Use this option for unattended clients. <br /><strong>interact --</strong> Client will requery for an <strong>--auth-user-pass</strong> username/password and/or private key password before attempting a reconnection.</p>
     327<p>Note that while this option cannot be pushed, it can be controlled from the management interface.</p>
     328</dd><dt><strong>--explicit-exit-notify [n]</strong></dt><dd>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 <strong>n</strong> parameter (default=1) controls the maximum number of retries that the client will attempt to resend the exit notification message.</dd></dl>
     329<p><a name="lbAJ" title="lbAJ"></a></p>
     330<h3>Data Channel Encryption Options:</h3>
     331<p>These options are meaningful for both Static &amp; TLS-negotiated key modes (must be compatible between peers).</p>
     332<dl><dt><strong>--secret file [direction]</strong></dt><dd>Enable Static Key encryption mode (non-TLS). Use pre-shared secret <strong>file</strong> which was generated with <strong>--genkey.</strong>
     333<p>The optional <strong>direction</strong> 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.</p>
     334<p>When the <strong>direction</strong> parameter is omitted, 2 keys are used bidirectionally, one for HMAC and the other for encryption/decryption.</p>
     335<p>The <strong>direction</strong> parameter should always be complementary on either side of the connection, i.e. one side should use "0" and the other should use "1", or both sides should omit it altogether.</p>
     336<p>The <strong>direction</strong> parameter requires that <strong>file</strong> contains a 2048 bit key. While pre-1.5 versions of OpenVPN generate 1024 bit key files, any version of OpenVPN which supports the <strong>direction</strong> parameter, will also support 2048 bit key file generation using the <strong>--genkey</strong> option.</p>
     337<p>Static key encryption mode has certain advantages, the primary being ease of configuration.</p>
     338<p>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 <strong>ssh</strong> ) 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.</p>
     339<p>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.</p>
     340</dd><dt><strong>--auth alg</strong></dt><dd>Authenticate packets with HMAC using message digest algorithm <strong>alg.</strong> (The default is <strong>SHA1</strong>). 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.
     341<p>OpenVPN's usage of HMAC is to first encrypt a packet, then HMAC the resulting ciphertext.</p>
     342<p>In static-key encryption mode, the HMAC key is included in the key file generated by <strong>--genkey.</strong> 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 <strong>alg=none</strong> to disable authentication.</p>
     343<p>For more information on HMAC see <em><a href=""></a></em></p>
     344</dd><dt><strong>--cipher alg</strong></dt><dd>Encrypt packets with cipher algorithm <strong>alg.</strong> The default is <strong>BF-CBC,</strong>an abbreviation for Blowfish in Cipher Block Chaining mode. Blowfish has the advantages of being fast, very secure, and allowing key sizes of up to 448 bits. Blowfish is designed to be used in situations where keys are changed infrequently.
     345<p>For more information on blowfish, see <em><a href=""></a></em></p>
     346<p>To see other ciphers that are available with OpenVPN, use the <strong>--show-ciphers</strong> option.</p>
     347<p>OpenVPN supports the CBC, CFB, and OFB cipher modes.</p>
     348<p>Set <strong>alg=none</strong> to disable encryption.</p>
     349</dd><dt><strong>--keysize n</strong></dt><dd>Size of cipher key in bits (optional). If unspecified, defaults to cipher-specific default. The <strong>--show-ciphers</strong> option (see below) shows all available OpenSSL ciphers, their default key sizes, and whether the key size can be changed. Use care in changing a cipher's default key size. Many ciphers have not been extensively cryptanalyzed with non-standard key lengths, and a larger key may offer no real guarantee of greater security, or may even reduce security.</dd><dt><strong>--engine [engine-name]</strong></dt><dd>Enable OpenSSL hardware-based crypto engine functionality.
     350<p>If <strong>engine-name</strong> is specified, use a specific crypto engine. Use the <strong>--show-engines</strong> standalone option to list the crypto engines which are supported by OpenSSL.</p>
     351</dd><dt><strong>--no-replay</strong></dt><dd>Disable OpenVPN's protection against replay attacks. Don't use this option unless you are prepared to make a tradeoff of greater efficiency in exchange for less security.
     352<p>OpenVPN provides datagram replay protection by default.</p>
     353<p>Replay protection is accomplished by tagging each outgoing datagram with an identifier that is guaranteed to be unique for the key being used. The peer that receives the datagram will check for the uniqueness of the identifier. If the identifier was already received in a previous datagram, OpenVPN will drop the packet. Replay protection is important to defeat attacks such as a SYN flood attack, where the attacker listens in the wire, intercepts a TCP SYN packet (identifying it by the context in which it occurs in relation to other packets), then floods the receiving peer with copies of this packet.</p>
     354<p>OpenVPN's replay protection is implemented in slightly different ways, depending on the key management mode you have selected.</p>
     355<p>In Static Key mode or when using an CFB or OFB mode cipher, OpenVPN uses a 64 bit unique identifier that combines a time stamp with an incrementing sequence number.</p>
     356<p>When using TLS mode for key exchange and a CBC cipher mode, OpenVPN uses only a 32 bit sequence number without a time stamp, since OpenVPN can guarantee the uniqueness of this value for each key. As in IPSec, if the sequence number is close to wrapping back to zero, OpenVPN will trigger a new key exchange.</p>
     357<p>To check for replays, OpenVPN uses the <em>sliding window</em> algorithm used by IPSec.</p>
     358</dd><dt><strong>--replay-window n [t]</strong></dt><dd>Use a replay protection sliding-window of size <strong>n</strong> and a time window of <strong>t</strong>seconds.
     359<p>By default <strong>n</strong> is 64 (the IPSec default) and <strong>t</strong> is 15 seconds.</p>
     360<p>This option is only relevant in UDP mode, i.e. when either <strong>--proto udp</strong> is specifed, or no <strong>--proto</strong> option is specified.</p>
     361<p>When OpenVPN tunnels IP packets over UDP, there is the possibility that packets might be dropped or delivered out of order. Because OpenVPN, like IPSec, is emulating the physical network layer, it will accept an out-of-order packet sequence, and will deliver such packets in the same order they were received to the TCP/IP protocol stack, provided they satisfy several constraints.</p>
     362<p><strong>(a)</strong> The packet cannot be a replay (unless <strong>--no-replay</strong> is specified, which disables replay protection altogether).</p>
     363<p><strong>(b)</strong> If a packet arrives out of order, it will only be accepted if the difference between its sequence number and the highest sequence number received so far is less than <strong>n.</strong></p>
     364<p><strong>(c)</strong> If a packet arrives out of order, it will only be accepted if it arrives no later than <strong>t</strong> seconds after any packet containing a higher sequence number.</p>
     365<p>If you are using a network link with a large pipeline (meaning that the product of bandwidth and latency is high), you may want to use a larger value for <strong>n.</strong> Satellite links in particular often require this.</p>
     366<p>If you run OpenVPN at <strong>--verb 4,</strong> you will see the message "Replay-window backtrack occurred [x]" every time the maximum sequence number backtrack seen thus far increases. This can be used to calibrate <strong>n.</strong></p>
     367<p>There is some controversy on the appropriate method of handling packet reordering at the security layer.</p>
     368<p>Namely, to what extent should the security layer protect the encapsulated protocol from attacks which masquerade as the kinds of normal packet loss and reordering that occur over IP networks?</p>
     369<p>The IPSec and OpenVPN approach is to allow packet reordering within a certain fixed sequence number window.</p>
     370<p>OpenVPN adds to the IPSec model by limiting the window size in time as well as sequence space.</p>
     371<p>OpenVPN also adds TCP transport as an option (not offered by IPSec) in which case OpenVPN can adopt a very strict attitude towards message deletion and reordering: Don't allow it. Since TCP guarantees reliability, any packet loss or reordering event can be assumed to be an attack.</p>
     372<p>In this sense, it could be argued that TCP tunnel transport is preferred when tunneling non-IP or UDP application protocols which might be vulnerable to a message deletion or reordering attack which falls within the normal operational parameters of IP networks.</p>
     373<p>So I would make the statement that one should never tunnel a non-IP protocol or UDP application protocol over UDP, if the protocol might be vulnerable to a message deletion or reordering attack that falls within the normal operating parameters of what is to be expected from the physical IP layer. The problem is easily fixed by simply using TCP as the VPN transport layer.</p>
     374</dd><dt><strong>--mute-replay-warnings</strong></dt><dd>Silence the output of replay warnings, which are a common false alarm on WiFi networks. This option preserves the security of the replay protection code without the verbosity associated with warnings about duplicate packets.</dd><dt><strong>--replay-persist file</strong></dt><dd>Persist replay-protection state across sessions using <strong>file</strong>to save and reload the state.
     375<p>This option will strengthen protection against replay attacks, especially when you are using OpenVPN in a dynamic context (such as with <strong>--inetd)</strong> when OpenVPN sessions are frequently started and stopped.</p>
     376<p>This option will keep a disk copy of the current replay protection state (i.e. the most recent packet timestamp and sequence number received from the remote peer), so that if an OpenVPN session is stopped and restarted, it will reject any replays of packets which were already received by the prior session.</p>
     377<p>This option only makes sense when replay protection is enabled (the default) and you are using either <strong>--secret</strong> (shared-secret key mode) or TLS mode with <strong>--tls-auth.</strong></p>
     378</dd><dt><strong>--no-iv</strong></dt><dd>Disable OpenVPN's use of IV (cipher initialization vector). Don't use this option unless you are prepared to make a tradeoff of greater efficiency in exchange for less security.
     379<p>OpenVPN uses an IV by default, and requires it for CFB and OFB cipher modes (which are totally insecure without it). Using an IV is important for security when multiple messages are being encrypted/decrypted with the same key.</p>
     380<p>IV is implemented differently depending on the cipher mode used.</p>
     381<p>In CBC mode, OpenVPN uses a pseudo-random IV for each packet.</p>
     382<p>In CFB/OFB mode, OpenVPN uses a unique sequence number and time stamp as the IV. In fact, in CFB/OFB mode, OpenVPN uses a datagram space-saving optimization that uses the unique identifier for datagram replay protection as the IV.</p>
     383</dd><dt><strong>--test-crypto</strong></dt><dd>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 <strong>--dev</strong> or <strong>--remote.</strong>
     384<p>The typical usage of <strong>--test-crypto</strong> would be something like this:</p>
     385<p><strong>openvpn --test-crypto --secret key</strong></p>
     387<p><strong>openvpn --test-crypto --secret key --verb 9</strong></p>
     388<p>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.</p>
     390<p><a name="lbAK" title="lbAK"></a></p>
     391<h3>TLS Mode Options:</h3>
     392<p>TLS mode is the most powerful crypto mode of OpenVPN in both security and flexibility. TLS mode works by establishing control and data channels which are multiplexed over a single TCP/UDP port. OpenVPN initiates a TLS session over the control channel and uses it to exchange cipher and HMAC keys to protect the data channel. TLS mode uses a robust reliability layer over the UDP connection for all control channel communication, while the data channel, over which encrypted tunnel data passes, is forwarded without any mediation. The result is the best of both worlds: a fast data channel that forwards over UDP with only the overhead of encrypt, decrypt, and HMAC functions, and a control channel that provides all of the security features of TLS, including certificate-based authentication and Diffie Hellman forward secrecy.</p>
     393<p>To use TLS mode, each peer that runs OpenVPN should have its own local certificate/key pair ( <strong>--cert</strong> and <strong>--key</strong> ), signed by the root certificate which is specified in <strong>--ca.</strong></p>
     394<p>When two OpenVPN peers connect, each presents its local certificate to the other. Each peer will then check that its partner peer presented a certificate which was signed by the master root certificate as specified in <strong>--ca.</strong></p>
     395<p>If that check on both peers succeeds, then the TLS negotiation will succeed, both OpenVPN peers will exchange temporary session keys, and the tunnel will begin passing data.</p>
     396<p>The OpenVPN distribution contains a set of scripts for managing RSA certificates &amp; keys, located in the <em>easy-rsa</em> subdirectory.</p>
     397<p>The easy-rsa package is also rendered in web form here: <em><a href="easyrsa.html"></a></em></p>
     398<dl><dt><strong>--tls-server</strong></dt><dd>Enable TLS and assume server role during TLS handshake. Note that OpenVPN is designed as a peer-to-peer application. The designation of client or server is only for the purpose of negotiating the TLS control channel.</dd><dt><strong>--tls-client</strong></dt><dd>Enable TLS and assume client role during TLS handshake.</dd><dt><strong>--ca file</strong></dt><dd>Certificate authority (CA) file in .pem format, also referred to as the <em>root</em>certificate. This file can have multiple certificates in .pem format, concatenated together. You can construct your own certificate authority certificate and private key by using a command such as:
     399<p><strong>openssl req -nodes -new -x509 -keyout tmp-ca.key -out tmp-ca.crt</strong></p>
     400<p>Then edit your openssl.cnf file and edit the <strong>certificate</strong> variable to point to your new root certificate <strong>tmp-ca.crt.</strong></p>
     401<p>For testing purposes only, the OpenVPN distribution includes a sample CA certificate (tmp-ca.crt). Of course you should never use the test certificates and test keys distributed with OpenVPN in a production environment, since by virtue of the fact that they are distributed with OpenVPN, they are totally insecure.</p>
     402</dd><dt><strong>--dh file</strong></dt><dd>File containing Diffie Hellman parameters in .pem format (required for <strong>--tls-server</strong>only). Use
     403<p><strong>openssl dhparam -out dh1024.pem 1024</strong></p>
     404<p>to generate your own, or use the existing dh1024.pem file included with the OpenVPN distribution. Diffie Hellman parameters may be considered public.</p>
     405</dd><dt><strong>--cert file</strong></dt><dd>Local peer's signed certificate in .pem format -- must be signed by a certificate authority whose certificate is in <strong>--ca file.</strong> Each peer in an OpenVPN link running in TLS mode should have its own certificate and private key file. In addition, each certificate should have been signed by the key of a certificate authority whose public key resides in the <strong>--ca</strong>certificate authority file. You can easily make your own certificate authority (see above) or pay money to use a commercial service such as (in which case you will be helping to finance the world's second space tourist :). To generate a certificate, you can use a command such as:
     406<p><strong>openssl req -nodes -new -keyout mycert.key -out mycert.csr</strong></p>
     407<p>If your certificate authority private key lives on another machine, copy the certificate signing request (mycert.csr) to this other machine (this can be done over an insecure channel such as email). Now sign the certificate with a command such as:</p>
     408<p><strong>openssl ca -out mycert.crt -in mycert.csr</strong></p>
     409<p>Now copy the certificate (mycert.crt) back to the peer which initially generated the .csr file (this can be over a public medium). Note that the <strong>openssl ca</strong> command reads the location of the certificate authority key from its configuration file such as <strong>/usr/share/ssl/openssl.cnf</strong> -- note also that for certificate authority functions, you must set up the files <strong>index.txt</strong> (may be empty) and <strong>serial</strong> (initialize to <strong>01</strong> ).</p>
     410</dd><dt><strong>--key file</strong></dt><dd>Local peer's private key in .pem format. Use the private key which was generated when you built your peer's certificate (see <strong>-cert file</strong> above).</dd><dt><strong>--pkcs12 file</strong></dt><dd>Specify a PKCS #12 file containing local private key, local certificate, and root CA certificate. This option can be used instead of <strong>--ca, --cert,</strong> and <strong>--key.</strong></dd><dt><strong>--cryptoapicert select-string</strong></dt><dd>Load the certificate and private key from the Windows Certificate System Store (Windows Only).
     411<p>Use this option instead of <strong>--cert</strong> and <strong>--key.</strong></p>
     412<p>This makes it possible to use any smart card, supported by Windows, but also any kind of certificate, residing in the Cert Store, where you have access to the private key. This option has been tested with a couple of different smart cards (GemSAFE, Cryptoflex, and Swedish Post Office eID) on the client side, and also an imported PKCS12 software certificate on the server side.</p>
     413<p>To select a certificate, based on a substring search in the certificate's subject:</p>
     414<p><strong>cryptoapicert</strong> "SUBJ:Peter Runestig"</p>
     415<p>To select a certificate, based on certificate's thumbprint:</p>
     416<p><strong>cryptoapicert</strong> "THUMB:f6 49 24 41 01 b4 ..."</p>
     417<p>The thumbprint hex string can easily be copy-and-pasted from the Windows Certificate Store GUI.</p>
     418<p> </p>
     419</dd><dt><strong>--key-method m</strong></dt><dd>Use data channel key negotiation method <strong>m.</strong>The key method must match on both sides of the connection.
     420<p>After OpenVPN negotiates a TLS session, a new set of keys for protecting the tunnel data channel is generated and exchanged over the TLS session.</p>
     421<p>In method 1 (the default for OpenVPN 1.x), both sides generate random encrypt and HMAC-send keys which are forwarded to the other host over the TLS channel.</p>
     422<p>In method 2, (the default for OpenVPN 2.0) the client generates a random key. Both client and server also generate some random seed material. All key source material is exchanged over the TLS channel. The actual keys are generated using the TLS PRF function, taking source entropy from both client and server. Method 2 is designed to closely parallel the key generation process used by TLS 1.0.</p>
     423<p>Note that in TLS mode, two separate levels of keying occur:</p>
     424<p>(1) The TLS connection is initially negotiated, with both sides of the connection producing certificates and verifying the certificate (or other authentication info provided) of the other side. The <strong>--key-method</strong> parameter has no effect on this process.</p>
     425<p>(2) After the TLS connection is established, the tunnel session keys are separately negotiated over the existing secure TLS channel. Here, <strong>--key-method</strong> determines the derivation of the tunnel session keys.</p>
     426</dd><dt><strong>--tls-cipher l</strong></dt><dd>A list <strong>l</strong> of allowable TLS ciphers delimited by a colon (":"). If you require a high level of security, you may want to set this parameter manually, to prevent a version rollback attack where a man-in-the-middle attacker tries to force two peers to negotiate to the lowest level of security they both support. Use <strong>--show-tls</strong> to see a list of supported TLS ciphers.</dd><dt><strong>--tls-timeout n</strong></dt><dd>Packet retransmit timeout on TLS control channel if no acknowledgment from remote within <strong>n</strong> seconds (default=2). When OpenVPN sends a control packet to its peer, it will expect to receive an acknowledgement within <strong>n</strong> seconds or it will retransmit the packet, subject to a TCP-like exponential backoff algorithm. This parameter only applies to control channel packets. Data channel packets (which carry encrypted tunnel data) are never acknowledged, sequenced, or retransmitted by OpenVPN because the higher level network protocols running on top of the tunnel such as TCP expect this role to be left to them.</dd><dt><strong>--reneg-bytes n</strong></dt><dd>Renegotiate data channel key after <strong>n</strong> bytes sent or received (disabled by default). OpenVPN allows the lifetime of a key to be expressed as a number of bytes encrypted/decrypted, a number of packets, or a number of seconds. A key renegotiation will be forced if any of these three criteria are met by either peer.</dd><dt><strong>--reneg-pkts n</strong></dt><dd>Renegotiate data channel key after <strong>n</strong> packets sent and received (disabled by default).</dd><dt><strong>--reneg-sec n</strong></dt><dd>Renegotiate data channel key after <strong>n</strong> seconds (default=3600).</dd><dt><strong>--hand-window n</strong></dt><dd>Handshake Window -- the TLS-based key exchange must finalize within <strong>n</strong> seconds of handshake initiation by any peer (default = 60 seconds). If the handshake fails we will attempt to reset our connection with our peer and try again. Even in the event of handshake failure we will still use our expiring key for up to <strong>--tran-window</strong> seconds to maintain continuity of transmission of tunnel data.</dd><dt><strong>--tran-window n</strong></dt><dd>Transition window -- our old key can live this many seconds after a new a key renegotiation begins (default = 3600 seconds). This feature allows for a graceful transition from old to new key, and removes the key renegotiation sequence from the critical path of tunnel data forwarding.</dd><dt><strong>--single-session</strong></dt><dd>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.
     427<p>If the daemon is reset by a signal or <strong>--ping-restart,</strong> it will allow one new connection.</p>
     428<p><strong>--single-session</strong> can be used with <strong>--ping-exit</strong> or <strong>--inactive</strong> to create a single dynamic session that will exit when finished.</p>
     429</dd><dt><strong>--tls-exit</strong></dt><dd>Exit on TLS negotiation failure.</dd><dt><strong>--tls-auth file [direction]</strong></dt><dd>Add an additional layer of HMAC authentication on top of the TLS control channel to protect against DoS attacks.
     430<p>In a nutshell, <strong>--tls-auth</strong> enables a kind of "HMAC firewall" on OpenVPN's TCP/UDP port, where TLS control channel packets bearing an incorrect HMAC signature can be dropped immediately without response.</p>
     431<p><strong>file</strong> (required) is a key file which can be in one of two formats:</p>
     432<p><strong>(1)</strong> An OpenVPN static key file generated by <strong>--genkey</strong> (required if <strong>direction</strong> parameter is used).</p>
     433<p><strong>(2)</strong> A freeform passphrase file. In this case the HMAC key will be derived by taking a secure hash of this file, similar to the <strong>md5sum</strong>(1) or <strong>sha1sum</strong>(1) commands.</p>
     434<p>OpenVPN will first try format (1), and if the file fails to parse as a static key file, format (2) will be used.</p>
     435<p>See the <strong>--secret</strong> option for more information on the optional <strong>direction</strong> parameter.</p>
     436<p><strong>--tls-auth</strong> is recommended when you are running OpenVPN in a mode where it is listening for packets from any IP address, such as when <strong>--remote</strong> is not specified, or <strong>--remote</strong> is specified with <strong>--float.</strong></p>
     437<p>The rationale for this feature is as follows. TLS requires a multi-packet exchange before it is able to authenticate a peer. During this time before authentication, OpenVPN is allocating resources (memory and CPU) to this potential peer. The potential peer is also exposing many parts of OpenVPN and the OpenSSL library to the packets it is sending. Most successful network attacks today seek to either exploit bugs in programs (such as buffer overflow attacks) or force a program to consume so many resources that it becomes unusable. Of course the first line of defense is always to produce clean, well-audited code. OpenVPN has been written with buffer overflow attack prevention as a top priority. But as history has shown, many of the most widely used network applications have, from time to time, fallen to buffer overflow attacks.</p>
     438<p>So as a second line of defense, OpenVPN offers this special layer of authentication on top of the TLS control channel so that every packet on the control channel is authenticated by an HMAC signature and a unique ID for replay protection. This signature will also help protect against DoS (Denial of Service) attacks. An important rule of thumb in reducing vulnerability to DoS attacks is to minimize the amount of resources a potential, but as yet unauthenticated, client is able to consume.</p>
     439<p><strong>--tls-auth</strong> does this by signing every TLS control channel packet with an HMAC signature, including packets which are sent before the TLS level has had a chance to authenticate the peer. The result is that packets without the correct signature can be dropped immediately upon reception, before they have a chance to consume additional system resources such as by initiating a TLS handshake. <strong>--tls-auth</strong> can be strengthened by adding the <strong>--replay-persist</strong> option which will keep OpenVPN's replay protection state in a file so that it is not lost across restarts.</p>
     440<p>It should be emphasized that this feature is optional and that the passphrase/key file used with <strong>--tls-auth</strong> gives a peer nothing more than the power to initiate a TLS handshake. It is not used to encrypt or authenticate any tunnel data.</p>
     441</dd><dt><strong>--askpass [file]</strong></dt><dd>Get certificate password from console or <strong>file</strong>before we daemonize.
     442<p>For the extremely security conscious, it is possible to protect your private key with a password. Of course this means that every time the OpenVPN daemon is started you must be there to type the password. The <strong>--askpass</strong> option allows you to start OpenVPN from the command line. It will query you for a password before it daemonizes. To protect a private key with a password you should omit the <strong>-nodes</strong> option when you use the <strong>openssl</strong> command line tool to manage certificates and private keys.</p>
     443<p>If <strong>file</strong> is specified, read the password from the first line of <strong>file.</strong> Keep in mind that storing your password in a file to a certain extent invalidates the extra security provided by using an encrypted key (Note: OpenVPN will only read passwords from a file if it has been built with the --enable-password-save configure option, or on Windows by defining ENABLE_PASSWORD_SAVE in config-win32.h).</p>
     444</dd><dt><strong>--auth-nocache</strong></dt><dd>Don't cache <strong>--askpass</strong> or <strong>--auth-user-pass</strong>username/passwords in virtual memory.
     445<p>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.</p>
     446<p>This directive does not affect the <strong>--http-proxy</strong> username/password. It is always cached.</p>
     447</dd><dt><strong>--tls-verify cmd</strong></dt><dd>Execute shell command <strong>cmd</strong> to verify the X509 name of a pending TLS connection that has otherwise passed all other tests of certification (except for revocation via <strong>--crl-verify</strong> directive; the revocation test occurs after the <strong>--tls-verify</strong>test).
     448<p><strong>cmd</strong> should return 0 to allow the TLS handshake to proceed, or 1 to fail. <strong>cmd</strong> is executed as</p>
     449<p><strong>cmd certificate_depth X509_NAME_oneline</strong></p>
     450<p>This feature is useful if the peer you want to trust has a certificate which was signed by a certificate authority who also signed many other certificates, where you don't necessarily want to trust all of them, but rather be selective about which peer certificate you will accept. This feature allows you to write a script which will test the X509 name on a certificate and decide whether or not it should be accepted. For a simple perl script which will test the common name field on the certificate, see the file <strong>verify-cn</strong> in the OpenVPN distribution.</p>
     451<p>See the "Environmental Variables" section below for additional parameters passed as environmental variables.</p>
     452<p>Note that <strong>cmd</strong> can be a shell command with multiple arguments, in which case all OpenVPN-generated arguments will be appended to <strong>cmd</strong> to build a command line which will be passed to the script.</p>
     453</dd><dt><strong>--tls-remote name</strong></dt><dd>Accept connections only from a host with X509 name or common name equal to <strong>name.</strong>The remote host must also pass all other tests of verification.
     454<p>Name can also be a common name prefix, for example if you want a client to only accept connections to "Server-1", "Server-2", etc., you can simply use <strong>--tls-remote Server</strong></p>
     455<p>Using a common name prefix is a useful alternative to managing a CRL (Certificate Revocation List) on the client, since it allows the client to refuse all certificates except for those associated with designated servers.</p>
     456<p><strong>--tls-remote</strong> is a useful replacement for the <strong>--tls-verify</strong> option to verify the remote host, because <strong>--tls-remote</strong> works in a <strong>--chroot</strong> environment too.</p>
     457</dd><dt><strong>--ns-cert-type client|server</strong></dt><dd>Require that peer certificate was signed with an explicit <strong>nsCertType</strong>designation of "client" or "server".
     458<p>This is a useful security option for clients, to ensure that the host they connect with is a designated server.</p>
     459<p>See the easy-rsa/build-key-server script for an example of how to generate a certificate with the <strong>nsCertType</strong> field set to "server".</p>
     460<p>If the server certificate's nsCertType field is set to "server", then the clients can verify this with <strong>--ns-cert-type server.</strong></p>
     461<p>This is an important security precaution to protect against a man-in-the-middle attack where an authorized client attempts to connect to another client by impersonating the server. The attack is easily prevented by having clients verify the server certificate using any one of <strong>--ns-cert-type, --tls-remote,</strong> or <strong>--tls-verify.</strong></p>
     462</dd><dt><strong>--crl-verify crl</strong></dt><dd>Check peer certificate against the file <strong>crl</strong>in PEM format.
     463<p>A CRL (certificate revocation list) is used when a particular key is compromised but when the overall PKI is still intact.</p>
     464<p>Suppose you had a PKI consisting of a CA, root certificate, and a number of client certificates. Suppose a laptop computer containing a client key and certificate was stolen. By adding the stolen certificate to the CRL file, you could reject any connection which attempts to use it, while preserving the overall integrity of the PKI.</p>
     465<p>The only time when it would be necessary to rebuild the entire PKI from scratch would be if the root certificate key itself was compromised.</p>
     467<p><a name="lbAL" title="lbAL"></a></p>
     468<h3>SSL Library information:</h3>
     469<dl><dt><strong>--show-ciphers</strong></dt><dd>(Standalone) Show all cipher algorithms to use with the <strong>--cipher</strong> option.</dd><dt><strong>--show-digests</strong></dt><dd>(Standalone) Show all message digest algorithms to use with the <strong>--auth</strong> option.</dd><dt><strong>--show-tls</strong></dt><dd>(Standalone) Show all TLS ciphers (TLS used only as a control channel). The TLS ciphers will be sorted from highest preference (most secure) to lowest.</dd><dt><strong>--show-engines</strong></dt><dd>(Standalone) Show currently available hardware-based crypto acceleration engines supported by the OpenSSL library.</dd></dl>
     470<p><a name="lbAM" title="lbAM"></a></p>
     471<h3>Generate a random key:</h3>
     472<p>Used only for non-TLS static key encryption mode.</p>
     473<dl><dt><strong>--genkey</strong></dt><dd>(Standalone) Generate a random key to be used as a shared secret, for use with the <strong>--secret</strong> option. This file must be shared with the peer over a pre-existing secure channel such as <strong>scp</strong>(1)</dd><dt><strong>--secret file</strong></dt><dd>Write key to <strong>file.</strong></dd></dl>
     474<p><a name="lbAN" title="lbAN"></a></p>
     475<h3>TUN/TAP persistent tunnel config mode:</h3>
     476<p>Available with linux 2.4.7+. These options comprise a standalone mode of OpenVPN which can be used to create and delete persistent tunnels.</p>
     477<dl><dt><strong>--mktun</strong></dt><dd>(Standalone) Create a persistent tunnel on platforms which support them such as Linux. Normally TUN/TAP tunnels exist only for the period of time that an application has them open. This option takes advantage of the TUN/TAP driver's ability to build persistent tunnels that live through multiple instantiations of OpenVPN and die only when they are deleted or the machine is rebooted.
     478<p>One of the advantages of persistent tunnels is that they eliminate the need for separate <strong>--up</strong> and <strong>--down</strong> scripts to run the appropriate <strong>ifconfig</strong>(8) and <strong>route</strong>(8) commands. These commands can be placed in the the same shell script which starts or terminates an OpenVPN session.</p>
     479<p>Another advantage is that open connections through the TUN/TAP-based tunnel will not be reset if the OpenVPN peer restarts. This can be useful to provide uninterrupted connectivity through the tunnel in the event of a DHCP reset of the peer's public IP address (see the <strong>--ipchange</strong> option above).</p>
     480<p>One disadvantage of persistent tunnels is that it is harder to automatically configure their MTU value (see <strong>--link-mtu</strong> and <strong>--tun-mtu</strong> above).</p>
     481<p>On some platforms such as Windows, TAP-Win32 tunnels are persistent by default.</p>
     482</dd><dt><strong>--rmtun</strong></dt><dd>(Standalone) Remove a persistent tunnel.</dd><dt><strong>--dev tunX | tapX</strong></dt><dd>TUN/TAP device</dd></dl>
     483<p><a name="lbAO" title="lbAO"></a></p>
     484<h3>Windows-Specific Options:</h3>
     485<dl><dt><strong>--ip-win32 method</strong></dt><dd>When using <strong>--ifconfig</strong> on Windows, set the TAP-Win32 adapter IP address and netmask using <strong>method.</strong> Don't use this option unless you are also using <strong>--ifconfig.</strong>
     486<p><strong>manual --</strong> Don't set the IP address or netmask automatically. Instead output a message to the console telling the user to configure the adapter manually and indicating the IP/netmask which OpenVPN expects the adapter to be set to.</p>
     487<p><strong>dynamic [offset] [lease-time] --</strong> (Default) Automatically set the IP address and netmask by replying to DHCP query messages generated by the kernel. This mode is probably the "cleanest" solution for setting the TCP/IP properties since it uses the well-known DHCP protocol. There are, however, two prerequisites for using this mode: (1) The TCP/IP properties for the TAP-Win32 adapter must be set to "Obtain an IP address automatically," and (2) OpenVPN needs to claim an IP address in the subnet for use as the virtual DHCP server address. By default in <strong>--dev tap</strong> mode, OpenVPN will take the normally unused first address in the subnet. For example, if your subnet is netmask, then OpenVPN will take the IP address to use as the virtual DHCP server address. In <strong>--dev tun</strong> mode, OpenVPN will cause the DHCP server to masquerade as if it were coming from the remote endpoint. The optional offset parameter is an integer which is &gt; -256 and &lt; 256 and which defaults to 0. If offset is positive, the DHCP server will masquerade as the IP address at network address + offset. If offset is negative, the DHCP server will masquerade as the IP address at broadcast address + offset. The Windows <strong>ipconfig /all</strong> command can be used to show what Windows thinks the DHCP server address is. OpenVPN will "claim" this address, so make sure to use a free address. Having said that, different OpenVPN instantiations, including different ends of the same connection, can share the same virtual DHCP server address. The <strong>lease-time</strong> parameter controls the lease time of the DHCP assignment given to the TAP-Win32 adapter, and is denoted in seconds. Normally a very long lease time is preferred because it prevents routes involving the TAP-Win32 adapter from being lost when the system goes to sleep. The default lease time is one year.</p>
     488<p><strong>netsh --</strong> Automatically set the IP address and netmask using the Windows command-line "netsh" command. This method appears to work correctly on Windows XP but not Windows 2000.</p>
     489<p><strong>ipapi --</strong> Automatically set the IP address and netmask using the Windows IP Helper API. This approach does not have ideal semantics, though testing has indicated that it works okay in practice. If you use this option, it is best to leave the TCP/IP properties for the TAP-Win32 adapter in their default state, i.e. "Obtain an IP address automatically."</p>
     490</dd><dt><strong>--route-method m</strong></dt><dd>Which method <strong>m</strong>to use for adding routes on Windows?
     491<p><strong>ipapi</strong> (default) -- Use IP helper API. <br /><strong>exe</strong> -- Call the route.exe shell command.</p>
     492</dd><dt><strong>--dhcp-option type [parm]</strong></dt><dd>Set extended TAP-Win32 TCP/IP properties, must be used with <strong>--ip-win32 dynamic.</strong>This option can be used to set additional TCP/IP properties on the TAP-Win32 adapter, and is particularly useful for configuring an OpenVPN client to access a Samba server across the VPN.
     493<p><strong>DOMAIN name --</strong> Set Connection-specific DNS Suffix.</p>
     494<p><strong>DNS addr --</strong> Set primary domain name server address. Repeat this option to set secondary DNS server addresses.</p>
     495<p><strong>WINS addr --</strong> Set primary WINS server address (NetBIOS over TCP/IP Name Server). Repeat this option to set secondary WINS server addresses.</p>
     496<p><strong>NBDD addr --</strong> Set primary NBDD server address (NetBIOS over TCP/IP Datagram Distribution Server) Repeat this option to set secondary NBDD server addresses.</p>
     497<p><strong>NTP addr --</strong> Set primary NTP server address (Network Time Protocol). Repeat this option to set secondary NTP server addresses.</p>
     498<p><strong>NBT type --</strong> Set NetBIOS over TCP/IP Node type. Possible options: <strong>1</strong> = b-node (broadcasts), <strong>2</strong> = p-node (point-to-point name queries to a WINS server), <strong>4</strong> = m-node (broadcast then query name server), and <strong>8</strong> = h-node (query name server, then broadcast).</p>
     499<p><strong>NBS scope-id --</strong> Set NetBIOS over TCP/IP Scope. A NetBIOS Scope ID provides an extended naming service for the NetBIOS over TCP/IP (Known as NBT) module. The primary purpose of a NetBIOS scope ID is to isolate NetBIOS traffic on a single network to only those nodes with the same NetBIOS scope ID. The NetBIOS scope ID is a character string that is appended to the NetBIOS name. The NetBIOS scope ID on two hosts must match, or the two hosts will not be able to communicate. The NetBIOS Scope ID also allows computers to use the same computer name, as they have different scope IDs. The Scope ID becomes a part of the NetBIOS name, making the name unique. (This description of NetBIOS scopes courtesy of <a href=""></a>)</p>
     500<p><strong>DISABLE-NBT --</strong> Disable Netbios-over-TCP/IP.</p>
     501<p>Note that if <strong>--dhcp-option</strong> is pushed via <strong>--push</strong> to a non-windows client, the option will be saved in the client's environment before the up script is called, under the name "foreign_option_{n}".</p>
     502</dd><dt><strong>--tap-sleep n</strong></dt><dd>Cause OpenVPN to sleep for <strong>n</strong>seconds immediately after the TAP-Win32 adapter state is set to "connected".
     503<p>This option is intended to be used to troubleshoot problems with the <strong>--ifconfig</strong> and <strong>--ip-win32</strong> options, and is used to give the TAP-Win32 adapter time to come up before Windows IP Helper API operations are applied to it.</p>
     504</dd><dt><strong>--show-net-up</strong></dt><dd>Output OpenVPN's view of the system routing table and network adapter list to the syslog or log file after the TUN/TAP adapter has been brought up and any routes have been added.</dd><dt><strong>--dhcp-renew</strong></dt><dd>Ask Windows to renew the TAP adapter lease on startup. This option is normally unnecessary, as Windows automatically triggers a DHCP renegotiation on the TAP adapter when it comes up, however if you set the TAP-Win32 adapter Media Status property to "Always Connected", you may need this flag.</dd><dt><strong>--dhcp-release</strong></dt><dd>Ask Windows to release the TAP adapter lease on shutdown. This option has the same caveats as <strong>--dhcp-renew</strong> above.</dd><dt><strong>--pause-exit</strong></dt><dd>Put up a "press any key to continue" message on the console prior to OpenVPN program exit. This option is automatically used by the Windows explorer when OpenVPN is run on a configuration file using the right-click explorer menu.</dd><dt><strong>--service exit-event [0|1]</strong></dt><dd>Should be used when OpenVPN is being automatically executed by another program in such a context that no interaction with the user via display or keyboard is possible. In general, end-users should never need to explicitly use this option, as it is automatically added by the OpenVPN service wrapper when a given OpenVPN configuration is being run as a service.
     505<p><strong>exit-event</strong> is the name of a Windows global event object, and OpenVPN will continuously monitor the state of this event object and exit when it becomes signaled.</p>
     506<p>The second parameter indicates the initial state of <strong>exit-event</strong> and normally defaults to 0.</p>
     507<p>Multiple OpenVPN processes can be simultaneously executed with the same <strong>exit-event</strong> parameter. In any case, the controlling process can signal <strong>exit-event,</strong> causing all such OpenVPN processes to exit.</p>
     508<p>When executing an OpenVPN process using the <strong>--service</strong> directive, OpenVPN will probably not have a console window to output status/error messages, therefore it is useful to use <strong>--log</strong> or <strong>--log-append</strong> to write these messages to a file.</p>
     509</dd><dt><strong>--show-adapters</strong></dt><dd>(Standalone) Show available TAP-Win32 adapters which can be selected using the <strong>--dev-node</strong> option. On non-Windows systems, the <strong>ifconfig</strong>(8) command provides similar functionality.</dd><dt><strong>--show-valid-subnets</strong></dt><dd>(Standalone) Show valid subnets for <strong>--dev tun</strong>emulation. Since the TAP-Win32 driver exports an ethernet interface to Windows, and since TUN devices are point-to-point in nature, it is necessary for the TAP-Win32 driver to impose certain constraints on TUN endpoint address selection.
     510<p>Namely, the point-to-point endpoints used in TUN device emulation must be the middle two addresses of a /30 subnet (netmask</p>
     511</dd><dt><strong>--show-net</strong></dt><dd>(Standalone) Show OpenVPN's view of the system routing table and network adapter list.</dd></dl>
     512<p><a name="lbAP" title="lbAP"></a></p>
     514<p>OpenVPN exports a series of environmental variables for use by user-defined scripts. <a name="lbAQ" title="lbAQ"></a></p>
     515<h3>Script Order of Execution</h3>
     516<dl><dt><strong>--up</strong></dt><dd>Executed after TCP/UDP socket bind and TUN/TAP open.</dd><dt><strong>--tls-verify</strong></dt><dd>Executed when we have a still untrusted remote peer.</dd><dt><strong>--ipchange</strong></dt><dd>Executed after connection authentication, or remote IP address change.</dd><dt><strong>--client-connect</strong></dt><dd>Executed in <strong>--mode server</strong> mode immediately after client authentication.</dd><dt><strong>--route-up</strong></dt><dd>Executed after connection authentication, either immediately after, or some number of seconds after as defined by the <strong>--route-delay</strong> option.</dd><dt><strong>--client-disconnect</strong></dt><dd>Executed in <strong>--mode server</strong> mode on client instance shutdown.</dd><dt><strong>--down</strong></dt><dd>Executed after TCP/UDP and TUN/TAP close.</dd><dt><strong>--learn-address</strong></dt><dd>Executed in <strong>--mode server</strong> mode whenever an IPv4 address/route or MAC address is added to OpenVPN's internal routing table.</dd><dt><strong>--auth-user-pass-verify</strong></dt><dd>Executed in <strong>--mode server</strong> mode on new client connections, when the client is still untrusted.</dd></dl>
     517<p><a name="lbAR" title="lbAR"></a></p>
     518<h3>String Types and Remapping</h3>
     519<p>In certain cases, OpenVPN will perform remapping of characters in strings. Essentially, any characters outside the set of permitted characters for each string type will be converted to underbar ('_').</p>
     520<p><strong>Q:</strong> Why is string remapping necessary?</p>
     521<p><strong>A:</strong> It's an important security feature to prevent the malicious coding of strings from untrusted sources to be passed as parameters to scripts, saved in the environment, used as a common name, translated to a filename, etc.</p>
     522<p>Here is a brief rundown of OpenVPN's current string types and the permitted character class for each string:</p>
     523<p><strong>X509 Names:</strong> Alphanumeric, underbar ('_'), dash ('-'), dot ('.'), at ('@'), colon (':'), slash ('/'), and equal ('='). Alphanumeric is defined as a character which will cause the C library isalnum() function to return true.</p>
     524<p><strong>Common Names:</strong> Alphanumeric, underbar ('_'), dash ('-'), dot ('.'), and at ('@').</p>
     525<p><strong>--auth-user-pass username:</strong> Same as Common Name, with one exception: starting with OpenVPN 2.0.1, the username is passed to the OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY plugin in its raw form, without string remapping.</p>
     526<p><strong>--auth-user-pass password:</strong> Any "printable" character except CR or LF. Printable is defined to be a character which will cause the C library isprint() function to return true.</p>
     527<p><strong>--client-config-dir filename as derived from common name or username:</strong> Alphanumeric, underbar ('_'), dash ('-'), and dot ('.') except for "." or ".." as standalone strings. As of 2.0.1-rc6, the at ('@') character has been added as well for compatibility with the common name character class.</p>
     528<p><strong>Environmental variable names:</strong> Alphanumeric or underbar ('_').</p>
     529<p><strong>Environmental variable values:</strong> Any printable character.</p>
     530<p>For all cases, characters in a string which are not members of the legal character class for that string type will be remapped to underbar ('_'). <a name="lbAS" title="lbAS"></a></p>
     531<h3>Environmental Variables</h3>
     532<p>Once set, a variable is persisted indefinitely until it is reset by a new value or a restart,</p>
     533<p>As of OpenVPN 2.0-beta12, in server mode, environmental variables set by OpenVPN are scoped according to the client objects they are associated with, so there should not be any issues with scripts having access to stale, previously set variables which refer to different client instances.</p>
     534<dl><dt><strong>bytes_received</strong></dt><dd>Total number of bytes received from client during VPN session. Set prior to execution of the <strong>--client-disconnect</strong> script.</dd><dt><strong>bytes_sent</strong></dt><dd>Total number of bytes sent to client during VPN session. Set prior to execution of the <strong>--client-disconnect</strong> script.</dd><dt><strong>common_name</strong></dt><dd>The X509 common name of an authenticated client. Set prior to execution of <strong>--client-connect, --client-disconnect,</strong> and <strong>--auth-user-pass-verify</strong> scripts.</dd><dt><strong>config</strong></dt><dd>Name of first <strong>--config</strong> file. Set on program initiation and reset on SIGHUP.</dd><dt><strong>daemon</strong></dt><dd>Set to "1" if the <strong>--daemon</strong> directive is specified, or "0" otherwise. Set on program initiation and reset on SIGHUP.</dd><dt><strong>daemon_log_redirect</strong></dt><dd>Set to "1" if the <strong>--log</strong> or <strong>--log-append</strong> directives are specified, or "0" otherwise. Set on program initiation and reset on SIGHUP.</dd><dt><strong>dev</strong></dt><dd>The actual name of the TUN/TAP device, including a unit number if it exists. Set prior to <strong>--up</strong> or <strong>--down</strong> script execution.</dd><dt><strong>foreign_option_{n}</strong></dt><dd>An option pushed via <strong>--push</strong> to a client which does not natively support it, such as <strong>--dhcp-option</strong> on a non-Windows system, will be recorded to this environmental variable sequence prior to <strong>--up</strong> script execution.</dd><dt><strong>ifconfig_broadcast</strong></dt><dd>The broadcast address for the virtual ethernet segment which is derived from the <strong>--ifconfig</strong> option when <strong>--dev tap</strong> is used. Set prior to OpenVPN calling the <em>ifconfig</em> or <em>netsh</em> (windows version of ifconfig) commands which normally occurs prior to <strong>--up</strong> script execution.</dd><dt><strong>ifconfig_local</strong></dt><dd>The local VPN endpoint IP address specified in the <strong>--ifconfig</strong> option (first parameter). Set prior to OpenVPN calling the <em>ifconfig</em> or <em>netsh</em> (windows version of ifconfig) commands which normally occurs prior to <strong>--up</strong> script execution.</dd><dt><strong>ifconfig_remote</strong></dt><dd>The remote VPN endpoint IP address specified in the <strong>--ifconfig</strong> option (second parameter) when <strong>--dev tun</strong> is used. Set prior to OpenVPN calling the <em>ifconfig</em> or <em>netsh</em> (windows version of ifconfig) commands which normally occurs prior to <strong>--up</strong> script execution.</dd><dt><strong>ifconfig_netmask</strong></dt><dd>The subnet mask of the virtual ethernet segment that is specified as the second parameter to <strong>--ifconfig</strong> when <strong>--dev tap</strong> is being used. Set prior to OpenVPN calling the <em>ifconfig</em> or <em>netsh</em> (windows version of ifconfig) commands which normally occurs prior to <strong>--up</strong> script execution.</dd><dt><strong>ifconfig_pool_local_ip</strong></dt><dd>The local virtual IP address for the TUN/TAP tunnel taken from an <strong>--ifconfig-push</strong> directive if specified, or otherwise from the ifconfig pool (controlled by the <strong>--ifconfig-pool</strong> config file directive). Only set for <strong>--dev tun</strong> tunnels. This option is set on the server prior to execution of the <strong>--client-connect</strong> and <strong>--client-disconnect</strong> scripts.</dd><dt><strong>ifconfig_pool_netmask</strong></dt><dd>The virtual IP netmask for the TUN/TAP tunnel taken from an <strong>--ifconfig-push</strong> directive if specified, or otherwise from the ifconfig pool (controlled by the <strong>--ifconfig-pool</strong> config file directive). Only set for <strong>--dev tap</strong> tunnels. This option is set on the server prior to execution of the <strong>--client-connect</strong> and <strong>--client-disconnect</strong> scripts.</dd><dt><strong>ifconfig_pool_remote_ip</strong></dt><dd>The remote virtual IP address for the TUN/TAP tunnel taken from an <strong>--ifconfig-push</strong> directive if specified, or otherwise from the ifconfig pool (controlled by the <strong>--ifconfig-pool</strong> config file directive). This option is set on the server prior to execution of the <strong>--client-connect</strong> and <strong>--client-disconnect</strong> scripts.</dd><dt><strong>link_mtu</strong></dt><dd>The maximum packet size (not including the IP header) of tunnel data in UDP tunnel transport mode. Set prior to <strong>--up</strong> or <strong>--down</strong> script execution.</dd><dt><strong>local</strong></dt><dd>The <strong>--local</strong> parameter. Set on program initiation and reset on SIGHUP.</dd><dt><strong>local_port</strong></dt><dd>The local port number, specified by <strong>--port</strong> or <strong>--lport.</strong> Set on program initiation and reset on SIGHUP.</dd><dt><strong>password</strong></dt><dd>The password provided by a connecting client. Set prior to <strong>--auth-user-pass-verify</strong> script execution only when the <strong>via-env</strong> modifier is specified, and deleted from the environment after the script returns.</dd><dt><strong>proto</strong></dt><dd>The <strong>--proto</strong> parameter. Set on program initiation and reset on SIGHUP.</dd><dt><strong>remote_{n}</strong></dt><dd>The <strong>--remote</strong> parameter. Set on program initiation and reset on SIGHUP.</dd><dt><strong>remote_port_{n}</strong></dt><dd>The remote port number, specified by <strong>--port</strong> or <strong>--rport.</strong> Set on program initiation and reset on SIGHUP.</dd><dt><strong>route_net_gateway</strong></dt><dd>The pre-existing default IP gateway in the system routing table. Set prior to <strong>--up</strong> script execution.</dd><dt><strong>route_vpn_gateway</strong></dt><dd>The default gateway used by <strong>--route</strong> options, as specified in either the <strong>--route-gateway</strong> option or the second parameter to <strong>--ifconfig</strong> when <strong>--dev tun</strong> is specified. Set prior to <strong>--up</strong> script execution.</dd><dt><strong>route_{parm}_{n}</strong></dt><dd>A set of variables which define each route to be added, and are set prior to <strong>--up</strong>script execution.
     535<p><strong>parm</strong> will be one of "network", "netmask", "gateway", or "metric".</p>
     536<p><strong>n</strong> is the OpenVPN route number, starting from 1.</p>
     537<p>If the network or gateway are resolvable DNS names, their IP address translations will be recorded rather than their names as denoted on the command line or configuration file.</p>
     538</dd><dt><strong>script_context</strong></dt><dd>Set to "init" or "restart" prior to up/down script execution. For more information, see documentation for <strong>--up.</strong></dd><dt><strong>script_type</strong></dt><dd>One of <strong>up, down, ipchange, route-up, tls-verify, auth-user-pass-verify,</strong> <strong>client-connect, client-disconnect, </strong>or <strong>learn-address.</strong> Set prior to execution of any script.</dd><dt><strong>signal</strong></dt><dd>The reason for exit or restart. Can be one of <strong>sigusr1, sighup, sigterm, sigint, inactive</strong> (controlled by <strong>--inactive</strong> option), <strong>ping-exit</strong> (controlled by <strong>--ping-exit</strong> option), <strong>ping-restart</strong> (controlled by <strong>--ping-restart</strong> option), <strong>connection-reset</strong> (triggered on TCP connection reset), <strong>error,</strong> or <strong>unknown</strong> (unknown signal). This variable is set just prior to down script execution.</dd><dt><strong>tls_id_{n}</strong></dt><dd>A series of certificate fields from the remote peer, where <strong>n</strong> is the verification level. Only set for TLS connections. Set prior to execution of <strong>--tls-verify</strong> script.</dd><dt><strong>tls_serial_{n}</strong></dt><dd>The serial number of the certificate from the remote peer, where <strong>n</strong> is the verification level. Only set for TLS connections. Set prior to execution of <strong>--tls-verify</strong> script.</dd><dt><strong>tun_mtu</strong></dt><dd>The MTU of the TUN/TAP device. Set prior to <strong>--up</strong> or <strong>--down</strong> script execution.</dd><dt><strong>trusted_ip</strong></dt><dd>Actual IP address of connecting client or peer which has been authenticated. Set prior to execution of <strong>--ipchange, --client-connect,</strong> and <strong>--client-disconnect</strong> scripts.</dd><dt><strong>trusted_port</strong></dt><dd>Actual port number of connecting client or peer which has been authenticated. Set prior to execution of <strong>--ipchange, --client-connect,</strong> and <strong>--client-disconnect</strong> scripts.</dd><dt><strong>untrusted_ip</strong></dt><dd>Actual IP address of connecting client or peer which has not been authenticated yet. Sometimes used to <strong>nmap</strong> the connecting host in a <strong>--tls-verify</strong> script to ensure it is firewalled properly. Set prior to execution of <strong>--tls-verify</strong> and <strong>--auth-user-pass-verify</strong> scripts.</dd><dt><strong>untrusted_port</strong></dt><dd>Actual port number of connecting client or peer which has not been authenticated yet. Set prior to execution of <strong>--tls-verify</strong> and <strong>--auth-user-pass-verify</strong> scripts.</dd><dt><strong>username</strong></dt><dd>The username provided by a connecting client. Set prior to <strong>--auth-user-pass-verify</strong> script execution only when the <strong>via-env</strong> modifier is specified.</dd></dl>
     539<p><a name="lbAT" title="lbAT"></a></p>
     541<dl><dt><strong>SIGHUP</strong></dt><dd>Cause OpenVPN to close all TUN/TAP and network connections, restart, re-read the configuration file (if any), and reopen TUN/TAP and network connections.</dd><dt><strong>SIGUSR1</strong></dt><dd>Like <strong>SIGHUP,</strong> except don't re-read configuration file, and possibly don't close and reopen TUN/TAP device, re-read key files, preserve local IP address/port, or preserve most recently authenticated remote IP address/port based on <strong>--persist-tun, --persist-key, --persist-local-ip,</strong> and <strong>--persist-remote-ip</strong>options respectively (see above).
     542<p>This signal may also be internally generated by a timeout condition, governed by the <strong>--ping-restart</strong> option.</p>
     543<p>This signal, when combined with <strong>--persist-remote-ip,</strong> may be sent when the underlying parameters of the host's network interface change such as when the host is a DHCP client and is assigned a new IP address. See <strong>--ipchange</strong> above for more information.</p>
     544</dd><dt><strong>SIGUSR2</strong></dt><dd>Causes OpenVPN to display its current statistics (to the syslog file if <strong>--daemon</strong> is used, or stdout otherwise).</dd><dt><strong>SIGINT, SIGTERM</strong></dt><dd>Causes OpenVPN to exit gracefully.</dd></dl>
     545<p><a name="lbAU" title="lbAU"></a></p>
     546<h2>TUN/TAP DRIVER SETUP</h2>
     547<p>If you are running Linux 2.4.7 or higher, you probably have the TUN/TAP driver already installed. If so, there are still a few things you need to do:</p>
     548<p>Make device: <strong>mknod /dev/net/tun c 10 200</strong></p>
     549<p>Load driver: <strong>modprobe tun</strong></p>
     550<p>If you have Linux 2.2 or earlier, you should obtain version 1.1 of the TUN/TAP driver from <em><a href=""></a></em> and follow the installation instructions. <a name="lbAV" title="lbAV"></a></p>
     552<p>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. <a name="lbAW" title="lbAW"></a></p>
     553<h3>TUN/TAP Setup:</h3>
     554<p>If you are using Linux 2.4 or higher, make the tun device node and load the tun module:</p>
     555<dl><dt></dt><dd><strong>mknod /dev/net/tun c 10 200</strong></dd></dl>
     556<p> </p>
     557<dl><dt></dt><dd><strong>modprobe tun</strong></dd></dl>
     558<p>If you installed from RPM, the <strong>mknod</strong> step may be omitted, because the RPM install does that for you.</p>
     559<p>If you have Linux 2.2, you should obtain version 1.1 of the TUN/TAP driver from <em><a href=""></a></em> and follow the installation instructions.</p>
     560<p>For other platforms, consult the INSTALL file at <em><a href="install.html"></a></em> for more information. <a name="lbAX" title="lbAX"></a></p>
     561<h3>Firewall Setup:</h3>
     562<p>If firewalls exist between the two machines, they should be set to forward UDP port 1194 in both directions. If you do not have control over the firewalls between the two machines, you may still be able to use OpenVPN by adding <strong>--ping 15</strong> to each of the <strong>openvpn</strong>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).</p>
     563<p>If you are using a Linux iptables-based firewall, you may need to enter the following command to allow incoming packets on the TUN device:</p>
     564<dl><dt></dt><dd><strong>iptables -A INPUT -i tun+ -j ACCEPT</strong></dd></dl>
     565<p>See the firewalls section below for more information on configuring firewalls for use with OpenVPN. <a name="lbAY" title="lbAY"></a></p>
     566<h3>VPN Address Setup:</h3>
     567<p>For purposes of our example, our two machines will be called <strong></strong> and <strong></strong> If you are constructing a VPN over the internet, then replace <strong></strong> and <strong></strong>with the internet hostname or IP address that each machine will use to contact the other over the internet.</p>
     568<p>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 will be and for,</p>
     569<p>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 and you wish to connect to via <strong>ssh</strong> without using the VPN (since <strong>ssh</strong> has its own built-in security) you would use the command <strong>ssh</strong> However in the same scenario, you could also use the command <strong>telnet</strong> to create a telnet session with over the VPN, that would use the VPN to secure the session rather than <strong>ssh.</strong></p>
     570<p>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. <a name="lbAZ" title="lbAZ"></a></p>
     571<h3>Example 1: A simple tunnel without security</h3>
     572<p>On may:</p>
     573<dl><dt></dt><dd><strong>openvpn --remote --dev tun1 --ifconfig --verb 9</strong></dd></dl>
     574<p>On june:</p>
     575<dl><dt></dt><dd><strong>openvpn --remote --dev tun1 --ifconfig --verb 9</strong></dd></dl>
     576<p>Now verify the tunnel is working by pinging across the tunnel.</p>
     577<p>On may:</p>
     579<p>On june:</p>
     581<p>The <strong>--verb 9</strong> option will produce verbose output, similar to the <strong>tcpdump</strong>(8) program. Omit the <strong>--verb 9</strong> option to have OpenVPN run quietly. <a name="lbBA" title="lbBA"></a></p>
     582<h3>Example 2: A tunnel with static-key security (i.e. using a pre-shared secret)</h3>
     583<p>First build a static key on may.</p>
     584<dl><dt></dt><dd><strong>openvpn --genkey --secret key</strong></dd></dl>
     585<p>This command will build a random key file called <strong>key</strong> (in ascii format). Now copy <strong>key</strong> to june over a secure medium such as by using the <strong>scp</strong>(1) program.</p>
     586<p>On may:</p>
     587<dl><dt></dt><dd><strong>openvpn --remote --dev tun1 --ifconfig --verb 5 --secret key</strong></dd></dl>
     588<p>On june:</p>
     589<dl><dt></dt><dd><strong>openvpn --remote --dev tun1 --ifconfig --verb 5 --secret key</strong></dd></dl>
     590<p>Now verify the tunnel is working by pinging across the tunnel.</p>
     591<p>On may:</p>
     593<p>On june:</p>
     595<p><a name="lbBB" title="lbBB"></a></p>
     596<h3>Example 3: A tunnel with full TLS-based security</h3>
     597<p>For this test, we will designate <strong>may</strong> as the TLS client and <strong>june</strong> as the TLS server. <em>Note that 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.</em></p>
     598<p>First, build a separate certificate/key pair for both may and june (see above where <strong>--cert</strong> is discussed for more info). Then construct Diffie Hellman parameters (see above where <strong>--dh</strong> is discussed for more info). You can also use the included test files client.crt, client.key, server.crt, server.key and tmp-ca.crt. The .crt files are certificates/public-keys, the .key files are private keys, and tmp-ca.crt is a certification authority who has signed both client.crt and server.crt. For Diffie Hellman parameters you can use the included file dh1024.pem. <em>Note that all client, server, and certificate authority certificates and keys included in the OpenVPN distribution are totally insecure and should be used for testing only.</em></p>
     599<p>On may:</p>
     600<dl><dt></dt><dd><strong>openvpn --remote --dev tun1 --ifconfig --tls-client --ca tmp-ca.crt --cert client.crt --key client.key --reneg-sec 60 --verb 5</strong></dd></dl>
     601<p>On june:</p>
     602<dl><dt></dt><dd><strong>openvpn --remote --dev tun1 --ifconfig --tls-server --dh dh1024.pem --ca tmp-ca.crt --cert server.crt --key server.key --reneg-sec 60 --verb 5</strong></dd></dl>
     603<p>Now verify the tunnel is working by pinging across the tunnel.</p>
     604<p>On may:</p>
     606<p>On june:</p>
     608<p>Notice the <strong>--reneg-sec 60</strong> option we used above. That tells OpenVPN to renegotiate the data channel keys every minute. Since we used <strong>--verb 5</strong> above, you will see status information on each new key negotiation.</p>
     609<p>For production operations, a key renegotiation interval of 60 seconds is probably too frequent. Omit the <strong>--reneg-sec 60</strong> option to use OpenVPN's default key renegotiation interval of one hour. <a name="lbBC" title="lbBC"></a></p>
     611<p>Assuming you can ping across the tunnel, the next step is to route a real subnet over the secure tunnel. Suppose that may and june 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 may's private subnet is and june's is</p>
     612<p>First, ensure that IP forwarding is enabled on both peers. On Linux, enable routing:</p>
     613<dl><dt></dt><dd><strong>echo 1 &gt; /proc/sys/net/ipv4/ip_forward</strong></dd></dl>
     614<p>and enable TUN packet forwarding through the firewall:</p>
     615<dl><dt></dt><dd><strong>iptables -A FORWARD -i tun+ -j ACCEPT</strong></dd></dl>
     616<p>On may:</p>
     617<dl><dt></dt><dd><strong>route add -net netmask gw</strong></dd></dl>
     618<p>On june:</p>
     619<dl><dt></dt><dd><strong>route add -net netmask gw</strong></dd></dl>
     620<p>Now any machine on the subnet can access any machine on the subnet over the secure tunnel (or vice versa).</p>
     621<p>In a production environment, you could put the route command(s) in a shell script and execute with the <strong>--up</strong> option. <a name="lbBD" title="lbBD"></a></p>
     623<p>OpenVPN's usage of a single UDP port makes it fairly firewall-friendly. You should add an entry to your firewall rules to allow incoming OpenVPN packets. On Linux 2.4+:</p>
     624<dl><dt></dt><dd><strong>iptables -A INPUT -p udp -s --dport 1194 -j ACCEPT</strong></dd></dl>
     625<p>This will allow incoming packets on UDP port 1194 (OpenVPN's default UDP port) from an OpenVPN peer at</p>
     626<p>If you are using HMAC-based packet authentication (the default in any of OpenVPN's secure modes), having the firewall filter on source address can be considered optional, since HMAC packet authentication is a much more secure method of verifying the authenticity of a packet source. In that case:</p>
     627<dl><dt></dt><dd><strong>iptables -A INPUT -p udp --dport 1194 -j ACCEPT</strong></dd></dl>
     628<p>would be adequate and would not render the host inflexible with respect to its peer having a dynamic IP address.</p>
     629<p>OpenVPN also works well on stateful firewalls. In some cases, you may not need to add any static rules to the firewall list if you are using a stateful firewall that knows how to track UDP connections. If you specify <strong>--ping n,</strong> OpenVPN will be guaranteed to send a packet to its peer at least once every <strong>n</strong> seconds. If <strong>n</strong> is less than the stateful firewall connection timeout, you can maintain an OpenVPN connection indefinitely without explicit firewall rules.</p>
     630<p>You should also add firewall rules to allow incoming IP traffic on TUN or TAP devices such as:</p>
     631<dl><dt></dt><dd><strong>iptables -A INPUT -i tun+ -j ACCEPT</strong></dd></dl>
     632<p>to allow input packets from tun devices,</p>
     633<dl><dt></dt><dd><strong>iptables -A FORWARD -i tun+ -j ACCEPT</strong></dd></dl>
     634<p>to allow input packets from tun devices to be forwarded to other hosts on the local network,</p>
     635<dl><dt></dt><dd><strong>iptables -A INPUT -i tap+ -j ACCEPT</strong></dd></dl>
     636<p>to allow input packets from tap devices, and</p>
     637<dl><dt></dt><dd><strong>iptables -A FORWARD -i tap+ -j ACCEPT</strong></dd></dl>
     638<p>to allow input packets from tap devices to be forwarded to other hosts on the local network.</p>
     639<p>These rules are secure if you use packet authentication, since no incoming packets will arrive on a TUN or TAP virtual device unless they first pass an HMAC authentication test. <a name="lbBE" title="lbBE"></a></p>
     641<p><em><a href="faq.html"></a></em> <a name="lbBF" title="lbBF"></a></p>
     643<p>For a more comprehensive guide to setting up OpenVPN in a production setting, see the OpenVPN HOWTO at <em><a href="howto.html"></a></em> <a name="lbBG" title="lbBG"></a></p>
     645<p>For a description of OpenVPN's underlying protocol, see <em><a href="security.html"></a></em> <a name="lbBH" title="lbBH"></a></p>
     647<p>OpenVPN's web site is at <em><a href=""></a></em></p>
     648<p>Go here to download the latest version of OpenVPN, subscribe to the mailing lists, read the mailing list archives, or browse the CVS repository. <a name="lbBI" title="lbBI"></a></p>
     650<p>Report all bugs to the OpenVPN users list &lt;<a href=""></a>&gt;. To subscribe to the list or see the archives, go to <em><a href="mail.html"></a></em> <a name="lbBJ" title="lbBJ"></a></p>
     651<h2>SEE ALSO</h2>
     652<p><strong>dhcpcd</strong>(8), <strong>ifconfig</strong>(8), <strong>openssl</strong>(1), <strong>route</strong>(8), <strong>scp</strong>(1) <strong>ssh</strong>(1) <a name="lbBK" title="lbBK"></a></p>
     654<p>This product includes software developed by the OpenSSL Project ( <em><a href=""></a></em> )</p>
     655<p>For more information on the TLS protocol, see <em><a href=""></a></em></p>
     656<p>For more information on the LZO real-time compression library see <em><a href=""></a></em> <a name="lbBL" title="lbBL"></a></p>
     658<p>Copyright (C) 2002-2010 OpenVPN Technologies, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. <a name="lbBM" title="lbBM"></a></p>
     660<p>James Yonan <a href=""></a></p>
     661<p> </p>
     662<hr />
     663<p><a name="index" title="index"></a></p>
     665<dl><dt><a href="#lbAB">NAME</a></dt><dd></dd><dt><a href="#lbAC">SYNOPSIS</a></dt><dd></dd><dt><a href="#lbAD">INTRODUCTION</a></dt><dd></dd><dt><a href="#lbAE">DESCRIPTION</a></dt><dd></dd><dt><a href="#lbAF">OPTIONS</a></dt><dd><dl><dt><a href="#lbAG">Tunnel Options:</a></dt><dd></dd><dt><a href="#lbAH">Server Mode</a></dt><dd></dd><dt><a href="#lbAI">Client Mode</a></dt><dd></dd><dt><a href="#lbAJ">Data Channel Encryption Options:</a></dt><dd></dd><dt><a href="#lbAK">TLS Mode Options:</a></dt><dd></dd><dt><a href="#lbAL">SSL Library information:</a></dt><dd></dd><dt><a href="#lbAM">Generate a random key:</a></dt><dd></dd><dt><a href="#lbAN">TUN/TAP persistent tunnel config mode:</a></dt><dd></dd><dt><a href="#lbAO">Windows-Specific Options:</a></dt><dd></dd></dl></dd><dt><a href="#lbAP">SCRIPTING AND ENVIRONMENTAL VARIABLES</a></dt><dd><dl><dt><a href="#lbAQ">Script Order of Execution</a></dt><dd></dd><dt><a href="#lbAR">String Types and Remapping</a></dt><dd></dd><dt><a href="#lbAS">Environmental Variables</a></dt><dd></dd></dl></dd><dt><a href="#lbAT">SIGNALS</a></dt><dd></dd><dt><a href="#lbAU">TUN/TAP DRIVER SETUP</a></dt><dd></dd><dt><a href="#lbAV">EXAMPLES</a></dt><dd><dl><dt><a href="#lbAW">TUN/TAP Setup:</a></dt><dd></dd><dt><a href="#lbAX">Firewall Setup:</a></dt><dd></dd><dt><a href="#lbAY">VPN Address Setup:</a></dt><dd></dd><dt><a href="#lbAZ">Example 1: A simple tunnel without security</a></dt><dd></dd><dt><a href="#lbBA">Example 2: A tunnel with static-key security (i.e. using a pre-shared secret)</a></dt><dd></dd><dt><a href="#lbBB">Example 3: A tunnel with full TLS-based security</a></dt><dd></dd><dt><a href="#lbBC">Routing:</a></dt><dd></dd></dl></dd><dt><a href="#lbBD">FIREWALLS</a></dt><dd></dd><dt><a href="#lbBE">FAQ</a></dt><dd></dd><dt><a href="#lbBF">HOWTO</a></dt><dd></dd><dt><a href="#lbBG">PROTOCOL</a></dt><dd></dd><dt><a href="#lbBH">WEB</a></dt><dd></dd><dt><a href="#lbBI">BUGS</a></dt><dd></dd><dt><a href="#lbBJ">SEE ALSO</a></dt><dd></dd><dt><a href="#lbBK">NOTES </a></dt><dd></dd><dt><a href="#lbBL">COPYRIGHT</a></dt><dd></dd><dt><a href="#lbBM">AUTHORS</a></dt></dl>