openvpn 2.3.10
[tomato.git] / release / src / router / openvpn / doc / openvpn.8
blob25ea9f97cf51b19ea53e330532f64c6e3b31f6d6
1 .\"  OpenVPN -- An application to securely tunnel IP networks
2 .\"             over a single TCP/UDP port, with support for SSL/TLS-based
3 .\"             session authentication and key exchange,
4 .\"             packet encryption, packet authentication, and
5 .\"             packet compression.
6 .\"
7 .\"  Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
8 .\"
9 .\"  This program is free software; you can redistribute it and/or modify
10 .\"  it under the terms of the GNU General Public License version 2
11 .\"  as published by the Free Software Foundation.
12 .\"
13 .\"  This program is distributed in the hope that it will be useful,
14 .\"  but WITHOUT ANY WARRANTY; without even the implied warranty of
15 .\"  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 .\"  GNU General Public License for more details.
17 .\"
18 .\"  You should have received a copy of the GNU General Public License
19 .\"  along with this program (see the file COPYING included with this
20 .\"  distribution); if not, write to the Free Software Foundation, Inc.,
21 .\"  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
22 .\"
23 .\" Manual page for openvpn
25 .\" SH section heading
26 .\" SS subsection heading
27 .\" LP paragraph
28 .\" IP indented paragraph
29 .\" TP hanging label
31 .\" .nf -- no formatting
32 .\" .fi -- resume formatting
33 .\" .ft 3 -- boldface
34 .\" .ft -- normal face
35 .\" .in +|-{n} -- indent
36 .\"
37 .TH openvpn 8 "17 November 2008"
38 .\"*********************************************************
39 .SH NAME
40 openvpn - secure IP tunnel daemon.
41 .\"*********************************************************
42 .SH SYNOPSIS
43 .ft 3
44 openvpn [ options ... ]
45 .ft
46 .\"*********************************************************
47 .SH INTRODUCTION
48 .LP
49 OpenVPN is an open source VPN daemon by James Yonan.
50 Because OpenVPN tries to
51 be a universal VPN tool offering a great deal of flexibility,
52 there are a lot of options on this manual page.
53 If you're new to OpenVPN, you might want to skip ahead to the
54 examples section where you will see how to construct simple
55 VPNs on the command line without even needing a configuration file.
57 Also note that there's more documentation and examples on
58 the OpenVPN web site:
59 .I http://openvpn.net/
61 And if you would like to see a shorter version of this manual,
62 see the openvpn usage message which can be obtained by
63 running
64 .B openvpn
65 without any parameters.
66 .\"*********************************************************
67 .SH DESCRIPTION
68 .LP
69 OpenVPN is a robust and highly flexible VPN daemon.
70 OpenVPN supports SSL/TLS security, ethernet bridging,
71 TCP or UDP tunnel transport through proxies or NAT,
72 support for dynamic IP addresses and DHCP,
73 scalability to hundreds or thousands of users,
74 and portability to most major OS platforms.
76 OpenVPN is tightly bound to the OpenSSL library, and derives much
77 of its crypto capabilities from it.
79 OpenVPN supports
80 conventional encryption
81 using a pre-shared secret key
82 .B (Static Key mode)
84 public key security
85 .B (SSL/TLS mode)
86 using client & server certificates.
87 OpenVPN also
88 supports non-encrypted TCP/UDP tunnels.  
90 OpenVPN is designed to work with the
91 .B TUN/TAP
92 virtual networking interface that exists on most platforms.
94 Overall, OpenVPN aims to offer many of the key features of IPSec but
95 with a relatively lightweight footprint.
96 .\"*********************************************************
97 .SH OPTIONS
98 OpenVPN allows any option to be placed either on the command line
99 or in a configuration file.  Though all command line options are preceded
100 by a double-leading-dash ("\-\-"), this prefix can be removed when
101 an option is placed in a configuration file.
102 .\"*********************************************************
104 .B \-\-help
105 Show options.
106 .\"*********************************************************
108 .B \-\-config file
109 Load additional config options from
110 .B file
111 where each line corresponds to one command line option,
112 but with the leading '\-\-' removed.
115 .B \-\-config file
116 is the only option to the openvpn command,
118 .B \-\-config
119 can be removed, and the command can be given as
120 .B openvpn file
122 Note that
123 configuration files can be nested to a reasonable depth.
125 Double quotation or single quotation characters ("", '')
126 can be used to enclose single parameters containing whitespace,
127 and "#" or ";" characters in the first column
128 can be used to denote comments.
130 Note that OpenVPN 2.0 and higher performs backslash-based shell
131 escaping for characters not in single quotations,
132 so the following mappings should be observed:
135 .ft 3
136 .in +4
137 \\\\       Maps to a single backslash character (\\).
138 \\"       Pass a literal doublequote character ("), don't
139          interpret it as enclosing a parameter.
140 \\[SPACE] Pass a literal space or tab character, don't
141          interpret it as a parameter delimiter.
142 .in -4
146 For example on Windows, use double backslashes to
147 represent pathnames:
150 .ft 3
151 .in +4
152 secret "c:\\\\OpenVPN\\\\secret.key"
153 .in -4
157 For examples of configuration files,
159 .I http://openvpn.net/examples.html
161 Here is an example configuration file:
164 .ft 3
165 .in +4
167 # Sample OpenVPN configuration file for
168 # using a pre-shared static key.
170 # '#' or ';' may be used to delimit comments.
172 # Use a dynamic tun device.
173 dev tun
175 # Our remote peer
176 remote mypeer.mydomain
178 # 10.1.0.1 is our local VPN endpoint
179 # 10.1.0.2 is our remote VPN endpoint
180 ifconfig 10.1.0.1 10.1.0.2
182 # Our pre-shared static key
183 secret static.key
184 .in -4
187 .\"*********************************************************
188 .SS Tunnel Options:
190 .B \-\-mode m
191 Set OpenVPN major mode.  By default, OpenVPN runs in
192 point-to-point mode ("p2p").  OpenVPN 2.0 introduces
193 a new mode ("server") which implements a multi-client
194 server capability.
195 .\"*********************************************************
197 .B \-\-local host
198 Local host name or IP address for bind.
199 If specified, OpenVPN will bind to this address only.
200 If unspecified, OpenVPN will bind to all interfaces.
201 .\"*********************************************************
203 .B \-\-remote host [port] [proto]
204 Remote host name or IP address.  On the client, multiple
205 .B \-\-remote
206 options may be specified for redundancy, each referring
207 to a different OpenVPN server.  Specifying multiple
208 .B \-\-remote
209 options for this purpose is a special case of the more
210 general connection-profile feature.  See the
211 .B <connection>
212 documentation below.
214 The OpenVPN client will try to connect to a server at
215 .B host:port
216 in the order specified by the list of
217 .B \-\-remote
218 options.
220 .B proto
221 indicates the protocol to use when connecting with the
222 remote, and may be "tcp" or "udp".
224 The client will move on to the next host in the list,
225 in the event of connection failure.
226 Note that at any given time, the OpenVPN client
227 will at most be connected to
228 one server.
230 Note that since UDP is connectionless, connection failure
231 is defined by the
232 .B \-\-ping
234 .B \-\-ping\-restart
235 options.
237 Note the following corner case:  If you use multiple
238 .B \-\-remote
239 options, AND you are dropping root privileges on
240 the client with
241 .B \-\-user
242 and/or
243 .B \-\-group,
244 AND the client is running a non-Windows OS, if the client needs
245 to switch to a different server, and that server pushes
246 back different TUN/TAP or route settings, the client may lack
247 the necessary privileges to close and reopen the TUN/TAP interface.
248 This could cause the client to exit with a fatal error.
251 .B \-\-remote
252 is unspecified, OpenVPN will listen
253 for packets from any IP address, but will not act on those packets unless
254 they pass all authentication tests.  This requirement for authentication
255 is binding on all potential peers, even those from known and supposedly
256 trusted IP addresses (it is very easy to forge a source IP address on
257 a UDP packet).
259 When used in TCP mode, 
260 .B \-\-remote
261 will act as a filter, rejecting connections from any host which does
262 not match
263 .B host.
266 .B host
267 is a DNS name which resolves to multiple IP addresses,
268 the first address returned by the system getaddrinfo() function
269 will be used (no DNS randomization inside OpenVPN 2.3.x, and
270 it will not try multiple addresses).
271 .\"*********************************************************
273 .B \-\-remote\-random\-hostname
274 Prepend a random string (6 bytes, 12 hex characters) to hostname to prevent
275 DNS caching.  For example, "foo.bar.gov" would be modified to
276 "<random-chars>.foo.bar.gov".
277 .\"*********************************************************
279 .B <connection>
280 Define a client connection
281 profile.  Client connection profiles are groups of OpenVPN options that
282 describe how to connect to a given OpenVPN server.  Client connection
283 profiles are specified within an OpenVPN configuration file, and
284 each profile is bracketed by
285 .B <connection>
287 .B </connection>.
289 An OpenVPN client will try each connection profile sequentially
290 until it achieves a successful connection.  
292 .B \-\-remote\-random
293 can be used to initially "scramble" the connection
294 list.
296 Here is an example of connection profile usage:
299 .ft 3
300 .in +4
301 client
302 dev tun
304 <connection>
305 remote 198.19.34.56 1194 udp
306 </connection>
308 <connection>
309 remote 198.19.34.56 443 tcp
310 </connection>
312 <connection>
313 remote 198.19.34.56 443 tcp
314 http-proxy 192.168.0.8 8080
315 http-proxy-retry
316 </connection>
318 <connection>
319 remote 198.19.36.99 443 tcp
320 http-proxy 192.168.0.8 8080
321 http-proxy-retry
322 </connection>
324 persist-key
325 persist-tun
326 pkcs12 client.p12
327 ns-cert-type server
328 verb 3
329 .in -4
333 First we try to connect to a server at 198.19.34.56:1194 using UDP.
334 If that fails, we then try to connect to 198.19.34.56:443 using TCP.
335 If that also fails, then try connecting through an HTTP proxy at 
336 192.168.0.8:8080 to 198.19.34.56:443 using TCP.  Finally, try to
337 connect through the same proxy to a server at 198.19.36.99:443
338 using TCP.
340 The following OpenVPN options may be used inside of
342 .B <connection>
343 block:
345 .B bind,
346 .B connect-retry,
347 .B connect-retry-max,
348 .B connect-timeout,
349 .B explicit-exit-notify,
350 .B float,
351 .B fragment,
352 .B http-proxy,
353 .B http-proxy-option,
354 .B http-proxy-retry,
355 .B http-proxy-timeout,
356 .B link-mtu,
357 .B local,
358 .B lport,
359 .B mssfix,
360 .B mtu-disc,
361 .B nobind,
362 .B port,
363 .B proto,
364 .B remote,
365 .B rport,
366 .B socks-proxy,
367 .B socks-proxy-retry,
368 .B tun-mtu and
369 .B tun-mtu-extra.
371 A defaulting mechanism exists for specifying options to apply to
373 .B <connection>
374 profiles.  If any of the above options (with the exception of
375 .B remote
376 ) appear outside of a
377 .B <connection>
378 block, but in a configuration file which has one or more
379 .B <connection>
380 blocks, the option setting will be used as a default for
381 .B <connection>
382 blocks which follow it in the configuration file.
384 For example, suppose the
385 .B nobind
386 option were placed in the sample configuration file above, near
387 the top of the file, before the first
388 .B <connection>
389 block.  The effect would be as if
390 .B nobind
391 were declared in all
392 .B <connection>
393 blocks below it.
394 .\"*********************************************************
396 .B \-\-proto\-force p
397 When iterating through connection profiles,
398 only consider profiles using protocol
399 .B p
400 ('tcp'|'udp'). 
401 .\"*********************************************************
403 .B \-\-remote\-random
404 When multiple
405 .B \-\-remote
406 address/ports are specified, or if connection profiles are being
407 used, initially randomize the order of the list
408 as a kind of basic load-balancing measure.
409 .\"*********************************************************
411 .B \-\-proto p
412 Use protocol
413 .B p
414 for communicating with remote host.
415 .B p
416 can be
417 .B udp,
418 .B tcp-client,
420 .B tcp-server.
422 The default protocol is
423 .B udp
424 when
425 .B \-\-proto
426 is not specified.
428 For UDP operation,
429 .B \-\-proto udp
430 should be specified on both peers.
432 For TCP operation, one peer must use
433 .B \-\-proto tcp\-server
434 and the other must use
435 .B \-\-proto tcp\-client.
436 A peer started with
437 .B tcp-server
438 will wait indefinitely for an incoming connection.  A peer
439 started with
440 .B tcp\-client
441 will attempt to connect, and if that fails, will sleep for 5
442 seconds (adjustable via the
443 .B \-\-connect\-retry
444 option) and try again infinite or up to N retries (adjustable via the
445 .B \-\-connect\-retry\-max
446 option).  Both TCP client and server will simulate
447 a SIGUSR1 restart signal if either side resets the connection.
449 OpenVPN is designed to operate optimally over UDP, but TCP capability is provided
450 for situations where UDP cannot be used.
451 In comparison with UDP, TCP will usually be
452 somewhat less efficient and less robust when used over unreliable or congested
453 networks.
455 This article outlines some of problems with tunneling IP over TCP:
457 .I http://sites.inka.de/sites/bigred/devel/tcp-tcp.html
459 There are certain cases, however, where using TCP may be advantageous from
460 a security and robustness perspective, such as tunneling non-IP or
461 application-level UDP protocols, or tunneling protocols which don't
462 possess a built-in reliability layer.
463 .\"*********************************************************
465 .B \-\-connect\-retry n
467 .B \-\-proto tcp\-client,
468 take
469 .B n
470 as the
471 number of seconds to wait
472 between connection retries (default=5).
473 .\"*********************************************************
475 .B \-\-connect\-timeout n
477 .B \-\-proto tcp\-client,
478 set connection timeout to
479 .B n
480 seconds (default=10).
481 .\"*********************************************************
483 .B \-\-connect\-retry\-max n
485 .B \-\-proto tcp\-client,
486 take
487 .B n
488 as the
489 number of retries of connection attempt (default=infinite).
490 .\"*********************************************************
492 .B \-\-show\-proxy\-settings
493 Show sensed HTTP or SOCKS proxy settings. Currently, only Windows clients
494 support this option.
495 .\"*********************************************************
497 .B \-\-http\-proxy server port [authfile|'auto'|'auto\-nct'] [auth-method]
498 Connect to remote host through an HTTP proxy at address
499 .B server
500 and port
501 .B port.
502 If HTTP Proxy-Authenticate is required,
503 .B authfile
504 is a file containing a username and password on 2 lines, or
505 "stdin" to prompt from console.
507 .B auth-method
508 should be one of "none", "basic", or "ntlm".
510 HTTP Digest authentication is supported as well, but only via
512 .B auto
514 .B auto\-nct
515 flags (below).
518 .B auto
519 flag causes OpenVPN to automatically determine the
520 .B auth-method
521 and query stdin or the management interface for
522 username/password credentials, if required.  This flag
523 exists on OpenVPN 2.1 or higher.
526 .B auto\-nct
527 flag (no clear-text auth) instructs OpenVPN to automatically
528 determine the authentication method, but to reject weak
529 authentication protocols such as HTTP Basic Authentication.
530 .\"*********************************************************
532 .B \-\-http\-proxy\-retry
533 Retry indefinitely on HTTP proxy errors.  If an HTTP proxy error
534 occurs, simulate a SIGUSR1 reset.
535 .\"*********************************************************
537 .B \-\-http\-proxy\-timeout n
538 Set proxy timeout to
539 .B n
540 seconds, default=5.
541 .\"*********************************************************
543 .B \-\-http\-proxy\-option type [parm]
544 Set extended HTTP proxy options.
545 Repeat to set multiple options.
547 .B VERSION version --
548 Set HTTP version number to
549 .B version
550 (default=1.0).
552 .B AGENT user-agent --
553 Set HTTP "User-Agent" string to
554 .B user-agent.
555 .\"*********************************************************
557 .B \-\-socks\-proxy server [port] [authfile]
558 Connect to remote host through a Socks5 proxy at address
559 .B server
560 and port
561 .B port
562 (default=1080).
563 .B authfile
564 (optional) is a file containing a username and password on 2 lines, or
565 "stdin" to prompt from console.
566 .\"*********************************************************
568 .B \-\-socks\-proxy\-retry
569 Retry indefinitely on Socks proxy errors.  If a Socks proxy error
570 occurs, simulate a SIGUSR1 reset.
571 .\"*********************************************************
573 .B \-\-resolv\-retry n
574 If hostname resolve fails for
575 .B \-\-remote,
576 retry resolve for
577 .B n
578 seconds before failing.
581 .B n
582 to "infinite" to retry indefinitely.
584 By default,
585 .B \-\-resolv-retry infinite
586 is enabled.  You can disable by setting n=0.
587 .\"*********************************************************
589 .B \-\-float
590 Allow remote peer to change its IP address and/or port number, such as due to
591 DHCP (this is the default if
592 .B \-\-remote
593 is not used).
594 .B \-\-float
595 when specified with
596 .B \-\-remote
597 allows an OpenVPN session to initially connect to a peer
598 at a known address, however if packets arrive from a new
599 address and pass all authentication tests, the new address
600 will take control of the session.  This is useful when
601 you are connecting to a peer which holds a dynamic address
602 such as a dial-in user or DHCP client.
604 Essentially,
605 .B \-\-float
606 tells OpenVPN to accept authenticated packets
607 from any address, not only the address which was specified in the
608 .B \-\-remote
609 option.
610 .\"*********************************************************
612 .B \-\-ipchange cmd
613 Run command
614 .B cmd
615 when our remote ip-address is initially authenticated or
616 changes.
618 .B cmd
619 consists of a path to script (or executable program), optionally
620 followed by arguments. The path and arguments may be single- or double-quoted
621 and/or escaped using a backslash, and should be separated by one or more spaces.
623 When
624 .B cmd
625 is executed two arguments are appended after any arguments specified in
626 .B cmd
627 , as follows:
629 .B cmd ip_address port_number
631 Don't use
632 .B \-\-ipchange
634 .B \-\-mode server
635 mode.  Use a
636 .B \-\-client\-connect
637 script instead.
639 See the "Environmental Variables" section below for
640 additional parameters passed as environmental variables.
642 If you are running in a dynamic IP address environment where
643 the IP addresses of either peer could change without notice,
644 you can use this script, for example, to edit the
645 .I /etc/hosts
646 file with the current address of the peer.  The script will
647 be run every time the remote peer changes its IP address.
649 Similarly if
650 .I our
651 IP address changes due to DHCP, we should configure
652 our IP address change script (see man page for
653 .BR dhcpcd (8)
654 ) to deliver a
655 .B SIGHUP
657 .B SIGUSR1
658 signal to OpenVPN.  OpenVPN will then
659 reestablish a connection with its most recently authenticated
660 peer on its new IP address.
661 .\"*********************************************************
663 .B \-\-port port
664 TCP/UDP port number or port name for both local and remote (sets both
665 .B \-\-lport
667 .B \-\-rport
668 options to given port).  The current
669 default of 1194 represents the official IANA port number
670 assignment for OpenVPN and has been used since version 2.0-beta17.
671 Previous versions used port 5000 as the default.
672 .\"*********************************************************
674 .B \-\-lport port
675 Set local TCP/UDP port number or name.  Cannot be used together with
676 .B \-\-nobind
677 option.
678 .\"*********************************************************
680 .B \-\-rport port
681 Set TCP/UDP port number or name used by the
682 .B \-\-remote
683 option. The port can also be set directly using the
684 .B \-\-remote
685 option.
686 .\"*********************************************************
688 .B \-\-bind
689 Bind to local address and port. This is the default unless any of 
690 .B \-\-proto tcp\-client
692 .B \-\-http\-proxy
694 .B \-\-socks\-proxy
695 are used.
696 .\"*********************************************************
698 .B \-\-nobind
699 Do not bind to local address and port.  The IP stack will allocate
700 a dynamic port for returning packets.  Since the value of the dynamic port
701 could not be known in advance by a peer, this option is only suitable for
702 peers which will be initiating connections by using the
703 .B \-\-remote
704 option.
705 .\"*********************************************************
707 .B \-\-dev tunX | tapX | null
708 TUN/TAP virtual network device (
709 .B X
710 can be omitted for a dynamic device.)
712 See examples section below
713 for an example on setting up a TUN device.
715 You must use either tun devices on both ends of the connection
716 or tap devices on both ends.  You cannot mix them, as they
717 represent different underlying network layers.
719 .B tun
720 devices encapsulate IPv4 or IPv6 (OSI Layer 3) while
721 .B tap
722 devices encapsulate Ethernet 802.3 (OSI Layer 2).
723 .\"*********************************************************
725 .B \-\-dev\-type device-type
726 Which device type are we using?
727 .B device-type
728 should be
729 .B tun
730 (OSI Layer 3)
732 .B tap
733 (OSI Layer 2).
734 Use this option only if the TUN/TAP device used with
735 .B \-\-dev
736 does not begin with
737 .B tun
739 .B tap.
740 .\"*********************************************************
742 .B \-\-topology mode
743 Configure virtual addressing topology when running in
744 .B \-\-dev tun
745 mode.  This directive has no meaning in
746 .B \-\-dev tap
747 mode, which always uses a
748 .B subnet
749 topology.
751 If you set this directive on the server, the
752 .B \-\-server
754 .B \-\-server\-bridge
755 directives will automatically push your chosen topology setting to clients
756 as well.  This directive can also be manually pushed to clients.  Like the
757 .B \-\-dev
758 directive, this directive must always be compatible between client and server.
760 .B mode
761 can be one of:
763 .B net30 --
764 Use a point-to-point topology, by allocating one /30 subnet per client.
765 This is designed to allow point-to-point semantics when some
766 or all of the connecting clients might be Windows systems.  This is the
767 default on OpenVPN 2.0.
769 .B p2p --
770 Use a point-to-point topology where the remote endpoint of the client's
771 tun interface always points to the local endpoint of the server's tun interface.
772 This mode allocates a single IP address per connecting client.
773 Only use
774 when none of the connecting clients are Windows systems.  This mode
775 is functionally equivalent to the
776 .B \-\-ifconfig\-pool\-linear
777 directive which is available in OpenVPN 2.0 and is now deprecated.
779 .B subnet --
780 Use a subnet rather than a point-to-point topology by
781 configuring the tun interface with a local IP address and subnet mask,
782 similar to the topology used in
783 .B \-\-dev tap
784 and ethernet bridging mode.
785 This mode allocates a single IP address per connecting client and works on
786 Windows as well.  Only available when server and clients are OpenVPN 2.1 or
787 higher, or OpenVPN 2.0.x which has been manually patched with the
788 .B \-\-topology
789 directive code.  When used on Windows, requires version 8.2 or higher
790 of the TAP-Win32 driver.  When used on *nix, requires that the tun
791 driver supports an
792 .BR ifconfig (8)
793 command which sets a subnet instead of a remote endpoint IP address.
795 This option exists in OpenVPN 2.1 or higher.
797 Note: Using
798 .B \-\-topology subnet
799 changes the interpretation of the arguments of
800 .B \-\-ifconfig
801 to mean "address netmask", no longer "local remote".
802 .\"*********************************************************
804 .B \-\-tun\-ipv6
805 Build a tun link capable of forwarding IPv6 traffic.
806 Should be used in conjunction with
807 .B \-\-dev tun
809 .B \-\-dev tunX.
810 A warning will be displayed
811 if no specific IPv6 TUN support for your OS has been compiled into OpenVPN.
813 See below for further IPv6-related configuration options.
814 .\"*********************************************************
816 .B \-\-dev\-node node
817 Explicitly set the device node rather than using
818 /dev/net/tun, /dev/tun, /dev/tap, etc.  If OpenVPN
819 cannot figure out whether
820 .B node
821 is a TUN or TAP device based on the name, you should
822 also specify
823 .B \-\-dev\-type tun
825 .B \-\-dev\-type tap.
827 Under Mac OS X this option can be used to specify the default tun
828 implementation. Using
829 .B \-\-dev\-node utun
830 forces usage of the native Darwin tun kernel support. Use
831 .B \-\-dev\-node utunN
832 to select a specific utun instance. To force using the tun.kext (/dev/tunX) use
833 .B \-\-dev\-node tun\fR.
834 When not specifying a
835 .B \-\-dev\-node
836 option openvpn will first try to open utun, and fall back to tun.kext.
838 On Windows systems, select the TAP-Win32 adapter which
839 is named
840 .B node
841 in the Network Connections Control Panel or the
842 raw GUID of the adapter enclosed by braces.
844 .B \-\-show\-adapters
845 option under Windows can also be used
846 to enumerate all available TAP-Win32
847 adapters and will show both the network
848 connections control panel name and the GUID for
849 each TAP-Win32 adapter.
851 .B \-\-lladdr address
852 Specify the link layer address, more commonly known as the MAC address.
853 Only applied to TAP devices.
854 .\"*********************************************************
856 .B \-\-iproute cmd
857 Set alternate command to execute instead of default iproute2 command.
858 May be used in order to execute OpenVPN in unprivileged environment.
859 .\"*********************************************************
861 .B \-\-ifconfig l rn
862 Set TUN/TAP adapter parameters. 
863 .B l
864 is the IP address of the local VPN endpoint.
865 For TUN devices in point-to-point mode,
866 .B rn
867 is the IP address of the remote VPN endpoint.
868 For TAP devices, or TUN devices used with
869 .B \-\-topology subnet,
870 .B rn
871 is the subnet mask of the virtual network segment
872 which is being created or connected to.
874 For TUN devices, which facilitate virtual
875 point-to-point IP connections (when used in
876 .B \-\-topology net30
878 .B p2p
879 mode),
880 the proper usage of
881 .B \-\-ifconfig
882 is to use two private IP addresses
883 which are not a member of any
884 existing subnet which is in use.
885 The IP addresses may be consecutive
886 and should have their order reversed
887 on the remote peer.  After the VPN
888 is established, by pinging
889 .B rn,
890 you will be pinging across the VPN.
892 For TAP devices, which provide
893 the ability to create virtual
894 ethernet segments, or TUN devices in
895 .B \-\-topology subnet
896 mode (which create virtual "multipoint networks"),
897 .B \-\-ifconfig
898 is used to set an IP address and
899 subnet mask just as a physical
900 ethernet adapter would be
901 similarly configured.  If you are
902 attempting to connect to a remote
903 ethernet bridge, the IP address
904 and subnet should be set to values
905 which would be valid on the
906 the bridged ethernet segment (note
907 also that DHCP can be used for the
908 same purpose).
910 This option, while primarily a proxy for the
911 .BR ifconfig (8)
912 command, is designed to simplify TUN/TAP
913 tunnel configuration by providing a
914 standard interface to the different
915 ifconfig implementations on different
916 platforms.
918 .B \-\-ifconfig
919 parameters which are IP addresses can
920 also be specified as a DNS or /etc/hosts
921 file resolvable name.
923 For TAP devices,
924 .B \-\-ifconfig
925 should not be used if the TAP interface will be
926 getting an IP address lease from a DHCP
927 server.
928 .\"*********************************************************
930 .B \-\-ifconfig\-noexec
931 Don't actually execute ifconfig/netsh commands, instead
932 pass
933 .B \-\-ifconfig
934 parameters to scripts using environmental variables.
935 .\"*********************************************************
937 .B \-\-ifconfig\-nowarn
938 Don't output an options consistency check warning
939 if the
940 .B \-\-ifconfig
941 option on this side of the
942 connection doesn't match the remote side.  This is useful
943 when you want to retain the overall benefits of the
944 options consistency check (also see
945 .B \-\-disable\-occ
946 option) while only disabling the ifconfig component of
947 the check.
949 For example,
950 if you have a configuration where the local host uses
951 .B \-\-ifconfig
952 but the remote host does not, use
953 .B \-\-ifconfig\-nowarn
954 on the local host.
956 This option will also silence warnings about potential
957 address conflicts which occasionally annoy more experienced
958 users by triggering "false positive" warnings.
959 .\"*********************************************************
961 .B \-\-route network/IP [netmask] [gateway] [metric]
962 Add route to routing table after connection is established.
963 Multiple routes can be specified.  Routes will be
964 automatically torn down in reverse order prior to
965 TUN/TAP device close.
967 This option is intended as
968 a convenience proxy for the
969 .BR route (8)
970 shell command,
971 while at the same time providing portable semantics
972 across OpenVPN's platform space.
974 .B netmask
975 default -- 255.255.255.255
977 .B gateway
978 default -- taken from
979 .B \-\-route\-gateway
980 or the second parameter to
981 .B \-\-ifconfig
982 when
983 .B \-\-dev tun
984 is specified.
986 .B metric
987 default \-\- taken from
988 .B \-\-route\-metric
989 otherwise 0.
991 The default can be specified by leaving an option blank or setting
992 it to "default".
995 .B network
997 .B gateway
998 parameters can
999 also be specified as a DNS or /etc/hosts
1000 file resolvable name, or as one of three special keywords:
1002 .B vpn_gateway
1003 -- The remote VPN endpoint address
1004 (derived either from
1005 .B \-\-route\-gateway
1006 or the second parameter to
1007 .B \-\-ifconfig
1008 when
1009 .B \-\-dev tun
1010 is specified).
1012 .B net_gateway
1013 -- The pre-existing IP default gateway, read from the routing
1014 table (not supported on all OSes).
1016 .B remote_host
1017 -- The
1018 .B \-\-remote
1019 address if OpenVPN is being run in client mode, and is undefined in server mode.
1020 .\"*********************************************************
1022 .B \-\-max\-routes n
1023 Allow a maximum number of n
1024 .B \-\-route
1025 options to be specified, either in the local configuration file,
1026 or pulled from an OpenVPN server.  By default, n=100.
1027 .\"*********************************************************
1029 .B \-\-route\-gateway gw|'dhcp'
1030 Specify a default gateway
1031 .B gw
1032 for use with
1033 .B \-\-route.
1036 .B dhcp
1037 is specified as the parameter,
1038 the gateway address will be extracted from a DHCP
1039 negotiation with the OpenVPN server-side LAN.
1040 .\"*********************************************************
1042 .B \-\-route\-metric m
1043 Specify a default metric
1044 .B m
1045 for use with
1046 .B \-\-route.
1047 .\"*********************************************************
1049 .B \-\-route\-delay [n] [w]
1050 Delay
1051 .B n
1052 seconds (default=0) after connection
1053 establishment, before adding routes. If
1054 .B n
1055 is 0, routes will be added immediately upon connection
1056 establishment.  If
1057 .B \-\-route\-delay
1058 is omitted, routes will be added immediately after TUN/TAP device
1059 open and
1060 .B \-\-up
1061 script execution, before any
1062 .B \-\-user
1063 or 
1064 .B \-\-group
1065 privilege downgrade (or
1066 .B \-\-chroot
1067 execution.)
1069 This option is designed to be useful in scenarios where DHCP is
1070 used to set
1071 tap adapter addresses.  The delay will give the DHCP handshake
1072 time to complete before routes are added.
1074 On Windows,
1075 .B \-\-route\-delay
1076 tries to be more intelligent by waiting
1077 .B w
1078 seconds (w=30 by default)
1079 for the TAP-Win32 adapter to come up before adding routes.
1080 .\"*********************************************************
1082 .B \-\-route\-up cmd
1083 Run command
1084 .B cmd
1085 after routes are added, subject to
1086 .B \-\-route\-delay.
1088 .B cmd
1089 consists of a path to script (or executable program), optionally
1090 followed by arguments. The path and arguments may be single- or double-quoted
1091 and/or escaped using a backslash, and should be separated by one or more spaces.
1093 See the "Environmental Variables" section below for
1094 additional parameters passed as environmental variables.
1095 .\"*********************************************************
1097 .B \-\-route\-pre\-down cmd
1098 Run command
1099 .B cmd
1100 before routes are removed upon disconnection.
1102 .B cmd
1103 consists of a path to script (or executable program), optionally
1104 followed by arguments. The path and arguments may be single- or double-quoted
1105 and/or escaped using a backslash, and should be separated by one or more spaces.
1107 See the "Environmental Variables" section below for
1108 additional parameters passed as environmental variables.
1109 .\"*********************************************************
1111 .B \-\-route\-noexec
1112 Don't add or remove routes automatically.  Instead pass routes to
1113 .B \-\-route\-up
1114 script using environmental variables.
1115 .\"*********************************************************
1117 .B \-\-route\-nopull
1118 When used with
1119 .B \-\-client
1121 .B \-\-pull,
1122 accept options pushed by server EXCEPT for routes, block-outside-dns and dhcp
1123 options like DNS servers.
1125 When used on the client, this option effectively bars the
1126 server from adding routes to the client's routing table,
1127 however note that this option still allows the server
1128 to set the TCP/IP properties of the client's TUN/TAP interface.
1129 .\"*********************************************************
1131 .B \-\-allow\-pull\-fqdn
1132 Allow client to pull DNS names from server (rather than being limited
1133 to IP address) for
1134 .B \-\-ifconfig,
1135 .B \-\-route,
1137 .B \-\-route\-gateway.
1138 .\"*********************************************************
1140 .B \-\-client\-nat snat|dnat network netmask alias
1141 This pushable client option sets up a stateless one-to-one NAT
1142 rule on packet addresses (not ports), and is useful in cases
1143 where routes or ifconfig settings pushed to the client would
1144 create an IP numbering conflict.
1146 .B network/netmask
1147 (for example 192.168.0.0/255.255.0.0)
1148 defines the local view of a resource from the client perspective, while
1149 .B alias/netmask
1150 (for example 10.64.0.0/255.255.0.0)
1151 defines the remote view from the server perspective.
1154 .B snat
1155 (source NAT) for resources owned by the client and
1156 .B dnat
1157 (destination NAT) for remote resources.
1160 .B \-\-verb 6
1161 for debugging info showing the transformation of src/dest
1162 addresses in packets.
1163 .\"*********************************************************
1165 .B \-\-redirect\-gateway flags...
1166 Automatically execute routing commands to cause all outgoing IP traffic
1167 to be redirected over the VPN.  This is a client-side option.
1169 This option performs three steps:
1171 .B (1)
1172 Create a static route for the
1173 .B \-\-remote
1174 address which forwards to the pre-existing default gateway.
1175 This is done so that
1176 .B (3)
1177 will not create a routing loop.
1179 .B (2)
1180 Delete the default gateway route.
1182 .B (3)
1183 Set the new default gateway to be the VPN endpoint address (derived either from
1184 .B \-\-route\-gateway
1185 or the second parameter to
1186 .B \-\-ifconfig
1187 when
1188 .B \-\-dev tun
1189 is specified).
1191 When the tunnel is torn down, all of the above steps are reversed so
1192 that the original default route is restored.
1194 Option flags:
1196 .B local --
1197 Add the
1198 .B local
1199 flag if both OpenVPN servers are directly connected via a common subnet,
1200 such as with wireless.  The
1201 .B local
1202 flag will cause step
1203 .B 1
1204 above to be omitted.
1206 .B autolocal --
1207 Try to automatically determine whether to enable
1208 .B local
1209 flag above.
1211 .B def1 --
1212 Use this flag to override
1213 the default gateway by using 0.0.0.0/1 and 128.0.0.0/1
1214 rather than 0.0.0.0/0.  This has the benefit of overriding
1215 but not wiping out the original default gateway. 
1217 .B bypass-dhcp --
1218 Add a direct route to the DHCP server (if it is non-local) which
1219 bypasses the tunnel
1220 (Available on Windows clients, may not be available
1221 on non-Windows clients).
1223 .B bypass-dns --
1224 Add a direct route to the DNS server(s) (if they are non-local) which
1225 bypasses the tunnel
1226 (Available on Windows clients, may not be available
1227 on non-Windows clients).
1229 .B block-local --
1230 Block access to local LAN when the tunnel is active, except for
1231 the LAN gateway itself.  This is accomplished by routing the local
1232 LAN (except for the LAN gateway address) into the tunnel.
1233 .\"*********************************************************
1235 .B \-\-link\-mtu n
1236 Sets an upper bound on the size of UDP packets which are sent
1237 between OpenVPN peers.  It's best not to set this parameter unless
1238 you know what you're doing.
1239 .\"*********************************************************
1240 .\"*********************************************************
1242 .B \-\-redirect\-private [flags]
1243 Like \-\-redirect\-gateway, but omit actually changing the default
1244 gateway.  Useful when pushing private subnets.
1245 .\"*********************************************************
1247 .B \-\-tun\-mtu n
1248 Take the TUN device MTU to be
1249 .B n
1250 and derive the link MTU
1251 from it (default=1500).  In most cases, you will probably want to
1252 leave this parameter set to its default value.
1254 The MTU (Maximum Transmission Units) is
1255 the maximum datagram size in bytes that can be sent unfragmented
1256 over a particular network path.  OpenVPN requires that packets
1257 on the control or data channels be sent unfragmented.
1259 MTU problems often manifest themselves as connections which
1260 hang during periods of active usage.
1262 It's best to use the
1263 .B \-\-fragment
1264 and/or
1265 .B \-\-mssfix
1266 options to deal with MTU sizing issues.
1267 .\"*********************************************************
1269 .B \-\-tun\-mtu\-extra n
1270 Assume that the TUN/TAP device might return as many as
1271 .B n
1272 bytes more than the
1273 .B \-\-tun\-mtu
1274 size on read.  This parameter defaults to 0, which is sufficient for
1275 most TUN devices.  TAP devices may introduce additional overhead in excess
1276 of the MTU size, and a setting of 32 is the default when TAP devices are used.
1277 This parameter only controls internal OpenVPN buffer sizing,
1278 so there is no transmission overhead associated with using a larger value.
1279 .\"*********************************************************
1281 .B \-\-mtu\-disc type
1282 Should we do Path MTU discovery on TCP/UDP channel?  Only supported on OSes such
1283 as Linux that supports the necessary system call to set.
1285 .B 'no'
1286 -- Never send DF (Don't Fragment) frames
1288 .B 'maybe'
1289 -- Use per-route hints
1291 .B 'yes'
1292 -- Always DF (Don't Fragment)
1294 .\"*********************************************************
1296 .B \-\-mtu\-test
1297 To empirically measure MTU on connection startup,
1298 add the
1299 .B \-\-mtu\-test
1300 option to your configuration.
1301 OpenVPN will send ping packets of various sizes
1302 to the remote peer and measure the largest packets
1303 which were successfully received.  The
1304 .B \-\-mtu\-test
1305 process normally takes about 3 minutes to complete.
1306 .\"*********************************************************
1308 .B \-\-fragment max
1309 Enable internal datagram fragmentation so
1310 that no UDP datagrams are sent which
1311 are larger than
1312 .B max
1313 bytes.
1316 .B max
1317 parameter is interpreted in the same way as the
1318 .B \-\-link\-mtu
1319 parameter, i.e. the UDP packet size after encapsulation
1320 overhead has been added in, but not including
1321 the UDP header itself.
1324 .B \-\-fragment
1325 option only makes sense when you are using the UDP protocol (
1326 .B \-\-proto udp
1329 .B \-\-fragment
1330 adds 4 bytes of overhead per datagram.
1332 See the
1333 .B \-\-mssfix
1334 option below for an important related option to
1335 .B \-\-fragment.
1337 It should also be noted that this option is not meant to replace
1338 UDP fragmentation at the IP stack level.  It is only meant as a
1339 last resort when path MTU discovery is broken.  Using this option
1340 is less efficient than fixing path MTU discovery for your IP link and
1341 using native IP fragmentation instead.
1343 Having said that, there are circumstances where using OpenVPN's
1344 internal fragmentation capability may be your only option, such
1345 as tunneling a UDP multicast stream which requires fragmentation.
1346 .\"*********************************************************
1348 .B \-\-mssfix max
1349 Announce to TCP sessions running over the tunnel that they should limit
1350 their send packet sizes such that after OpenVPN has encapsulated them,
1351 the resulting UDP packet size that OpenVPN sends to its peer will not
1352 exceed
1353 .B max
1354 bytes. The default value is
1355 .B 1450.
1358 .B max
1359 parameter is interpreted in the same way as the
1360 .B \-\-link\-mtu
1361 parameter, i.e. the UDP packet size after encapsulation
1362 overhead has been added in, but not including
1363 the UDP header itself.
1366 .B \-\-mssfix
1367 option only makes sense when you are using the UDP protocol
1368 for OpenVPN peer-to-peer communication, i.e.
1369 .B \-\-proto udp.
1371 .B \-\-mssfix
1373 .B \-\-fragment
1374 can be ideally used together, where
1375 .B \-\-mssfix
1376 will try to keep TCP from needing
1377 packet fragmentation in the first place,
1378 and if big packets come through anyhow
1379 (from protocols other than TCP),
1380 .B \-\-fragment
1381 will internally fragment them.
1383 Both
1384 .B \-\-fragment
1386 .B \-\-mssfix
1387 are designed to work around cases where Path MTU discovery
1388 is broken on the network path between OpenVPN peers.
1390 The usual symptom of such a breakdown is an OpenVPN
1391 connection which successfully starts, but then stalls
1392 during active usage.
1395 .B \-\-fragment
1397 .B \-\-mssfix
1398 are used together,
1399 .B \-\-mssfix
1400 will take its default
1401 .B max
1402 parameter from the
1403 .B \-\-fragment max
1404 option.
1406 Therefore, one could lower the maximum UDP packet size
1407 to 1300 (a good first try for solving MTU-related
1408 connection problems) with the following options:
1410 .B \-\-tun\-mtu 1500 \-\-fragment 1300 \-\-mssfix
1411 .\"*********************************************************
1413 .B \-\-sndbuf size
1414 Set the TCP/UDP socket send buffer size.
1415 Defaults to operation system default.
1416 .\"*********************************************************
1418 .B \-\-rcvbuf size
1419 Set the TCP/UDP socket receive buffer size.
1420 Defaults to operation system default.
1421 .\"*********************************************************
1423 .B \-\-mark value
1424 Mark encrypted packets being sent with value. The mark value can be
1425 matched in policy routing and packetfilter rules. This option is
1426 only supported in Linux and does nothing on other operating systems.
1427 .\"*********************************************************
1429 .B \-\-socket\-flags flags...
1430 Apply the given flags to the OpenVPN transport socket.
1431 Currently, only
1432 .B TCP_NODELAY
1433 is supported.
1436 .B TCP_NODELAY
1437 socket flag is useful in TCP mode, and causes the kernel
1438 to send tunnel packets immediately over the TCP connection without
1439 trying to group several smaller packets into a larger packet.
1440 This can result in a considerably improvement in latency.
1442 This option is pushable from server to client, and should be used
1443 on both client and server for maximum effect.
1444 .\"*********************************************************
1446 .B \-\-txqueuelen n
1447 (Linux only) Set the TX queue length on the TUN/TAP interface.
1448 Currently defaults to 100.
1449 .\"*********************************************************
1451 .B \-\-shaper n
1452 Limit bandwidth of outgoing tunnel data to
1453 .B n
1454 bytes per second on the TCP/UDP port.
1455 Note that this will only work if mode is set to p2p.
1456 If you want to limit the bandwidth
1457 in both directions, use this option on both peers.
1459 OpenVPN uses the following algorithm to implement
1460 traffic shaping: Given a shaper rate of
1461 .I n
1462 bytes per second, after a datagram write of
1463 .I b
1464 bytes is queued on the TCP/UDP port, wait a minimum of
1465 .I (b / n)
1466 seconds before queuing the next write.
1468 It should be noted that OpenVPN supports multiple
1469 tunnels between the same two peers, allowing you
1470 to construct full-speed and reduced bandwidth tunnels
1471 at the same time,
1472 routing low-priority data such as off-site backups
1473 over the reduced bandwidth tunnel, and other data
1474 over the full-speed tunnel.
1476 Also note that for low bandwidth tunnels
1477 (under 1000 bytes per second), you should probably
1478 use lower MTU values as well (see above), otherwise
1479 the packet latency will grow so large as to trigger
1480 timeouts in the TLS layer and TCP connections running
1481 over the tunnel.
1483 OpenVPN allows
1484 .B n
1485 to be between 100 bytes/sec and 100 Mbytes/sec.
1486 .\"*********************************************************
1488 .B \-\-inactive n [bytes]
1489 Causes OpenVPN to exit after
1490 .B n
1491 seconds of inactivity on the TUN/TAP device. The time length of
1492 inactivity is measured since the last incoming or outgoing tunnel
1493 packet.  The default value is 0 seconds, which disables this feature.
1495 If the optional
1496 .B bytes
1497 parameter is included,
1498 exit if less than
1499 .B bytes
1500 of combined in/out traffic are produced on the tun/tap device
1502 .B n
1503 seconds.
1505 In any case, OpenVPN's internal ping packets (which are just
1506 keepalives) and TLS control packets are not considered
1507 "activity", nor are they counted as traffic, as they are used
1508 internally by OpenVPN and are not an indication of actual user
1509 activity.
1510 .\"*********************************************************
1512 .B \-\-ping n
1513 Ping remote over the TCP/UDP control channel
1514 if no packets have been sent for at least
1515 .B n
1516 seconds (specify
1517 .B \-\-ping
1518 on both peers to cause ping packets to be sent in both directions since
1519 OpenVPN ping packets are not echoed like IP ping packets).
1520 When used in one of OpenVPN's secure modes (where
1521 .B \-\-secret, \-\-tls\-server,
1523 .B \-\-tls\-client
1524 is specified), the ping packet
1525 will be cryptographically secure.
1527 This option has two intended uses:
1529 (1) Compatibility
1530 with stateful firewalls.  The periodic ping will ensure that
1531 a stateful firewall rule which allows OpenVPN UDP packets to
1532 pass will not time out.
1534 (2) To provide a basis for the remote to test the existence
1535 of its peer using the
1536 .B \-\-ping\-exit
1537 option.
1538 .\"*********************************************************
1540 .B \-\-ping\-exit n
1541 Causes OpenVPN to exit after
1542 .B n
1543 seconds pass without reception of a ping
1544 or other packet from remote.
1545 This option can be combined with
1546 .B \-\-inactive, \-\-ping,
1548 .B \-\-ping\-exit
1549 to create a two-tiered inactivity disconnect.
1551 For example,
1553 .B openvpn [options...] \-\-inactive 3600 \-\-ping 10 \-\-ping\-exit 60
1555 when used on both peers will cause OpenVPN to exit within 60
1556 seconds if its peer disconnects, but will exit after one
1557 hour if no actual tunnel data is exchanged.
1558 .\"*********************************************************
1560 .B \-\-ping\-restart n
1561 Similar to
1562 .B \-\-ping\-exit,
1563 but trigger a
1564 .B SIGUSR1
1565 restart after
1566 .B n
1567 seconds pass without reception of a ping
1568 or other packet from remote.
1570 This option is useful in cases
1571 where the remote peer has a dynamic IP address and
1572 a low-TTL DNS name is used to track the IP address using
1573 a service such as
1574 .I http://dyndns.org/
1575 + a dynamic DNS client such
1577 .B ddclient.
1579 If the peer cannot be reached, a restart will be triggered, causing
1580 the hostname used with
1581 .B \-\-remote
1582 to be re-resolved (if
1583 .B \-\-resolv\-retry
1584 is also specified).
1586 In server mode,
1587 .B \-\-ping\-restart, \-\-inactive,
1588 or any other type of internally generated signal will always be
1589 applied to
1590 individual client instance objects, never to whole server itself.
1591 Note also in server mode that any internally generated signal
1592 which would normally cause a restart, will cause the deletion
1593 of the client instance object instead.
1595 In client mode, the
1596 .B \-\-ping\-restart
1597 parameter is set to 120 seconds by default.  This default will
1598 hold until the client pulls a replacement value from the server, based on
1600 .B \-\-keepalive
1601 setting in the server configuration.
1602 To disable the 120 second default, set
1603 .B \-\-ping\-restart 0
1604 on the client.
1606 See the signals section below for more information
1608 .B SIGUSR1.
1610 Note that the behavior of
1611 .B SIGUSR1
1612 can be modified by the
1613 .B \-\-persist\-tun, \-\-persist\-key, \-\-persist\-local\-ip,
1615 .B \-\-persist\-remote\-ip
1616 options.
1618 Also note that
1619 .B \-\-ping\-exit
1621 .B \-\-ping\-restart
1622 are mutually exclusive and cannot be used together.
1623 .\"*********************************************************
1625 .B \-\-keepalive n m
1626 A helper directive designed to simplify the expression of
1627 .B \-\-ping
1629 .B \-\-ping\-restart
1630 in server mode configurations.
1632 The server timeout is set twice the value of the second argument.
1633 This ensures that a timeout is detected on client side
1634 before the server side drops the connection.
1636 For example,
1637 .B \-\-keepalive 10 60
1638 expands as follows:
1641 .ft 3
1642 .in +4
1643  if mode server:
1644    ping 10
1645    ping-restart 120
1646    push "ping 10"
1647    push "ping-restart 60"
1648  else
1649    ping 10
1650    ping-restart 60
1651 .in -4
1654 .\"*********************************************************
1656 .B \-\-ping\-timer\-rem
1657 Run the
1658 .B \-\-ping\-exit
1660 .B \-\-ping\-restart
1661 timer only if we have a remote address.  Use this option if you are
1662 starting the daemon in listen mode (i.e. without an explicit
1663 .B \-\-remote
1664 peer), and you don't want to start clocking timeouts until a remote
1665 peer connects.
1666 .\"*********************************************************
1668 .B \-\-persist\-tun
1669 Don't close and reopen TUN/TAP device or run up/down scripts
1670 across
1671 .B SIGUSR1
1673 .B \-\-ping\-restart
1674 restarts.
1676 .B SIGUSR1
1677 is a restart signal similar to
1678 .B SIGHUP,
1679 but which offers finer-grained control over
1680 reset options.
1681 .\"*********************************************************
1683 .B \-\-persist\-key
1684 Don't re-read key files across
1685 .B SIGUSR1
1687 .B \-\-ping\-restart.
1689 This option can be combined with
1690 .B \-\-user nobody
1691 to allow restarts triggered by the
1692 .B SIGUSR1
1693 signal.
1694 Normally if you drop root privileges in OpenVPN,
1695 the daemon cannot be restarted since it will now be unable to re-read protected
1696 key files.
1698 This option solves the problem by persisting keys across
1699 .B SIGUSR1
1700 resets, so they don't need to be re-read.
1701 .\"*********************************************************
1703 .B \-\-persist\-local\-ip
1704 Preserve initially resolved local IP address and port number
1705 across
1706 .B SIGUSR1
1708 .B \-\-ping\-restart
1709 restarts.
1710 .\"*********************************************************
1712 .B \-\-persist\-remote\-ip
1713 Preserve most recently authenticated remote IP address and port number
1714 across
1715 .B SIGUSR1
1717 .B \-\-ping\-restart
1718 restarts.
1719 .\"*********************************************************
1721 .B \-\-mlock
1722 Disable paging by calling the POSIX mlockall function.
1723 Requires that OpenVPN be initially run as root (though
1724 OpenVPN can subsequently downgrade its UID using the
1725 .B \-\-user
1726 option).
1728 Using this option ensures that key material and tunnel
1729 data are never written to disk due to virtual
1730 memory paging operations which occur under most
1731 modern operating systems.  It ensures that even if an
1732 attacker was able to crack the box running OpenVPN, he
1733 would not be able to scan the system swap file to
1734 recover previously used
1735 ephemeral keys, which are used for a period of time
1736 governed by the
1737 .B \-\-reneg
1738 options (see below), then are discarded.
1740 The downside
1741 of using
1742 .B \-\-mlock
1743 is that it will reduce the amount of physical
1744 memory available to other applications.
1745 .\"*********************************************************
1747 .B \-\-up cmd
1748 Run command
1749 .B cmd
1750 after successful TUN/TAP device open
1751 (pre
1752 .B \-\-user
1753 UID change).
1755 .B cmd
1756 consists of a path to script (or executable program), optionally
1757 followed by arguments. The path and arguments may be single- or double-quoted
1758 and/or escaped using a backslash, and should be separated by one or more spaces.
1760 The up command is useful for specifying route
1761 commands which route IP traffic destined for
1762 private subnets which exist at the other
1763 end of the VPN connection into the tunnel.
1766 .B \-\-dev tun
1767 execute as:
1769 .B cmd tun_dev tun_mtu link_mtu ifconfig_local_ip ifconfig_remote_ip [ init | restart ]
1772 .B \-\-dev tap
1773 execute as:
1775 .B cmd tap_dev tap_mtu link_mtu ifconfig_local_ip ifconfig_netmask [ init | restart ]
1777 See the "Environmental Variables" section below for
1778 additional parameters passed as environmental variables.
1780 Note that if
1781 .B cmd
1782 includes arguments, all OpenVPN-generated arguments will be appended
1783 to them to build an argument list with which the executable will be
1784 called.
1786 Typically,
1787 .B cmd
1788 will run a script to add routes to the tunnel.
1790 Normally the up script is called after the TUN/TAP device is opened.
1791 In this context, the last command line parameter passed to the script
1792 will be
1793 .I init.
1794 If the
1795 .B \-\-up\-restart
1796 option is also used, the up script will be called for restarts as
1797 well.  A restart is considered to be a partial reinitialization
1798 of OpenVPN where the TUN/TAP instance is preserved (the
1799 .B \-\-persist\-tun
1800 option will enable such preservation).  A restart
1801 can be generated by a SIGUSR1 signal, a
1802 .B \-\-ping\-restart
1803 timeout, or a connection reset when the TCP protocol is enabled
1804 with the
1805 .B \-\-proto
1806 option.  If a restart occurs, and
1807 .B \-\-up\-restart
1808 has been specified, the up script will be called with
1809 .I restart
1810 as the last parameter.
1812 NOTE: on restart, OpenVPN will not pass the full set of environment
1813 variables to the script.  Namely, everything related to routing and
1814 gateways will not be passed, as nothing needs to be done anyway - all
1815 the routing setup is already in place.  Additionally, the up\-restart
1816 script will run with the downgraded UID/GID settings (if configured).
1818 The following standalone example shows how the
1819 .B \-\-up
1820 script can be called in both an initialization and restart context.
1821 (NOTE: for security reasons, don't run the following example unless UDP port
1822 9999 is blocked by your firewall.  Also, the example will run indefinitely,
1823 so you should abort with control-c).
1825 .B openvpn \-\-dev tun \-\-port 9999 \-\-verb 4 \-\-ping\-restart 10 \-\-up 'echo up' \-\-down 'echo down' \-\-persist\-tun \-\-up\-restart
1827 Note that OpenVPN also provides the
1828 .B \-\-ifconfig
1829 option to automatically ifconfig the TUN device,
1830 eliminating the need to define an
1831 .B \-\-up
1832 script, unless you also want to configure routes
1833 in the
1834 .B \-\-up
1835 script.
1838 .B \-\-ifconfig
1839 is also specified, OpenVPN will pass the ifconfig local
1840 and remote endpoints on the command line to the
1841 .B \-\-up
1842 script so that they can be used to configure routes such as:
1844 .B route add \-net 10.0.0.0 netmask 255.255.255.0 gw $5
1845 .\"*********************************************************
1847 .B \-\-up\-delay
1848 Delay TUN/TAP open and possible
1849 .B \-\-up
1850 script execution
1851 until after TCP/UDP connection establishment with peer.
1854 .B \-\-proto udp
1855 mode, this option normally requires the use of
1856 .B \-\-ping
1857 to allow connection initiation to be sensed in the absence
1858 of tunnel data, since UDP is a "connectionless" protocol.
1860 On Windows, this option will delay the TAP-Win32 media state
1861 transitioning to "connected" until connection establishment,
1862 i.e. the receipt of the first authenticated packet from the peer.
1863 .\"*********************************************************
1865 .B \-\-down cmd
1866 Run command
1867 .B cmd
1868 after TUN/TAP device close
1869 (post
1870 .B \-\-user
1871 UID change and/or
1872 .B \-\-chroot
1874 .B cmd
1875 consists of a path to script (or executable program), optionally
1876 followed by arguments. The path and arguments may be single- or double-quoted
1877 and/or escaped using a backslash, and should be separated by one or more spaces.
1879 Called with the same parameters and environmental
1880 variables as the
1881 .B \-\-up
1882 option above.
1884 Note that if you reduce privileges by using
1885 .B \-\-user
1886 and/or
1887 .B \-\-group,
1888 your
1889 .B \-\-down
1890 script will also run at reduced privilege.
1891 .\"*********************************************************
1893 .B \-\-down\-pre
1894 Call
1895 .B \-\-down
1896 cmd/script before, rather than after, TUN/TAP close.
1897 .\"*********************************************************
1899 .B \-\-up\-restart
1900 Enable the
1901 .B \-\-up
1903 .B \-\-down
1904 scripts to be called for restarts as well as initial program start.
1905 This option is described more fully above in the
1906 .B \-\-up
1907 option documentation.
1908 .\"*********************************************************
1910 .B \-\-setenv name value
1911 Set a custom environmental variable
1912 .B name=value
1913 to pass to script.
1914 .\"*********************************************************
1916 .B \-\-setenv FORWARD_COMPATIBLE 1
1917 Relax config file syntax checking so that unknown directives
1918 will trigger a warning but not a fatal error,
1919 on the assumption that a given unknown directive might be valid
1920 in future OpenVPN versions.
1922 This option should be used with caution, as there are good security
1923 reasons for having OpenVPN fail if it detects problems in a
1924 config file.  Having said that, there are valid reasons for wanting
1925 new software features to gracefully degrade when encountered by
1926 older software versions.
1928 It is also possible to tag a single directive so as not to trigger
1929 a fatal error if the directive isn't recognized.  To do this,
1930 prepend the following before the directive:
1931 .B setenv opt
1933 Versions prior to OpenVPN 2.3.3 will always ignore options set with the
1934 .B setenv opt
1935 directive.
1937 See also
1938 .B \-\-ignore\-unknown\-option
1939 .\"*********************************************************
1941 .B \-\-setenv\-safe name value
1942 Set a custom environmental variable
1943 .B OPENVPN_name=value
1944 to pass to script.
1946 This directive is designed to be pushed by the server to clients,
1947 and the prepending of "OPENVPN_" to the environmental variable
1948 is a safety precaution to prevent a LD_PRELOAD style attack
1949 from a malicious or compromised server.
1950 .\"*********************************************************
1952 .B \-\-ignore\-unknown\-option opt1 opt2 opt3 ... optN
1953 When one of options
1954 .B opt1 ... optN
1955 is encountered in the configuration file the configuration
1956 file parsing does not fail if this OpenVPN version does not
1957 support the option. Multiple
1958 .B \-\-ignore\-unknown\-option
1959 options can be given to support a larger number of options to ignore.
1961 This option should be used with caution, as there are good security
1962 reasons for having OpenVPN fail if it detects problems in a
1963 config file. Having said that, there are valid reasons for wanting
1964 new software features to gracefully degrade when encountered by
1965 older software versions.
1967 .B \-\-ignore\-unknown\-option
1968 is available since OpenVPN 2.3.3.
1969 .\"*********************************************************
1971 .B \-\-script\-security level
1972 This directive offers policy-level control over OpenVPN's usage of external programs
1973 and scripts.  Lower
1974 .B level
1975 values are more restrictive, higher values are more permissive.  Settings for
1976 .B level:
1978 .B 0 --
1979 Strictly no calling of external programs.
1981 .B 1 --
1982 (Default) Only call built-in executables such as ifconfig, ip, route, or netsh.
1984 .B 2 --
1985 Allow calling of built-in executables and user-defined scripts.
1987 .B 3 --
1988 Allow passwords to be passed to scripts via environmental variables (potentially unsafe).
1990 OpenVPN releases before v2.3 also supported a
1991 .B method
1992 flag which indicated how OpenVPN should call external commands and scripts.  This
1993 could be either
1994 .B execve
1995 or 
1996 .B system. 
1997 As of OpenVPN v2.3, this flag is no longer accepted.  In most *nix environments the execve()
1998 approach has been used without any issues.
2000 Some directives such as \-\-up allow options to be passed to the external
2001 script. In these cases make sure the script name does not contain any spaces or
2002 the configuration parser will choke because it can't determine where the script
2003 name ends and script options start.
2005 To run scripts in Windows in earlier OpenVPN
2006 versions you needed to either add a full path to the script interpreter which can parse the
2007 script or use the
2008 .B system
2009 flag to run these scripts.  As of OpenVPN v2.3 it is now a strict requirement to have
2010 full path to the script interpreter when running non-executables files.
2011 This is not needed for executable files, such as .exe, .com, .bat or .cmd files.  For
2012 example, if you have a Visual Basic script, you must use this syntax now:
2015 .ft 3
2016 .in +4
2017 \-\-up 'C:\\\\Windows\\\\System32\\\\wscript.exe C:\\\\Program\\ Files\\\\OpenVPN\\\\config\\\\my-up-script.vbs'
2018 .in -4
2022 Please note the single quote marks and the escaping of the backslashes (\\) and
2023 the space character.
2025 The reason the support for the
2026 .B system
2027 flag was removed is due to the security implications with shell expansions
2028 when executing scripts via the system() call.
2029 .\"*********************************************************
2031 .B \-\-disable\-occ
2032 Don't output a warning message if option inconsistencies are detected between
2033 peers.  An example of an option inconsistency would be where one peer uses
2034 .B \-\-dev tun
2035 while the other peer uses
2036 .B \-\-dev tap.
2038 Use of this option is discouraged, but is provided as
2039 a temporary fix in situations where a recent version of OpenVPN must
2040 connect to an old version.
2041 .\"*********************************************************
2043 .B \-\-user user
2044 Change the user ID of the OpenVPN process to
2045 .B user
2046 after initialization, dropping privileges in the process.
2047 This option is useful to protect the system
2048 in the event that some hostile party was able to gain control of
2049 an OpenVPN session.  Though OpenVPN's security features make
2050 this unlikely, it is provided as a second line of defense.
2052 By setting
2053 .B user
2055 .I nobody
2056 or somebody similarly unprivileged, the hostile party would be
2057 limited in what damage they could cause.  Of course once
2058 you take away privileges, you cannot return them
2059 to an OpenVPN session.  This means, for example, that if
2060 you want to reset an OpenVPN daemon with a
2061 .B SIGUSR1
2062 signal
2063 (for example in response
2064 to a DHCP reset), you should make use of one or more of the
2065 .B \-\-persist
2066 options to ensure that OpenVPN doesn't need to execute any privileged
2067 operations in order to restart (such as re-reading key files
2068 or running
2069 .BR ifconfig
2070 on the TUN device).
2071 .\"*********************************************************
2073 .B \-\-group group
2074 Similar to the
2075 .B \-\-user
2076 option,
2077 this option changes the group ID of the OpenVPN process to
2078 .B group
2079 after initialization.
2080 .\"*********************************************************
2082 .B \-\-cd dir
2083 Change directory to
2084 .B dir
2085 prior to reading any files such as
2086 configuration files, key files, scripts, etc.
2087 .B dir
2088 should be an absolute path, with a leading "/",
2089 and without any references
2090 to the current directory such as "." or "..".
2092 This option is useful when you are running
2093 OpenVPN in 
2094 .B \-\-daemon
2095 mode, and you want to consolidate all of
2096 your OpenVPN control files in one location.
2097 .\"*********************************************************
2099 .B \-\-chroot dir
2100 Chroot to
2101 .B dir
2102 after initialization.  
2103 .B \-\-chroot
2104 essentially redefines
2105 .B dir
2106 as being the top
2107 level directory tree (/).  OpenVPN will therefore
2108 be unable to access any files outside this tree.
2109 This can be desirable from a security standpoint.
2111 Since the chroot operation is delayed until after
2112 initialization, most OpenVPN options that reference
2113 files will operate in a pre-chroot context.
2115 In many cases, the
2116 .B dir
2117 parameter can point to an empty directory, however
2118 complications can result when scripts or restarts
2119 are executed after the chroot operation.
2121 Note: if OpenVPN is built using the PolarSSL SSL
2122 library,
2123 .B \-\-chroot
2124 will only work if a /dev/urandom device node is available
2125 inside the chroot directory
2126 .B dir.
2127 This is due to the way PolarSSL works (it wants to open
2128 /dev/urandom every time randomness is needed, not just once
2129 at startup) and nothing OpenVPN can influence.
2130 .\"*********************************************************
2132 .B \-\-setcon context
2133 Apply SELinux
2134 .B context
2135 after initialization. This
2136 essentially provides the ability to restrict OpenVPN's
2137 rights to only network I/O operations, thanks to
2138 SELinux. This goes further than
2139 .B \-\-user
2141 .B \-\-chroot
2142 in that those two, while being great security features,
2143 unfortunately do not protect against privilege escalation
2144 by exploitation of a vulnerable system call. You can of
2145 course combine all three, but please note that since
2146 setcon requires access to /proc you will have to provide
2147 it inside the chroot directory (e.g. with mount \-\-bind).
2149 Since the setcon operation is delayed until after
2150 initialization, OpenVPN can be restricted to just
2151 network-related system calls, whereas by applying the
2152 context before startup (such as the OpenVPN one provided
2153 in the SELinux Reference Policies) you will have to
2154 allow many things required only during initialization.
2156 Like with chroot, complications can result when scripts
2157 or restarts are executed after the setcon operation,
2158 which is why you should really consider using the
2159 .B \-\-persist\-key
2161 .B \-\-persist\-tun
2162 options.
2163 .\"*********************************************************
2165 .B \-\-daemon [progname]
2166 Become a daemon after all initialization functions are completed.
2167 This option will cause all message and error output to
2168 be sent to the syslog file (such as /var/log/messages),
2169 except for the output of scripts and
2170 ifconfig commands,
2171 which will go to /dev/null unless otherwise redirected.
2172 The syslog redirection occurs immediately at the point
2173 that
2174 .B \-\-daemon
2175 is parsed on the command line even though
2176 the daemonization point occurs later.  If one of the
2177 .B \-\-log
2178 options is present, it will supercede syslog
2179 redirection.
2181 The optional
2182 .B progname
2183 parameter will cause OpenVPN to report its program name
2184 to the system logger as
2185 .B progname.
2186 This can be useful in linking OpenVPN messages
2187 in the syslog file with specific tunnels.
2188 When unspecified,
2189 .B progname
2190 defaults to "openvpn".
2192 When OpenVPN is run with the
2193 .B \-\-daemon
2194 option, it will try to delay daemonization until the majority of initialization
2195 functions which are capable of generating fatal errors are complete.  This means
2196 that initialization scripts can test the return status of the
2197 openvpn command for a fairly reliable indication of whether the command
2198 has correctly initialized and entered the packet forwarding event loop.
2200 In OpenVPN, the vast majority of errors which occur after initialization are non-fatal.
2202 Note: as soon as OpenVPN has daemonized, it can not ask for usernames,
2203 passwords, or key pass phrases anymore.  This has certain consequences,
2204 namely that using a password-protected private key will fail unless the
2205 .B \-\-askpass
2206 option is used to tell OpenVPN to ask for the pass phrase (this
2207 requirement is new in 2.3.7, and is a consequence of calling daemon()
2208 before initializing the crypto layer).
2210 Further, using
2211 .B \-\-daemon
2212 together with
2213 .B \-\-auth-user-pass
2214 (entered on console) and
2215 .B \-\-auth-nocache
2216 will fail as soon as key renegotiation (and reauthentication) occurs.
2217 .\"*********************************************************
2219 .B \-\-syslog [progname]
2220 Direct log output to system logger, but do not become a daemon.
2222 .B \-\-daemon
2223 directive above for description of
2224 .B progname
2225 parameter.
2227 .B \-\-errors\-to\-stderr
2228 Output errors to stderr instead of stdout unless log output is redirected by one of the
2229 .B \-\-log
2230 options.
2231 .\"*********************************************************
2233 .B \-\-passtos
2234 Set the TOS field of the tunnel packet to what the payload's TOS is.
2235 .\"*********************************************************
2237 .B \-\-inetd [wait|nowait] [progname]
2238 Use this option when OpenVPN is being run from the inetd or
2239 .BR xinetd(8)
2240 server.
2243 .B wait/nowait
2244 option must match what is specified in the inetd/xinetd
2245 config file.  The
2246 .B nowait
2247 mode can only be used with
2248 .B \-\-proto tcp\-server.
2249 The default is
2250 .B wait.
2252 .B nowait
2253 mode can be used to instantiate the OpenVPN daemon as a classic TCP server,
2254 where client connection requests are serviced on a single
2255 port number.  For additional information on this kind of configuration,
2256 see the OpenVPN FAQ:
2257 .I http://openvpn.net/faq.html#oneport
2259 This option precludes the use of
2260 .B \-\-daemon, \-\-local,
2262 .B \-\-remote.
2263 Note that this option causes message and error output to be handled in the same
2264 way as the
2265 .B \-\-daemon
2266 option.  The optional
2267 .B progname
2268 parameter is also handled exactly as in
2269 .B \-\-daemon.
2271 Also note that in
2272 .B wait
2273 mode, each OpenVPN tunnel requires a separate TCP/UDP port and
2274 a separate inetd or xinetd entry.  See the OpenVPN 1.x HOWTO for an example
2275 on using OpenVPN with xinetd:
2276 .I http://openvpn.net/1xhowto.html
2277 .\"*********************************************************
2279 .B \-\-log file
2280 Output logging messages to
2281 .B file,
2282 including output to stdout/stderr which
2283 is generated by called scripts.
2285 .B file
2286 already exists it will be truncated.
2287 This option takes effect
2288 immediately when it is parsed in the command line
2289 and will supercede syslog output if
2290 .B \-\-daemon
2292 .B \-\-inetd
2293 is also specified.
2294 This option is persistent over the entire course of
2295 an OpenVPN instantiation and will not be reset by SIGHUP,
2296 SIGUSR1, or
2297 .B \-\-ping\-restart.
2299 Note that on Windows, when OpenVPN is started as a service,
2300 logging occurs by default without the need to specify
2301 this option.
2302 .\"*********************************************************
2304 .B \-\-log\-append file
2305 Append logging messages to
2306 .B file.
2308 .B file
2309 does not exist, it will be created.
2310 This option behaves exactly like
2311 .B \-\-log
2312 except that it appends to rather
2313 than truncating the log file.
2314 .\"*********************************************************
2316 .B \-\-suppress\-timestamps
2317 Avoid writing timestamps to log messages, even when they
2318 otherwise would be prepended. In particular, this applies to
2319 log messages sent to stdout.
2320 .\"*********************************************************
2322 .B \-\-writepid file
2323 Write OpenVPN's main process ID to
2324 .B file.
2325 .\"*********************************************************
2327 .B \-\-nice n
2328 Change process priority after initialization
2330 .B n
2331 greater than 0 is lower priority,
2332 .B n
2333 less than zero is higher priority).
2334 .\"*********************************************************
2335 .\".TP
2336 .\".B \-\-nice\-work n
2337 .\"Change priority of background TLS work thread.  The TLS thread
2338 .\"feature is enabled when OpenVPN is built
2339 .\"with pthread support, and you are running OpenVPN
2340 .\"in TLS mode (i.e. with
2341 .\".B \-\-tls\-client
2342 .\"or
2343 .\".B \-\-tls\-server
2344 .\"specified).
2346 .\"Using a TLS thread offloads the CPU-intensive process of SSL/TLS-based
2347 .\"key exchange to a background thread so that it does not become
2348 .\"a latency bottleneck in the tunnel packet forwarding process.
2350 .\"The parameter
2351 .\".B n
2352 .\"is interpreted exactly as with the
2353 .\".B \-\-nice
2354 .\"option above, but in relation to the work thread rather
2355 .\"than the main thread.
2356 .\"*********************************************************
2358 .B \-\-fast\-io
2359 (Experimental) Optimize TUN/TAP/UDP I/O writes by avoiding
2360 a call to poll/epoll/select prior to the write operation.  The purpose
2361 of such a call would normally be to block until the device
2362 or socket is ready to accept the write.  Such blocking is unnecessary
2363 on some platforms which don't support write blocking on UDP sockets
2364 or TUN/TAP devices.  In such cases, one can optimize the event loop
2365 by avoiding the poll/epoll/select call, improving CPU efficiency
2366 by 5% to 10%.
2368 This option can only be used on non-Windows systems, when
2369 .B \-\-proto udp
2370 is specified, and when
2371 .B \-\-shaper
2372 is NOT specified.
2373 .\"*********************************************************
2375 .B \-\-multihome
2376 Configure a multi-homed UDP server.  This option needs to be used when
2377 a server has more than one IP address (e.g. multiple interfaces, or
2378 secondary IP addresses), and is not using
2379 .B \-\-local
2380 to force binding to one specific address only.  This option will
2381 add some extra lookups to the packet path to ensure that the UDP reply
2382 packets are always sent from the address that the client is
2383 talking to. This is not supported on all platforms, and it adds more
2384 processing, so it's not enabled by default.
2386 Note: this option is only relevant for UDP servers.
2388 Note 2: if you do an IPv6+IPv4 dual-stack bind on a Linux machine with
2389 multiple IPv4 address, connections to IPv4 addresses will not work
2390 right on kernels before 3.15, due to missing kernel support for the
2391 IPv4-mapped case (some distributions have ported this to earlier kernel
2392 versions, though).
2393 .\"*********************************************************
2395 .B \-\-echo [parms...]
2396 Echo
2397 .B parms
2398 to log output.
2400 Designed to be used to send messages to a controlling application
2401 which is receiving the OpenVPN log output.
2402 .\"*********************************************************
2404 .B \-\-remap\-usr1 signal
2405 Control whether internally or externally
2406 generated SIGUSR1 signals are remapped to
2407 SIGHUP (restart without persisting state) or
2408 SIGTERM (exit).
2410 .B signal
2411 can be set to "SIGHUP" or "SIGTERM".  By default, no remapping
2412 occurs.
2413 .\"*********************************************************
2415 .B \-\-verb n
2416 Set output verbosity to
2417 .B n
2418 (default=1).  Each level shows all info from the previous levels.
2419 Level 3 is recommended if you want a good summary
2420 of what's happening without being swamped by output.
2422 .B 0 --
2423 No output except fatal errors.
2425 .B 1 to 4 --
2426 Normal usage range.
2428 .B 5 --
2429 Output
2430 .B R
2432 .B W
2433 characters to the console for each packet read and write, uppercase is
2434 used for TCP/UDP packets and lowercase is used for TUN/TAP packets.
2436 .B 6 to 11 --
2437 Debug info range (see errlevel.h for additional
2438 information on debug levels).
2439 .\"*********************************************************
2441 .B \-\-status file [n]
2442 Write operational status to
2443 .B file
2444 every
2445 .B n
2446 seconds.
2448 Status can also be written to the syslog by sending a
2449 .B SIGUSR2
2450 signal.
2451 .\"*********************************************************
2453 .B \-\-status\-version [n]
2454 Choose the status file format version number.  Currently
2455 .B n
2456 can be 1, 2, or 3 and defaults to 1.
2457 .\"*********************************************************
2459 .B \-\-mute n
2460 Log at most
2461 .B n
2462 consecutive messages in the same category.  This is useful to
2463 limit repetitive logging of similar message types.
2464 .\"*********************************************************
2466 .B \-\-comp\-lzo [mode]
2467 Use fast LZO compression -- may add up to 1 byte per
2468 packet for incompressible data.
2469 .B mode
2470 may be "yes", "no", or "adaptive" (default).
2472 In a server mode setup, it is possible to selectively turn
2473 compression on or off for individual clients.
2475 First, make sure the client-side config file enables selective
2476 compression by having at least one
2477 .B \-\-comp\-lzo
2478 directive, such as
2479 .B \-\-comp\-lzo no.
2480 This will turn off compression by default,
2481 but allow a future directive push from the server to
2482 dynamically change the
2483 on/off/adaptive setting.
2485 Next in a
2486 .B \-\-client\-config\-dir
2487 file, specify the compression setting for the client,
2488 for example:
2491 .ft 3
2492 .in +4
2493 comp-lzo yes
2494 push "comp\-lzo yes"
2495 .in -4
2499 The first line sets the
2500 .B comp-lzo
2501 setting for the server
2502 side of the link, the second sets the client side.
2503 .\"*********************************************************
2505 .B \-\-comp\-noadapt
2506 When used in conjunction with
2507 .B \-\-comp\-lzo,
2508 this option will disable OpenVPN's adaptive compression algorithm.
2509 Normally, adaptive compression is enabled with
2510 .B \-\-comp\-lzo.
2512 Adaptive compression tries to optimize the case where you have
2513 compression enabled, but you are sending predominantly incompressible
2514 (or pre-compressed) packets over the tunnel, such as an FTP or rsync transfer
2515 of a large, compressed file.  With adaptive compression,
2516 OpenVPN will periodically sample the compression process to measure its
2517 efficiency.  If the data being sent over the tunnel is already compressed,
2518 the compression efficiency will be very low, triggering openvpn to disable
2519 compression for a period of time until the next re-sample test.
2520 .\"*********************************************************
2522 .B \-\-management IP port [pw-file]
2523 Enable a TCP server on
2524 .B IP:port
2525 to handle daemon management functions.
2526 .B pw-file,
2527 if specified,
2528 is a password file (password on first line)
2529 or "stdin" to prompt from standard input.  The password
2530 provided will set the password which TCP clients will need
2531 to provide in order to access management functions.
2533 The management interface can also listen on a unix domain socket,
2534 for those platforms that support it.  To use a unix domain socket, specify
2535 the unix socket pathname in place of
2536 .B IP
2537 and set
2538 .B port
2539 to 'unix'.  While the default behavior is to create a unix domain socket
2540 that may be connected to by any process, the
2541 .B \-\-management\-client\-user
2543 .B \-\-management\-client\-group
2544 directives can be used to restrict access.
2546 The management interface provides a special mode where the TCP
2547 management link can operate over the tunnel itself.  To enable this mode,
2549 .B IP
2550 = "tunnel".  Tunnel mode will cause the management interface
2551 to listen for a TCP connection on the local VPN address of the
2552 TUN/TAP interface.
2554 While the management port is designed for programmatic control
2555 of OpenVPN by other applications, it is possible to telnet
2556 to the port, using a telnet client in "raw" mode.  Once connected,
2557 type "help" for a list of commands.
2559 For detailed documentation on the management interface, see
2560 the management-notes.txt file in the
2561 .B management
2562 folder of
2563 the OpenVPN source distribution.
2565 It is strongly recommended that
2566 .B IP
2567 be set to 127.0.0.1
2568 (localhost) to restrict accessibility of the management
2569 server to local clients. 
2571 .B \-\-management\-client
2572 Management interface will connect as a TCP/unix domain client to
2573 .B IP:port
2574 specified by
2575 .B \-\-management
2576 rather than listen as a TCP server or on a unix domain socket.
2578 If the client connection fails to connect or is disconnected,
2579 a SIGTERM signal will be generated causing OpenVPN to quit.
2580 .\"*********************************************************
2582 .B \-\-management\-query\-passwords
2583 Query management channel for private key password and
2584 .B \-\-auth\-user\-pass
2585 username/password.  Only query the management channel
2586 for inputs which ordinarily would have been queried from the
2587 console.
2588 .\"*********************************************************
2590 .B \-\-management\-query\-proxy
2591 Query management channel for proxy server information for a specific
2592 .B \-\-remote
2593 (client-only).
2594 .\"*********************************************************
2596 .B \-\-management\-query\-remote
2597 Allow management interface to override
2598 .B \-\-remote
2599 directives (client-only).
2600 .\"*********************************************************
2601 .B \-\-management\-external\-key
2602 Allows usage for external private key file instead of
2603 .B \-\-key
2604 option (client-only).
2605 .\"*********************************************************
2607 .B \-\-management\-forget\-disconnect
2608 Make OpenVPN forget passwords when management session
2609 disconnects.
2611 This directive does not affect the
2612 .B \-\-http\-proxy
2613 username/password.  It is always cached.
2614 .\"*********************************************************
2616 .B \-\-management\-hold
2617 Start OpenVPN in a hibernating state, until a client
2618 of the management interface explicitly starts it
2619 with the
2620 .B hold release
2621 command.
2622 .\"*********************************************************
2624 .B \-\-management\-signal
2625 Send SIGUSR1 signal to OpenVPN if management session disconnects.
2626 This is useful when you wish to disconnect an OpenVPN session on
2627 user logoff. For \-\-management\-client this option is not needed since
2628 a disconnect will always generate a SIGTERM.
2629 .\"*********************************************************
2631 .B \-\-management\-log\-cache n
2632 Cache the most recent
2633 .B n
2634 lines of log file history for usage
2635 by the management channel.
2636 .\"*********************************************************
2638 .B \-\-management\-up\-down
2639 Report tunnel up/down events to management interface.
2640 .B 
2641 .\"*********************************************************
2643 .B \-\-management\-client\-auth
2644 Gives management interface client the responsibility
2645 to authenticate clients after their client certificate
2646 has been verified.  See management-notes.txt in OpenVPN
2647 distribution for detailed notes.
2648 .\"*********************************************************
2650 .B \-\-management\-client\-pf
2651 Management interface clients must specify a packet
2652 filter file for each connecting client.  See management-notes.txt
2653 in OpenVPN distribution for detailed notes.
2654 .\"*********************************************************
2656 .B \-\-management\-client\-user u
2657 When the management interface is listening on a unix domain socket,
2658 only allow connections from user
2659 .B u.
2660 .\"*********************************************************
2662 .B \-\-management\-client\-group g
2663 When the management interface is listening on a unix domain socket,
2664 only allow connections from group
2665 .B g.
2666 .\"*********************************************************
2668 .B \-\-plugin module-pathname [init-string]
2669 Load plug-in module from the file
2670 .B module-pathname,
2671 passing
2672 .B init-string
2673 as an argument
2674 to the module initialization function.  Multiple
2675 plugin modules may be loaded into one OpenVPN
2676 process.
2678 For more information and examples on how to build OpenVPN
2679 plug-in modules, see the README file in the
2680 .B plugin
2681 folder of the OpenVPN source distribution.
2683 If you are using an RPM install of OpenVPN, see
2684 /usr/share/openvpn/plugin.  The documentation is
2686 .B doc
2687 and the actual plugin modules are in
2688 .B lib.
2690 Multiple plugin modules can be cascaded, and modules can be
2691 used in tandem with scripts.  The modules will be called by
2692 OpenVPN in the order that they are declared in the config
2693 file.  If both a plugin and script are configured for the same
2694 callback, the script will be called last.  If the
2695 return code of the module/script controls an authentication
2696 function (such as tls-verify, auth-user-pass-verify, or
2697 client-connect), then
2698 every module and script must return success (0) in order for
2699 the connection to be authenticated.
2700 .\"*********************************************************
2701 .SS Server Mode
2702 Starting with OpenVPN 2.0, a multi-client TCP/UDP server mode
2703 is supported, and can be enabled with the
2704 .B \-\-mode server
2705 option.  In server mode, OpenVPN will listen on a single
2706 port for incoming client connections.  All client
2707 connections will be routed through a single tun or tap
2708 interface.  This mode is designed for scalability and should
2709 be able to support hundreds or even thousands of clients
2710 on sufficiently fast hardware.  SSL/TLS authentication must
2711 be used in this mode.
2712 .\"*********************************************************
2714 .B \-\-server network netmask ['nopool']
2715 A helper directive designed to simplify the configuration
2716 of OpenVPN's server mode.  This directive will set up an
2717 OpenVPN server which will allocate addresses to clients
2718 out of the given network/netmask.  The server itself
2719 will take the ".1" address of the given network
2720 for use as the server-side endpoint of the local
2721 TUN/TAP interface.
2723 For example,
2724 .B \-\-server 10.8.0.0 255.255.255.0
2725 expands as follows:
2728 .ft 3
2729 .in +4
2730  mode server
2731  tls-server
2732  push "topology [topology]"
2734  if dev tun AND (topology == net30 OR topology == p2p):
2735    ifconfig 10.8.0.1 10.8.0.2
2736    if !nopool:
2737      ifconfig-pool 10.8.0.4 10.8.0.251
2738    route 10.8.0.0 255.255.255.0
2739    if client-to-client:
2740      push "route 10.8.0.0 255.255.255.0"
2741    else if topology == net30:
2742      push "route 10.8.0.1"
2744  if dev tap OR (dev tun AND topology == subnet):
2745    ifconfig 10.8.0.1 255.255.255.0
2746    if !nopool:
2747      ifconfig-pool 10.8.0.2 10.8.0.254 255.255.255.0
2748    push "route-gateway 10.8.0.1"
2749    if route-gateway unset:
2750      route-gateway 10.8.0.2
2752 .in -4
2756 Don't use
2757 .B \-\-server
2758 if you are ethernet bridging.  Use
2759 .B \-\-server\-bridge
2760 instead.
2761 .\"*********************************************************
2763 .B \-\-server\-bridge gateway netmask pool-start-IP pool-end-IP
2765 .B \-\-server\-bridge ['nogw']
2767 A helper directive similar to
2768 .B \-\-server
2769 which is designed to simplify the configuration
2770 of OpenVPN's server mode in ethernet bridging configurations.
2773 .B \-\-server\-bridge
2774 is used without any parameters, it will enable a DHCP-proxy
2775 mode, where connecting OpenVPN clients will receive an IP
2776 address for their TAP adapter from the DHCP server running
2777 on the OpenVPN server-side LAN.
2778 Note that only clients that support
2779 the binding of a DHCP client with the TAP adapter (such as
2780 Windows) can support this mode.  The optional 
2781 .B nogw
2782 flag (advanced) indicates that gateway information should not be
2783 pushed to the client.
2785 To configure ethernet bridging, you 
2786 must first use your OS's bridging capability
2787 to bridge the TAP interface with the ethernet
2788 NIC interface.  For example, on Linux this is done
2789 with the
2790 .B brctl
2791 tool, and with Windows XP it is done in the Network
2792 Connections Panel by selecting the ethernet and
2793 TAP adapters and right-clicking on "Bridge Connections".
2795 Next you you must manually set the
2796 IP/netmask on the bridge interface.  The
2797 .B gateway
2799 .B netmask
2800 parameters to
2801 .B \-\-server\-bridge
2802 can be set to either the IP/netmask of the
2803 bridge interface, or the IP/netmask of the
2804 default gateway/router on the bridged
2805 subnet.
2807 Finally, set aside a IP range in the bridged
2808 subnet,
2809 denoted by
2810 .B pool-start-IP
2812 .B pool-end-IP,
2813 for OpenVPN to allocate to connecting
2814 clients.
2816 For example,
2817 .B server-bridge 10.8.0.4 255.255.255.0 10.8.0.128 10.8.0.254
2818 expands as follows:
2821 .ft 3
2822 .in +4
2823 mode server
2824 tls-server
2826 ifconfig-pool 10.8.0.128 10.8.0.254 255.255.255.0
2827 push "route-gateway 10.8.0.4"
2828 .in -4
2832 In another example,
2833 .B \-\-server\-bridge
2834 (without parameters) expands as follows:
2837 .ft 3
2838 .in +4
2839 mode server
2840 tls-server
2842 push "route-gateway dhcp"
2843 .in -4
2848 .B \-\-server\-bridge nogw
2849 expands as follows:
2852 .ft 3
2853 .in +4
2854 mode server
2855 tls-server
2856 .in -4
2859 .\"*********************************************************
2861 .B \-\-push "option"
2862 Push a config file option back to the client for remote
2863 execution.  Note that
2865 option
2866 must be enclosed in double quotes ("").  The client must specify
2867 .B \-\-pull
2868 in its config file.  The set of options which can be
2869 pushed is limited by both feasibility and security.
2870 Some options such as those which would execute scripts
2871 are banned, since they would effectively allow a compromised
2872 server to execute arbitrary code on the client.
2873 Other options such as TLS or MTU parameters
2874 cannot be pushed because the client needs to know
2875 them before the connection to the server can be initiated.
2877 This is a partial list of options which can currently be pushed:
2878 .B \-\-route, \-\-route\-gateway, \-\-route\-delay, \-\-redirect\-gateway,
2879 .B \-\-ip\-win32, \-\-dhcp\-option,
2880 .B \-\-inactive, \-\-ping, \-\-ping\-exit, \-\-ping\-restart,
2881 .B \-\-setenv,
2882 .B \-\-persist\-key, \-\-persist\-tun, \-\-echo,
2883 .B \-\-comp\-lzo,
2884 .B \-\-socket\-flags,
2885 .B \-\-sndbuf, \-\-rcvbuf
2886 .\"*********************************************************
2888 .B \-\-push\-reset
2889 Don't inherit the global push list for a specific client instance.
2890 Specify this option in a client-specific context such
2891 as with a
2892 .B \-\-client\-config\-dir
2893 configuration file.  This option will ignore
2894 .B \-\-push
2895 options at the global config file level.
2897 .B \-\-push\-peer\-info
2898 Push additional information about the client to server.  The additional information
2899 consists of the following data:
2901 IV_VER=<version> -- the client OpenVPN version
2903 IV_PLAT=[linux|solaris|openbsd|mac|netbsd|freebsd|win] -- the client OS platform
2905 IV_HWADDR=<mac address> -- the MAC address of clients default gateway
2907 IV_LZO_STUB=1 -- if client was built with LZO stub capability
2909 UV_<name>=<value> -- client environment variables whose names start with "UV_"
2910 .\"*********************************************************
2912 .B \-\-disable
2913 Disable a particular client (based on the common name)
2914 from connecting.  Don't use this option to disable a client
2915 due to key or password compromise.  Use a CRL (certificate
2916 revocation list) instead (see the
2917 .B \-\-crl\-verify
2918 option).
2920 This option must be associated with a specific client instance,
2921 which means that it must be specified either in a client
2922 instance config file using
2923 .B \-\-client\-config\-dir
2924 or dynamically generated using a
2925 .B \-\-client\-connect
2926 script.
2927 .\"*********************************************************
2929 .B \-\-ifconfig\-pool start-IP end-IP [netmask]
2930 Set aside a pool of subnets to be
2931 dynamically allocated to connecting clients, similar
2932 to a DHCP server.  For tun-style
2933 tunnels, each client will be given a /30 subnet (for
2934 interoperability with Windows clients).  For tap-style
2935 tunnels, individual addresses will be allocated, and the
2936 optional
2937 .B netmask
2938 parameter will also be pushed to clients.
2940 .\"*********************************************************
2942 .B \-\-ifconfig\-pool\-persist file [seconds]
2943 Persist/unpersist ifconfig-pool
2944 data to
2945 .B file,
2947 .B seconds
2948 intervals (default=600), as well as on program startup and
2949 shutdown.
2951 The goal of this option is to provide a long-term association
2952 between clients (denoted by their common name) and the virtual
2953 IP address assigned to them from the ifconfig-pool.
2954 Maintaining a long-term
2955 association is good for clients because it allows them
2956 to effectively use the
2957 .B \-\-persist\-tun
2958 option.
2960 .B file
2961 is a comma-delimited ASCII file, formatted as
2962 <Common-Name>,<IP-address>.
2965 .B seconds
2966 = 0,
2967 .B file
2968 will be treated as read-only.  This is useful if
2969 you would like to treat
2970 .B file
2971 as a configuration file.
2973 Note that the entries in this file are treated by OpenVPN as
2974 suggestions only, based on past associations between
2975 a common name and IP address.  They do not guarantee that the given common
2976 name will always receive the given IP address.  If you want guaranteed
2977 assignment, use
2978 .B \-\-ifconfig\-push
2979 .\"*********************************************************
2981 .B \-\-ifconfig\-pool\-linear
2982 Modifies the
2983 .B \-\-ifconfig\-pool
2984 directive to
2985 allocate individual TUN interface addresses for
2986 clients rather than /30 subnets.  NOTE:  This option
2987 is incompatible with Windows clients.
2989 This option is deprecated, and should be replaced with
2990 .B \-\-topology p2p
2991 which is functionally equivalent.
2992 .\"*********************************************************
2994 .B \-\-ifconfig\-push local remote-netmask [alias]
2995 Push virtual IP endpoints for client tunnel,
2996 overriding the \-\-ifconfig\-pool dynamic allocation.
2998 The parameters
2999 .B local
3001 .B remote-netmask
3002 are set according to the
3003 .B \-\-ifconfig
3004 directive which you want to execute on the client machine to
3005 configure the remote end of the tunnel.  Note that the parameters
3006 .B local
3008 .B remote\-netmask
3009 are from the perspective of the client, not the server.  They may be
3010 DNS names rather than IP addresses, in which case they will be resolved
3011 on the server at the time of client connection.
3013 The optional
3014 .B alias
3015 parameter may be used in cases where NAT causes the client view
3016 of its local endpoint to differ from the server view.  In this case
3017 .B local/remote-netmask
3018 will refer to the server view while
3019 .B alias/remote-netmask
3020 will refer to the client view.
3022 This option must be associated with a specific client instance,
3023 which means that it must be specified either in a client
3024 instance config file using
3025 .B \-\-client\-config\-dir
3026 or dynamically generated using a
3027 .B \-\-client\-connect
3028 script.
3030 Remember also to include a
3031 .B \-\-route
3032 directive in the main OpenVPN config file which encloses
3033 .B local,
3034 so that the kernel will know to route it
3035 to the server's TUN/TAP interface.
3037 OpenVPN's internal client IP address selection algorithm works as
3038 follows:
3040 .B 1
3041 -- Use
3042 .B \-\-client\-connect script
3043 generated file for static IP (first choice).
3045 .B 2
3046 -- Use
3047 .B \-\-client\-config\-dir
3048 file for static IP (next choice).
3050 .B 3
3051 -- Use
3052 .B \-\-ifconfig\-pool
3053 allocation for dynamic IP (last choice).
3055 .\"*********************************************************
3057 .B \-\-iroute network [netmask]
3058 Generate an internal route to a specific
3059 client. The
3060 .B netmask
3061 parameter, if omitted, defaults to 255.255.255.255.
3063 This directive can be used to route a fixed subnet from
3064 the server to a particular client, regardless
3065 of where the client is connecting from.  Remember
3066 that you must also add the route to the system
3067 routing table as well (such as by using the
3068 .B \-\-route
3069 directive).  The reason why two routes are needed
3070 is that the
3071 .B \-\-route
3072 directive routes the packet from the kernel
3073 to OpenVPN.  Once in OpenVPN, the
3074 .B \-\-iroute
3075 directive routes to the specific client.
3077 This option must be specified either in a client
3078 instance config file using
3079 .B \-\-client\-config\-dir
3080 or dynamically generated using a
3081 .B \-\-client\-connect
3082 script.
3085 .B \-\-iroute
3086 directive also has an important interaction with
3087 .B \-\-push
3088 "route ...".
3089 .B \-\-iroute
3090 essentially defines a subnet which is owned by a
3091 particular client (we will call this client A).
3092 If you would like other clients to be able to reach A's
3093 subnet, you can use
3094 .B \-\-push
3095 "route ..."
3096 together with
3097 .B \-\-client\-to\-client
3098 to effect this.  In order for all clients to see
3099 A's subnet, OpenVPN must push this route to all clients
3100 EXCEPT for A, since the subnet is already owned by A.
3101 OpenVPN accomplishes this by not
3102 not pushing a route to a client
3103 if it matches one of the client's iroutes.
3104 .\"*********************************************************
3106 .B \-\-client\-to\-client
3107 Because the OpenVPN server mode handles multiple clients
3108 through a single tun or tap interface, it is effectively
3109 a router.  The
3110 .B \-\-client\-to\-client
3111 flag tells OpenVPN to internally route client-to-client
3112 traffic rather than pushing all client-originating traffic
3113 to the TUN/TAP interface.
3115 When this option is used, each client will "see" the other
3116 clients which are currently connected.  Otherwise, each
3117 client will only see the server.  Don't use this option
3118 if you want to firewall tunnel traffic using
3119 custom, per-client rules.
3120 .\"*********************************************************
3122 .B \-\-duplicate\-cn
3123 Allow multiple clients with the same common name to concurrently connect.
3124 In the absence of this option, OpenVPN will disconnect a client instance
3125 upon connection of a new client having the same common name.
3126 .\"*********************************************************
3128 .B \-\-client\-connect cmd
3130 .B command cmd
3131 on client connection.
3133 .B cmd
3134 consists of a path to script (or executable program), optionally
3135 followed by arguments. The path and arguments may be single- or double-quoted
3136 and/or escaped using a backslash, and should be separated by one or more spaces.
3138 The command is passed the common name
3139 and IP address of the just-authenticated client
3140 as environmental variables (see environmental variable section
3141 below).  The command is also passed
3142 the pathname of a freshly created temporary file as the last argument
3143 (after any arguments specified in
3144 .B cmd
3145 ), to be used by the command
3146 to pass dynamically generated config file directives back to OpenVPN.
3148 If the script wants to generate a dynamic config file
3149 to be applied on the server when the client connects,
3150 it should write it to the file named by the last argument.
3152 See the
3153 .B \-\-client\-config\-dir
3154 option below for options which
3155 can be legally used in a dynamically generated config file.
3157 Note that the return value of
3158 .B script
3159 is significant.  If
3160 .B script
3161 returns a non-zero error status, it will cause the client
3162 to be disconnected.
3163 .\"*********************************************************
3165 .B \-\-client\-disconnect cmd
3166 Like
3167 .B \-\-client\-connect
3168 but called on client instance shutdown.  Will not be called
3169 unless the
3170 .B \-\-client\-connect
3171 script and plugins (if defined)
3172 were previously called on this instance with
3173 successful (0) status returns.
3175 The exception to this rule is if the
3176 .B \-\-client\-disconnect
3177 command or plugins are cascaded, and at least one client-connect
3178 function succeeded, then ALL of the client-disconnect functions for
3179 scripts and plugins will be called on client instance object deletion,
3180 even in cases where some of the related client-connect functions returned
3181 an error status.
3184 .B \-\-client\-disconnect
3185 command is passed the same pathname as the corresponding
3186 .B \-\-client\-connect
3187 command as its last argument. (after any arguments specified in
3188 .B cmd
3190 .B 
3191 .\"*********************************************************
3193 .B \-\-client\-config\-dir dir
3194 Specify a directory
3195 .B dir
3196 for custom client config files.  After
3197 a connecting client has been authenticated, OpenVPN will
3198 look in this directory for a file having the same name
3199 as the client's X509 common name.  If a matching file
3200 exists, it will be opened and parsed for client-specific
3201 configuration options.  If no matching file is found, OpenVPN
3202 will instead try to open and parse a default file called
3203 "DEFAULT", which may be provided but is not required. Note that
3204 the configuration files must be readable by the OpenVPN process
3205 after it has dropped it's root privileges.
3207 This file can specify a fixed IP address for a given
3208 client using
3209 .B \-\-ifconfig\-push,
3210 as well as fixed subnets owned by the client using
3211 .B \-\-iroute.
3213 One of the useful properties of this option is that it
3214 allows client configuration files to be conveniently
3215 created, edited, or removed while the server is live,
3216 without needing to restart the server.
3218 The following
3219 options are legal in a client-specific context:
3220 .B \-\-push, \-\-push\-reset, \-\-iroute, \-\-ifconfig\-push,
3222 .B \-\-config.
3223 .\"*********************************************************
3225 .B \-\-ccd\-exclusive
3226 Require, as a
3227 condition of authentication, that a connecting client has a
3228 .B \-\-client\-config\-dir
3229 file.
3230 .\"*********************************************************
3232 .B \-\-tmp\-dir dir
3233 Specify a directory
3234 .B dir
3235 for temporary files.  This directory will be used by
3236 openvpn processes and script to communicate temporary
3237 data with openvpn main process. Note that
3238 the directory must be writable by the OpenVPN process
3239 after it has dropped it's root privileges.
3241 This directory will be used by in the following cases:
3244 .B \-\-client\-connect
3245 scripts to dynamically generate client-specific
3246 configuration files.
3249 .B OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY
3250 plugin hook to return success/failure via auth_control_file
3251 when using deferred auth method
3254 .B OPENVPN_PLUGIN_ENABLE_PF
3255 plugin hook to pass filtering rules via pf_file
3256 .\"*********************************************************
3258 .B \-\-hash\-size r v
3259 Set the size of the real address hash table to
3260 .B r
3261 and the virtual address table to
3262 .B v.
3263 By default, both tables are sized at 256 buckets.
3264 .\"*********************************************************
3266 .B \-\-bcast\-buffers n
3267 Allocate
3268 .B n
3269 buffers for broadcast datagrams (default=256).
3270 .\"*********************************************************
3272 .B \-\-tcp\-queue\-limit n
3273 Maximum number of output packets queued before TCP (default=64).
3275 When OpenVPN is tunneling data from a TUN/TAP device to a
3276 remote client over a TCP connection, it is possible that the TUN/TAP device
3277 might produce data at a faster rate than the TCP connection
3278 can support.  When the number of output packets queued before sending to
3279 the TCP socket reaches this limit for a given client connection,
3280 OpenVPN will start to drop outgoing packets directed
3281 at this client.
3282 .\"*********************************************************
3284 .B \-\-tcp\-nodelay
3285 This macro sets the TCP_NODELAY socket flag on the server
3286 as well as pushes it to connecting clients.  The TCP_NODELAY
3287 flag disables the Nagle algorithm on TCP sockets causing
3288 packets to be transmitted immediately with low latency,
3289 rather than waiting a short period of time in order
3290 to aggregate several packets into a larger containing
3291 packet.  In VPN applications over TCP, TCP_NODELAY
3292 is generally a good latency optimization.
3294 The macro expands as follows:
3297 .ft 3
3298 .in +4
3299  if mode server:
3300    socket-flags TCP_NODELAY
3301    push "socket-flags TCP_NODELAY"
3302 .in -4
3305 .\"*********************************************************
3307 .B \-\-max\-clients n
3308 Limit server to a maximum of
3309 .B n
3310 concurrent clients.
3311 .\"*********************************************************
3313 .B \-\-max\-routes\-per\-client n
3314 Allow a maximum of
3315 .B n
3316 internal routes per client (default=256).
3317 This is designed to
3318 help contain DoS attacks where an authenticated client floods the
3319 server with packets appearing to come from many unique MAC addresses,
3320 forcing the server to deplete
3321 virtual memory as its internal routing table expands.
3322 This directive can be used in a
3323 .B \-\-client\-config\-dir
3324 file or auto-generated by a
3325 .B \-\-client\-connect
3326 script to override the global value for a particular client.
3328 Note that this
3329 directive affects OpenVPN's internal routing table, not the
3330 kernel routing table.
3331 .\"*********************************************************
3333 .B \-\-stale\-routes\-check n [t]
3334 Remove routes haven't had activity for
3335 .B n
3336 seconds (i.e. the ageing time).
3338 This check is ran every
3339 .B t
3340 seconds (i.e. check interval).
3343 .B t
3344 is not present it defaults to
3345 .B n
3347 This option helps to keep the dynamic routing table small.
3348 See also
3349 .B \-\-max\-routes\-per\-client
3350 .\"*********************************************************
3352 .B \-\-connect\-freq n sec
3353 Allow a maximum of
3354 .B n
3355 new connections per
3356 .B sec 
3357 seconds from clients.  This is designed to contain DoS attacks which flood
3358 the server with connection requests using certificates which
3359 will ultimately fail to authenticate.
3361 This is an imperfect solution however, because in a real
3362 DoS scenario, legitimate connections might also be refused.
3364 For the best protection against DoS attacks in server mode,
3366 .B \-\-proto udp
3368 .B \-\-tls\-auth.
3369 .\"*********************************************************
3371 .B \-\-learn\-address cmd
3372 Run command
3373 .B cmd
3374 to validate client virtual addresses or routes.
3376 .B cmd
3377 consists of a path to script (or executable program), optionally
3378 followed by arguments. The path and arguments may be single- or double-quoted
3379 and/or escaped using a backslash, and should be separated by one or more spaces.
3381 Three arguments will be appended to any arguments in
3382 .B cmd
3383 as follows:
3385 .B [1] operation --
3386 "add", "update", or "delete" based on whether or not
3387 the address is being added to, modified, or deleted from
3388 OpenVPN's internal routing table.
3390 .B [2] address --
3391 The address being learned or unlearned.  This can be
3392 an IPv4 address such as "198.162.10.14", an IPv4 subnet
3393 such as "198.162.10.0/24", or an ethernet MAC address (when
3394 .B \-\-dev tap
3395 is being used) such as "00:FF:01:02:03:04".
3397 .B [3] common name --
3398 The common name on the certificate associated with the
3399 client linked to this address.  Only present for "add"
3400 or "update" operations, not "delete".
3402 On "add" or "update" methods, if the script returns
3403 a failure code (non-zero), OpenVPN will reject the address
3404 and will not modify its internal routing table.
3406 Normally, the
3407 .B cmd
3408 script will use the information provided above to set
3409 appropriate firewall entries on the VPN TUN/TAP interface.
3410 Since OpenVPN provides the association between virtual IP
3411 or MAC address and the client's authenticated common name,
3412 it allows a user-defined script to configure firewall access
3413 policies with regard to the client's high-level common name,
3414 rather than the low level client virtual addresses.
3415 .\"*********************************************************
3417 .B \-\-auth\-user\-pass\-verify cmd method
3418 Require the client to provide a username/password (possibly
3419 in addition to a client certificate) for authentication.
3421 OpenVPN will run
3422 .B command cmd
3423 to validate the username/password
3424 provided by the client.
3426 .B cmd
3427 consists of a path to script (or executable program), optionally
3428 followed by arguments. The path and arguments may be single- or double-quoted
3429 and/or escaped using a backslash, and should be separated by one or more spaces.
3432 .B method
3433 is set to "via-env", OpenVPN will call
3434 .B script
3435 with the environmental variables
3436 .B username
3438 .B password
3439 set to the username/password strings provided by the client.
3440 Be aware that this method is insecure on some platforms which
3441 make the environment of a process publicly visible to other
3442 unprivileged processes.
3445 .B method
3446 is set to "via-file", OpenVPN will write the username and
3447 password to the first two lines of a temporary file.  The filename
3448 will be passed as an argument to
3449 .B script,
3450 and the file will be automatically deleted by OpenVPN after
3451 the script returns.  The location of the temporary file is
3452 controlled by the
3453 .B \-\-tmp\-dir
3454 option, and will default to the current directory if unspecified.
3455 For security, consider setting 
3456 .B \-\-tmp\-dir
3457 to a volatile storage medium such as
3458 .B /dev/shm
3459 (if available) to prevent the username/password file from touching the hard drive.
3461 The script should examine the username
3462 and password,
3463 returning a success exit code (0) if the
3464 client's authentication request is to be accepted, or a failure
3465 code (1) to reject the client.
3467 This directive is designed to enable a plugin-style interface
3468 for extending OpenVPN's authentication capabilities.
3470 To protect against a client passing a maliciously formed
3471 username or password string, the username string must
3472 consist only of these characters: alphanumeric, underbar
3473 ('_'), dash ('-'), dot ('.'), or at ('@').  The password
3474 string can consist of any printable characters except for
3475 CR or LF.  Any illegal characters in either the username
3476 or password string will be converted to underbar ('_').
3478 Care must be taken by any user-defined scripts to avoid
3479 creating a security vulnerability in the way that these
3480 strings are handled.  Never use these strings in such a way
3481 that they might be escaped or evaluated by a shell interpreter.
3483 For a sample script that performs PAM authentication, see
3484 .B sample-scripts/auth-pam.pl
3485 in the OpenVPN source distribution.
3486 .\"*********************************************************
3488 .B \-\-opt\-verify
3489 Clients that connect with options that are incompatible
3490 with those of the server will be disconnected.
3492 Options that will be compared for compatibility include
3493 dev-type, link-mtu, tun-mtu, proto, tun-ipv6, ifconfig,
3494 comp-lzo, fragment, keydir, cipher, auth, keysize, secret,
3495 no-replay, no-iv, tls-auth, key-method, tls-server, and tls-client.
3497 This option requires that
3498 .B \-\-disable\-occ
3499 NOT be used.
3500 .\"*********************************************************
3502 .B \-\-auth\-user\-pass\-optional
3503 Allow connections by clients that do not specify a username/password.
3504 Normally, when
3505 .B \-\-auth\-user\-pass\-verify
3507 .B \-\-management\-client\-auth
3508 is specified (or an authentication plugin module), the
3509 OpenVPN server daemon will require connecting clients to specify a
3510 username and password.  This option makes the submission of a username/password
3511 by clients optional, passing the responsibility to the user-defined authentication
3512 module/script to accept or deny the client based on other factors
3513 (such as the setting of X509 certificate fields).  When this option is used,
3514 and a connecting client does not submit a username/password, the user-defined
3515 authentication module/script will see the username and password as being set
3516 to empty strings ("").  The authentication module/script MUST have logic
3517 to detect this condition and respond accordingly.
3518 .\"*********************************************************
3520 .B \-\-client\-cert\-not\-required
3521 Don't require client certificate, client will authenticate
3522 using username/password only.  Be aware that using this directive
3523 is less secure than requiring certificates from all clients.
3525 If you use this directive, the
3526 entire responsibility of authentication will rest on your
3527 .B \-\-auth\-user\-pass\-verify
3528 script, so keep in mind that bugs in your script
3529 could potentially compromise the security of your VPN.
3531 If you don't use this directive, but you also specify an
3532 .B \-\-auth\-user\-pass\-verify
3533 script, then OpenVPN will perform double authentication.  The
3534 client certificate verification AND the
3535 .B \-\-auth\-user\-pass\-verify
3536 script will need to succeed in order for a client to be
3537 authenticated and accepted onto the VPN.
3538 .\"*********************************************************
3540 .B \-\-username\-as\-common\-name
3542 .B \-\-auth\-user\-pass\-verify
3543 authentication, use
3544 the authenticated username as the common name,
3545 rather than the common name from the client cert.
3546 .\"*********************************************************
3548 .B \-\-compat\-names [no\-remapping] (DEPRECATED)
3549 Until OpenVPN v2.3 the format of the X.509 Subject fields was formatted
3550 like this:
3553 /C=US/L=Somewhere/CN=John Doe/emailAddress=john@example.com
3555 In addition the old behaviour was to remap any character other than
3556 alphanumeric, underscore ('_'), dash ('-'), dot ('.'), and slash ('/') to
3557 underscore ('_').  The X.509 Subject string as returned by the
3558 .B tls_id
3559 environmental variable, could additionally contain colon (':') or equal ('=').
3561 When using the
3562 .B \-\-compat\-names
3563 option, this old formatting and remapping will be re-enabled again.  This is
3564 purely implemented for compatibility reasons when using older plug-ins or
3565 scripts which does not handle the new formatting or UTF-8 characters.
3567 In OpenVPN v2.3 the formatting of these fields changed into a more
3568 standardised format.  It now looks like:
3571 C=US, L=Somewhere, CN=John Doe, emailAddress=john@example.com
3573 The new default format in OpenVPN v2.3 also does not do the character remapping
3574 which happened earlier.  This new format enables proper support for UTF\-8
3575 characters in the usernames, X.509 Subject fields and Common Name variables and
3576 it complies to the RFC 2253, UTF\-8 String Representation of Distinguished
3577 Names.
3580 .B no\-remapping
3581 mode flag can be used with the
3583 \-\-compat\-names
3584 option to be compatible with the now deprecated \-\-no\-name\-remapping option.
3585 It is only available at the server. When this mode flag is used, the Common Name,
3586 Subject, and username strings are allowed to include any printable character
3587 including space, but excluding control characters such as tab, newline, and
3588 carriage-return. no-remapping is only available on the server side.
3590 .B Please note:
3591 This option is immediately deprecated.  It is only implemented
3592 to make the transition to the new formatting less intrusive.  It will be
3593 removed either in OpenVPN v2.4 or v2.5.  So please make sure you use the
3594 .B \-\-verify\-x509\-name
3595 option instead of
3596 .B \-\-tls\-remote
3597 as soon as possible and update your scripts where necessary.
3598 .\"*********************************************************
3600 .B \-\-no\-name\-remapping (DEPRECATED)
3602 .B \-\-no\-name\-remapping
3603 option is an alias for
3604 .B \-\-compat\-names\ no\-remapping.
3605 It ensures compatibility with server configurations using the
3606 .B \-\-no\-name\-remapping
3607 option.
3609 .B Please note:
3610 This option is now deprecated.  It will be removed either in OpenVPN v2.4
3611 or v2.5.  So please make sure you support the new X.509 name formatting
3612 described with the
3613 .B \-\-compat\-names
3614 option as soon as possible.
3615 .\"*********************************************************
3617 .B \-\-port\-share host port [dir]
3618 When run in TCP server mode, share the OpenVPN port with
3619 another application, such as an HTTPS server.  If OpenVPN
3620 senses a connection to its port which is using a non-OpenVPN
3621 protocol, it will proxy the connection to the server at
3622 .B host:port.
3623 Currently only designed to work with HTTP/HTTPS,
3624 though it would be theoretically possible to extend to
3625 other protocols such as ssh.
3627 .B dir
3628 specifies an optional directory where a temporary file with name N
3629 containing content C will be dynamically generated for each proxy
3630 connection, where N is the source IP:port of the client connection
3631 and C is the source IP:port of the connection to the proxy
3632 receiver.  This directory can be used as a dictionary by
3633 the proxy receiver to determine the origin of the connection.
3634 Each generated file will be automatically deleted when the proxied
3635 connection is torn down.
3637 Not implemented on Windows.
3638 .\"*********************************************************
3639 .SS Client Mode
3640 Use client mode when connecting to an OpenVPN server
3641 which has
3642 .B \-\-server, \-\-server\-bridge,
3644 .B \-\-mode server
3645 in it's configuration.
3646 .\"*********************************************************
3648 .B \-\-client
3649 A helper directive designed to simplify the configuration
3650 of OpenVPN's client mode.  This directive is equivalent to:
3653 .ft 3
3654 .in +4
3655  pull
3656  tls-client
3657 .in -4
3660 .\"*********************************************************
3662 .B \-\-pull
3663 This option must be used on a client which is connecting
3664 to a multi-client server.  It indicates to OpenVPN that it
3665 should accept options pushed by the server, provided they
3666 are part of the legal set of pushable options (note that the
3667 .B \-\-pull
3668 option is implied by
3669 .B \-\-client
3672 In particular,
3673 .B \-\-pull
3674 allows the server to push routes to the client, so you should
3675 not use
3676 .B \-\-pull
3678 .B \-\-client
3679 in situations where you don't trust the server to have control
3680 over the client's routing table.
3681 .\"*********************************************************
3683 .B \-\-auth\-user\-pass [up]
3684 Authenticate with server using username/password.
3685 .B up
3686 is a file containing username/password on 2 lines. If the
3687 password line is missing, OpenVPN will prompt for one.
3690 .B up
3691 is omitted, username/password will be prompted from the
3692 console.
3694 The server configuration must specify an
3695 .B \-\-auth\-user\-pass\-verify
3696 script to verify the username/password provided by
3697 the client.
3698 .\"*********************************************************
3700 .B \-\-auth\-retry type
3701 Controls how OpenVPN responds to username/password verification
3702 errors such as the client-side response to an AUTH_FAILED message from the server
3703 or verification failure of the private key password.
3705 Normally used to prevent auth errors from being fatal
3706 on the client side, and to permit username/password requeries in case
3707 of error.
3709 An AUTH_FAILED message is generated by the server if the client
3710 fails
3711 .B \-\-auth\-user\-pass
3712 authentication, or if the server-side
3713 .B \-\-client\-connect
3714 script returns an error status when the client
3715 tries to connect.
3717 .B type
3718 can be one of:
3720 .B none --
3721 Client will exit with a fatal error (this is the default).
3723 .B nointeract --
3724 Client will retry the connection without requerying for an
3725 .B \-\-auth\-user\-pass
3726 username/password.  Use this option for unattended clients.
3728 .B interact --
3729 Client will requery for an
3730 .B \-\-auth\-user\-pass
3731 username/password and/or private key password before attempting a reconnection.
3733 Note that while this option cannot be pushed, it can be controlled
3734 from the management interface.
3735 .\"*********************************************************
3737 .B \-\-static\-challenge t e
3738 Enable static challenge/response protocol using challenge text
3739 .B t,
3740 with
3741 echo flag given by
3742 .B e
3743 (0|1).
3745 The echo flag indicates whether or not the user's response
3746 to the challenge should be echoed.
3748 See management\-notes.txt in the OpenVPN distribution for a
3749 description of the OpenVPN challenge/response protocol.
3750 .\"*********************************************************
3752 .B \-\-server\-poll\-timeout n
3753 when polling possible remote servers to connect to
3754 in a round-robin fashion, spend no more than
3755 .B n
3756 seconds waiting for a response before trying the next server.
3757 As this only makes sense in client-to-server setups, it cannot
3758 be used in point-to-point setups using
3759 .B \-\-secret
3760 symmetrical key mode.
3761 .\"*********************************************************
3763 .B \-\-explicit\-exit\-notify [n]
3764 In UDP client mode or point-to-point mode, send server/peer an exit notification
3765 if tunnel is restarted or OpenVPN process is exited.  In client mode, on
3766 exit/restart, this
3767 option will tell the server to immediately close its client instance object
3768 rather than waiting for a timeout.  The
3769 .B n
3770 parameter (default=1) controls the maximum number of attempts that the client
3771 will try to resend the exit notification message.  OpenVPN will not send any exit
3772 notifications unless this option is enabled.
3773 .\"*********************************************************
3774 .SS Data Channel Encryption Options:
3775 These options are meaningful for both Static & TLS-negotiated key modes
3776 (must be compatible between peers).
3777 .\"*********************************************************
3779 .B \-\-secret file [direction]
3780 Enable Static Key encryption mode (non-TLS).
3781 Use pre-shared secret
3782 .B file
3783 which was generated with
3784 .B \-\-genkey.
3786 The optional
3787 .B direction
3788 parameter enables the use of 4 distinct keys
3789 (HMAC-send, cipher-encrypt, HMAC-receive, cipher-decrypt), so that
3790 each data flow direction has a different set of HMAC and cipher keys.
3791 This has a number of desirable security properties including
3792 eliminating certain kinds of DoS and message replay attacks.
3794 When the
3795 .B direction
3796 parameter is omitted, 2 keys are used bidirectionally, one for HMAC
3797 and the other for encryption/decryption.
3800 .B direction
3801 parameter should always be complementary on either side of the connection,
3802 i.e. one side should use "0" and the other should use "1", or both sides
3803 should omit it altogether.
3806 .B direction
3807 parameter requires that
3808 .B file
3809 contains a 2048 bit key.  While pre-1.5 versions of OpenVPN
3810 generate 1024 bit key files, any version of OpenVPN which
3811 supports the
3812 .B direction
3813 parameter, will also support 2048 bit key file generation
3814 using the
3815 .B \-\-genkey
3816 option.
3818 Static key encryption mode has certain advantages,
3819 the primary being ease of configuration.
3821 There are no certificates
3822 or certificate authorities or complicated negotiation handshakes and protocols.
3823 The only requirement is that you have a pre-existing secure channel with
3824 your peer (such as
3825 .B ssh
3826 ) to initially copy the key.  This requirement, along with the
3827 fact that your key never changes unless you manually generate a new one,
3828 makes it somewhat less secure than TLS mode (see below).  If an attacker
3829 manages to steal your key, everything that was ever encrypted with
3830 it is compromised.  Contrast that to the perfect forward secrecy features of
3831 TLS mode (using Diffie Hellman key exchange), where even if an attacker
3832 was able to steal your private key, he would gain no information to help
3833 him decrypt past sessions.
3835 Another advantageous aspect of Static Key encryption mode is that
3836 it is a handshake-free protocol 
3837 without any distinguishing signature or feature
3838 (such as a header or protocol handshake sequence) 
3839 that would mark the ciphertext packets as being
3840 generated by OpenVPN.  Anyone eavesdropping on the wire
3841 would see nothing
3842 but random-looking data.
3843 .\"*********************************************************
3845 .B \-\-key\-direction
3846 Alternative way of specifying the optional direction parameter for the
3847 .B \-\-tls\-auth
3849 .B \-\-secret
3850 options. Useful when using inline files (See section on inline files).
3851 .\"*********************************************************
3853 .B \-\-auth alg
3854 Authenticate packets with HMAC using message
3855 digest algorithm
3856 .B alg.
3857 (The default is
3858 .B SHA1
3860 HMAC is a commonly used message authentication algorithm (MAC) that uses
3861 a data string, a secure hash algorithm, and a key, to produce
3862 a digital signature.
3864 OpenVPN's usage of HMAC is to first encrypt a packet, then HMAC the resulting ciphertext.
3866 In static-key encryption mode, the HMAC key
3867 is included in the key file generated by
3868 .B \-\-genkey.
3869 In TLS mode, the HMAC key is dynamically generated and shared
3870 between peers via the TLS control channel.  If OpenVPN receives a packet with
3871 a bad HMAC it will drop the packet.
3872 HMAC usually adds 16 or 20 bytes per packet.
3874 .B alg=none
3875 to disable authentication.
3877 For more information on HMAC see
3878 .I http://www.cs.ucsd.edu/users/mihir/papers/hmac.html
3879 .\"*********************************************************
3881 .B \-\-cipher alg
3882 Encrypt data channel packets with cipher algorithm
3883 .B alg.
3884 The default is
3885 .B BF-CBC,
3886 an abbreviation for Blowfish in Cipher Block Chaining mode.
3887 Blowfish has the advantages of being fast, very secure, and allowing key sizes
3888 of up to 448 bits.  Blowfish is designed to be used in situations where
3889 keys are changed infrequently.
3891 For more information on blowfish, see
3892 .I http://www.counterpane.com/blowfish.html
3894 To see other ciphers that are available with
3895 OpenVPN, use the
3896 .B \-\-show\-ciphers
3897 option.
3899 OpenVPN supports the CBC, CFB, and OFB cipher modes,
3900 however CBC is recommended and CFB and OFB should
3901 be considered advanced modes.
3904 .B alg=none
3905 to disable encryption.
3906 .\"*********************************************************
3908 .B \-\-keysize n
3909 Size of cipher key in bits (optional).
3910 If unspecified, defaults to cipher-specific default.  The
3911 .B \-\-show\-ciphers
3912 option (see below) shows all available OpenSSL ciphers,
3913 their default key sizes, and whether the key size can
3914 be changed.  Use care in changing a cipher's default
3915 key size.  Many ciphers have not been extensively
3916 cryptanalyzed with non-standard key lengths, and a
3917 larger key may offer no real guarantee of greater
3918 security, or may even reduce security.
3919 .\"*********************************************************
3921 .B \-\-prng alg [nsl]
3922 (Advanced) For PRNG (Pseudo-random number generator),
3923 use digest algorithm
3924 .B alg
3925 (default=sha1), and set
3926 .B nsl
3927 (default=16)
3928 to the size in bytes of the nonce secret length (between 16 and 64).
3931 .B alg=none
3932 to disable the PRNG and use the OpenSSL RAND_bytes function
3933 instead for all of OpenVPN's pseudo-random number needs.
3934 .\"*********************************************************
3936 .B \-\-engine [engine-name]
3937 Enable OpenSSL hardware-based crypto engine functionality.
3940 .B engine-name
3941 is specified,
3942 use a specific crypto engine.  Use the
3943 .B \-\-show\-engines
3944 standalone option to list the crypto engines which are
3945 supported by OpenSSL.
3946 .\"*********************************************************
3948 .B \-\-no\-replay
3949 (Advanced) Disable OpenVPN's protection against replay attacks.
3950 Don't use this option unless you are prepared to make
3951 a tradeoff of greater efficiency in exchange for less
3952 security.
3954 OpenVPN provides datagram replay protection by default.
3956 Replay protection is accomplished
3957 by tagging each outgoing datagram with an identifier
3958 that is guaranteed to be unique for the key being used.
3959 The peer that receives the datagram will check for
3960 the uniqueness of the identifier.  If the identifier
3961 was already received in a previous datagram, OpenVPN
3962 will drop the packet.  Replay protection is important
3963 to defeat attacks such as a SYN flood attack, where
3964 the attacker listens in the wire, intercepts a TCP
3965 SYN packet (identifying it by the context in which
3966 it occurs in relation to other packets), then floods
3967 the receiving peer with copies of this packet.
3969 OpenVPN's replay protection is implemented in slightly
3970 different ways, depending on the key management mode
3971 you have selected.
3973 In Static Key mode
3974 or when using an CFB or OFB mode cipher, OpenVPN uses a
3975 64 bit unique identifier that combines a time stamp with
3976 an incrementing sequence number.
3978 When using TLS mode for key exchange and a CBC cipher
3979 mode, OpenVPN uses only a 32 bit sequence number without
3980 a time stamp, since OpenVPN can guarantee the uniqueness
3981 of this value for each key.  As in IPSec, if the sequence number is
3982 close to wrapping back to zero, OpenVPN will trigger
3983 a new key exchange.
3985 To check for replays, OpenVPN uses
3987 .I sliding window
3988 algorithm used
3989 by IPSec.
3990 .\"*********************************************************
3992 .B \-\-replay\-window n [t]
3993 Use a replay protection sliding-window of size
3994 .B n
3995 and a time window of
3996 .B t
3997 seconds.
3999 By default
4000 .B n
4001 is 64 (the IPSec default) and
4002 .B t
4003 is 15 seconds.
4005 This option is only relevant in UDP mode, i.e.
4006 when either
4007 .B \-\-proto udp
4008 is specifed, or no
4009 .B \-\-proto
4010 option is specified.
4012 When OpenVPN tunnels IP packets over UDP, there is the possibility that
4013 packets might be dropped or delivered out of order.  Because OpenVPN, like IPSec,
4014 is emulating the physical network layer,
4015 it will accept an out-of-order packet sequence, and
4016 will deliver such packets in the same order they were received to
4017 the TCP/IP protocol stack, provided they satisfy several constraints.
4019 .B (a)
4020 The packet cannot be a replay (unless
4021 .B \-\-no\-replay
4022 is specified, which disables replay protection altogether).
4024 .B (b)
4025 If a packet arrives out of order, it will only be accepted if the difference
4026 between its sequence number and the highest sequence number received
4027 so far is less than
4028 .B n.
4030 .B (c)
4031 If a packet arrives out of order, it will only be accepted if it arrives no later
4032 than
4033 .B t
4034 seconds after any packet containing a higher sequence number.
4036 If you are using a network link with a large pipeline (meaning that
4037 the product of bandwidth and latency is high), you may want to use
4038 a larger value for
4039 .B n.
4040 Satellite links in particular often require this.
4042 If you run OpenVPN at
4043 .B \-\-verb 4,
4044 you will see the message "Replay-window backtrack occurred [x]"
4045 every time the maximum sequence number backtrack seen thus far
4046 increases.  This can be used to calibrate
4047 .B n.
4049 There is some controversy on the appropriate method of handling packet
4050 reordering at the security layer.
4052 Namely, to what extent should the
4053 security layer protect the encapsulated protocol from attacks which masquerade
4054 as the kinds of normal packet loss and reordering that occur over IP networks?
4056 The IPSec and OpenVPN approach is to allow packet reordering within a certain
4057 fixed sequence number window.
4059 OpenVPN adds to the IPSec model by limiting the window size in time as well as
4060 sequence space.
4062 OpenVPN also adds TCP transport as an option (not offered by IPSec) in which
4063 case OpenVPN can adopt a very strict attitude towards message deletion and
4064 reordering:  Don't allow it.  Since TCP guarantees reliability, any packet
4065 loss or reordering event can be assumed to be an attack.
4067 In this sense, it could be argued that TCP tunnel transport is preferred when
4068 tunneling non-IP or UDP application protocols which might be vulnerable to a
4069 message deletion or reordering attack which falls within the normal
4070 operational parameters of IP networks.
4072 So I would make the statement that one should never tunnel a non-IP protocol
4073 or UDP application protocol over UDP, if the protocol might be vulnerable to a
4074 message deletion or reordering attack that falls within the normal operating
4075 parameters of what is to be expected from the physical IP layer.  The problem
4076 is easily fixed by simply using TCP as the VPN transport layer.
4077 .\"*********************************************************
4079 .B \-\-mute\-replay\-warnings
4080 Silence the output of replay warnings, which are a common
4081 false alarm on WiFi networks.  This option preserves
4082 the security of the replay protection code without
4083 the verbosity associated with warnings about duplicate
4084 packets.
4085 .\"*********************************************************
4087 .B \-\-replay\-persist file
4088 Persist replay-protection state across sessions using
4089 .B file
4090 to save and reload the state.
4092 This option will strengthen protection against replay attacks,
4093 especially when you are using OpenVPN in a dynamic context (such
4094 as with
4095 .B \-\-inetd)
4096 when OpenVPN sessions are frequently started and stopped. 
4098 This option will keep a disk copy of the current replay protection
4099 state (i.e. the most recent packet timestamp and sequence number
4100 received from the remote peer), so that if an OpenVPN session
4101 is stopped and restarted, it will reject any replays of packets
4102 which were already received by the prior session.
4104 This option only makes sense when replay protection is enabled
4105 (the default) and you are using either
4106 .B \-\-secret
4107 (shared-secret key mode) or TLS mode with
4108 .B \-\-tls\-auth.
4109 .\"*********************************************************
4111 .B \-\-no\-iv
4112 (Advanced) Disable OpenVPN's use of IV (cipher initialization vector).
4113 Don't use this option unless you are prepared to make
4114 a tradeoff of greater efficiency in exchange for less
4115 security.
4117 OpenVPN uses an IV by default, and requires it for CFB and
4118 OFB cipher modes (which are totally insecure without it).
4119 Using an IV is important for security when multiple
4120 messages are being encrypted/decrypted with the same key.
4122 IV is implemented differently depending on the cipher mode used.
4124 In CBC mode, OpenVPN uses a pseudo-random IV for each packet.
4126 In CFB/OFB mode, OpenVPN uses a unique sequence number and time stamp
4127 as the IV.  In fact, in CFB/OFB mode, OpenVPN uses a datagram
4128 space-saving optimization that uses the unique identifier for
4129 datagram replay protection as the IV.
4130 .\"*********************************************************
4132 .B \-\-use\-prediction\-resistance
4133 Enable prediction resistance on PolarSSL's RNG.
4135 Enabling prediction resistance causes the RNG to reseed in each
4136 call for random. Reseeding this often can quickly deplete the kernel
4137 entropy pool.
4139 If you need this option, please consider running a daemon that adds
4140 entropy to the kernel pool.
4142 Note that this option only works with PolarSSL versions greater
4143 than 1.1.
4144 .\"*********************************************************
4146 .B \-\-test\-crypto
4147 Do a self-test of OpenVPN's crypto options by encrypting and
4148 decrypting test packets using the data channel encryption options
4149 specified above.  This option does not require a peer to function,
4150 and therefore can be specified without
4151 .B \-\-dev
4153 .B \-\-remote.
4155 The typical usage of
4156 .B \-\-test\-crypto
4157 would be something like this:
4159 .B openvpn \-\-test\-crypto \-\-secret key
4163 .B openvpn \-\-test\-crypto \-\-secret key \-\-verb 9
4165 This option is very useful to test OpenVPN after it has been ported to
4166 a new platform, or to isolate problems in the compiler, OpenSSL
4167 crypto library, or OpenVPN's crypto code.  Since it is a self-test mode,
4168 problems with encryption and authentication can be debugged independently
4169 of network and tunnel issues.
4170 .\"*********************************************************
4171 .SS TLS Mode Options:
4172 TLS mode is the most powerful crypto mode of OpenVPN in both security and flexibility.
4173 TLS mode works by establishing control and
4174 data channels which are multiplexed over a single TCP/UDP port.  OpenVPN initiates
4175 a TLS session over the control channel and uses it to exchange cipher
4176 and HMAC keys to protect the data channel.  TLS mode uses a robust reliability
4177 layer over the UDP connection for all control channel communication, while
4178 the data channel, over which encrypted tunnel data passes, is forwarded without
4179 any mediation.  The result is the best of both worlds: a fast data channel
4180 that forwards over UDP with only the overhead of encrypt,
4181 decrypt, and HMAC functions,
4182 and a control channel that provides all of the security features of TLS,
4183 including certificate-based authentication and Diffie Hellman forward secrecy.
4185 To use TLS mode, each peer that runs OpenVPN should have its own local
4186 certificate/key pair (
4187 .B \-\-cert
4189 .B \-\-key
4190 ), signed by the root certificate which is specified
4192 .B \-\-ca.
4194 When two OpenVPN peers connect, each presents its local certificate to the
4195 other.  Each peer will then check that its partner peer presented a
4196 certificate which was signed by the master root certificate as specified in
4197 .B \-\-ca.
4199 If that check on both peers succeeds, then the TLS negotiation
4200 will succeed, both OpenVPN
4201 peers will exchange temporary session keys, and the tunnel will begin
4202 passing data.
4204 The OpenVPN distribution contains a set of scripts for
4205 managing RSA certificates & keys,
4206 located in the
4207 .I easy-rsa
4208 subdirectory.
4210 The easy-rsa package is also rendered in web form here:
4211 .I http://openvpn.net/easyrsa.html
4212 .\"*********************************************************
4214 .B \-\-tls\-server
4215 Enable TLS and assume server role during TLS handshake.  Note that
4216 OpenVPN is designed as a peer-to-peer application.  The designation
4217 of client or server is only for the purpose of negotiating the TLS
4218 control channel.
4219 .\"*********************************************************
4221 .B \-\-tls\-client
4222 Enable TLS and assume client role during TLS handshake.
4223 .\"*********************************************************
4225 .B \-\-ca file
4226 Certificate authority (CA) file in .pem format, also referred to as the
4227 .I root
4228 certificate.  This file can have multiple
4229 certificates in .pem format, concatenated together.  You can construct your own
4230 certificate authority certificate and private key by using a command such as:
4232 .B openssl req \-nodes \-new \-x509 \-keyout ca.key \-out ca.crt
4234 Then edit your openssl.cnf file and edit the
4235 .B certificate
4236 variable to point to your new root certificate
4237 .B ca.crt.
4239 For testing purposes only, the OpenVPN distribution includes a sample
4240 CA certificate (ca.crt).
4241 Of course you should never use
4242 the test certificates and test keys distributed with OpenVPN in a
4243 production environment, since by virtue of the fact that
4244 they are distributed with OpenVPN, they are totally insecure.
4245 .\"*********************************************************
4247 .B \-\-capath dir
4248 Directory containing trusted certificates (CAs and CRLs).
4249 Available with OpenSSL version >= 0.9.7 dev.
4250 Not available with PolarSSL.
4252 When using the
4253 .B \-\-capath
4254 option, you are required to supply valid CRLs for the CAs too.  CAs in the
4255 capath directory are expected to be named <hash>.<n>.  CRLs are expected to
4256 be named <hash>.r<n>.  See the
4257 .B -CApath
4258 option of
4259 .B openssl verify
4260 , and the
4261 .B -hash
4262 option of
4263 .B openssl x509
4265 .B openssl crl
4266 for more information.
4267 .\"*********************************************************
4269 .B \-\-dh file
4270 File containing Diffie Hellman parameters
4271 in .pem format (required for
4272 .B \-\-tls\-server
4273 only). Use
4275 .B openssl dhparam \-out dh1024.pem 1024
4277 to generate your own, or use the existing dh1024.pem file
4278 included with the OpenVPN distribution.  Diffie Hellman parameters
4279 may be considered public.
4280 .\"*********************************************************
4282 .B \-\-cert file
4283 Local peer's signed certificate in .pem format -- must be signed
4284 by a certificate authority whose certificate is in
4285 .B \-\-ca file.
4286 Each peer in an OpenVPN link running in TLS mode should have its own
4287 certificate and private key file.  In addition, each certificate should
4288 have been signed by the key of a certificate
4289 authority whose public key resides in the
4290 .B \-\-ca
4291 certificate authority file.
4292 You can easily make your own certificate authority (see above) or pay money
4293 to use a commercial service such as thawte.com (in which case you will be
4294 helping to finance the world's second space tourist :).
4295 To generate a certificate,
4296 you can use a command such as:
4298 .B openssl req \-nodes \-new \-keyout mycert.key \-out mycert.csr
4300 If your certificate authority private key lives on another machine, copy
4301 the certificate signing request (mycert.csr) to this other machine (this can
4302 be done over an insecure channel such as email).  Now sign the certificate
4303 with a command such as:
4305 .B openssl ca \-out mycert.crt \-in mycert.csr
4307 Now copy the certificate (mycert.crt)
4308 back to the peer which initially generated the .csr file (this
4309 can be over a public medium).
4310 Note that the
4311 .B openssl ca
4312 command reads the location of the certificate authority key from its
4313 configuration file such as
4314 .B /usr/share/ssl/openssl.cnf
4315 -- note also
4316 that for certificate authority functions, you must set up the files
4317 .B index.txt
4318 (may be empty) and
4319 .B serial
4320 (initialize to
4321 .B 
4324 .\"*********************************************************
4326 .B \-\-extra\-certs file
4327 Specify a
4328 .B file
4329 containing one or more PEM certs (concatenated together)
4330 that complete the
4331 local certificate chain.
4333 This option is useful for "split" CAs, where the CA for server
4334 certs is different than the CA for client certs.  Putting certs
4335 in this file allows them to be used to complete the local
4336 certificate chain without trusting them to verify the peer-submitted
4337 certificate, as would be the case if the certs were placed in the
4338 .B ca
4339 file.
4340 .\"*********************************************************
4342 .B \-\-key file
4343 Local peer's private key in .pem format.  Use the private key which was generated
4344 when you built your peer's certificate (see
4345 .B \-\-cert file
4346 above).
4347 .\"*********************************************************
4349 .B \-\-tls\-version\-min version ['or\-highest']
4350 Enable TLS version negotiation, and set the minimum
4351 TLS version we will accept from the peer (default is "1.0").
4352 Examples for version
4353 include "1.0", "1.1", or "1.2".  If 'or-highest' is specified
4354 and version is not recognized, we will only accept the highest TLS
4355 version supported by the local SSL implementation.
4357 Also see
4358 .B \-\-tls\-version\-max
4359 below, for information on compatibility.
4360 .\"*********************************************************
4362 .B \-\-tls\-version\-max version
4363 Set the maximum TLS version we will use (default is the highest version
4364 supported).  Examples for version include "1.0", "1.1", or "1.2".
4366 If and only if this is set to 1.0, and OpenSSL is used (not PolarSSL),
4367 then OpenVPN will set up OpenSSL to use a fixed TLSv1 handshake. All
4368 other configurations will autonegotiate in the given limits, and the
4369 choice of handshake versions is left to the SSL implementation.
4370 .\"*********************************************************
4372 .B \-\-pkcs12 file
4373 Specify a PKCS #12 file containing local private key,
4374 local certificate, and root CA certificate.
4375 This option can be used instead of
4376 .B \-\-ca, \-\-cert,
4378 .B \-\-key.
4379 Not available with PolarSSL.
4380 .\"*********************************************************
4382 .B \-\-verify\-hash hash
4383 Specify SHA1 fingerprint for level-1 cert.  The level-1 cert is the
4384 CA (or intermediate cert) that signs the leaf certificate, and is
4385 one removed from the leaf certificate in the direction of the root.
4386 When accepting a connection from a peer, the level-1 cert
4387 fingerprint must match
4388 .B hash
4389 or certificate verification will fail.  Hash is specified
4390 as XX:XX:...  For example: AD:B0:95:D8:09:C8:36:45:12:A9:89:C8:90:09:CB:13:72:A6:AD:16
4391 .\"*********************************************************
4393 .B \-\-pkcs11\-cert\-private [0|1]...
4394 Set if access to certificate object should be performed after login.
4395 Every provider has its own setting.
4396 .\"*********************************************************
4398 .B \-\-pkcs11\-id name
4399 Specify the serialized certificate id to be used. The id can be gotten
4400 by the standalone
4401 .B \-\-show\-pkcs11\-ids
4402 option.
4403 .\"*********************************************************
4405 .B \-\-pkcs11\-id\-management
4406 Acquire PKCS#11 id from management interface. In this case a NEED-STR 'pkcs11-id-request'
4407 real-time message will be triggered, application may use pkcs11-id-count command to
4408 retrieve available number of certificates, and pkcs11-id-get command to retrieve certificate
4409 id and certificate body.
4410 .\"*********************************************************
4412 .B \-\-pkcs11\-pin\-cache seconds
4413 Specify how many seconds the PIN can be cached, the default is until the token is removed.
4414 .\"*********************************************************
4416 .B \-\-pkcs11\-protected\-authentication [0|1]...
4417 Use PKCS#11 protected authentication path, useful for biometric and external
4418 keypad devices.
4419 Every provider has its own setting.
4420 .\"*********************************************************
4422 .B \-\-pkcs11\-providers provider...
4423 Specify a RSA Security Inc. PKCS #11 Cryptographic Token Interface (Cryptoki) providers
4424 to load.
4425 This option can be used instead of
4426 .B \-\-cert, \-\-key,
4428 .B \-\-pkcs12.
4430 If p11-kit is present on the system, its
4431 .B p11-kit-proxy.so
4432 module will be loaded by default if either the
4433 .B \-\-pkcs11\-id
4435 .B \-\-pkcs11\-id\-management
4436 options are specified without
4437 .B \-\-pkcs11\-provider
4438 being given.
4439 .\"*********************************************************
4441 .B \-\-pkcs11\-private\-mode mode...
4442 Specify which method to use in order to perform private key operations.
4443 A different mode can be specified for each provider.
4444 Mode is encoded as hex number, and can be a mask one of the following:
4446 .B 0
4447 (default) -- Try to determine automatically.
4449 .B 1
4450 -- Use sign.
4452 .B 2
4453 -- Use sign recover.
4455 .B 4
4456 -- Use decrypt.
4458 .B 8
4459 -- Use unwrap.
4461 .\"*********************************************************
4463 .B \-\-cryptoapicert select-string
4464 Load the certificate and private key from the
4465 Windows Certificate System Store (Windows/OpenSSL Only).
4467 Use this option instead of
4468 .B \-\-cert
4470 .B \-\-key.
4472 This makes
4473 it possible to use any smart card, supported by Windows, but also any
4474 kind of certificate, residing in the Cert Store, where you have access to
4475 the private key.  This option has been tested with a couple of different
4476 smart cards (GemSAFE, Cryptoflex, and Swedish Post Office eID) on the
4477 client side, and also an imported PKCS12 software certificate on the
4478 server side.
4480 To select a certificate, based on a substring search in the
4481 certificate's subject:
4483 .B cryptoapicert
4484 "SUBJ:Peter Runestig"
4486 To select a certificate, based on certificate's thumbprint:
4488 .B cryptoapicert
4489 "THUMB:f6 49 24 41 01 b4 ..."
4491 The thumbprint hex string can easily be copy-and-pasted from the Windows
4492 Certificate Store GUI.
4494 .\"*********************************************************
4496 .B \-\-key\-method m
4497 Use data channel key negotiation method
4498 .B m.
4499 The key method must match on both sides of the connection.
4501 After OpenVPN negotiates a TLS session, a new set of keys
4502 for protecting the tunnel data channel is generated and
4503 exchanged over the TLS session.
4505 In method 1 (the default for OpenVPN 1.x), both sides generate
4506 random encrypt and HMAC-send keys which are forwarded to
4507 the other host over the TLS channel.
4509 In method 2, (the default for OpenVPN 2.0)
4510 the client generates a random key.  Both client
4511 and server also generate some random seed material.  All key source
4512 material is exchanged over the TLS channel. The actual
4513 keys are generated using the TLS PRF function, taking source
4514 entropy from both client and server.  Method 2 is designed to
4515 closely parallel the key generation process used by TLS 1.0.
4517 Note that in TLS mode, two separate levels 
4518 of keying occur:
4520 (1) The TLS connection is initially negotiated, with both sides
4521 of the connection producing certificates and verifying the certificate
4522 (or other authentication info provided) of
4523 the other side.  The
4524 .B \-\-key\-method
4525 parameter has no effect on this process.
4527 (2) After the TLS connection is established, the tunnel session keys are
4528 separately negotiated over the existing secure TLS channel.  Here,
4529 .B \-\-key\-method
4530 determines the derivation of the tunnel session keys.
4531 .\"*********************************************************
4533 .B \-\-tls\-cipher l
4534 A list
4535 .B l
4536 of allowable TLS ciphers delimited by a colon (":").
4538 This setting can be used to ensure that certain cipher suites are used (or
4539 not used) for the TLS connection.  OpenVPN uses TLS to secure the control
4540 channel, over which the keys that are used to protect the actual VPN traffic
4541 are exchanged.
4543 The supplied list of ciphers is (after potential OpenSSL/IANA name translation)
4544 simply supplied to the crypto library.  Please see the OpenSSL and/or PolarSSL
4545 documentation for details on the cipher list interpretation.
4548 .B \-\-show\-tls
4549 to see a list of TLS ciphers supported by your crypto library.
4551 Warning!
4552 .B \-\-tls\-cipher
4553 is an expert feature, which - if used correcly - can improve the security of
4554 your VPN connection.  But it is also easy to unwittingly use it to carefully
4555 align a gun with your foot, or just break your connection.  Use with care!
4557 The default for --tls-cipher is to use PolarSSL's default cipher list
4558 when using PolarSSL or "DEFAULT:!EXP:!PSK:!SRP:!kRSA" when using OpenSSL.
4559 .\"*********************************************************
4561 .B \-\-tls\-timeout n
4562 Packet retransmit timeout on TLS control channel
4563 if no acknowledgment from remote within
4564 .B n
4565 seconds (default=2).  When OpenVPN sends a control
4566 packet to its peer, it will expect to receive an
4567 acknowledgement within
4568 .B n
4569 seconds or it will retransmit the packet, subject
4570 to a TCP-like exponential backoff algorithm.  This parameter
4571 only applies to control channel packets.  Data channel
4572 packets (which carry encrypted tunnel data) are never
4573 acknowledged, sequenced, or retransmitted by OpenVPN because
4574 the higher level network protocols running on top of the tunnel
4575 such as TCP expect this role to be left to them.
4576 .\"*********************************************************
4578 .B \-\-reneg\-bytes n
4579 Renegotiate data channel key after
4580 .B n
4581 bytes sent or received (disabled by default).
4582 OpenVPN allows the lifetime of a key
4583 to be expressed as a number of bytes encrypted/decrypted, a number of packets, or
4584 a number of seconds.  A key renegotiation will be forced
4585 if any of these three criteria are met by either peer.
4586 .\"*********************************************************
4588 .B \-\-reneg\-pkts n
4589 Renegotiate data channel key after
4590 .B n
4591 packets sent and received (disabled by default).
4592 .\"*********************************************************
4594 .B \-\-reneg\-sec n
4595 Renegotiate data channel key after
4596 .B n
4597 seconds (default=3600).
4599 When using dual-factor authentication, note that this default value may
4600 cause the end user to be challenged to reauthorize once per hour.
4602 Also, keep in mind that this option can be used on both the client and server,
4603 and whichever uses the lower value will be the one to trigger the renegotiation.
4604 A common mistake is to set
4605 .B \-\-reneg\-sec
4606 to a higher value on either the client or server, while the other side of the connection
4607 is still using the default value of 3600 seconds, meaning that the renegotiation will
4608 still occur once per 3600 seconds.  The solution is to increase \-\-reneg\-sec on both the
4609 client and server, or set it to 0 on one side of the connection (to disable), and to
4610 your chosen value on the other side.
4611 .\"*********************************************************
4613 .B \-\-hand\-window n
4614 Handshake Window -- the TLS-based key exchange must finalize within
4615 .B n
4616 seconds
4617 of handshake initiation by any peer (default = 60 seconds).
4618 If the handshake fails
4619 we will attempt to reset our connection with our peer and try again.
4620 Even in the event of handshake failure we will still use
4621 our expiring key for up to
4622 .B \-\-tran\-window
4623 seconds to maintain continuity of transmission of tunnel
4624 data.
4625 .\"*********************************************************
4627 .B \-\-tran\-window n
4628 Transition window -- our old key can live this many seconds
4629 after a new a key renegotiation begins (default = 3600 seconds).
4630 This feature allows for a graceful transition from old to new
4631 key, and removes the key renegotiation sequence from the critical
4632 path of tunnel data forwarding.
4633 .\"*********************************************************
4635 .B \-\-single\-session
4636 After initially connecting to a remote peer, disallow any new connections.
4637 Using this
4638 option means that a remote peer cannot connect, disconnect, and then
4639 reconnect.
4641 If the daemon is reset by a signal or
4642 .B \-\-ping\-restart,
4643 it will allow one new connection.
4645 .B \-\-single\-session
4646 can be used with
4647 .B \-\-ping\-exit
4649 .B \-\-inactive
4650 to create a single dynamic session that will exit when finished.
4651 .\"*********************************************************
4653 .B \-\-tls\-exit
4654 Exit on TLS negotiation failure.
4655 .\"*********************************************************
4657 .B \-\-tls\-auth file [direction]
4658 Add an additional layer of HMAC authentication on top of the TLS
4659 control channel to protect against DoS attacks.
4661 In a nutshell,
4662 .B \-\-tls\-auth
4663 enables a kind of "HMAC firewall" on OpenVPN's TCP/UDP port,
4664 where TLS control channel packets
4665 bearing an incorrect HMAC signature can be dropped immediately without
4666 response.
4668 .B file
4669 (required) is a key file which can be in one of two formats:
4671 .B (1)
4672 An OpenVPN static key file generated by
4673 .B \-\-genkey
4674 (required if
4675 .B direction
4676 parameter is used).
4678 .B (2) DEPRECATED
4679 A freeform passphrase file.  In this case the HMAC key will
4680 be derived by taking a secure hash of this file, similar to
4682 .BR md5sum (1)
4684 .BR sha1sum (1)
4685 commands. This option is deprecated and will stop working in OpenVPN 2.4 and
4686 newer releases.
4688 OpenVPN will first try format (1), and if the file fails to parse as
4689 a static key file, format (2) will be used.
4691 See the
4692 .B \-\-secret
4693 option for more information on the optional
4694 .B direction
4695 parameter.
4697 .B \-\-tls\-auth
4698 is recommended when you are running OpenVPN in a mode where
4699 it is listening for packets from any IP address, such as when
4700 .B \-\-remote
4701 is not specified, or
4702 .B \-\-remote
4703 is specified with
4704 .B \-\-float.
4706 The rationale for
4707 this feature is as follows.  TLS requires a multi-packet exchange
4708 before it is able to authenticate a peer.  During this time
4709 before authentication, OpenVPN is allocating resources (memory
4710 and CPU) to this potential peer.  The potential peer is also
4711 exposing many parts of OpenVPN and the OpenSSL library to the packets
4712 it is sending.  Most successful network attacks today seek
4713 to either exploit bugs in programs (such as buffer overflow attacks) or
4714 force a program to consume so many resources that it becomes unusable.
4715 Of course the first line of defense is always to produce clean,
4716 well-audited code.  OpenVPN has been written with buffer overflow
4717 attack prevention as a top priority.
4718 But as history has shown, many of the most widely used
4719 network applications have, from time to time,
4720 fallen to buffer overflow attacks.
4722 So as a second line of defense, OpenVPN offers
4723 this special layer of authentication on top of the TLS control channel so that
4724 every packet on the control channel is authenticated by an
4725 HMAC signature and a unique ID for replay protection.
4726 This signature will also help protect against DoS (Denial of Service) attacks.
4727 An important rule of thumb in reducing vulnerability to DoS attacks is to
4728 minimize the amount of resources a potential, but as yet unauthenticated,
4729 client is able to consume.
4731 .B \-\-tls\-auth
4732 does this by signing every TLS control channel packet with an HMAC signature,
4733 including packets which are sent before the TLS level has had a chance
4734 to authenticate the peer.
4735 The result is that packets without
4736 the correct signature can be dropped immediately upon reception,
4737 before they have a chance to consume additional system resources
4738 such as by initiating a TLS handshake.
4739 .B \-\-tls\-auth
4740 can be strengthened by adding the
4741 .B \-\-replay\-persist
4742 option which will keep OpenVPN's replay protection state
4743 in a file so that it is not lost across restarts.
4745 It should be emphasized that this feature is optional and that the
4746 passphrase/key file used with
4747 .B \-\-tls\-auth
4748 gives a peer nothing more than the power to initiate a TLS
4749 handshake.  It is not used to encrypt or authenticate any tunnel data.
4750 .\"*********************************************************
4752 .B \-\-askpass [file]
4753 Get certificate password from console or
4754 .B file
4755 before we daemonize.
4757 For the extremely
4758 security conscious, it is possible to protect your private key with
4759 a password.  Of course this means that every time the OpenVPN
4760 daemon is started you must be there to type the password.  The
4761 .B \-\-askpass
4762 option allows you to start OpenVPN from the command line.  It will
4763 query you for a password before it daemonizes.  To protect a private
4764 key with a password you should omit the
4765 .B \-nodes
4766 option when you use the
4767 .B openssl
4768 command line tool to manage certificates and private keys.
4771 .B file
4772 is specified, read the password from the first line of
4773 .B file.
4774 Keep in mind that storing your password in a file
4775 to a certain extent invalidates the extra security provided by
4776 using an encrypted key.
4777 .\"*********************************************************
4779 .B \-\-auth\-nocache
4780 Don't cache
4781 .B \-\-askpass
4783 .B \-\-auth\-user\-pass
4784 username/passwords in virtual memory.
4786 If specified, this directive will cause OpenVPN to immediately
4787 forget username/password inputs after they are used.  As a result,
4788 when OpenVPN needs a username/password, it will prompt for input
4789 from stdin, which may be multiple times during the duration of an
4790 OpenVPN session.
4792 When using \-\-auth\-nocache in combination with a user/password file
4793 and \-\-chroot or \-\-daemon, make sure to use an absolute path.
4795 This directive does not affect the
4796 .B \-\-http\-proxy
4797 username/password.  It is always cached.
4798 .\"*********************************************************
4800 .B \-\-tls\-verify cmd
4801 Run command
4802 .B cmd
4803 to verify the X509 name of a
4804 pending TLS connection that has otherwise passed all other
4805 tests of certification (except for revocation via
4806 .B \-\-crl\-verify
4807 directive; the revocation test occurs after the
4808 .B \-\-tls\-verify
4809 test).
4811 .B cmd
4812 should return 0 to allow the TLS handshake to proceed, or 1 to fail.
4814 .B cmd
4815 consists of a path to script (or executable program), optionally
4816 followed by arguments. The path and arguments may be single- or double-quoted
4817 and/or escaped using a backslash, and should be separated by one or more spaces.
4819 When
4820 .B cmd
4821 is executed two arguments are appended after any arguments specified in
4822 .B cmd
4823 , as follows:
4825 .B cmd certificate_depth subject
4827 These arguments are, respectively, the current certificate depth and
4828 the X509 common name (cn) of the peer.
4830 This feature is useful if the peer you want to trust has a certificate
4831 which was signed by a certificate authority who also signed many
4832 other certificates, where you don't necessarily want to trust all of them,
4833 but rather be selective about which
4834 peer certificate you will accept.  This feature allows you to write a script
4835 which will test the X509 name on a certificate and decide whether or
4836 not it should be accepted.  For a simple perl script which will test
4837 the common name field on the certificate, see the file
4838 .B verify-cn
4839 in the OpenVPN distribution.
4841 See the "Environmental Variables" section below for
4842 additional parameters passed as environmental variables.
4843 .\"*********************************************************
4845 .B \-\-tls\-export\-cert directory
4846 Store the certificates the clients uses upon connection to this
4847 directory. This will be done before \-\-tls\-verify is called.  The
4848 certificates will use a temporary name and will be deleted when
4849 the tls-verify script returns.  The file name used for the certificate
4850 is available via the peer_cert environment variable.
4851 .\"*********************************************************
4853 .B \-\-x509\-username\-field [ext:\]fieldname
4854 Field in the X.509 certificate subject to be used as the username (default=CN).
4855 Typically, this option is specified with
4856 .B fieldname
4857 as either of the following:
4859 .B \-\-x509\-username\-field
4860 emailAddress
4862 .B \-\-x509\-username\-field ext:\fRsubjectAltName
4864 The first example uses the value of the "emailAddress" attribute in the
4865 certificate's Subject field as the username.  The second example uses
4867 .B ext:
4868 prefix to signify that the X.509 extension
4869 .B fieldname
4870 "subjectAltName" be searched for an rfc822Name (email) field to be used
4871 as the username.  In cases where there are multiple email addresses
4873 .B ext:fieldname\fR,
4874 the last occurrence is chosen.
4876 When this option is used, the
4877 .B \-\-verify\-x509\-name
4878 option will match against the chosen
4879 .B fieldname
4880 instead of the Common Name.
4882 .B Please note:
4883 This option has a feature which will convert an all-lowercase
4884 .B fieldname
4885 to uppercase characters, e.g., ou -> OU.  A mixed-case
4886 .B fieldname
4887 or one having the
4888 .B ext:
4889 prefix will be left as-is.  This automatic upcasing feature
4890 is deprecated and will be removed in a future release.
4891 .\"*********************************************************
4893 .B \-\-tls\-remote name (DEPRECATED)
4894 Accept connections only from a host with X509 name
4895 or common name equal to
4896 .B name.
4897 The remote host must also pass all other tests
4898 of verification.
4900 .B NOTE:
4901 Because tls-remote may test against a common name prefix,
4902 only use this option when you are using OpenVPN with a custom CA
4903 certificate that is under your control.
4904 Never use this option when your client certificates are signed by
4905 a third party, such as a commercial web CA.
4907 Name can also be a common name prefix, for example if you
4908 want a client to only accept connections to "Server-1",
4909 "Server-2", etc., you can simply use
4910 .B \-\-tls\-remote Server
4912 Using a common name prefix is a useful alternative to managing
4913 a CRL (Certificate Revocation List) on the client, since it allows the client
4914 to refuse all certificates except for those associated
4915 with designated servers.
4917 .B \-\-tls\-remote
4918 is a useful replacement for the
4919 .B \-\-tls\-verify
4920 option to verify the remote host, because
4921 .B \-\-tls\-remote
4922 works in a
4923 .B \-\-chroot
4924 environment too.
4926 .B Please also note:
4927 This option is now deprecated.  It will be removed either in OpenVPN v2.4
4928 or v2.5.  So please make sure you support the new X.509 name formatting
4929 described with the
4930 .B \-\-compat\-names
4931 option as soon as possible by updating your configurations to use
4932 .B \-\-verify\-x509\-name
4933 instead.
4934 .\"*********************************************************
4936 .B \-\-verify\-x509\-name name type
4937 Accept connections only if a host's X.509 name is equal to
4938 .B name.
4939 The remote host must also pass all other tests of verification.
4941 Which X.509 name is compared to
4942 .B name
4943 depends on the setting of type.
4944 .B type
4945 can be "subject" to match the complete subject DN (default),
4946 "name" to match a subject RDN or "name-prefix" to match a subject RDN prefix.
4947 Which RDN is verified as name depends on the
4948 .B \-\-x509\-username\-field
4949 option. But it defaults to the common name (CN), e.g. a certificate with a
4950 subject DN "C=KG, ST=NA, L=Bishkek, CN=Server-1" would be matched by:
4952 .B \-\-verify\-x509\-name 'C=KG, ST=NA, L=Bishkek, CN=Server-1'
4954 .B \-\-verify\-x509\-name Server-1 name
4955 or you could use
4956 .B \-\-verify\-x509\-name Server- name-prefix
4957 if you want a client to only accept connections to "Server-1", "Server-2", etc.
4959 .B \-\-verify\-x509\-name
4960 is a useful replacement for the
4961 .B \-\-tls\-verify
4962 option to verify the remote host, because
4963 .B \-\-verify\-x509\-name
4964 works in a
4965 .B \-\-chroot
4966 environment without any dependencies.
4968 Using a name prefix is a useful alternative to managing
4969 a CRL (Certificate Revocation List) on the client, since it allows the client
4970 to refuse all certificates except for those associated
4971 with designated servers.
4973 .B NOTE:
4974 Test against a name prefix only when you are using OpenVPN with
4975 a custom CA certificate that is under your control.
4976 Never use this option with type "name-prefix" when your client certificates
4977 are signed by a third party, such as a commercial web CA.
4978 .\"*********************************************************
4980 .B \-\-x509\-track attribute
4981 Save peer X509
4982 .B attribute
4983 value in environment for use by plugins and management interface.
4984 Prepend a '+' to
4985 .B attribute
4986 to save values from full cert chain.  Values will be encoded
4987 as X509_<depth>_<attribute>=<value>.  Multiple
4988 .B \-\-x509\-track
4989 options can be defined to track multiple attributes.
4990 Not available with PolarSSL.
4991 .\"*********************************************************
4993 .B \-\-ns\-cert\-type client|server
4994 Require that peer certificate was signed with an explicit
4995 .B nsCertType
4996 designation of "client" or "server".
4998 This is a useful security option for clients, to ensure that
4999 the host they connect with is a designated server.
5001 See the easy-rsa/build-key-server script for an example
5002 of how to generate a certificate with the
5003 .B nsCertType
5004 field set to "server".
5006 If the server certificate's nsCertType field is set
5007 to "server", then the clients can verify this with
5008 .B \-\-ns\-cert\-type server.
5010 This is an important security precaution to protect against
5011 a man-in-the-middle attack where an authorized client
5012 attempts to connect to another client by impersonating the server.
5013 The attack is easily prevented by having clients verify
5014 the server certificate using any one of
5015 .B \-\-ns\-cert\-type, \-\-verify\-x509\-name,
5017 .B \-\-tls\-verify.
5018 .\"*********************************************************
5020 .B \-\-remote\-cert\-ku v...
5021 Require that peer certificate was signed with an explicit
5022 .B key usage.
5024 This is a useful security option for clients, to ensure that
5025 the host they connect to is a designated server.
5027 The key usage should be encoded in hex, more than one key
5028 usage can be specified.
5029 .\"*********************************************************
5031 .B \-\-remote\-cert\-eku oid
5032 Require that peer certificate was signed with an explicit
5033 .B extended key usage.
5035 This is a useful security option for clients, to ensure that
5036 the host they connect to is a designated server.
5038 The extended key usage should be encoded in oid notation, or
5039 OpenSSL symbolic representation.
5040 .\"*********************************************************
5042 .B \-\-remote\-cert\-tls client|server
5043 Require that peer certificate was signed with an explicit
5044 .B key usage
5046 .B extended key usage
5047 based on RFC3280 TLS rules.
5049 This is a useful security option for clients, to ensure that
5050 the host they connect to is a designated server.
5053 .B \-\-remote\-cert\-tls client
5054 option is equivalent to
5056 \-\-remote\-cert\-ku 80 08 88 \-\-remote\-cert\-eku "TLS Web Client Authentication"
5058 The key usage is digitalSignature and/or keyAgreement.
5061 .B \-\-remote\-cert\-tls server
5062 option is equivalent to
5064 \-\-remote\-cert\-ku a0 88 \-\-remote\-cert\-eku "TLS Web Server Authentication"
5066 The key usage is digitalSignature and ( keyEncipherment or keyAgreement ).
5068 This is an important security precaution to protect against
5069 a man-in-the-middle attack where an authorized client
5070 attempts to connect to another client by impersonating the server.
5071 The attack is easily prevented by having clients verify
5072 the server certificate using any one of
5073 .B \-\-remote\-cert\-tls, \-\-verify\-x509\-name,
5075 .B \-\-tls\-verify.
5076 .\"*********************************************************
5078 .B \-\-crl\-verify crl ['dir']
5079 Check peer certificate against the file
5080 .B crl
5081 in PEM format.
5083 A CRL (certificate revocation list) is used when a particular key is
5084 compromised but when the overall PKI is still intact.
5086 Suppose you had a PKI consisting of a CA, root certificate, and a number of
5087 client certificates.  Suppose a laptop computer containing a client key and
5088 certificate was stolen.  By adding the stolen certificate to the CRL file,
5089 you could reject any connection which attempts to use it, while preserving the
5090 overall integrity of the PKI.
5092 The only time when it would be necessary to rebuild the entire PKI from scratch would be
5093 if the root certificate key itself was compromised.
5095 If the optional
5096 .B dir
5097 flag is specified, enable a different mode where
5098 .B crl
5099 is a directory containing files named as revoked serial numbers
5100 (the files may be empty, the contents are never read).  If a client
5101 requests a connection, where the client certificate serial number
5102 (decimal string) is the name of a file present in the directory,
5103 it will be rejected.
5105 Note: As the crl file (or directory) is read every time a peer connects,
5106 if you are dropping root privileges with
5107 .B \-\-user,
5108 make sure that this user has sufficient privileges to read the file.
5109 .\"*********************************************************
5110 .SS SSL Library information:
5111 .\"*********************************************************
5113 .B \-\-show\-ciphers
5114 (Standalone)
5115 Show all cipher algorithms to use with the
5116 .B \-\-cipher
5117 option.
5118 .\"*********************************************************
5120 .B \-\-show\-digests
5121 (Standalone)
5122 Show all message digest algorithms to use with the
5123 .B \-\-auth
5124 option.
5125 .\"*********************************************************
5127 .B \-\-show\-tls
5128 (Standalone)
5129 Show all TLS ciphers supported by the crypto library.  OpenVPN uses TLS to
5130 secure the control channel, over which the keys that are used to protect the
5131 actual VPN traffic are exchanged.  The TLS ciphers will be sorted from highest
5132 preference (most secure) to lowest.
5134 Be aware that whether a cipher suite in this list can actually work depends on
5135 the specific setup of both peers (e.g. both peers must support the cipher, and
5136 an ECDSA cipher suite will not work if you are using an RSA certificate, etc.).
5137 .\"*********************************************************
5139 .B \-\-show\-engines
5140 (Standalone)
5141 Show currently available hardware-based crypto acceleration
5142 engines supported by the OpenSSL library.
5143 .\"*********************************************************
5144 .SS Generate a random key:
5145 Used only for non-TLS static key encryption mode.
5146 .\"*********************************************************
5148 .B \-\-genkey
5149 (Standalone)
5150 Generate a random key to be used as a shared secret,
5151 for use with the
5152 .B \-\-secret
5153 option.  This file must be shared with the
5154 peer over a pre-existing secure channel such as
5155 .BR scp (1)
5157 .\"*********************************************************
5159 .B \-\-secret file
5160 Write key to
5161 .B file.
5162 .\"*********************************************************
5163 .SS TUN/TAP persistent tunnel config mode:
5164 Available with linux 2.4.7+.  These options comprise a standalone mode
5165 of OpenVPN which can be used to create and delete persistent tunnels.
5166 .\"*********************************************************
5168 .B \-\-mktun
5169 (Standalone)
5170 Create a persistent tunnel on platforms which support them such
5171 as Linux.  Normally TUN/TAP tunnels exist only for
5172 the period of time that an application has them open.  This option
5173 takes advantage of the TUN/TAP driver's ability to build persistent
5174 tunnels that live through multiple instantiations of OpenVPN and die
5175 only when they are deleted or the machine is rebooted.
5177 One of the advantages of persistent tunnels is that they eliminate the
5178 need for separate
5179 .B \-\-up
5181 .B \-\-down
5182 scripts to run the appropriate
5183 .BR ifconfig (8)
5185 .BR route (8)
5186 commands.  These commands can be placed in the the same shell script
5187 which starts or terminates an OpenVPN session.
5189 Another advantage is that open connections through the TUN/TAP-based tunnel
5190 will not be reset if the OpenVPN peer restarts.  This can be useful to
5191 provide uninterrupted connectivity through the tunnel in the event of a DHCP
5192 reset of the peer's public IP address (see the
5193 .B \-\-ipchange
5194 option above).
5196 One disadvantage of persistent tunnels is that it is harder to automatically
5197 configure their MTU value (see
5198 .B \-\-link\-mtu
5200 .B \-\-tun\-mtu
5201 above).
5203 On some platforms such as Windows, TAP-Win32 tunnels are persistent by
5204 default.
5205 .\"*********************************************************
5207 .B \-\-rmtun
5208 (Standalone)
5209 Remove a persistent tunnel.
5210 .\"*********************************************************
5212 .B \-\-dev tunX | tapX
5213 TUN/TAP device
5214 .\"*********************************************************
5216 .B \-\-user user
5217 Optional user to be owner of this tunnel.
5218 .\"*********************************************************
5220 .B \-\-group group
5221 Optional group to be owner of this tunnel.
5222 .\"*********************************************************
5223 .SS Windows-Specific Options:
5224 .\"*********************************************************
5226 .B \-\-win\-sys path
5227 Set the Windows system directory pathname to use when looking for system
5228 executables such as
5229 .B route.exe
5231 .B netsh.exe.
5232 By default, if this directive is
5233 not specified, OpenVPN will use the SystemRoot environment variable.
5235 This option have changed behaviour in OpenVPN 2.3.  Earlier you had to
5236 define
5237 .B \-\-win\-sys env
5238 to use the SystemRoot environment variable, otherwise it defaulted to C:\\WINDOWS.
5239 It is not needed to use the
5240 .B env
5241 keyword any more, and it will just be ignored. A warning is logged when this
5242 is found in the configuration file.
5243 .\"*********************************************************
5245 .B \-\-ip\-win32 method
5246 When using
5247 .B \-\-ifconfig
5248 on Windows, set the TAP-Win32 adapter
5249 IP address and netmask using
5250 .B method.
5251 Don't use this option unless you are also using
5252 .B \-\-ifconfig.
5254 .B manual --
5255 Don't set the IP address or netmask automatically.
5256 Instead output a message
5257 to the console telling the user to configure the
5258 adapter manually and indicating the IP/netmask which
5259 OpenVPN expects the adapter to be set to.
5261 .B dynamic [offset] [lease-time] --
5262 Automatically set the IP address and netmask by replying to
5263 DHCP query messages generated by the kernel.  This mode is
5264 probably the "cleanest" solution
5265 for setting the TCP/IP properties since it uses the well-known
5266 DHCP protocol.  There are, however, two prerequisites for using
5267 this mode: (1) The TCP/IP properties for the TAP-Win32
5268 adapter must be set to "Obtain an IP address automatically," and
5269 (2) OpenVPN needs to claim an IP address in the subnet for use
5270 as the virtual DHCP server address.  By default in
5271 .B \-\-dev tap
5272 mode, OpenVPN will
5273 take the normally unused first address in the subnet.  For example,
5274 if your subnet is 192.168.4.0 netmask 255.255.255.0, then
5275 OpenVPN will take the IP address 192.168.4.0 to use as the
5276 virtual DHCP server address.  In
5277 .B \-\-dev tun
5278 mode, OpenVPN will cause the DHCP server to masquerade as if it were
5279 coming from the remote endpoint.  The optional offset parameter is
5280 an integer which is > -256 and < 256 and which defaults to 0.
5281 If offset is positive, the DHCP server will masquerade as the IP
5282 address at network address + offset.
5283 If offset is negative, the DHCP server will masquerade as the IP
5284 address at broadcast address + offset.  The Windows
5285 .B ipconfig /all
5286 command can be used to show what Windows thinks the DHCP server
5287 address is.  OpenVPN will "claim" this address, so make sure to
5288 use a free address.  Having said that, different OpenVPN instantiations,
5289 including different ends of the same connection, can share the same
5290 virtual DHCP server address.  The
5291 .B lease-time
5292 parameter controls the lease time of the DHCP assignment given to
5293 the TAP-Win32 adapter, and is denoted in seconds.
5294 Normally a very long lease time is preferred
5295 because it prevents routes involving the TAP-Win32 adapter from
5296 being lost when the system goes to sleep.  The default
5297 lease time is one year.
5299 .B netsh --
5300 Automatically set the IP address and netmask using
5301 the Windows command-line "netsh"
5302 command.  This method appears to work correctly on
5303 Windows XP but not Windows 2000.
5305 .B ipapi --
5306 Automatically set the IP address and netmask using the
5307 Windows IP Helper API.  This approach
5308 does not have ideal semantics, though testing has indicated
5309 that it works okay in practice.  If you use this option,
5310 it is best to leave the TCP/IP properties for the TAP-Win32
5311 adapter in their default state, i.e. "Obtain an IP address
5312 automatically."
5314 .B adaptive --
5315 (Default) Try
5316 .B dynamic
5317 method initially and fail over to
5318 .B netsh
5319 if the DHCP negotiation with the TAP-Win32 adapter does
5320 not succeed in 20 seconds.  Such failures have been known
5321 to occur when certain third-party firewall packages installed
5322 on the client machine block the DHCP negotiation used by
5323 the TAP-Win32 adapter.
5324 Note that if the
5325 .B netsh
5326 failover occurs, the TAP-Win32 adapter
5327 TCP/IP properties will be reset from DHCP to static, and this
5328 will cause future OpenVPN startups using the
5329 .B adaptive
5330 mode to use
5331 .B netsh
5332 immediately, rather than trying
5333 .B dynamic
5334 first.  To "unstick" the
5335 .B adaptive
5336 mode from using
5337 .B netsh,
5338 run OpenVPN at least once using the
5339 .B dynamic
5340 mode to restore the TAP-Win32 adapter TCP/IP properties
5341 to a DHCP configuration.
5342 .\"*********************************************************
5344 .B \-\-route\-method m
5345 Which method
5346 .B m
5347 to use for adding routes on Windows?
5349 .B adaptive
5350 (default) -- Try IP helper API first.  If that fails, fall
5351 back to the route.exe shell command.
5353 .B ipapi
5354 -- Use IP helper API.
5356 .B exe
5357 -- Call the route.exe shell command.
5358 .\"*********************************************************
5360 .B \-\-dhcp\-option type [parm]
5361 Set extended TAP-Win32 TCP/IP properties, must
5362 be used with
5363 .B \-\-ip\-win32 dynamic
5365 .B \-\-ip\-win32 adaptive.
5366 This option can be used to set additional TCP/IP properties
5367 on the TAP-Win32 adapter, and is particularly useful for
5368 configuring an OpenVPN client to access a Samba server
5369 across the VPN.
5371 .B DOMAIN name --
5372 Set Connection-specific DNS Suffix.
5374 .B DNS addr --
5375 Set primary domain name server address.  Repeat
5376 this option to set secondary DNS server addresses.
5378 .B WINS addr --
5379 Set primary WINS server address (NetBIOS over TCP/IP Name Server).
5380 Repeat this option to set secondary WINS server addresses.
5382 .B NBDD addr --
5383 Set primary NBDD server address (NetBIOS over TCP/IP Datagram Distribution Server)
5384 Repeat this option
5385 to set secondary NBDD server addresses.
5387 .B NTP addr --
5388 Set primary NTP server address (Network Time Protocol).
5389 Repeat this option
5390 to set secondary NTP server addresses.
5392 .B NBT type --
5393 Set NetBIOS over TCP/IP Node type.  Possible options:
5394 .B 1
5395 = b-node (broadcasts),
5396 .B 2
5397 = p-node (point-to-point
5398 name queries to a WINS server),
5399 .B 4
5400 = m-node (broadcast
5401 then query name server), and
5402 .B 8
5403 = h-node (query name server, then broadcast).
5405 .B NBS scope-id --
5406 Set NetBIOS over TCP/IP Scope. A NetBIOS Scope ID provides an extended
5407 naming service for the NetBIOS over TCP/IP (Known as NBT) module. The
5408 primary purpose of a NetBIOS scope ID is to isolate NetBIOS traffic on
5409 a single network to only those nodes with the same NetBIOS scope ID.
5410 The NetBIOS scope ID is a character string that is appended to the NetBIOS
5411 name. The NetBIOS scope ID on two hosts must match, or the two hosts
5412 will not be able to communicate. The NetBIOS Scope ID also allows
5413 computers to use the same computer name, as they have different
5414 scope IDs. The Scope ID becomes a part of the NetBIOS name, making the name unique.
5415 (This description of NetBIOS scopes courtesy of NeonSurge@abyss.com)
5417 .B DISABLE-NBT --
5418 Disable Netbios-over-TCP/IP.
5420 Note that if
5421 .B \-\-dhcp\-option
5422 is pushed via
5423 .B \-\-push
5424 to a non-windows client, the option will be saved in the client's
5425 environment before the up script is called, under
5426 the name "foreign_option_{n}".
5427 .\"*********************************************************
5429 .B \-\-tap\-sleep n
5430 Cause OpenVPN to sleep for
5431 .B n
5432 seconds immediately after the TAP-Win32 adapter state
5433 is set to "connected".
5435 This option is intended to be used to troubleshoot problems
5436 with the
5437 .B \-\-ifconfig
5439 .B \-\-ip\-win32
5440 options, and is used to give
5441 the TAP-Win32 adapter time to come up before
5442 Windows IP Helper API operations are applied to it.
5443 .\"*********************************************************
5445 .B \-\-show\-net\-up
5446 Output OpenVPN's view of the system routing table and network
5447 adapter list to the syslog or log file after the TUN/TAP adapter
5448 has been brought up and any routes have been added.
5449 .\"*********************************************************
5451 .B \-\-block\-outside\-dns
5452 Block DNS servers on other network adapters to prevent
5453 DNS leaks. This option prevents any application from accessing
5454 TCP or UDP port 53 except one inside the tunnel. It uses
5455 Windows Filtering Platform (WFP) and works on Windows Vista or
5456 later.
5457 .\"*********************************************************
5459 .B \-\-dhcp\-renew
5460 Ask Windows to renew the TAP adapter lease on startup.
5461 This option is normally unnecessary, as Windows automatically
5462 triggers a DHCP renegotiation on the TAP adapter when it
5463 comes up, however if you set the TAP-Win32 adapter
5464 Media Status property to "Always Connected", you may need this
5465 flag.
5466 .\"*********************************************************
5468 .B \-\-dhcp\-release
5469 Ask Windows to release the TAP adapter lease on shutdown.
5470 This option has the same caveats as
5471 .B \-\-dhcp\-renew
5472 above.
5473 .\"*********************************************************
5475 .B \-\-register\-dns
5476 Run net stop dnscache, net start dnscache, ipconfig /flushdns
5477 and ipconfig /registerdns on connection initiation.
5478 This is known to kick Windows into
5479 recognizing pushed DNS servers.
5480 .\"*********************************************************
5482 .B \-\-pause\-exit
5483 Put up a "press any key to continue" message on the console prior
5484 to OpenVPN program exit.  This option is automatically used by the
5485 Windows explorer when OpenVPN is run on a configuration
5486 file using the right-click explorer menu.
5487 .\"*********************************************************
5489 .B \-\-service exit\-event [0|1]
5490 Should be used when OpenVPN is being automatically executed by another
5491 program in such
5492 a context that no interaction with the user via display or keyboard
5493 is possible.  In general, end-users should never need to explicitly
5494 use this option, as it is automatically added by the OpenVPN service wrapper
5495 when a given OpenVPN configuration is being run as a service.
5497 .B exit-event
5498 is the name of a Windows global event object, and OpenVPN will continuously
5499 monitor the state of this event object and exit when it becomes signaled.
5501 The second parameter indicates the initial state of
5502 .B exit-event
5503 and normally defaults to 0.
5505 Multiple OpenVPN processes can be simultaneously executed with the same
5506 .B exit-event
5507 parameter.  In any case, the controlling process can signal
5508 .B exit-event,
5509 causing all such OpenVPN processes to exit.
5511 When executing an OpenVPN process using the
5512 .B \-\-service
5513 directive, OpenVPN will probably not have a console
5514 window to output status/error
5515 messages, therefore it is useful to use
5516 .B \-\-log
5518 .B \-\-log\-append
5519 to write these messages to a file.
5520 .\"*********************************************************
5522 .B \-\-show\-adapters
5523 (Standalone)
5524 Show available TAP-Win32 adapters which can be selected using the
5525 .B \-\-dev\-node
5526 option.  On non-Windows systems, the
5527 .BR ifconfig (8)
5528 command provides similar functionality.
5529 .\"*********************************************************
5531 .B \-\-allow\-nonadmin [TAP-adapter]
5532 (Standalone)
5534 .B TAP-adapter
5535 to allow access from non-administrative accounts.  If
5536 .B TAP-adapter
5537 is omitted, all TAP adapters on the system will be configured to allow
5538 non-admin access.
5539 The non-admin access setting will only persist for the length of time that
5540 the TAP-Win32 device object and driver remain loaded, and will need
5541 to be re-enabled after a reboot, or if the driver is unloaded
5542 and reloaded.
5543 This directive can only be used by an administrator.
5544 .\"*********************************************************
5546 .B \-\-show\-valid\-subnets
5547 (Standalone)
5548 Show valid subnets for
5549 .B \-\-dev tun
5550 emulation.  Since the TAP-Win32 driver
5551 exports an ethernet interface to Windows, and since TUN devices are
5552 point-to-point in nature, it is necessary for the TAP-Win32 driver
5553 to impose certain constraints on TUN endpoint address selection.
5555 Namely, the point-to-point endpoints used in TUN device emulation
5556 must be the middle two addresses of a /30 subnet (netmask 255.255.255.252).
5557 .\"*********************************************************
5559 .B \-\-show\-net
5560 (Standalone)
5561 Show OpenVPN's view of the system routing table and network
5562 adapter list.
5563 .\"*********************************************************
5564 .SS PKCS#11 Standalone Options:
5565 .\"*********************************************************
5567 .B \-\-show\-pkcs11\-ids [provider] [cert_private]
5568 (Standalone)
5569 Show PKCS#11 token object list. Specify cert_private as 1
5570 if certificates are stored as private objects.
5572 If p11-kit is present on the system, the
5573 .B provider
5574 argument is optional; if omitted the default
5575 .B p11-kit-proxy.so
5576 module will be queried.
5578 .B \-\-verb
5579 option can be used BEFORE this option to produce debugging information.
5580 .\"*********************************************************
5581 .SS IPv6 Related Options
5582 .\"*********************************************************
5583 The following options exist to support IPv6 tunneling in peer-to-peer
5584 and client-server mode.  All options are modeled after their IPv4
5585 counterparts, so more detailed explanations given there apply here
5586 as well (except for
5587 .B \-\-topology
5588 , which has no effect on IPv6).
5590 .B \-\-ifconfig\-ipv6 ipv6addr/bits ipv6remote
5591 configure IPv6 address
5592 .B ipv6addr/bits
5593 on the ``tun'' device.  The second parameter is used as route target for
5594 .B \-\-route\-ipv6
5595 if no gateway is specified.
5597 .B \-\-route\-ipv6 ipv6addr/bits [gateway] [metric]
5598 setup IPv6 routing in the system to send the specified IPv6 network
5599 into OpenVPN's ``tun'' device
5601 .B \-\-server\-ipv6 ipv6addr/bits
5602 convenience-function to enable a number of IPv6 related options at
5603 once, namely
5604 .B \-\-ifconfig\-ipv6, \-\-ifconfig\-ipv6\-pool, \-\-tun\-ipv6
5606 .B \-\-push tun\-ipv6
5607 Is only accepted if ``\-\-mode server'' or ``\-\-server'' is set.
5609 .B \-\-ifconfig\-ipv6\-pool ipv6addr/bits
5610 Specify an IPv6 address pool for dynamic assignment to clients.  The
5611 pool starts at
5612 .B ipv6addr
5613 and increments by +1 for every new client (linear mode).  The
5614 .B /bits
5615 setting controls the size of the pool.  Due to implementation details,
5616 the pool size must be between /64 and /112.
5618 .B \-\-ifconfig\-ipv6\-push ipv6addr/bits ipv6remote
5619 for ccd/ per-client static IPv6 interface configuration, see
5620 .B \-\-client\-config\-dir
5622 .B \-\-ifconfig\-push
5623 for more details.
5625 .B \-\-iroute\-ipv6 ipv6addr/bits
5626 for ccd/ per-client static IPv6 route configuration, see
5627 .B \-\-iroute
5628 for more details how to setup and use this, and how
5629 .B \-\-iroute
5631 .B \-\-route
5632 interact.
5634 .\"*********************************************************
5635 .SH SCRIPTING AND ENVIRONMENTAL VARIABLES
5636 OpenVPN exports a series
5637 of environmental variables for use by user-defined scripts.
5638 .\"*********************************************************
5639 .SS Script Order of Execution
5640 .\"*********************************************************
5642 .B \-\-up
5643 Executed after TCP/UDP socket bind and TUN/TAP open.
5644 .\"*********************************************************
5646 .B \-\-tls\-verify
5647 Executed when we have a still untrusted remote peer.
5648 .\"*********************************************************
5650 .B \-\-ipchange
5651 Executed after connection authentication, or remote IP address change.
5652 .\"*********************************************************
5654 .B \-\-client\-connect
5655 Executed in
5656 .B \-\-mode server
5657 mode immediately after client authentication.
5658 .\"*********************************************************
5660 .B \-\-route\-up
5661 Executed after connection authentication, either
5662 immediately after, or some number of seconds after
5663 as defined by the
5664 .B \-\-route\-delay
5665 option.
5666 .\"*********************************************************
5668 .B \-\-route\-pre\-down
5669 Executed right before the routes are removed.
5670 .\"*********************************************************
5672 .B \-\-client\-disconnect
5673 Executed in
5674 .B \-\-mode server
5675 mode on client instance shutdown.
5676 .\"*********************************************************
5678 .B \-\-down
5679 Executed after TCP/UDP and TUN/TAP close.
5680 .\"*********************************************************
5682 .B \-\-learn\-address
5683 Executed in
5684 .B \-\-mode server
5685 mode whenever an IPv4 address/route or MAC address is added to OpenVPN's
5686 internal routing table.
5687 .\"*********************************************************
5689 .B \-\-auth\-user\-pass\-verify
5690 Executed in
5691 .B \-\-mode server
5692 mode on new client connections, when the client is
5693 still untrusted.
5694 .\"*********************************************************
5695 .SS String Types and Remapping
5696 In certain cases, OpenVPN will perform remapping of characters
5697 in strings.  Essentially, any characters outside the set of
5698 permitted characters for each string type will be converted
5699 to underbar ('_').
5701 .B Q:
5702 Why is string remapping necessary?
5704 .B A:
5705 It's an important security feature to prevent the malicious coding of
5706 strings from untrusted sources to be passed as parameters to scripts,
5707 saved in the environment, used as a common name, translated to a filename,
5708 etc.
5710 .B Q:
5711 Can string remapping be disabled?
5713 .B A:
5714 Yes, by using the
5715 .B \-\-no\-name\-remapping
5716 option, however this should be considered an advanced option.
5718 Here is a brief rundown of OpenVPN's current string types and the 
5719 permitted character class for each string:
5721 .B X509 Names:
5722 Alphanumeric, underbar ('_'), dash ('-'), dot ('.'), at 
5723 ('@'), colon (':'), slash ('/'), and equal ('=').  Alphanumeric is defined 
5724 as a character which will cause the C library isalnum() function to return 
5725 true.
5727 .B Common Names:
5728 Alphanumeric, underbar ('_'), dash ('-'), dot ('.'), and at                
5729 ('@').
5731 .B \-\-auth\-user\-pass username:
5732 Same as Common Name, with one exception: starting with OpenVPN 2.0.1,
5733 the username is passed to the OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY plugin in its raw form,
5734 without string remapping.
5736 .B \-\-auth\-user\-pass password:
5737 Any "printable" character except CR or LF.  
5738 Printable is defined to be a character which will cause the C library 
5739 isprint() function to return true.
5741 .B \-\-client\-config\-dir filename as derived from common name or username:
5742 Alphanumeric, underbar ('_'), dash ('-'), and dot ('.') except for "." or 
5743 ".." as standalone strings.  As of 2.0.1-rc6, the at ('@') character has
5744 been added as well for compatibility with the common name character class.
5746 .B Environmental variable names:
5747 Alphanumeric or underbar ('_').
5749 .B Environmental variable values:
5750 Any printable character.
5752 For all cases, characters in a string which are not members of the legal 
5753 character class for that string type will be remapped to underbar ('_').
5754 .\"*********************************************************
5755 .SS Environmental Variables
5756 Once set, a variable is persisted
5757 indefinitely until it is reset by a new value or a restart,
5759 As of OpenVPN 2.0-beta12, in server mode, environmental
5760 variables set by OpenVPN
5761 are scoped according to the client objects
5762 they are
5763 associated with, so there should not be any issues with
5764 scripts having access to stale, previously set variables
5765 which refer to different client instances.
5766 .\"*********************************************************
5768 .B bytes_received
5769 Total number of bytes received from client during VPN session.
5770 Set prior to execution of the
5771 .B \-\-client\-disconnect
5772 script.
5773 .\"*********************************************************
5775 .B bytes_sent
5776 Total number of bytes sent to client during VPN session.
5777 Set prior to execution of the
5778 .B \-\-client\-disconnect
5779 script.
5780 .\"*********************************************************
5782 .B common_name
5783 The X509 common name of an authenticated client.
5784 Set prior to execution of
5785 .B \-\-client\-connect, \-\-client\-disconnect,
5787 .B \-\-auth\-user\-pass\-verify
5788 scripts.
5789 .\"*********************************************************
5791 .B config
5792 Name of first
5793 .B \-\-config
5794 file.
5795 Set on program initiation and reset on SIGHUP.
5796 .\"*********************************************************
5798 .B daemon
5799 Set to "1" if the
5800 .B \-\-daemon
5801 directive is specified, or "0" otherwise.
5802 Set on program initiation and reset on SIGHUP.
5803 .\"*********************************************************
5805 .B daemon_log_redirect
5806 Set to "1" if the
5807 .B \-\-log
5809 .B \-\-log\-append
5810 directives are specified, or "0" otherwise.
5811 Set on program initiation and reset on SIGHUP.
5812 .\"*********************************************************
5814 .B dev
5815 The actual name of the TUN/TAP device, including
5816 a unit number if it exists.
5817 Set prior to
5818 .B \-\-up
5820 .B \-\-down
5821 script execution.
5822 .\"*********************************************************
5824 .B dev_idx
5825 On Windows, the device index of the TUN/TAP adapter (to
5826 be used in netsh.exe calls which sometimes just do not work
5827 right with interface names).
5828 Set prior to
5829 .B \-\-up
5831 .B \-\-down
5832 script execution.
5833 .\"*********************************************************
5835 .B foreign_option_{n}
5836 An option pushed via
5837 .B \-\-push
5838 to a client which does not natively support it,
5839 such as
5840 .B \-\-dhcp\-option
5841 on a non-Windows system, will be recorded to this
5842 environmental variable sequence prior to
5843 .B \-\-up
5844 script execution.
5845 .\"*********************************************************
5847 .B ifconfig_broadcast
5848 The broadcast address for the virtual
5849 ethernet segment which is derived from the
5850 .B \-\-ifconfig
5851 option when
5852 .B \-\-dev tap
5853 is used.
5854 Set prior to OpenVPN calling the
5855 .I ifconfig
5857 .I netsh
5858 (windows version of ifconfig) commands which
5859 normally occurs prior to
5860 .B \-\-up
5861 script execution.
5862 .\"*********************************************************
5864 .B ifconfig_ipv6_local
5865 The local VPN endpoint IPv6 address specified in the
5866 .B \-\-ifconfig\-ipv6
5867 option (first parameter).
5868 Set prior to OpenVPN calling the
5869 .I ifconfig
5871 .I netsh
5872 (windows version of ifconfig) commands which
5873 normally occurs prior to
5874 .B \-\-up
5875 script execution.
5876 .\"*********************************************************
5878 .B ifconfig_ipv6_netbits
5879 The prefix length of the IPv6 network on the VPN interface.  Derived from
5880 the /nnn parameter of the IPv6 address in the
5881 .B \-\-ifconfig\-ipv6
5882 option (first parameter).
5883 Set prior to OpenVPN calling the
5884 .I ifconfig
5886 .I netsh
5887 (windows version of ifconfig) commands which
5888 normally occurs prior to
5889 .B \-\-up
5890 script execution.
5891 .\"*********************************************************
5893 .B ifconfig_ipv6_remote
5894 The remote VPN endpoint IPv6 address specified in the
5895 .B \-\-ifconfig\-ipv6
5896 option (second parameter).
5897 Set prior to OpenVPN calling the
5898 .I ifconfig
5900 .I netsh
5901 (windows version of ifconfig) commands which
5902 normally occurs prior to
5903 .B \-\-up
5904 script execution.
5905 .\"*********************************************************
5907 .B ifconfig_local
5908 The local VPN endpoint IP address specified in the
5909 .B \-\-ifconfig
5910 option (first parameter).
5911 Set prior to OpenVPN calling the
5912 .I ifconfig
5914 .I netsh
5915 (windows version of ifconfig) commands which
5916 normally occurs prior to
5917 .B \-\-up
5918 script execution.
5919 .\"*********************************************************
5921 .B ifconfig_remote
5922 The remote VPN endpoint IP address specified in the
5923 .B \-\-ifconfig
5924 option (second parameter) when
5925 .B \-\-dev tun
5926 is used.
5927 Set prior to OpenVPN calling the
5928 .I ifconfig
5930 .I netsh
5931 (windows version of ifconfig) commands which
5932 normally occurs prior to
5933 .B \-\-up
5934 script execution.
5935 .\"*********************************************************
5937 .B ifconfig_netmask
5938 The subnet mask of the virtual ethernet segment
5939 that is specified as the second parameter to
5940 .B \-\-ifconfig
5941 when
5942 .B \-\-dev tap
5943 is being used.
5944 Set prior to OpenVPN calling the
5945 .I ifconfig
5947 .I netsh
5948 (windows version of ifconfig) commands which
5949 normally occurs prior to
5950 .B \-\-up
5951 script execution.
5952 .\"*********************************************************
5954 .B ifconfig_pool_local_ip
5955 The local
5956 virtual IP address for the TUN/TAP tunnel taken from an
5957 .B \-\-ifconfig\-push
5958 directive if specified, or otherwise from
5959 the ifconfig pool (controlled by the
5960 .B \-\-ifconfig\-pool
5961 config file directive).
5962 Only set for
5963 .B \-\-dev tun
5964 tunnels.
5965 This option is set on the server prior to execution
5966 of the
5967 .B \-\-client\-connect
5969 .B \-\-client\-disconnect
5970 scripts.
5971 .\"*********************************************************
5973 .B ifconfig_pool_netmask
5975 virtual IP netmask for the TUN/TAP tunnel taken from an
5976 .B \-\-ifconfig\-push
5977 directive if specified, or otherwise from
5978 the ifconfig pool (controlled by the
5979 .B \-\-ifconfig\-pool
5980 config file directive).
5981 Only set for
5982 .B \-\-dev tap
5983 tunnels.
5984 This option is set on the server prior to execution
5985 of the
5986 .B \-\-client\-connect
5988 .B \-\-client\-disconnect
5989 scripts.
5990 .\"*********************************************************
5992 .B ifconfig_pool_remote_ip
5993 The remote
5994 virtual IP address for the TUN/TAP tunnel taken from an
5995 .B \-\-ifconfig\-push
5996 directive if specified, or otherwise from
5997 the ifconfig pool (controlled by the
5998 .B \-\-ifconfig\-pool
5999 config file directive).
6000 This option is set on the server prior to execution
6001 of the
6002 .B \-\-client\-connect
6004 .B \-\-client\-disconnect
6005 scripts.
6006 .\"*********************************************************
6008 .B link_mtu
6009 The maximum packet size (not including the IP header)
6010 of tunnel data in UDP tunnel transport mode.
6011 Set prior to
6012 .B \-\-up
6014 .B \-\-down
6015 script execution.
6016 .\"*********************************************************
6018 .B local
6020 .B \-\-local
6021 parameter.
6022 Set on program initiation and reset on SIGHUP.
6023 .\"*********************************************************
6025 .B local_port
6026 The local port number, specified by
6027 .B \-\-port
6029 .B \-\-lport.
6030 Set on program initiation and reset on SIGHUP.
6031 .\"*********************************************************
6033 .B password
6034 The password provided by a connecting client.
6035 Set prior to
6036 .B \-\-auth\-user\-pass\-verify
6037 script execution only when the
6038 .B via-env
6039 modifier is specified, and deleted from the environment
6040 after the script returns.
6041 .\"*********************************************************
6043 .B proto
6045 .B \-\-proto
6046 parameter.
6047 Set on program initiation and reset on SIGHUP.
6048 .\"*********************************************************
6050 .B remote_{n}
6052 .B \-\-remote
6053 parameter.
6054 Set on program initiation and reset on SIGHUP.
6055 .\"*********************************************************
6057 .B remote_port_{n}
6058 The remote port number, specified by
6059 .B \-\-port
6061 .B \-\-rport.
6062 Set on program initiation and reset on SIGHUP.
6063 .\"*********************************************************
6065 .B route_net_gateway
6066 The pre-existing default IP gateway in the system routing
6067 table.
6068 Set prior to
6069 .B \-\-up
6070 script execution.
6071 .\"*********************************************************
6073 .B route_vpn_gateway
6074 The default gateway used by
6075 .B \-\-route
6076 options, as specified in either the
6077 .B \-\-route\-gateway
6078 option or the second parameter to
6079 .B \-\-ifconfig
6080 when
6081 .B \-\-dev tun
6082 is specified.
6083 Set prior to
6084 .B \-\-up
6085 script execution.
6086 .\"*********************************************************
6088 .B route_{parm}_{n}
6089 A set of variables which define each route to be added, and
6090 are set prior to
6091 .B \-\-up
6092 script execution.
6094 .B parm
6095 will be one of "network", "netmask", "gateway", or "metric".
6097 .B n
6098 is the OpenVPN route number, starting from 1.
6100 If the network or gateway are resolvable DNS names,
6101 their IP address translations will be recorded rather
6102 than their names as denoted on the command line
6103 or configuration file.
6104 .\"*********************************************************
6106 .B route_ipv6_{parm}_{n}
6107 A set of variables which define each IPv6 route to be added, and
6108 are set prior to
6109 .B \-\-up
6110 script execution.
6112 .B parm
6113 will be one of "network" or "gateway" ("netmask" is contained as "/nnn"
6114 in the route_ipv6_network_{n}, unlike IPv4 where it is passed in a separate
6115 environment variable).
6117 .B n
6118 is the OpenVPN route number, starting from 1.
6120 If the network or gateway are resolvable DNS names,
6121 their IP address translations will be recorded rather
6122 than their names as denoted on the command line
6123 or configuration file.
6124 .\"*********************************************************
6126 .B peer_cert
6127 Temporary file name containing the client certificate upon
6128 connection.  Useful in conjunction with \-\-tls\-verify
6129 .\"*********************************************************
6131 .B script_context
6132 Set to "init" or "restart" prior to up/down script execution.
6133 For more information, see
6134 documentation for
6135 .B \-\-up.
6136 .\"*********************************************************
6138 .B script_type
6139 Prior to execution of any script, this variable is set to the type of
6140 script being run.  It can be one of the following:
6141 .B up, down, ipchange, route-up, tls-verify, auth-user-pass-verify,
6142 .B client-connect, client-disconnect, 
6144 .B learn-address.
6145 Set prior to execution of any script.
6146 .\"*********************************************************
6148 .B signal
6149 The reason for exit or restart.  Can be one of
6150 .B sigusr1, sighup, sigterm, sigint, inactive
6151 (controlled by
6152 .B \-\-inactive
6153 option),
6154 .B ping-exit
6155 (controlled by
6156 .B \-\-ping\-exit
6157 option),
6158 .B ping-restart
6159 (controlled by
6160 .B \-\-ping\-restart
6161 option),
6162 .B connection-reset
6163 (triggered on TCP connection reset),
6164 .B error,
6166 .B unknown
6167 (unknown signal).  This variable is set just prior to down script execution.
6168 .\"*********************************************************
6170 .B time_ascii
6171 Client connection timestamp, formatted as a human-readable
6172 time string.
6173 Set prior to execution of the
6174 .B \-\-client\-connect
6175 script.
6176 .\"*********************************************************
6178 .B time_duration
6179 The duration (in seconds) of the client session which is now
6180 disconnecting.
6181 Set prior to execution of the
6182 .B \-\-client\-disconnect
6183 script.
6184 .\"*********************************************************
6186 .B time_unix
6187 Client connection timestamp, formatted as a unix integer
6188 date/time value.
6189 Set prior to execution of the
6190 .B \-\-client\-connect
6191 script.
6192 .\"*********************************************************
6194 .B tls_digest_{n}
6195 Contains the certificate SHA1 fingerprint/digest hash value,
6196 where
6197 .B n
6198 is the verification level.  Only set for TLS connections.  Set prior
6199 to execution of
6200 .B \-\-tls\-verify
6201 script.
6202 .\"*********************************************************
6204 .B tls_id_{n}
6205 A series of certificate fields from the remote peer,
6206 where
6207 .B n
6208 is the verification level.  Only set for TLS connections.  Set prior
6209 to execution of
6210 .B \-\-tls\-verify
6211 script.
6212 .\"*********************************************************
6214 .B tls_serial_{n}
6215 The serial number of the certificate from the remote peer,
6216 where
6217 .B n
6218 is the verification level.  Only set for TLS connections.  Set prior
6219 to execution of
6220 .B \-\-tls\-verify
6221 script. This is in the form of a decimal string like "933971680", which is
6222 suitable for doing serial-based OCSP queries (with OpenSSL, do not
6223 prepend "0x" to the string) If something goes wrong while reading
6224 the value from the certificate it will be an empty string, so your
6225 code should check that.
6226 See the contrib/OCSP_check/OCSP_check.sh script for an example.
6227 .\"*********************************************************
6229 .B tls_serial_hex_{n}
6230 Like
6231 .B tls_serial_{n}\fR,
6232 but in hex form (e.g. "12:34:56:78:9A").
6233 .\"*********************************************************
6235 .B tun_mtu
6236 The MTU of the TUN/TAP device.
6237 Set prior to
6238 .B \-\-up
6240 .B \-\-down
6241 script execution.
6242 .\"*********************************************************
6244 .B trusted_ip (or trusted_ip6)
6245 Actual IP address of connecting client or peer which has been authenticated.
6246 Set prior to execution of
6247 .B \-\-ipchange, \-\-client\-connect,
6249 .B \-\-client\-disconnect
6250 scripts.
6251 If using ipv6 endpoints (udp6, tcp6),
6252 .B trusted_ip6
6253 will be set instead.
6254 .\"*********************************************************
6256 .B trusted_port
6257 Actual port number of connecting client or peer which has been authenticated.
6258 Set prior to execution of
6259 .B \-\-ipchange, \-\-client\-connect,
6261 .B \-\-client\-disconnect
6262 scripts.
6263 .\"*********************************************************
6265 .B untrusted_ip (or untrusted_ip6)
6266 Actual IP address of connecting client or peer which has not been authenticated
6267 yet.  Sometimes used to
6268 .B nmap
6269 the connecting host in a
6270 .B \-\-tls\-verify
6271 script to ensure it is firewalled properly.
6272 Set prior to execution of
6273 .B \-\-tls\-verify
6275 .B \-\-auth\-user\-pass\-verify
6276 scripts.
6277 If using ipv6 endpoints (udp6, tcp6),
6278 .B untrusted_ip6
6279 will be set instead.
6280 .\"*********************************************************
6282 .B untrusted_port
6283 Actual port number of connecting client or peer which has not been authenticated
6284 yet.
6285 Set prior to execution of
6286 .B \-\-tls\-verify
6288 .B \-\-auth\-user\-pass\-verify
6289 scripts.
6290 .\"*********************************************************
6292 .B username
6293 The username provided by a connecting client.
6294 Set prior to
6295 .B \-\-auth\-user\-pass\-verify
6296 script execution only when the
6297 .B via-env
6298 modifier is specified.
6299 .\"*********************************************************
6301 .B X509_{n}_{subject_field}
6302 An X509 subject field from the remote peer certificate,
6303 where
6304 .B n
6305 is the verification level.  Only set for TLS connections.  Set prior
6306 to execution of
6307 .B \-\-tls\-verify
6308 script.  This variable is similar to
6309 .B tls_id_{n}
6310 except the component X509 subject fields are broken out, and
6311 no string remapping occurs on these field values (except for remapping
6312 of control characters to "_").
6313 For example, the following variables would be set on the
6314 OpenVPN server using the sample client certificate
6315 in sample-keys (client.crt).
6316 Note that the verification level is 0 for the client certificate
6317 and 1 for the CA certificate.
6320 .ft 3
6321 .in +4
6322 X509_0_emailAddress=me@myhost.mydomain
6323 X509_0_CN=Test-Client
6324 X509_0_O=OpenVPN-TEST
6325 X509_0_ST=NA
6326 X509_0_C=KG
6327 X509_1_emailAddress=me@myhost.mydomain
6328 X509_1_O=OpenVPN-TEST
6329 X509_1_L=BISHKEK
6330 X509_1_ST=NA
6331 X509_1_C=KG
6332 .in -4
6335 .\"*********************************************************
6336 .SH INLINE FILE SUPPORT
6337 OpenVPN allows including files in the main configuration for the
6338 .B \-\-ca, \-\-cert, \-\-dh, \-\-extra\-certs, \-\-key, \-\-pkcs12, \-\-secret
6340 .B \-\-tls\-auth
6341 options.
6343 Each inline file started by the line
6344 .B <option>
6345 and ended by the line
6346 .B </option>
6348 Here is an example of an inline file usage
6351 .ft 3
6352 .in +4
6353 <cert>
6354 -----BEGIN CERTIFICATE-----
6355 [...]
6356 -----END CERTIFICATE-----
6357 </cert>
6358 .in -4
6362 When using the inline file feature with
6363 .B \-\-pkcs12
6364 the inline file has to be base64 encoded. Encoding of a .p12 file into base64 can be done for example with OpenSSL by running
6365 .B openssl base64 \-in input.p12
6367 .SH SIGNALS
6369 .B SIGHUP
6370 Cause OpenVPN to close all TUN/TAP and
6371 network connections,
6372 restart, re-read the configuration file (if any),
6373 and reopen TUN/TAP and network connections.
6374 .\"*********************************************************
6376 .B SIGUSR1
6377 Like 
6378 .B SIGHUP,
6379 except don't re-read configuration file, and possibly don't close and reopen TUN/TAP
6380 device, re-read key files, preserve local IP address/port, or preserve most recently authenticated
6381 remote IP address/port based on
6382 .B \-\-persist\-tun, \-\-persist\-key, \-\-persist\-local\-ip,
6384 .B \-\-persist\-remote\-ip
6385 options respectively (see above).
6387 This signal may also be internally generated by a timeout condition, governed
6388 by the
6389 .B \-\-ping\-restart
6390 option.
6392 This signal, when combined with
6393 .B \-\-persist\-remote\-ip,
6394 may be
6395 sent when the underlying parameters of the host's network interface change
6396 such as when the host is a DHCP client and is assigned a new IP address.
6398 .B \-\-ipchange
6399 above for more information.
6400 .\"*********************************************************
6402 .B SIGUSR2
6403 Causes OpenVPN to display its current statistics (to the syslog
6404 file if
6405 .B \-\-daemon
6406 is used, or stdout otherwise).
6407 .\"*********************************************************
6409 .B SIGINT, SIGTERM
6410 Causes OpenVPN to exit gracefully.
6411 .\"*********************************************************
6412 .SH TUN/TAP DRIVER SETUP
6413 If you are running Linux 2.4.7 or higher, you probably have the TUN/TAP driver
6414 already installed.  If so, there are still a few things you need to do:
6416 Make device:
6417 .B mknod /dev/net/tun c 10 200
6419 Load driver:
6420 .B modprobe tun
6421 .\"*********************************************************
6422 .SH EXAMPLES
6423 Prior to running these examples, you should have OpenVPN installed on two
6424 machines with network connectivity between them.  If you have not
6425 yet installed OpenVPN, consult the INSTALL file included in the OpenVPN
6426 distribution.
6427 .\"*********************************************************
6428 .SS TUN/TAP Setup:
6429 If you are using Linux 2.4 or higher,
6430 make the tun device node and load the tun module:
6432 .B mknod /dev/net/tun c 10 200
6435 .B modprobe tun
6437 If you installed from RPM, the
6438 .B mknod
6439 step may be omitted, because the RPM install does that for you.
6441 Only Linux 2.4 and newer are supported.
6443 For other platforms, consult the INSTALL file at
6444 .I http://openvpn.net/install.html
6445 for more information.
6446 .\"*********************************************************
6447 .SS Firewall Setup:
6448 If firewalls exist between
6449 the two machines, they should be set to forward UDP port 1194
6450 in both directions.  If you do not have control over the firewalls
6451 between the two machines, you may still be able to use OpenVPN by adding
6452 .B \-\-ping 15
6453 to each of the
6454 .B openvpn
6455 commands used below in the examples (this will cause each peer to send out
6456 a UDP ping to its remote peer once every 15 seconds which will cause many
6457 stateful firewalls to forward packets in both directions
6458 without an explicit firewall rule).
6460 If you are using a Linux iptables-based firewall, you may need to enter
6461 the following command to allow incoming packets on the TUN device:
6463 .B iptables \-A INPUT \-i tun+ \-j ACCEPT
6465 See the firewalls section below for more information on configuring firewalls
6466 for use with OpenVPN.
6467 .\"*********************************************************
6468 .SS VPN Address Setup:
6469 For purposes
6470 of our example, our two machines will be called
6471 .B bob.example.com
6473 .B alice.example.com.
6474 If you are constructing a VPN over the internet, then replace
6475 .B bob.example.com
6477 .B alice.example.com
6478 with the internet hostname or IP address that each machine will use
6479 to contact the other over the internet.
6481 Now we will choose the tunnel endpoints.  Tunnel endpoints are
6482 private IP addresses that only have meaning in the context of
6483 the VPN.  Each machine will use the tunnel endpoint of the other
6484 machine to access it over the VPN.  In our example,
6485 the tunnel endpoint for bob.example.com
6486 will be 10.4.0.1 and for alice.example.com, 10.4.0.2.
6488 Once the VPN is established, you have essentially
6489 created a secure alternate path between the two hosts
6490 which is addressed by using the tunnel endpoints.  You can
6491 control which network
6492 traffic passes between the hosts 
6493 (a) over the VPN or (b) independently of the VPN, by choosing whether to use
6494 (a) the VPN endpoint address or (b) the public internet address,
6495 to access the remote host. For example if you are on bob.example.com and you wish to connect to alice.example.com
6497 .B ssh
6498 without using the VPN (since
6499 .B ssh
6500 has its own built-in security) you would use the command
6501 .B ssh alice.example.com.
6502 However in the same scenario, you could also use the command
6503 .B telnet 10.4.0.2
6504 to create a telnet session with alice.example.com over the VPN, that would
6505 use the VPN to secure the session rather than
6506 .B ssh.
6508 You can use any address you wish for the
6509 tunnel endpoints
6510 but make sure that they are private addresses
6511 (such as those that begin with 10 or 192.168) and that they are
6512 not part of any existing subnet on the networks of
6513 either peer, unless you are bridging.  If you use an address that is part of
6514 your local subnet for either of the tunnel endpoints,
6515 you will get a weird feedback loop.
6516 .\"*********************************************************
6517 .SS Example 1: A simple tunnel without security
6519 On bob:
6521 .B openvpn \-\-remote alice.example.com \-\-dev tun1 \-\-ifconfig 10.4.0.1 10.4.0.2 \-\-verb 9
6523 On alice:
6525 .B openvpn \-\-remote bob.example.com \-\-dev tun1 \-\-ifconfig 10.4.0.2 10.4.0.1 \-\-verb 9
6527 Now verify the tunnel is working by pinging across the tunnel.
6529 On bob:
6531 .B ping 10.4.0.2
6533 On alice:
6535 .B ping 10.4.0.1
6538 .B \-\-verb 9
6539 option will produce verbose output, similar to the
6540 .BR tcpdump (8)
6541 program.  Omit the
6542 .B \-\-verb 9
6543 option to have OpenVPN run quietly.
6544 .\"*********************************************************
6545 .SS Example 2: A tunnel with static-key security (i.e. using a pre-shared secret)
6546 First build a static key on bob.
6548 .B openvpn \-\-genkey \-\-secret key
6550 This command will build a random key file called
6551 .B key
6552 (in ascii format).
6553 Now copy
6554 .B key
6555 to alice over a secure medium such as by
6556 using the
6557 .BR scp (1)
6558 program.
6560 On bob:
6562 .B openvpn \-\-remote alice.example.com \-\-dev tun1 \-\-ifconfig 10.4.0.1 10.4.0.2 \-\-verb 5 \-\-secret key
6564 On alice:
6566 .B openvpn \-\-remote bob.example.com \-\-dev tun1 \-\-ifconfig 10.4.0.2 10.4.0.1 \-\-verb 5 \-\-secret key
6568 Now verify the tunnel is working by pinging across the tunnel.
6570 On bob:
6572 .B ping 10.4.0.2
6574 On alice:
6576 .B ping 10.4.0.1
6577 .\"*********************************************************
6578 .SS Example 3: A tunnel with full TLS-based security
6579 For this test, we will designate
6580 .B bob
6581 as the TLS client and
6582 .B alice
6583 as the TLS server.
6584 .I 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.
6586 First, build a separate certificate/key pair
6587 for both bob and alice (see above where
6588 .B \-\-cert
6589 is discussed for more info).  Then construct
6590 Diffie Hellman parameters (see above where
6591 .B \-\-dh
6592 is discussed for more info).  You can also use the
6593 included test files client.crt, client.key,
6594 server.crt, server.key and ca.crt.
6595 The .crt files are certificates/public-keys, the .key
6596 files are private keys, and ca.crt is a certification
6597 authority who has signed both
6598 client.crt and server.crt.  For Diffie Hellman
6599 parameters you can use the included file dh1024.pem.
6600 .I 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.
6602 On bob:
6604 .B openvpn \-\-remote alice.example.com \-\-dev tun1 \-\-ifconfig 10.4.0.1 10.4.0.2 \-\-tls\-client \-\-ca ca.crt \-\-cert client.crt \-\-key client.key \-\-reneg\-sec 60 \-\-verb 5
6606 On alice:
6608 .B openvpn \-\-remote bob.example.com \-\-dev tun1 \-\-ifconfig 10.4.0.2 10.4.0.1 \-\-tls\-server \-\-dh dh1024.pem \-\-ca ca.crt \-\-cert server.crt \-\-key server.key \-\-reneg\-sec 60 \-\-verb 5
6610 Now verify the tunnel is working by pinging across the tunnel.
6612 On bob:
6614 .B ping 10.4.0.2
6616 On alice:
6618 .B ping 10.4.0.1
6620 Notice the
6621 .B \-\-reneg\-sec 60
6622 option we used above.  That tells OpenVPN to renegotiate
6623 the data channel keys every minute.
6624 Since we used
6625 .B \-\-verb 5
6626 above, you will see status information on each new key negotiation.
6628 For production operations, a key renegotiation interval of 60 seconds
6629 is probably too frequent.  Omit the
6630 .B \-\-reneg\-sec 60
6631 option to use OpenVPN's default key renegotiation interval of one hour.
6632 .\"*********************************************************
6633 .SS Routing:
6634 Assuming you can ping across the tunnel,
6635 the next step is to route a real subnet over
6636 the secure tunnel.  Suppose that bob and alice have two network
6637 interfaces each, one connected
6638 to the internet, and the other to a private
6639 network.  Our goal is to securely connect
6640 both private networks.  We will assume that bob's private subnet
6641 is 10.0.0.0/24 and alice's is 10.0.1.0/24.
6643 First, ensure that IP forwarding is enabled on both peers.
6644 On Linux, enable routing:
6646 .B echo 1 > /proc/sys/net/ipv4/ip_forward
6648 and enable TUN packet forwarding through the firewall:
6650 .B iptables \-A FORWARD \-i tun+ \-j ACCEPT
6652 On bob:
6654 .B route add \-net 10.0.1.0 netmask 255.255.255.0 gw 10.4.0.2
6656 On alice:
6658 .B route add \-net 10.0.0.0 netmask 255.255.255.0 gw 10.4.0.1
6660 Now any machine on the 10.0.0.0/24 subnet can
6661 access any machine on the 10.0.1.0/24 subnet
6662 over the secure tunnel (or vice versa).
6664 In a production environment, you could put the route command(s)
6665 in a script and execute with the
6666 .B \-\-up
6667 option.
6668 .\"*********************************************************
6669 .SH FIREWALLS
6670 OpenVPN's usage of a single UDP port makes it fairly firewall-friendly.
6671 You should add an entry to your firewall rules to allow incoming OpenVPN
6672 packets.  On Linux 2.4+:
6674 .B iptables \-A INPUT \-p udp \-s 1.2.3.4 \-\-dport 1194 \-j ACCEPT
6676 This will allow incoming packets on UDP port 1194 (OpenVPN's default UDP port)
6677 from an OpenVPN peer at 1.2.3.4.
6679 If you are using HMAC-based packet authentication (the default in any of
6680 OpenVPN's secure modes), having the firewall filter on source
6681 address can be considered optional, since HMAC packet authentication
6682 is a much more secure method of verifying the authenticity of
6683 a packet source.  In that case:
6685 .B iptables \-A INPUT \-p udp \-\-dport 1194 \-j ACCEPT
6687 would be adequate and would not render the host inflexible with
6688 respect to its peer having a dynamic IP address.
6690 OpenVPN also works well on stateful firewalls.  In some cases, you may
6691 not need to add any static rules to the firewall list if you are
6692 using a stateful firewall that knows how to track UDP connections.
6693 If you specify
6694 .B \-\-ping n,
6695 OpenVPN will be guaranteed
6696 to send a packet to its peer at least once every
6697 .B n
6698 seconds.  If
6699 .B n
6700 is less than the stateful firewall connection timeout, you can
6701 maintain an OpenVPN connection indefinitely without explicit
6702 firewall rules.
6704 You should also add firewall rules to allow incoming IP traffic on
6705 TUN or TAP devices such as:
6707 .B iptables \-A INPUT \-i tun+ \-j ACCEPT
6709 to allow input packets from tun devices,
6711 .B iptables \-A FORWARD \-i tun+ \-j ACCEPT
6713 to allow input packets from tun devices to be forwarded to
6714 other hosts on the local network,
6716 .B iptables \-A INPUT \-i tap+ \-j ACCEPT
6718 to allow input packets from tap devices, and
6720 .B iptables \-A FORWARD \-i tap+ \-j ACCEPT
6722 to allow input packets from tap devices to be forwarded to
6723 other hosts on the local network.
6725 These rules are secure if you use packet authentication,
6726 since no incoming packets will arrive on a TUN or TAP
6727 virtual device
6728 unless they first pass an HMAC authentication test.
6729 .\"*********************************************************
6730 .SH FAQ
6731 .I http://openvpn.net/faq.html
6732 .\"*********************************************************
6733 .SH HOWTO
6734 For a more comprehensive guide to setting up OpenVPN
6735 in a production setting, see the OpenVPN HOWTO at
6736 .I http://openvpn.net/howto.html
6737 .\"*********************************************************
6738 .SH PROTOCOL
6739 For a description of OpenVPN's underlying protocol,
6740 see 
6741 .I http://openvpn.net/security.html
6742 .\"*********************************************************
6743 .SH WEB
6744 OpenVPN's web site is at
6745 .I http://openvpn.net/
6747 Go here to download the latest version of OpenVPN, subscribe
6748 to the mailing lists, read the mailing list
6749 archives, or browse the SVN repository.
6750 .\"*********************************************************
6751 .SH BUGS
6752 Report all bugs to the OpenVPN team <info@openvpn.net>.
6753 .\"*********************************************************
6754 .SH "SEE ALSO"
6755 .BR dhcpcd (8),
6756 .BR ifconfig (8),
6757 .BR openssl (1),
6758 .BR route (8),
6759 .BR scp (1)
6760 .BR ssh (1)
6761 .\"*********************************************************
6762 .SH NOTES 
6764 This product includes software developed by the
6765 OpenSSL Project (
6766 .I http://www.openssl.org/
6769 For more information on the TLS protocol, see
6770 .I http://www.ietf.org/rfc/rfc2246.txt
6772 For more information on the LZO real-time compression library see
6773 .I http://www.oberhumer.com/opensource/lzo/
6774 .\"*********************************************************
6775 .SH COPYRIGHT
6776 Copyright (C) 2002-2010 OpenVPN Technologies, Inc. This program is free software;
6777 you can redistribute it and/or modify
6778 it under the terms of the GNU General Public License version 2
6779 as published by the Free Software Foundation.
6780 .\"*********************************************************
6781 .SH AUTHORS
6782 James Yonan <jim@yonan.net>