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.
7
.\" Copyright (C) 2002-2009 OpenVPN Technologies, Inc. <sales@openvpn.net>
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.
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.
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
23
.\" Manual page for openvpn
25
.\" SH section heading
26
.\" SS subsection heading
28
.\" IP indented paragraph
31
.\" .nf -- no formatting
32
.\" .fi -- resume formatting
34
.\" .ft -- normal face
35
.\" .in +|-{n} -- indent
37
.TH openvpn 8 "17 November 2008"
38
.\"*********************************************************
40
openvpn \- secure IP tunnel daemon.
41
.\"*********************************************************
44
openvpn [ options ... ]
46
.\"*********************************************************
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
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
65
without any parameters.
66
.\"*********************************************************
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.
80
conventional encryption
81
using a pre-shared secret key
86
using client & server certificates.
88
supports non-encrypted TCP/UDP tunnels.
90
OpenVPN is designed to work with the
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
.\"*********************************************************
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
.\"*********************************************************
106
.\"*********************************************************
109
Load additional config options from
111
where each line corresponds to one command line option,
112
but with the leading '\-\-' removed.
116
is the only option to the openvpn command,
119
can be removed, and the command can be given as
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:
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.
146
For example on Windows, use double backslashes to
152
secret "c:\\\\OpenVPN\\\\secret.key"
157
For examples of configuration files,
159
.I http://openvpn.net/examples.html
161
Here is an example configuration file:
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.
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
187
.\"*********************************************************
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
195
.\"*********************************************************
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
206
options may be specified for redundancy, each referring
207
to a different OpenVPN server. Specifying multiple
209
options for this purpose is a special case of the more
210
general connection-profile feature. See the
214
The OpenVPN client will try to connect to a server at
216
in the order specified by the list of
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
230
Note that since UDP is connectionless, connection failure
237
Note the following corner case: If you use multiple
239
options, AND you are dropping root privileges on
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.
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
259
When used in TCP mode,
261
will act as a filter, rejecting connections from any host which does
267
is a DNS name which resolves to multiple IP addresses,
269
chosen, providing a sort of basic load-balancing and
271
.\"*********************************************************
274
Define a client connection
275
profile. Client connection profiles are groups of OpenVPN options that
276
describe how to connect to a given OpenVPN server. Client connection
277
profiles are specified within an OpenVPN configuration file, and
278
each profile is bracketed by
283
An OpenVPN client will try each connection profile sequentially
284
until it achieves a successful connection.
287
can be used to initially "scramble" the connection
290
Here is an example of connection profile usage:
299
remote 198.19.34.56 1194 udp
303
remote 198.19.34.56 443 tcp
307
remote 198.19.34.56 443 tcp
308
http-proxy 192.168.0.8 8080
313
remote 198.19.36.99 443 tcp
314
http-proxy 192.168.0.8 8080
327
First we try to connect to a server at 198.19.34.56:1194 using UDP.
328
If that fails, we then try to connect to 198.19.34.56:443 using TCP.
329
If that also fails, then try connecting through an HTTP proxy at
330
192.168.0.8:8080 to 198.19.34.56:443 using TCP. Finally, try to
331
connect through the same proxy to a server at 198.19.36.99:443
334
The following OpenVPN options may be used inside of
341
.B connect-retry-max,
345
.B http-proxy-option,
347
.B http-proxy-timeout,
356
.B socks-proxy-retry.
358
A defaulting mechanism exists for specifying options to apply to
361
profiles. If any of the above options (with the exception of
363
) appear outside of a
365
block, but in a configuration file which has one or more
367
blocks, the option setting will be used as a default for
369
blocks which follow it in the configuration file.
371
For example, suppose the
373
option were placed in the sample configuration file above, near
374
the top of the file, before the first
376
block. The effect would be as if
382
.\"*********************************************************
387
address/ports are specified, or if connection profiles are being
388
used, initially randomize the order of the list
389
as a kind of basic load-balancing measure.
390
.\"*********************************************************
395
for communicating with remote host.
403
The default protocol is
411
should be specified on both peers.
413
For TCP operation, one peer must use
414
.B \-\-proto tcp-server
415
and the other must use
416
.B \-\-proto tcp-client.
419
will wait indefinitely for an incoming connection. A peer
422
will attempt to connect, and if that fails, will sleep for 5
423
seconds (adjustable via the
425
option) and try again infinite or up to N retries (adjustable via the
426
.B \-\-connect-retry-max
427
option). Both TCP client and server will simulate
428
a SIGUSR1 restart signal if either side resets the connection.
430
OpenVPN is designed to operate optimally over UDP, but TCP capability is provided
431
for situations where UDP cannot be used.
432
In comparison with UDP, TCP will usually be
433
somewhat less efficient and less robust when used over unreliable or congested
436
This article outlines some of problems with tunneling IP over TCP:
438
.I http://sites.inka.de/sites/bigred/devel/tcp-tcp.html
440
There are certain cases, however, where using TCP may be advantageous from
441
a security and robustness perspective, such as tunneling non-IP or
442
application-level UDP protocols, or tunneling protocols which don't
443
possess a built-in reliability layer.
444
.\"*********************************************************
446
.B \-\-connect-retry n
448
.B \-\-proto tcp-client,
452
number of seconds to wait
453
between connection retries (default=5).
454
.\"*********************************************************
456
.B \-\-connect-retry-max n
458
.B \-\-proto tcp-client,
462
number of retries of connection attempt (default=infinite).
463
.\"*********************************************************
466
Try to sense HTTP or SOCKS proxy settings automatically.
467
If no settings are present, a direct connection will be attempted.
468
If both HTTP and SOCKS settings are present, HTTP will be preferred.
469
If the HTTP proxy server requires a password, it will be queried from
470
stdin or the management interface. If the underlying OS doesn't support an API for
471
returning proxy settings, a direct connection will be attempted.
472
Currently, only Windows clients support this option via the
473
InternetQueryOption API.
474
This option exists in OpenVPN 2.1 or higher.
475
.\"*********************************************************
477
.B \-\-http-proxy server port [authfile|'auto'] [auth-method]
478
Connect to remote host through an HTTP proxy at address
482
If HTTP Proxy-Authenticate is required,
484
is a file containing a username and password on 2 lines, or
485
"stdin" to prompt from console.
488
should be one of "none", "basic", or "ntlm".
492
flag causes OpenVPN to automatically determine the
494
and query stdin or the management interface for
495
username/password credentials, if required. This flag
496
exists on OpenVPN 2.1 or higher.
497
.\"*********************************************************
499
.B \-\-http-proxy-retry
500
Retry indefinitely on HTTP proxy errors. If an HTTP proxy error
501
occurs, simulate a SIGUSR1 reset.
502
.\"*********************************************************
504
.B \-\-http-proxy-timeout n
508
.\"*********************************************************
510
.B \-\-http-proxy-option type [parm]
511
Set extended HTTP proxy options.
512
Repeat to set multiple options.
514
.B VERSION version \-\-
515
Set HTTP version number to
519
.B AGENT user-agent \-\-
520
Set HTTP "User-Agent" string to
522
.\"*********************************************************
524
.B \-\-socks-proxy server [port]
525
Connect to remote host through a Socks5 proxy at address
530
.\"*********************************************************
532
.B \-\-socks-proxy-retry
533
Retry indefinitely on Socks proxy errors. If a Socks proxy error
534
occurs, simulate a SIGUSR1 reset.
535
.\"*********************************************************
537
.B \-\-resolv-retry n
538
If hostname resolve fails for
542
seconds before failing.
546
to "infinite" to retry indefinitely.
549
.B \-\-resolv-retry infinite
550
is enabled. You can disable by setting n=0.
551
.\"*********************************************************
554
Allow remote peer to change its IP address and/or port number, such as due to
555
DHCP (this is the default if
561
allows an OpenVPN session to initially connect to a peer
562
at a known address, however if packets arrive from a new
563
address and pass all authentication tests, the new address
564
will take control of the session. This is useful when
565
you are connecting to a peer which holds a dynamic address
566
such as a dial-in user or DHCP client.
570
tells OpenVPN to accept authenticated packets
571
from any address, not only the address which was specified in the
574
.\"*********************************************************
577
Execute shell command
579
when our remote ip-address is initially authenticated or
584
.B cmd ip_address port_number
591
.B \-\-client-connect
594
See the "Environmental Variables" section below for
595
additional parameters passed as environmental variables.
599
can be a shell command with multiple arguments, in which
600
case all OpenVPN-generated arguments will be appended
603
to build a command line which will be passed to the script.
605
If you are running in a dynamic IP address environment where
606
the IP addresses of either peer could change without notice,
607
you can use this script, for example, to edit the
609
file with the current address of the peer. The script will
610
be run every time the remote peer changes its IP address.
614
IP address changes due to DHCP, we should configure
615
our IP address change script (see man page for
621
signal to OpenVPN. OpenVPN will then
622
reestablish a connection with its most recently authenticated
623
peer on its new IP address.
624
.\"*********************************************************
627
TCP/UDP port number for both local and remote. The current
628
default of 1194 represents the official IANA port number
629
assignment for OpenVPN and has been used since version 2.0-beta17.
630
Previous versions used port 5000 as the default.
631
.\"*********************************************************
634
TCP/UDP port number for bind.
635
.\"*********************************************************
638
TCP/UDP port number for remote.
639
.\"*********************************************************
642
Bind to local address and port. This is the default unless any of
643
.B \-\-proto tcp-client
649
.\"*********************************************************
652
Do not bind to local address and port. The IP stack will allocate
653
a dynamic port for returning packets. Since the value of the dynamic port
654
could not be known in advance by a peer, this option is only suitable for
655
peers which will be initiating connections by using the
658
.\"*********************************************************
660
.B \-\-dev tunX | tapX | null
661
TUN/TAP virtual network device (
663
can be omitted for a dynamic device.)
665
See examples section below
666
for an example on setting up a TUN device.
668
You must use either tun devices on both ends of the connection
669
or tap devices on both ends. You cannot mix them, as they
670
represent different underlying network layers.
673
devices encapsulate IPv4 or IPv6 (OSI Layer 3) while
675
devices encapsulate Ethernet 802.3 (OSI Layer 2).
676
.\"*********************************************************
678
.B \-\-dev-type device-type
679
Which device type are we using?
687
Use this option only if the TUN/TAP device used with
693
.\"*********************************************************
696
Configure virtual addressing topology when running in
698
mode. This directive has no meaning in
700
mode, which always uses a
704
If you set this directive on the server, the
708
directives will automatically push your chosen topology setting to clients
709
as well. This directive can also be manually pushed to clients. Like the
711
directive, this directive must always be compatible between client and server.
717
Use a point-to-point topology, by allocating one /30 subnet per client.
718
This is designed to allow point-to-point semantics when some
719
or all of the connecting clients might be Windows systems. This is the
720
default on OpenVPN 2.0.
723
Use a point-to-point topology where the remote endpoint of the client's
724
tun interface always points to the local endpoint of the server's tun interface.
725
This mode allocates a single IP address per connecting client.
727
when none of the connecting clients are Windows systems. This mode
728
is functionally equivalent to the
729
.B \-\-ifconfig-pool-linear
730
directive which is available in OpenVPN 2.0 and is now deprecated.
733
Use a subnet rather than a point-to-point topology by
734
configuring the tun interface with a local IP address and subnet mask,
735
similar to the topology used in
737
and ethernet bridging mode.
738
This mode allocates a single IP address per connecting client and works on
739
Windows as well. Only available when server and clients are OpenVPN 2.1 or
740
higher, or OpenVPN 2.0.x which has been manually patched with the
742
directive code. When used on Windows, requires version 8.2 or higher
743
of the TAP-Win32 driver. When used on *nix, requires that the tun
746
command which sets a subnet instead of a remote endpoint IP address.
748
This option exists in OpenVPN 2.1 or higher.
749
.\"*********************************************************
752
Build a tun link capable of forwarding IPv6 traffic.
753
Should be used in conjunction with
757
A warning will be displayed
758
if no specific IPv6 TUN support for your OS has been compiled into OpenVPN.
759
.\"*********************************************************
762
Explicitly set the device node rather than using
763
/dev/net/tun, /dev/tun, /dev/tap, etc. If OpenVPN
764
cannot figure out whether
766
is a TUN or TAP device based on the name, you should
772
On Windows systems, select the TAP-Win32 adapter which
775
in the Network Connections Control Panel or the
776
raw GUID of the adapter enclosed by braces.
779
option under Windows can also be used
780
to enumerate all available TAP-Win32
781
adapters and will show both the network
782
connections control panel name and the GUID for
783
each TAP-Win32 adapter.
785
.B \-\-lladdr address
786
Specify the link layer address, more commonly known as the MAC address.
787
Only applied to TAP devices.
788
.\"*********************************************************
791
Set alternate command to execute instead of default iproute2 command.
792
May be used in order to execute OpenVPN in unprivileged environment.
793
.\"*********************************************************
796
Set TUN/TAP adapter parameters.
798
is the IP address of the local VPN endpoint.
801
is the IP address of the remote VPN endpoint.
804
is the subnet mask of the virtual ethernet segment
805
which is being created or connected to.
807
For TUN devices, which facilitate virtual
808
point-to-point IP connections,
811
is to use two private IP addresses
812
which are not a member of any
813
existing subnet which is in use.
814
The IP addresses may be consecutive
815
and should have their order reversed
816
on the remote peer. After the VPN
817
is established, by pinging
819
you will be pinging across the VPN.
821
For TAP devices, which provide
822
the ability to create virtual
825
is used to set an IP address and
826
subnet mask just as a physical
827
ethernet adapter would be
828
similarly configured. If you are
829
attempting to connect to a remote
830
ethernet bridge, the IP address
831
and subnet should be set to values
832
which would be valid on the
833
the bridged ethernet segment (note
834
also that DHCP can be used for the
837
This option, while primarily a proxy for the
839
command, is designed to simplify TUN/TAP
840
tunnel configuration by providing a
841
standard interface to the different
842
ifconfig implementations on different
846
parameters which are IP addresses can
847
also be specified as a DNS or /etc/hosts
848
file resolvable name.
852
should not be used if the TAP interface will be
853
getting an IP address lease from a DHCP
855
.\"*********************************************************
857
.B \-\-ifconfig-noexec
858
Don't actually execute ifconfig/netsh commands, instead
861
parameters to scripts using environmental variables.
862
.\"*********************************************************
864
.B \-\-ifconfig-nowarn
865
Don't output an options consistency check warning
868
option on this side of the
869
connection doesn't match the remote side. This is useful
870
when you want to retain the overall benefits of the
871
options consistency check (also see
873
option) while only disabling the ifconfig component of
877
if you have a configuration where the local host uses
879
but the remote host does not, use
880
.B \-\-ifconfig-nowarn
883
This option will also silence warnings about potential
884
address conflicts which occasionally annoy more experienced
885
users by triggering "false positive" warnings.
886
.\"*********************************************************
888
.B \-\-route network/IP [netmask] [gateway] [metric]
889
Add route to routing table after connection is established.
890
Multiple routes can be specified. Routes will be
891
automatically torn down in reverse order prior to
892
TUN/TAP device close.
894
This option is intended as
895
a convenience proxy for the
898
while at the same time providing portable semantics
899
across OpenVPN's platform space.
902
default \-\- 255.255.255.255
905
default \-\- taken from
907
or the second parameter to
914
default \-\- taken from
918
The default can be specified by leaving an option blank or setting
926
also be specified as a DNS or /etc/hosts
927
file resolvable name, or as one of three special keywords:
930
-- The remote VPN endpoint address
933
or the second parameter to
940
-- The pre-existing IP default gateway, read from the routing
941
table (not supported on all OSes).
946
address if OpenVPN is being run in client mode, and is undefined in server mode.
947
.\"*********************************************************
950
Allow a maximum number of n
952
options to be specified, either in the local configuration file,
953
or pulled from an OpenVPN server. By default, n=100.
954
.\"*********************************************************
956
.B \-\-route-gateway gw|'dhcp'
957
Specify a default gateway
964
is specified as the parameter,
965
the gateway address will be extracted from a DHCP
966
negotiation with the OpenVPN server-side LAN.
967
.\"*********************************************************
969
.B \-\-route-metric m
970
Specify a default metric
974
.\"*********************************************************
976
.B \-\-route-delay [n] [w]
979
seconds (default=0) after connection
980
establishment, before adding routes. If
982
is 0, routes will be added immediately upon connection
985
is omitted, routes will be added immediately after TUN/TAP device
988
script execution, before any
992
privilege downgrade (or
996
This option is designed to be useful in scenarios where DHCP is
998
tap adapter addresses. The delay will give the DHCP handshake
999
time to complete before routes are added.
1003
tries to be more intelligent by waiting
1005
seconds (w=30 by default)
1006
for the TAP-Win32 adapter to come up before adding routes.
1007
.\"*********************************************************
1010
Execute shell command
1012
after routes are added, subject to
1015
See the "Environmental Variables" section below for
1016
additional parameters passed as environmental variables.
1020
can be a shell command with multiple arguments.
1021
.\"*********************************************************
1024
Don't add or remove routes automatically. Instead pass routes to
1026
script using environmental variables.
1027
.\"*********************************************************
1034
accept options pushed by server EXCEPT for routes.
1036
When used on the client, this option effectively bars the
1037
server from adding routes to the client's routing table,
1038
however note that this option still allows the server
1039
to set the TCP/IP properties of the client's TUN/TAP interface.
1040
.\"*********************************************************
1042
.B \-\-allow-pull-fqdn
1043
Allow client to pull DNS names from server (rather than being limited
1048
.B \-\-route-gateway.
1049
.\"*********************************************************
1051
.B \-\-redirect-gateway flags...
1052
(Experimental) Automatically execute routing commands to cause all outgoing IP traffic
1053
to be redirected over the VPN.
1055
This option performs three steps:
1058
Create a static route for the
1060
address which forwards to the pre-existing default gateway.
1061
This is done so that
1063
will not create a routing loop.
1066
Delete the default gateway route.
1069
Set the new default gateway to be the VPN endpoint address (derived either from
1070
.B \-\-route-gateway
1071
or the second parameter to
1077
When the tunnel is torn down, all of the above steps are reversed so
1078
that the original default route is restored.
1085
flag if both OpenVPN servers are directly connected via a common subnet,
1086
such as with wireless. The
1088
flag will cause step
1090
above to be omitted.
1093
Use this flag to override
1094
the default gateway by using 0.0.0.0/1 and 128.0.0.0/1
1095
rather than 0.0.0.0/0. This has the benefit of overriding
1096
but not wiping out the original default gateway.
1099
Add a direct route to the DHCP server (if it is non-local) which
1101
(Available on Windows clients, may not be available
1102
on non-Windows clients).
1105
Add a direct route to the DNS server(s) (if they are non-local) which
1107
(Available on Windows clients, may not be available
1108
on non-Windows clients).
1110
Using the def1 flag is highly recommended.
1111
.\"*********************************************************
1114
Sets an upper bound on the size of UDP packets which are sent
1115
between OpenVPN peers. It's best not to set this parameter unless
1116
you know what you're doing.
1117
.\"*********************************************************
1120
Take the TUN device MTU to be
1122
and derive the link MTU
1123
from it (default=1500). In most cases, you will probably want to
1124
leave this parameter set to its default value.
1126
The MTU (Maximum Transmission Units) is
1127
the maximum datagram size in bytes that can be sent unfragmented
1128
over a particular network path. OpenVPN requires that packets
1129
on the control or data channels be sent unfragmented.
1131
MTU problems often manifest themselves as connections which
1132
hang during periods of active usage.
1134
It's best to use the
1138
options to deal with MTU sizing issues.
1139
.\"*********************************************************
1141
.B \-\-tun-mtu-extra n
1142
Assume that the TUN/TAP device might return as many as
1146
size on read. This parameter defaults to 0, which is sufficient for
1147
most TUN devices. TAP devices may introduce additional overhead in excess
1148
of the MTU size, and a setting of 32 is the default when TAP devices are used.
1149
This parameter only controls internal OpenVPN buffer sizing,
1150
so there is no transmission overhead associated with using a larger value.
1151
.\"*********************************************************
1153
.B \-\-mtu-disc type
1154
Should we do Path MTU discovery on TCP/UDP channel? Only supported on OSes such
1155
as Linux that supports the necessary system call to set.
1158
\-\- Never send DF (Don't Fragment) frames
1161
\-\- Use per-route hints
1164
\-\- Always DF (Don't Fragment)
1166
.\"*********************************************************
1169
To empirically measure MTU on connection startup,
1172
option to your configuration.
1173
OpenVPN will send ping packets of various sizes
1174
to the remote peer and measure the largest packets
1175
which were successfully received. The
1177
process normally takes about 3 minutes to complete.
1178
.\"*********************************************************
1181
Enable internal datagram fragmentation so
1182
that no UDP datagrams are sent which
1189
parameter is interpreted in the same way as the
1191
parameter, i.e. the UDP packet size after encapsulation
1192
overhead has been added in, but not including
1193
the UDP header itself.
1197
option only makes sense when you are using the UDP protocol (
1202
adds 4 bytes of overhead per datagram.
1206
option below for an important related option to
1209
It should also be noted that this option is not meant to replace
1210
UDP fragmentation at the IP stack level. It is only meant as a
1211
last resort when path MTU discovery is broken. Using this option
1212
is less efficient than fixing path MTU discovery for your IP link and
1213
using native IP fragmentation instead.
1215
Having said that, there are circumstances where using OpenVPN's
1216
internal fragmentation capability may be your only option, such
1217
as tunneling a UDP multicast stream which requires fragmentation.
1218
.\"*********************************************************
1221
Announce to TCP sessions running over the tunnel that they should limit
1222
their send packet sizes such that after OpenVPN has encapsulated them,
1223
the resulting UDP packet size that OpenVPN sends to its peer will not
1230
parameter is interpreted in the same way as the
1232
parameter, i.e. the UDP packet size after encapsulation
1233
overhead has been added in, but not including
1234
the UDP header itself.
1238
option only makes sense when you are using the UDP protocol
1239
for OpenVPN peer-to-peer communication, i.e.
1245
can be ideally used together, where
1247
will try to keep TCP from needing
1248
packet fragmentation in the first place,
1249
and if big packets come through anyhow
1250
(from protocols other than TCP),
1252
will internally fragment them.
1258
are designed to work around cases where Path MTU discovery
1259
is broken on the network path between OpenVPN peers.
1261
The usual symptom of such a breakdown is an OpenVPN
1262
connection which successfully starts, but then stalls
1263
during active usage.
1271
will take its default
1277
Therefore, one could lower the maximum UDP packet size
1278
to 1300 (a good first try for solving MTU-related
1279
connection problems) with the following options:
1281
.B \-\-tun-mtu 1500 \-\-fragment 1300 \-\-mssfix
1282
.\"*********************************************************
1285
Set the TCP/UDP socket send buffer size.
1286
Currently defaults to 65536 bytes.
1287
.\"*********************************************************
1290
Set the TCP/UDP socket receive buffer size.
1291
Currently defaults to 65536 bytes.
1292
.\"*********************************************************
1294
.B \-\-socket-flags flags...
1295
Apply the given flags to the OpenVPN transport socket.
1302
socket flag is useful in TCP mode, and causes the kernel
1303
to send tunnel packets immediately over the TCP connection without
1304
trying to group several smaller packets into a larger packet.
1305
This can result in a considerably improvement in latency.
1307
This option is pushable from server to client, and should be used
1308
on both client and server for maximum effect.
1309
.\"*********************************************************
1312
(Linux only) Set the TX queue length on the TUN/TAP interface.
1313
Currently defaults to 100.
1314
.\"*********************************************************
1317
Limit bandwidth of outgoing tunnel data to
1319
bytes per second on the TCP/UDP port.
1320
If you want to limit the bandwidth
1321
in both directions, use this option on both peers.
1323
OpenVPN uses the following algorithm to implement
1324
traffic shaping: Given a shaper rate of
1326
bytes per second, after a datagram write of
1328
bytes is queued on the TCP/UDP port, wait a minimum of
1330
seconds before queuing the next write.
1332
It should be noted that OpenVPN supports multiple
1333
tunnels between the same two peers, allowing you
1334
to construct full-speed and reduced bandwidth tunnels
1336
routing low-priority data such as off-site backups
1337
over the reduced bandwidth tunnel, and other data
1338
over the full-speed tunnel.
1340
Also note that for low bandwidth tunnels
1341
(under 1000 bytes per second), you should probably
1342
use lower MTU values as well (see above), otherwise
1343
the packet latency will grow so large as to trigger
1344
timeouts in the TLS layer and TCP connections running
1349
to be between 100 bytes/sec and 100 Mbytes/sec.
1350
.\"*********************************************************
1352
.B \-\-inactive n [bytes]
1353
Causes OpenVPN to exit after
1355
seconds of inactivity on the TUN/TAP device. The time length
1356
of inactivity is measured since the last incoming tunnel packet.
1360
parameter is included,
1361
exit after n seconds of activity on tun/tap device
1362
produces a combined in/out byte count that is less than
1364
.\"*********************************************************
1367
Ping remote over the TCP/UDP control channel
1368
if no packets have been sent for at least
1372
on both peers to cause ping packets to be sent in both directions since
1373
OpenVPN ping packets are not echoed like IP ping packets).
1374
When used in one of OpenVPN's secure modes (where
1375
.B \-\-secret, \-\-tls-server,
1378
is specified), the ping packet
1379
will be cryptographically secure.
1381
This option has two intended uses:
1384
with stateful firewalls. The periodic ping will ensure that
1385
a stateful firewall rule which allows OpenVPN UDP packets to
1386
pass will not time out.
1388
(2) To provide a basis for the remote to test the existence
1389
of its peer using the
1392
.\"*********************************************************
1395
Causes OpenVPN to exit after
1397
seconds pass without reception of a ping
1398
or other packet from remote.
1399
This option can be combined with
1400
.B \-\-inactive, \-\-ping,
1403
to create a two-tiered inactivity disconnect.
1407
.B openvpn [options...] \-\-inactive 3600 \-\-ping 10 \-\-ping-exit 60
1409
when used on both peers will cause OpenVPN to exit within 60
1410
seconds if its peer disconnects, but will exit after one
1411
hour if no actual tunnel data is exchanged.
1412
.\"*********************************************************
1414
.B \-\-ping-restart n
1421
seconds pass without reception of a ping
1422
or other packet from remote.
1424
This option is useful in cases
1425
where the remote peer has a dynamic IP address and
1426
a low-TTL DNS name is used to track the IP address using
1428
.I http://dyndns.org/
1429
+ a dynamic DNS client such
1433
If the peer cannot be reached, a restart will be triggered, causing
1434
the hostname used with
1436
to be re-resolved (if
1441
.B \-\-ping-restart, \-\-inactive,
1442
or any other type of internally generated signal will always be
1444
individual client instance objects, never to whole server itself.
1445
Note also in server mode that any internally generated signal
1446
which would normally cause a restart, will cause the deletion
1447
of the client instance object instead.
1451
parameter is set to 120 seconds by default. This default will
1452
hold until the client pulls a replacement value from the server, based on
1455
setting in the server configuration.
1456
To disable the 120 second default, set
1457
.B \-\-ping-restart 0
1460
See the signals section below for more information
1464
Note that the behavior of
1466
can be modified by the
1467
.B \-\-persist-tun, \-\-persist-key, \-\-persist-local-ip,
1469
.B \-\-persist-remote-ip
1476
are mutually exclusive and cannot be used together.
1477
.\"*********************************************************
1479
.B \-\-keepalive n m
1480
A helper directive designed to simplify the expression of
1484
in server mode configurations.
1487
.B \-\-keepalive 10 60
1497
push "ping-restart 60"
1504
.\"*********************************************************
1506
.B \-\-ping-timer-rem
1511
timer only if we have a remote address. Use this option if you are
1512
starting the daemon in listen mode (i.e. without an explicit
1514
peer), and you don't want to start clocking timeouts until a remote
1516
.\"*********************************************************
1519
Don't close and reopen TUN/TAP device or run up/down scripts
1527
is a restart signal similar to
1529
but which offers finer-grained control over
1531
.\"*********************************************************
1534
Don't re-read key files across
1537
.B \-\-ping-restart.
1539
This option can be combined with
1541
to allow restarts triggered by the
1544
Normally if you drop root privileges in OpenVPN,
1545
the daemon cannot be restarted since it will now be unable to re-read protected
1548
This option solves the problem by persisting keys across
1550
resets, so they don't need to be re-read.
1551
.\"*********************************************************
1553
.B \-\-persist-local-ip
1554
Preserve initially resolved local IP address and port number
1560
.\"*********************************************************
1562
.B \-\-persist-remote-ip
1563
Preserve most recently authenticated remote IP address and port number
1569
.\"*********************************************************
1572
Disable paging by calling the POSIX mlockall function.
1573
Requires that OpenVPN be initially run as root (though
1574
OpenVPN can subsequently downgrade its UID using the
1578
Using this option ensures that key material and tunnel
1579
data are never written to disk due to virtual
1580
memory paging operations which occur under most
1581
modern operating systems. It ensures that even if an
1582
attacker was able to crack the box running OpenVPN, he
1583
would not be able to scan the system swap file to
1584
recover previously used
1585
ephemeral keys, which are used for a period of time
1588
options (see below), then are discarded.
1593
is that it will reduce the amount of physical
1594
memory available to other applications.
1595
.\"*********************************************************
1598
Shell command to run after successful TUN/TAP device open
1601
UID change). The up script is useful for specifying route
1602
commands which route IP traffic destined for
1603
private subnets which exist at the other
1604
end of the VPN connection into the tunnel.
1610
.B cmd tun_dev tun_mtu link_mtu ifconfig_local_ip ifconfig_remote_ip [ init | restart ]
1616
.B cmd tap_dev tap_mtu link_mtu ifconfig_local_ip ifconfig_netmask [ init | restart ]
1618
See the "Environmental Variables" section below for
1619
additional parameters passed as environmental variables.
1623
can be a shell command with multiple arguments, in which
1624
case all OpenVPN-generated arguments will be appended
1627
to build a command line which will be passed to the shell.
1631
will run a script to add routes to the tunnel.
1633
Normally the up script is called after the TUN/TAP device is opened.
1634
In this context, the last command line parameter passed to the script
1639
option is also used, the up script will be called for restarts as
1640
well. A restart is considered to be a partial reinitialization
1641
of OpenVPN where the TUN/TAP instance is preserved (the
1643
option will enable such preservation). A restart
1644
can be generated by a SIGUSR1 signal, a
1646
timeout, or a connection reset when the TCP protocol is enabled
1649
option. If a restart occurs, and
1651
has been specified, the up script will be called with
1653
as the last parameter.
1655
The following standalone example shows how the
1657
script can be called in both an initialization and restart context.
1658
(NOTE: for security reasons, don't run the following example unless UDP port
1659
9999 is blocked by your firewall. Also, the example will run indefinitely,
1660
so you should abort with control-c).
1662
.B openvpn \-\-dev tun \-\-port 9999 \-\-verb 4 \-\-ping-restart 10 \-\-up 'echo up' \-\-down 'echo down' \-\-persist-tun \-\-up-restart
1664
Note that OpenVPN also provides the
1666
option to automatically ifconfig the TUN device,
1667
eliminating the need to define an
1669
script, unless you also want to configure routes
1676
is also specified, OpenVPN will pass the ifconfig local
1677
and remote endpoints on the command line to the
1679
script so that they can be used to configure routes such as:
1681
.B route add -net 10.0.0.0 netmask 255.255.255.0 gw $5
1682
.\"*********************************************************
1685
Delay TUN/TAP open and possible
1688
until after TCP/UDP connection establishment with peer.
1692
mode, this option normally requires the use of
1694
to allow connection initiation to be sensed in the absence
1695
of tunnel data, since UDP is a "connectionless" protocol.
1697
On Windows, this option will delay the TAP-Win32 media state
1698
transitioning to "connected" until connection establishment,
1699
i.e. the receipt of the first authenticated packet from the peer.
1700
.\"*********************************************************
1703
Shell command to run after TUN/TAP device close
1708
). Called with the same parameters and environmental
1713
Note that if you reduce privileges by using
1719
script will also run at reduced privilege.
1720
.\"*********************************************************
1725
cmd/script before, rather than after, TUN/TAP close.
1726
.\"*********************************************************
1733
scripts to be called for restarts as well as initial program start.
1734
This option is described more fully above in the
1736
option documentation.
1737
.\"*********************************************************
1739
.B \-\-setenv name value
1740
Set a custom environmental variable
1743
.\"*********************************************************
1745
.B \-\-setenv FORWARD_COMPATIBLE 1
1746
Relax config file syntax checking so that unknown directives
1747
will trigger a warning but not a fatal error,
1748
on the assumption that a given unknown directive might be valid
1749
in future OpenVPN versions.
1751
This option should be used with caution, as there are good security
1752
reasons for having OpenVPN fail if it detects problems in a
1753
config file. Having said that, there are valid reasons for wanting
1754
new software features to gracefully degrade when encountered by
1755
older software versions.
1756
.\"*********************************************************
1758
.B \-\-setenv-safe name value
1759
Set a custom environmental variable
1760
.B OPENVPN_name=value
1763
This directive is designed to be pushed by the server to clients,
1764
and the prepending of "OPENVPN_" to the environmental variable
1765
is a safety precaution to prevent a LD_PRELOAD style attack
1766
from a malicious or compromised server.
1767
.\"*********************************************************
1769
.B \-\-script-security level [method]
1770
This directive offers policy-level control over OpenVPN's usage of external programs
1773
values are more restrictive, higher values are more permissive. Settings for
1777
Strictly no calling of external programs.
1780
(Default) Only call built-in executables such as ifconfig, ip, route, or netsh.
1783
Allow calling of built-in executables and user-defined scripts.
1786
Allow passwords to be passed to scripts via environmental variables (potentially unsafe).
1790
parameter indicates how OpenVPN should call external commands and scripts.
1795
(default) Use execve() function on Unix family OSes and CreateProcess() on Windows.
1798
Use system() function (deprecated and less safe since the external program command
1799
line is subject to shell expansion).
1802
.B \-\-script-security
1803
option was introduced in OpenVPN 2.1_rc9. For configuration file compatibility
1804
with previous OpenVPN versions, use:
1805
.B \-\-script-security 3 system
1806
.\"*********************************************************
1809
Don't output a warning message if option inconsistencies are detected between
1810
peers. An example of an option inconsistency would be where one peer uses
1812
while the other peer uses
1815
Use of this option is discouraged, but is provided as
1816
a temporary fix in situations where a recent version of OpenVPN must
1817
connect to an old version.
1818
.\"*********************************************************
1821
Change the user ID of the OpenVPN process to
1823
after initialization, dropping privileges in the process.
1824
This option is useful to protect the system
1825
in the event that some hostile party was able to gain control of
1826
an OpenVPN session. Though OpenVPN's security features make
1827
this unlikely, it is provided as a second line of defense.
1833
or somebody similarly unprivileged, the hostile party would be
1834
limited in what damage they could cause. Of course once
1835
you take away privileges, you cannot return them
1836
to an OpenVPN session. This means, for example, that if
1837
you want to reset an OpenVPN daemon with a
1840
(for example in response
1841
to a DHCP reset), you should make use of one or more of the
1843
options to ensure that OpenVPN doesn't need to execute any privileged
1844
operations in order to restart (such as re-reading key files
1848
.\"*********************************************************
1854
this option changes the group ID of the OpenVPN process to
1856
after initialization.
1857
.\"*********************************************************
1862
prior to reading any files such as
1863
configuration files, key files, scripts, etc.
1865
should be an absolute path, with a leading "/",
1866
and without any references
1867
to the current directory such as "." or "..".
1869
This option is useful when you are running
1872
mode, and you want to consolidate all of
1873
your OpenVPN control files in one location.
1874
.\"*********************************************************
1879
after initialization.
1881
essentially redefines
1884
level directory tree (/). OpenVPN will therefore
1885
be unable to access any files outside this tree.
1886
This can be desirable from a security standpoint.
1888
Since the chroot operation is delayed until after
1889
initialization, most OpenVPN options that reference
1890
files will operate in a pre-chroot context.
1894
parameter can point to an empty directory, however
1895
complications can result when scripts or restarts
1896
are executed after the chroot operation.
1897
.\"*********************************************************
1899
.B \-\-setcon context
1902
after initialization. This
1903
essentially provides the ability to restrict OpenVPN's
1904
rights to only network I/O operations, thanks to
1905
SELinux. This goes further than
1909
in that those two, while being great security features,
1910
unfortunately do not protect against privilege escalation
1911
by exploitation of a vulnerable system call. You can of
1912
course combine all three, but please note that since
1913
setcon requires access to /proc you will have to provide
1914
it inside the chroot directory (e.g. with mount \-\-bind).
1916
Since the setcon operation is delayed until after
1917
initialization, OpenVPN can be restricted to just
1918
network-related system calls, whereas by applying the
1919
context before startup (such as the OpenVPN one provided
1920
in the SELinux Reference Policies) you will have to
1921
allow many things required only during initialization.
1923
Like with chroot, complications can result when scripts
1924
or restarts are executed after the setcon operation,
1925
which is why you should really consider using the
1930
.\"*********************************************************
1932
.B \-\-daemon [progname]
1933
Become a daemon after all initialization functions are completed.
1934
This option will cause all message and error output to
1935
be sent to the syslog file (such as /var/log/messages),
1936
except for the output of shell scripts and
1938
which will go to /dev/null unless otherwise redirected.
1939
The syslog redirection occurs immediately at the point
1942
is parsed on the command line even though
1943
the daemonization point occurs later. If one of the
1945
options is present, it will supercede syslog
1950
parameter will cause OpenVPN to report its program name
1951
to the system logger as
1953
This can be useful in linking OpenVPN messages
1954
in the syslog file with specific tunnels.
1957
defaults to "openvpn".
1959
When OpenVPN is run with the
1961
option, it will try to delay daemonization until the majority of initialization
1962
functions which are capable of generating fatal errors are complete. This means
1963
that initialization scripts can test the return status of the
1964
openvpn command for a fairly reliable indication of whether the command
1965
has correctly initialized and entered the packet forwarding event loop.
1967
In OpenVPN, the vast majority of errors which occur after initialization are non-fatal.
1968
.\"*********************************************************
1970
.B \-\-syslog [progname]
1971
Direct log output to system logger, but do not become a daemon.
1974
directive above for description of
1977
.\"*********************************************************
1980
Set the TOS field of the tunnel packet to what the payload's TOS is.
1981
.\"*********************************************************
1983
.B \-\-inetd [wait|nowait] [progname]
1984
Use this option when OpenVPN is being run from the inetd or
1990
option must match what is specified in the inetd/xinetd
1993
mode can only be used with
1994
.B \-\-proto tcp-server.
1999
mode can be used to instantiate the OpenVPN daemon as a classic TCP server,
2000
where client connection requests are serviced on a single
2001
port number. For additional information on this kind of configuration,
2002
see the OpenVPN FAQ:
2003
.I http://openvpn.net/faq.html#oneport
2005
This option precludes the use of
2006
.B \-\-daemon, \-\-local,
2009
Note that this option causes message and error output to be handled in the same
2012
option. The optional
2014
parameter is also handled exactly as in
2019
mode, each OpenVPN tunnel requires a separate TCP/UDP port and
2020
a separate inetd or xinetd entry. See the OpenVPN 1.x HOWTO for an example
2021
on using OpenVPN with xinetd:
2022
.I http://openvpn.net/1xhowto.html
2023
.\"*********************************************************
2026
Output logging messages to
2028
including output to stdout/stderr which
2029
is generated by called scripts.
2032
already exists it will be truncated.
2033
This option takes effect
2034
immediately when it is parsed in the command line
2035
and will supercede syslog output if
2040
This option is persistent over the entire course of
2041
an OpenVPN instantiation and will not be reset by SIGHUP,
2043
.B \-\-ping-restart.
2045
Note that on Windows, when OpenVPN is started as a service,
2046
logging occurs by default without the need to specify
2048
.\"*********************************************************
2050
.B \-\-log-append file
2051
Append logging messages to
2055
does not exist, it will be created.
2056
This option behaves exactly like
2058
except that it appends to rather
2059
than truncating the log file.
2060
.\"*********************************************************
2062
.B \-\-suppress-timestamps
2063
Avoid writing timestamps to log messages, even when they
2064
otherwise would be prepended. In particular, this applies to
2065
log messages sent to stdout.
2066
.\"*********************************************************
2068
.B \-\-writepid file
2069
Write OpenVPN's main process ID to
2071
.\"*********************************************************
2074
Change process priority after initialization
2077
greater than 0 is lower priority,
2079
less than zero is higher priority).
2080
.\"*********************************************************
2082
.\".B \-\-nice-work n
2083
.\"Change priority of background TLS work thread. The TLS thread
2084
.\"feature is enabled when OpenVPN is built
2085
.\"with pthread support, and you are running OpenVPN
2086
.\"in TLS mode (i.e. with
2087
.\".B \-\-tls-client
2089
.\".B \-\-tls-server
2092
.\"Using a TLS thread offloads the CPU-intensive process of SSL/TLS-based
2093
.\"key exchange to a background thread so that it does not become
2094
.\"a latency bottleneck in the tunnel packet forwarding process.
2098
.\"is interpreted exactly as with the
2100
.\"option above, but in relation to the work thread rather
2101
.\"than the main thread.
2102
.\"*********************************************************
2105
(Experimental) Optimize TUN/TAP/UDP I/O writes by avoiding
2106
a call to poll/epoll/select prior to the write operation. The purpose
2107
of such a call would normally be to block until the device
2108
or socket is ready to accept the write. Such blocking is unnecessary
2109
on some platforms which don't support write blocking on UDP sockets
2110
or TUN/TAP devices. In such cases, one can optimize the event loop
2111
by avoiding the poll/epoll/select call, improving CPU efficiency
2114
This option can only be used on non-Windows systems, when
2116
is specified, and when
2119
.\"*********************************************************
2122
Configure a multi-homed UDP server. This option can be used when
2123
OpenVPN has been configured to listen on all interfaces, and will
2124
attempt to bind client sessions to the interface on which packets
2125
are being received, so that outgoing packets will be sent out
2126
of the same interface. Note that this option is only relevant for
2127
UDP servers and currently is only implemented on Linux.
2129
Note: clients connecting to a
2131
server should always use the
2134
.\"*********************************************************
2136
.B \-\-echo [parms...]
2141
Designed to be used to send messages to a controlling application
2142
which is receiving the OpenVPN log output.
2143
.\"*********************************************************
2145
.B \-\-remap-usr1 signal
2146
Control whether internally or externally
2147
generated SIGUSR1 signals are remapped to
2148
SIGHUP (restart without persisting state) or
2152
can be set to "SIGHUP" or "SIGTERM". By default, no remapping
2154
.\"*********************************************************
2157
Set output verbosity to
2159
(default=1). Each level shows all info from the previous levels.
2160
Level 3 is recommended if you want a good summary
2161
of what's happening without being swamped by output.
2164
No output except fatal errors.
2174
characters to the console for each packet read and write, uppercase is
2175
used for TCP/UDP packets and lowercase is used for TUN/TAP packets.
2178
Debug info range (see errlevel.h for additional
2179
information on debug levels).
2180
.\"*********************************************************
2182
.B \-\-status file [n]
2183
Write operational status to
2189
Status can also be written to the syslog by sending a
2192
.\"*********************************************************
2194
.B \-\-status-version [n]
2195
Choose the status file format version number. Currently
2197
can be 1, 2, or 3 and defaults to 1.
2198
.\"*********************************************************
2203
consecutive messages in the same category. This is useful to
2204
limit repetitive logging of similar message types.
2205
.\"*********************************************************
2207
.B \-\-comp-lzo [mode]
2208
Use fast LZO compression -- may add up to 1 byte per
2209
packet for incompressible data.
2211
may be "yes", "no", or "adaptive" (default).
2213
In a server mode setup, it is possible to selectively turn
2214
compression on or off for individual clients.
2216
First, make sure the client-side config file enables selective
2217
compression by having at least one
2221
This will turn off compression by default,
2222
but allow a future directive push from the server to
2223
dynamically change the
2224
on/off/adaptive setting.
2227
.B \-\-client-config-dir
2228
file, specify the compression setting for the client,
2240
The first line sets the
2242
setting for the server
2243
side of the link, the second sets the client side.
2244
.\"*********************************************************
2247
When used in conjunction with
2249
this option will disable OpenVPN's adaptive compression algorithm.
2250
Normally, adaptive compression is enabled with
2253
Adaptive compression tries to optimize the case where you have
2254
compression enabled, but you are sending predominantly uncompressible
2255
(or pre-compressed) packets over the tunnel, such as an FTP or rsync transfer
2256
of a large, compressed file. With adaptive compression,
2257
OpenVPN will periodically sample the compression process to measure its
2258
efficiency. If the data being sent over the tunnel is already compressed,
2259
the compression efficiency will be very low, triggering openvpn to disable
2260
compression for a period of time until the next re-sample test.
2261
.\"*********************************************************
2263
.B \-\-management IP port [pw-file]
2264
Enable a TCP server on
2266
to handle daemon management functions.
2269
is a password file (password on first line)
2270
or "stdin" to prompt from standard input. The password
2271
provided will set the password which TCP clients will need
2272
to provide in order to access management functions.
2274
The management interface can also listen on a unix domain socket,
2275
for those platforms that support it. To use a unix domain socket, specify
2276
the unix socket pathname in place of
2280
to 'unix'. While the default behavior is to create a unix domain socket
2281
that may be connected to by any process, the
2282
.B \-\-management-client-user
2284
.B \-\-management-client-group
2285
directives can be used to restrict access.
2287
The management interface provides a special mode where the TCP
2288
management link can operate over the tunnel itself. To enable this mode,
2291
= "tunnel". Tunnel mode will cause the management interface
2292
to listen for a TCP connection on the local VPN address of the
2295
While the management port is designed for programmatic control
2296
of OpenVPN by other applications, it is possible to telnet
2297
to the port, using a telnet client in "raw" mode. Once connected,
2298
type "help" for a list of commands.
2300
For detailed documentation on the management interface, see
2301
the management-notes.txt file in the
2304
the OpenVPN source distribution.
2306
It is strongly recommended that
2309
(localhost) to restrict accessibility of the management
2310
server to local clients.
2311
.\"*********************************************************
2313
.B \-\-management-query-passwords
2314
Query management channel for private key password and
2315
.B \-\-auth-user-pass
2316
username/password. Only query the management channel
2317
for inputs which ordinarily would have been queried from the
2319
.\"*********************************************************
2321
.B \-\-management-forget-disconnect
2322
Make OpenVPN forget passwords when management session
2325
This directive does not affect the
2327
username/password. It is always cached.
2328
.\"*********************************************************
2330
.B \-\-management-hold
2331
Start OpenVPN in a hibernating state, until a client
2332
of the management interface explicitly starts it
2336
.\"*********************************************************
2338
.B \-\-management-signal
2339
Send SIGUSR1 signal to OpenVPN if management session disconnects.
2340
This is useful when you wish to disconnect an OpenVPN session on
2342
.\"*********************************************************
2344
.B \-\-management-log-cache n
2345
Cache the most recent
2347
lines of log file history for usage
2348
by the management channel.
2349
.\"*********************************************************
2351
.B \-\-management-client-auth
2352
Gives management interface client the responsibility
2353
to authenticate clients after their client certificate
2354
has been verified. See management-notes.txt in OpenVPN
2355
distribution for detailed notes.
2356
.\"*********************************************************
2358
.B \-\-management-client-pf
2359
Management interface clients must specify a packet
2360
filter file for each connecting client. See management-notes.txt
2361
in OpenVPN distribution for detailed notes.
2362
.\"*********************************************************
2364
.B \-\-management-client-user u
2365
When the management interface is listening on a unix domain socket,
2366
only allow connections from user
2368
.\"*********************************************************
2370
.B \-\-management-client-group g
2371
When the management interface is listening on a unix domain socket,
2372
only allow connections from group
2374
.\"*********************************************************
2376
.B \-\-plugin module-pathname [init-string]
2377
Load plug-in module from the file
2382
to the module initialization function. Multiple
2383
plugin modules may be loaded into one OpenVPN
2386
For more information and examples on how to build OpenVPN
2387
plug-in modules, see the README file in the
2389
folder of the OpenVPN source distribution.
2391
If you are using an RPM install of OpenVPN, see
2392
/usr/share/openvpn/plugin. The documentation is
2395
and the actual plugin modules are in
2398
Multiple plugin modules can be cascaded, and modules can be
2399
used in tandem with scripts. The modules will be called by
2400
OpenVPN in the order that they are declared in the config
2401
file. If both a plugin and script are configured for the same
2402
callback, the script will be called last. If the
2403
return code of the module/script controls an authentication
2404
function (such as tls-verify, auth-user-pass-verify, or
2405
client-connect), then
2406
every module and script must return success (0) in order for
2407
the connection to be authenticated.
2408
.\"*********************************************************
2410
Starting with OpenVPN 2.0, a multi-client TCP/UDP server mode
2411
is supported, and can be enabled with the
2413
option. In server mode, OpenVPN will listen on a single
2414
port for incoming client connections. All client
2415
connections will be routed through a single tun or tap
2416
interface. This mode is designed for scalability and should
2417
be able to support hundreds or even thousands of clients
2418
on sufficiently fast hardware. SSL/TLS authentication must
2419
be used in this mode.
2420
.\"*********************************************************
2422
.B \-\-server network netmask
2423
A helper directive designed to simplify the configuration
2424
of OpenVPN's server mode. This directive will set up an
2425
OpenVPN server which will allocate addresses to clients
2426
out of the given network/netmask. The server itself
2427
will take the ".1" address of the given network
2428
for use as the server-side endpoint of the local
2432
.B \-\-server 10.8.0.0 255.255.255.0
2440
push "topology [topology]"
2442
if dev tun AND (topology == net30 OR topology == p2p):
2443
ifconfig 10.8.0.1 10.8.0.2
2445
ifconfig-pool 10.8.0.4 10.8.0.251
2446
route 10.8.0.0 255.255.255.0
2447
if client-to-client:
2448
push "route 10.8.0.0 255.255.255.0"
2449
else if topology == net30:
2450
push "route 10.8.0.1"
2452
if dev tap OR (dev tun AND topology == subnet):
2453
ifconfig 10.8.0.1 255.255.255.0
2455
ifconfig-pool 10.8.0.2 10.8.0.254 255.255.255.0
2456
push "route-gateway 10.8.0.1"
2463
if you are ethernet bridging. Use
2464
.B \-\-server-bridge
2466
.\"*********************************************************
2468
.B \-\-server-bridge gateway netmask pool-start-IP pool-end-IP
2470
.B \-\-server-bridge ['nogw']
2472
A helper directive similar to
2474
which is designed to simplify the configuration
2475
of OpenVPN's server mode in ethernet bridging configurations.
2478
.B \-\-server-bridge
2479
is used without any parameters, it will enable a DHCP-proxy
2480
mode, where connecting OpenVPN clients will receive an IP
2481
address for their TAP adapter from the DHCP server running
2482
on the OpenVPN server-side LAN.
2483
Note that only clients that support
2484
the binding of a DHCP client with the TAP adapter (such as
2485
Windows) can support this mode. The optional
2487
flag (advanced) indicates that gateway information should not be
2488
pushed to the client.
2490
To configure ethernet bridging, you
2491
must first use your OS's bridging capability
2492
to bridge the TAP interface with the ethernet
2493
NIC interface. For example, on Linux this is done
2496
tool, and with Windows XP it is done in the Network
2497
Connections Panel by selecting the ethernet and
2498
TAP adapters and right-clicking on "Bridge Connections".
2500
Next you you must manually set the
2501
IP/netmask on the bridge interface. The
2506
.B \-\-server-bridge
2507
can be set to either the IP/netmask of the
2508
bridge interface, or the IP/netmask of the
2509
default gateway/router on the bridged
2512
Finally, set aside a IP range in the bridged
2518
for OpenVPN to allocate to connecting
2522
.B server-bridge 10.8.0.4 255.255.255.0 10.8.0.128 10.8.0.254
2531
ifconfig-pool 10.8.0.128 10.8.0.254 255.255.255.0
2532
push "route-gateway 10.8.0.4"
2538
.B \-\-server-bridge
2539
(without parameters) expands as follows:
2547
push "route-gateway dhcp"
2553
.B \-\-server-bridge nogw
2564
.\"*********************************************************
2566
.B \-\-push "option"
2567
Push a config file option back to the client for remote
2568
execution. Note that
2571
must be enclosed in double quotes (""). The client must specify
2573
in its config file. The set of options which can be
2574
pushed is limited by both feasibility and security.
2575
Some options such as those which would execute scripts
2576
are banned, since they would effectively allow a compromised
2577
server to execute arbitrary code on the client.
2578
Other options such as TLS or MTU parameters
2579
cannot be pushed because the client needs to know
2580
them before the connection to the server can be initiated.
2582
This is a partial list of options which can currently be pushed:
2583
.B \-\-route, \-\-route-gateway, \-\-route-delay, \-\-redirect-gateway,
2584
.B \-\-ip-win32, \-\-dhcp-option,
2585
.B \-\-inactive, \-\-ping, \-\-ping-exit, \-\-ping-restart,
2587
.B \-\-persist-key, \-\-persist-tun, \-\-echo,
2589
.B \-\-socket-flags,
2590
.B \-\-sndbuf, \-\-rcvbuf
2591
.\"*********************************************************
2594
Don't inherit the global push list for a specific client instance.
2595
Specify this option in a client-specific context such
2597
.B \-\-client-config-dir
2598
configuration file. This option will ignore
2600
options at the global config file level.
2601
.\"*********************************************************
2604
Disable a particular client (based on the common name)
2605
from connecting. Don't use this option to disable a client
2606
due to key or password compromise. Use a CRL (certificate
2607
revocation list) instead (see the
2611
This option must be associated with a specific client instance,
2612
which means that it must be specified either in a client
2613
instance config file using
2614
.B \-\-client-config-dir
2615
or dynamically generated using a
2616
.B \-\-client-connect
2618
.\"*********************************************************
2620
.B \-\-ifconfig-pool start-IP end-IP [netmask]
2621
Set aside a pool of subnets to be
2622
dynamically allocated to connecting clients, similar
2623
to a DHCP server. For tun-style
2624
tunnels, each client will be given a /30 subnet (for
2625
interoperability with Windows clients). For tap-style
2626
tunnels, individual addresses will be allocated, and the
2629
parameter will also be pushed to clients.
2631
.\"*********************************************************
2633
.B \-\-ifconfig-pool-persist file [seconds]
2634
Persist/unpersist ifconfig-pool
2639
intervals (default=600), as well as on program startup and
2642
The goal of this option is to provide a long-term association
2643
between clients (denoted by their common name) and the virtual
2644
IP address assigned to them from the ifconfig-pool.
2645
Maintaining a long-term
2646
association is good for clients because it allows them
2647
to effectively use the
2652
is a comma-delimited ASCII file, formatted as
2653
<Common-Name>,<IP-address>.
2659
will be treated as read-only. This is useful if
2660
you would like to treat
2662
as a configuration file.
2664
Note that the entries in this file are treated by OpenVPN as
2665
suggestions only, based on past associations between
2666
a common name and IP address. They do not guarantee that the given common
2667
name will always receive the given IP address. If you want guaranteed
2669
.B \-\-ifconfig-push
2670
.\"*********************************************************
2672
.B \-\-ifconfig-pool-linear
2674
.B \-\-ifconfig-pool
2676
allocate individual TUN interface addresses for
2677
clients rather than /30 subnets. NOTE: This option
2678
is incompatible with Windows clients.
2680
This option is deprecated, and should be replaced with
2682
which is functionally equivalent.
2683
.\"*********************************************************
2685
.B \-\-ifconfig-push local remote-netmask
2686
Push virtual IP endpoints for client tunnel,
2687
overriding the \-\-ifconfig-pool dynamic allocation.
2693
are set according to the
2695
directive which you want to execute on the client machine to
2696
configure the remote end of the tunnel. Note that the parameters
2700
are from the perspective of the client, not the server. They may be
2701
DNS names rather than IP addresses, in which case they will be resolved
2702
on the server at the time of client connection.
2704
This option must be associated with a specific client instance,
2705
which means that it must be specified either in a client
2706
instance config file using
2707
.B \-\-client-config-dir
2708
or dynamically generated using a
2709
.B \-\-client-connect
2712
Remember also to include a
2714
directive in the main OpenVPN config file which encloses
2716
so that the kernel will know to route it
2717
to the server's TUN/TAP interface.
2719
OpenVPN's internal client IP address selection algorithm works as
2724
.B \-\-client-connect script
2725
generated file for static IP (first choice).
2729
.B \-\-client-config-dir
2730
file for static IP (next choice).
2734
.B \-\-ifconfig-pool
2735
allocation for dynamic IP (last choice).
2737
.\"*********************************************************
2739
.B \-\-iroute network [netmask]
2740
Generate an internal route to a specific
2743
parameter, if omitted, defaults to 255.255.255.255.
2745
This directive can be used to route a fixed subnet from
2746
the server to a particular client, regardless
2747
of where the client is connecting from. Remember
2748
that you must also add the route to the system
2749
routing table as well (such as by using the
2751
directive). The reason why two routes are needed
2754
directive routes the packet from the kernel
2755
to OpenVPN. Once in OpenVPN, the
2757
directive routes to the specific client.
2759
This option must be specified either in a client
2760
instance config file using
2761
.B \-\-client-config-dir
2762
or dynamically generated using a
2763
.B \-\-client-connect
2768
directive also has an important interaction with
2772
essentially defines a subnet which is owned by a
2773
particular client (we will call this client A).
2774
If you would like other clients to be able to reach A's
2779
.B \-\-client-to-client
2780
to effect this. In order for all clients to see
2781
A's subnet, OpenVPN must push this route to all clients
2782
EXCEPT for A, since the subnet is already owned by A.
2783
OpenVPN accomplishes this by not
2784
not pushing a route to a client
2785
if it matches one of the client's iroutes.
2786
.\"*********************************************************
2788
.B \-\-client-to-client
2789
Because the OpenVPN server mode handles multiple clients
2790
through a single tun or tap interface, it is effectively
2792
.B \-\-client-to-client
2793
flag tells OpenVPN to internally route client-to-client
2794
traffic rather than pushing all client-originating traffic
2795
to the TUN/TAP interface.
2797
When this option is used, each client will "see" the other
2798
clients which are currently connected. Otherwise, each
2799
client will only see the server. Don't use this option
2800
if you want to firewall tunnel traffic using
2801
custom, per-client rules.
2802
.\"*********************************************************
2805
Allow multiple clients with the same common name to concurrently connect.
2806
In the absence of this option, OpenVPN will disconnect a client instance
2807
upon connection of a new client having the same common name.
2808
.\"*********************************************************
2810
.B \-\-client-connect script
2813
on client connection. The script is passed the common name
2814
and IP address of the just-authenticated client
2815
as environmental variables (see environmental variable section
2816
below). The script is also passed
2817
the pathname of a not-yet-created temporary file as $1
2818
(i.e. the first command line argument), to be used by the script
2819
to pass dynamically generated config file directives back to OpenVPN.
2821
If the script wants to generate a dynamic config file
2822
to be applied on the server when the client connects,
2823
it should write it to the file named by $1.
2826
.B \-\-client-config-dir
2827
option below for options which
2828
can be legally used in a dynamically generated config file.
2830
Note that the return value of
2834
returns a non-zero error status, it will cause the client
2836
.\"*********************************************************
2838
.B \-\-client-disconnect
2840
.B \-\-client-connect
2841
but called on client instance shutdown. Will not be called
2843
.B \-\-client-connect
2844
script and plugins (if defined)
2845
were previously called on this instance with
2846
successful (0) status returns.
2848
The exception to this rule is if the
2849
.B \-\-client-disconnect
2850
script or plugins are cascaded, and at least one client-connect
2851
function succeeded, then ALL of the client-disconnect functions for
2852
scripts and plugins will be called on client instance object deletion,
2853
even in cases where some of the related client-connect functions returned
2856
.\"*********************************************************
2858
.B \-\-client-config-dir dir
2861
for custom client config files. After
2862
a connecting client has been authenticated, OpenVPN will
2863
look in this directory for a file having the same name
2864
as the client's X509 common name. If a matching file
2865
exists, it will be opened and parsed for client-specific
2866
configuration options. If no matching file is found, OpenVPN
2867
will instead try to open and parse a default file called
2868
"DEFAULT", which may be provided but is not required.
2870
This file can specify a fixed IP address for a given
2872
.B \-\-ifconfig-push,
2873
as well as fixed subnets owned by the client using
2876
One of the useful properties of this option is that it
2877
allows client configuration files to be conveniently
2878
created, edited, or removed while the server is live,
2879
without needing to restart the server.
2882
options are legal in a client-specific context:
2883
.B \-\-push, \-\-push-reset, \-\-iroute, \-\-ifconfig-push,
2886
.\"*********************************************************
2888
.B \-\-ccd-exclusive
2890
condition of authentication, that a connecting client has a
2891
.B \-\-client-config-dir
2893
.\"*********************************************************
2898
for temporary files. This directory will be used by
2899
.B \-\-client-connect
2900
scripts to dynamically generate client-specific
2901
configuration files.
2902
.\"*********************************************************
2904
.B \-\-hash-size r v
2905
Set the size of the real address hash table to
2907
and the virtual address table to
2909
By default, both tables are sized at 256 buckets.
2910
.\"*********************************************************
2912
.B \-\-bcast-buffers n
2915
buffers for broadcast datagrams (default=256).
2916
.\"*********************************************************
2918
.B \-\-tcp-queue-limit n
2919
Maximum number of output packets queued before TCP (default=64).
2921
When OpenVPN is tunneling data from a TUN/TAP device to a
2922
remote client over a TCP connection, it is possible that the TUN/TAP device
2923
might produce data at a faster rate than the TCP connection
2924
can support. When the number of output packets queued before sending to
2925
the TCP socket reaches this limit for a given client connection,
2926
OpenVPN will start to drop outgoing packets directed
2928
.\"*********************************************************
2931
This macro sets the TCP_NODELAY socket flag on the server
2932
as well as pushes it to connecting clients. The TCP_NODELAY
2933
flag disables the Nagle algorithm on TCP sockets causing
2934
packets to be transmitted immediately with low latency,
2935
rather than waiting a short period of time in order
2936
to aggregate several packets into a larger containing
2937
packet. In VPN applications over TCP, TCP_NODELAY
2938
is generally a good latency optimization.
2940
The macro expands as follows:
2946
socket-flags TCP_NODELAY
2947
push "socket-flags TCP_NODELAY"
2951
.\"*********************************************************
2953
.B \-\-max-clients n
2954
Limit server to a maximum of
2957
.\"*********************************************************
2959
.B \-\-max-routes-per-client n
2962
internal routes per client (default=256).
2964
help contain DoS attacks where an authenticated client floods the
2965
server with packets appearing to come from many unique MAC addresses,
2966
forcing the server to deplete
2967
virtual memory as its internal routing table expands.
2968
This directive can be used in a
2969
.B \-\-client-config-dir
2970
file or auto-generated by a
2971
.B \-\-client-connect
2972
script to override the global value for a particular client.
2975
directive affects OpenVPN's internal routing table, not the
2976
kernel routing table.
2977
.\"*********************************************************
2979
.B \-\-connect-freq n sec
2984
seconds from clients. This is designed to contain DoS attacks which flood
2985
the server with connection requests using certificates which
2986
will ultimately fail to authenticate.
2988
This is an imperfect solution however, because in a real
2989
DoS scenario, legitimate connections might also be refused.
2991
For the best protection against DoS attacks in server mode,
2996
.\"*********************************************************
2998
.B \-\-learn-address cmd
2999
Run script or shell command
3001
to validate client virtual addresses or routes.
3004
will be executed with 3 parameters:
3006
.B [1] operation \-\-
3007
"add", "update", or "delete" based on whether or not
3008
the address is being added to, modified, or deleted from
3009
OpenVPN's internal routing table.
3012
The address being learned or unlearned. This can be
3013
an IPv4 address such as "198.162.10.14", an IPv4 subnet
3014
such as "198.162.10.0/24", or an ethernet MAC address (when
3016
is being used) such as "00:FF:01:02:03:04".
3018
.B [3] common name \-\-
3019
The common name on the certificate associated with the
3020
client linked to this address. Only present for "add"
3021
or "update" operations, not "delete".
3023
On "add" or "update" methods, if the script returns
3024
a failure code (non-zero), OpenVPN will reject the address
3025
and will not modify its internal routing table.
3029
script will use the information provided above to set
3030
appropriate firewall entries on the VPN TUN/TAP interface.
3031
Since OpenVPN provides the association between virtual IP
3032
or MAC address and the client's authenticated common name,
3033
it allows a user-defined script to configure firewall access
3034
policies with regard to the client's high-level common name,
3035
rather than the low level client virtual addresses.
3036
.\"*********************************************************
3038
.B \-\-auth-user-pass-verify script method
3039
Require the client to provide a username/password (possibly
3040
in addition to a client certificate) for authentication.
3042
OpenVPN will execute
3044
as a shell command to validate the username/password
3045
provided by the client.
3049
is set to "via-env", OpenVPN will call
3051
with the environmental variables
3055
set to the username/password strings provided by the client.
3056
Be aware that this method is insecure on some platforms which
3057
make the environment of a process publicly visible to other
3058
unprivileged processes.
3062
is set to "via-file", OpenVPN will write the username and
3063
password to the first two lines of a temporary file. The filename
3064
will be passed as an argument to
3066
and the file will be automatically deleted by OpenVPN after
3067
the script returns. The location of the temporary file is
3070
option, and will default to the current directory if unspecified.
3071
For security, consider setting
3073
to a volatile storage medium such as
3075
(if available) to prevent the username/password file from touching the hard drive.
3077
The script should examine the username
3079
returning a success exit code (0) if the
3080
client's authentication request is to be accepted, or a failure
3081
code (1) to reject the client.
3083
This directive is designed to enable a plugin-style interface
3084
for extending OpenVPN's authentication capabilities.
3086
To protect against a client passing a maliciously formed
3087
username or password string, the username string must
3088
consist only of these characters: alphanumeric, underbar
3089
('_'), dash ('-'), dot ('.'), or at ('@'). The password
3090
string can consist of any printable characters except for
3091
CR or LF. Any illegal characters in either the username
3092
or password string will be converted to underbar ('_').
3094
Care must be taken by any user-defined scripts to avoid
3095
creating a security vulnerability in the way that these
3096
strings are handled. Never use these strings in such a way
3097
that they might be escaped or evaluated by a shell interpreter.
3099
For a sample script that performs PAM authentication, see
3100
.B sample-scripts/auth-pam.pl
3101
in the OpenVPN source distribution.
3102
.\"*********************************************************
3105
Clients that connect with options that are incompatible
3106
with those of the server will be disconnected.
3108
Options that will be compared for compatibility include
3109
dev-type, link-mtu, tun-mtu, proto, tun-ipv6, ifconfig,
3110
comp-lzo, fragment, keydir, cipher, auth, keysize, secret,
3111
no-replay, no-iv, tls-auth, key-method, tls-server, and tls-client.
3113
This option requires that
3116
.\"*********************************************************
3118
.B \-\-auth-user-pass-optional
3119
Allow connections by clients that do not specify a username/password.
3121
.B \-\-auth-user-pass-verify
3123
.B \-\-management-client-auth
3124
is specified (or an authentication plugin module), the
3125
OpenVPN server daemon will require connecting clients to specify a
3126
username and password. This option makes the submission of a username/password
3127
by clients optional, passing the responsibility to the user-defined authentication
3128
module/script to accept or deny the client based on other factors
3129
(such as the setting of X509 certificate fields). When this option is used,
3130
and a connecting client does not submit a username/password, the user-defined
3131
authentication module/script will see the username and password as being set
3132
to empty strings (""). The authentication module/script MUST have logic
3133
to detect this condition and respond accordingly.
3134
.\"*********************************************************
3136
.B \-\-client-cert-not-required
3137
Don't require client certificate, client will authenticate
3138
using username/password only. Be aware that using this directive
3139
is less secure than requiring certificates from all clients.
3141
If you use this directive, the
3142
entire responsibility of authentication will rest on your
3143
.B \-\-auth-user-pass-verify
3144
script, so keep in mind that bugs in your script
3145
could potentially compromise the security of your VPN.
3147
If you don't use this directive, but you also specify an
3148
.B \-\-auth-user-pass-verify
3149
script, then OpenVPN will perform double authentication. The
3150
client certificate verification AND the
3151
.B \-\-auth-user-pass-verify
3152
script will need to succeed in order for a client to be
3153
authenticated and accepted onto the VPN.
3154
.\"*********************************************************
3156
.B \-\-username-as-common-name
3158
.B \-\-auth-user-pass-verify
3160
the authenticated username as the common name,
3161
rather than the common name from the client cert.
3162
.\"*********************************************************
3164
.B \-\-no-name-remapping
3165
Allow Common Name, X509 Subject, and username strings to include
3166
any printable character including space, but excluding control
3167
characters such as tab, newline, and carriage-return.
3169
By default, OpenVPN will remap
3170
any character other than alphanumeric, underbar ('_'), dash
3171
('-'), dot ('.'), and slash ('/') to underbar ('_'). The X509
3172
Subject string as returned by the
3174
environmental variable, can additionally contain colon (':') or
3177
While name remapping is performed for security reasons to reduce
3178
the possibility of introducing string expansion security vulnerabilities
3179
in user-defined authentication
3180
scripts, this option is provided for those cases where it is desirable to
3181
disable the remapping feature. Don't use this option unless you
3182
know what you are doing!
3183
.\"*********************************************************
3185
.B \-\-port-share host port
3186
When run in TCP server mode, share the OpenVPN port with
3187
another application, such as an HTTPS server. If OpenVPN
3188
senses a connection to its port which is using a non-OpenVPN
3189
protocol, it will proxy the connection to the server at
3191
Currently only designed to work with HTTP/HTTPS,
3192
though it would be theoretically possible to extend to
3193
other protocols such as ssh.
3195
Not implemented on Windows.
3196
.\"*********************************************************
3198
Use client mode when connecting to an OpenVPN server
3200
.B \-\-server, \-\-server-bridge,
3203
in it's configuration.
3204
.\"*********************************************************
3207
A helper directive designed to simplify the configuration
3208
of OpenVPN's client mode. This directive is equivalent to:
3218
.\"*********************************************************
3221
This option must be used on a client which is connecting
3222
to a multi-client server. It indicates to OpenVPN that it
3223
should accept options pushed by the server, provided they
3224
are part of the legal set of pushable options (note that the
3226
option is implied by
3232
allows the server to push routes to the client, so you should
3237
in situations where you don't trust the server to have control
3238
over the client's routing table.
3239
.\"*********************************************************
3241
.B \-\-auth-user-pass [up]
3242
Authenticate with server using username/password.
3244
is a file containing username/password on 2 lines (Note: OpenVPN
3245
will only read passwords from a file if it has been built
3246
with the \-\-enable-password-save configure option, or on Windows
3247
by defining ENABLE_PASSWORD_SAVE in config-win32.h).
3251
is omitted, username/password will be prompted from the
3254
The server configuration must specify an
3255
.B \-\-auth-user-pass-verify
3256
script to verify the username/password provided by
3258
.\"*********************************************************
3260
.B \-\-auth-retry type
3261
Controls how OpenVPN responds to username/password verification
3262
errors such as the client-side response to an AUTH_FAILED message from the server
3263
or verification failure of the private key password.
3265
Normally used to prevent auth errors from being fatal
3266
on the client side, and to permit username/password requeries in case
3269
An AUTH_FAILED message is generated by the server if the client
3271
.B \-\-auth-user-pass
3272
authentication, or if the server-side
3273
.B \-\-client-connect
3274
script returns an error status when the client
3281
Client will exit with a fatal error (this is the default).
3284
Client will retry the connection without requerying for an
3285
.B \-\-auth-user-pass
3286
username/password. Use this option for unattended clients.
3289
Client will requery for an
3290
.B \-\-auth-user-pass
3291
username/password and/or private key password before attempting a reconnection.
3293
Note that while this option cannot be pushed, it can be controlled
3294
from the management interface.
3295
.\"*********************************************************
3297
.B \-\-server-poll-timeout n
3298
when polling possible remote servers to connect to
3299
in a round-robin fashion, spend no more than
3301
seconds waiting for a response before trying the next server.
3302
.\"*********************************************************
3304
.B \-\-explicit-exit-notify [n]
3305
In UDP client mode or point-to-point mode, send server/peer an exit notification
3306
if tunnel is restarted or OpenVPN process is exited. In client mode, on
3308
option will tell the server to immediately close its client instance object
3309
rather than waiting for a timeout. The
3311
parameter (default=1) controls the maximum number of retries that the client
3312
will attempt to resend the exit notification message.
3313
.\"*********************************************************
3314
.SS Data Channel Encryption Options:
3315
These options are meaningful for both Static & TLS-negotiated key modes
3316
(must be compatible between peers).
3317
.\"*********************************************************
3319
.B \-\-secret file [direction]
3320
Enable Static Key encryption mode (non-TLS).
3321
Use pre-shared secret
3323
which was generated with
3328
parameter enables the use of 4 distinct keys
3329
(HMAC-send, cipher-encrypt, HMAC-receive, cipher-decrypt), so that
3330
each data flow direction has a different set of HMAC and cipher keys.
3331
This has a number of desirable security properties including
3332
eliminating certain kinds of DoS and message replay attacks.
3336
parameter is omitted, 2 keys are used bidirectionally, one for HMAC
3337
and the other for encryption/decryption.
3341
parameter should always be complementary on either side of the connection,
3342
i.e. one side should use "0" and the other should use "1", or both sides
3343
should omit it altogether.
3347
parameter requires that
3349
contains a 2048 bit key. While pre-1.5 versions of OpenVPN
3350
generate 1024 bit key files, any version of OpenVPN which
3353
parameter, will also support 2048 bit key file generation
3358
Static key encryption mode has certain advantages,
3359
the primary being ease of configuration.
3361
There are no certificates
3362
or certificate authorities or complicated negotiation handshakes and protocols.
3363
The only requirement is that you have a pre-existing secure channel with
3366
) to initially copy the key. This requirement, along with the
3367
fact that your key never changes unless you manually generate a new one,
3368
makes it somewhat less secure than TLS mode (see below). If an attacker
3369
manages to steal your key, everything that was ever encrypted with
3370
it is compromised. Contrast that to the perfect forward secrecy features of
3371
TLS mode (using Diffie Hellman key exchange), where even if an attacker
3372
was able to steal your private key, he would gain no information to help
3373
him decrypt past sessions.
3375
Another advantageous aspect of Static Key encryption mode is that
3376
it is a handshake-free protocol
3377
without any distinguishing signature or feature
3378
(such as a header or protocol handshake sequence)
3379
that would mark the ciphertext packets as being
3380
generated by OpenVPN. Anyone eavesdropping on the wire
3382
but random-looking data.
3383
.\"*********************************************************
3386
Authenticate packets with HMAC using message
3392
HMAC is a commonly used message authentication algorithm (MAC) that uses
3393
a data string, a secure hash algorithm, and a key, to produce
3394
a digital signature.
3396
OpenVPN's usage of HMAC is to first encrypt a packet, then HMAC the resulting ciphertext.
3398
In static-key encryption mode, the HMAC key
3399
is included in the key file generated by
3401
In TLS mode, the HMAC key is dynamically generated and shared
3402
between peers via the TLS control channel. If OpenVPN receives a packet with
3403
a bad HMAC it will drop the packet.
3404
HMAC usually adds 16 or 20 bytes per packet.
3407
to disable authentication.
3409
For more information on HMAC see
3410
.I http://www.cs.ucsd.edu/users/mihir/papers/hmac.html
3411
.\"*********************************************************
3414
Encrypt packets with cipher algorithm
3418
an abbreviation for Blowfish in Cipher Block Chaining mode.
3419
Blowfish has the advantages of being fast, very secure, and allowing key sizes
3420
of up to 448 bits. Blowfish is designed to be used in situations where
3421
keys are changed infrequently.
3423
For more information on blowfish, see
3424
.I http://www.counterpane.com/blowfish.html
3426
To see other ciphers that are available with
3431
OpenVPN supports the CBC, CFB, and OFB cipher modes,
3432
however CBC is recommended and CFB and OFB should
3433
be considered advanced modes.
3437
to disable encryption.
3438
.\"*********************************************************
3441
Size of cipher key in bits (optional).
3442
If unspecified, defaults to cipher-specific default. The
3444
option (see below) shows all available OpenSSL ciphers,
3445
their default key sizes, and whether the key size can
3446
be changed. Use care in changing a cipher's default
3447
key size. Many ciphers have not been extensively
3448
cryptanalyzed with non-standard key lengths, and a
3449
larger key may offer no real guarantee of greater
3450
security, or may even reduce security.
3451
.\"*********************************************************
3453
.B \-\-prng alg [nsl]
3454
(Advanced) For PRNG (Pseudo-random number generator),
3455
use digest algorithm
3457
(default=sha1), and set
3460
to the size in bytes of the nonce secret length (between 16 and 64).
3464
to disable the PRNG and use the OpenSSL RAND_bytes function
3465
instead for all of OpenVPN's pseudo-random number needs.
3466
.\"*********************************************************
3468
.B \-\-engine [engine-name]
3469
Enable OpenSSL hardware-based crypto engine functionality.
3474
use a specific crypto engine. Use the
3476
standalone option to list the crypto engines which are
3477
supported by OpenSSL.
3478
.\"*********************************************************
3481
(Advanced) Disable OpenVPN's protection against replay attacks.
3482
Don't use this option unless you are prepared to make
3483
a tradeoff of greater efficiency in exchange for less
3486
OpenVPN provides datagram replay protection by default.
3488
Replay protection is accomplished
3489
by tagging each outgoing datagram with an identifier
3490
that is guaranteed to be unique for the key being used.
3491
The peer that receives the datagram will check for
3492
the uniqueness of the identifier. If the identifier
3493
was already received in a previous datagram, OpenVPN
3494
will drop the packet. Replay protection is important
3495
to defeat attacks such as a SYN flood attack, where
3496
the attacker listens in the wire, intercepts a TCP
3497
SYN packet (identifying it by the context in which
3498
it occurs in relation to other packets), then floods
3499
the receiving peer with copies of this packet.
3501
OpenVPN's replay protection is implemented in slightly
3502
different ways, depending on the key management mode
3506
or when using an CFB or OFB mode cipher, OpenVPN uses a
3507
64 bit unique identifier that combines a time stamp with
3508
an incrementing sequence number.
3510
When using TLS mode for key exchange and a CBC cipher
3511
mode, OpenVPN uses only a 32 bit sequence number without
3512
a time stamp, since OpenVPN can guarantee the uniqueness
3513
of this value for each key. As in IPSec, if the sequence number is
3514
close to wrapping back to zero, OpenVPN will trigger
3517
To check for replays, OpenVPN uses
3522
.\"*********************************************************
3524
.B \-\-replay-window n [t]
3525
Use a replay protection sliding-window of size
3527
and a time window of
3533
is 64 (the IPSec default) and
3537
This option is only relevant in UDP mode, i.e.
3542
option is specified.
3544
When OpenVPN tunnels IP packets over UDP, there is the possibility that
3545
packets might be dropped or delivered out of order. Because OpenVPN, like IPSec,
3546
is emulating the physical network layer,
3547
it will accept an out-of-order packet sequence, and
3548
will deliver such packets in the same order they were received to
3549
the TCP/IP protocol stack, provided they satisfy several constraints.
3552
The packet cannot be a replay (unless
3554
is specified, which disables replay protection altogether).
3557
If a packet arrives out of order, it will only be accepted if the difference
3558
between its sequence number and the highest sequence number received
3563
If a packet arrives out of order, it will only be accepted if it arrives no later
3566
seconds after any packet containing a higher sequence number.
3568
If you are using a network link with a large pipeline (meaning that
3569
the product of bandwidth and latency is high), you may want to use
3572
Satellite links in particular often require this.
3574
If you run OpenVPN at
3576
you will see the message "Replay-window backtrack occurred [x]"
3577
every time the maximum sequence number backtrack seen thus far
3578
increases. This can be used to calibrate
3581
There is some controversy on the appropriate method of handling packet
3582
reordering at the security layer.
3584
Namely, to what extent should the
3585
security layer protect the encapsulated protocol from attacks which masquerade
3586
as the kinds of normal packet loss and reordering that occur over IP networks?
3588
The IPSec and OpenVPN approach is to allow packet reordering within a certain
3589
fixed sequence number window.
3591
OpenVPN adds to the IPSec model by limiting the window size in time as well as
3594
OpenVPN also adds TCP transport as an option (not offered by IPSec) in which
3595
case OpenVPN can adopt a very strict attitude towards message deletion and
3596
reordering: Don't allow it. Since TCP guarantees reliability, any packet
3597
loss or reordering event can be assumed to be an attack.
3599
In this sense, it could be argued that TCP tunnel transport is preferred when
3600
tunneling non-IP or UDP application protocols which might be vulnerable to a
3601
message deletion or reordering attack which falls within the normal
3602
operational parameters of IP networks.
3604
So I would make the statement that one should never tunnel a non-IP protocol
3605
or UDP application protocol over UDP, if the protocol might be vulnerable to a
3606
message deletion or reordering attack that falls within the normal operating
3607
parameters of what is to be expected from the physical IP layer. The problem
3608
is easily fixed by simply using TCP as the VPN transport layer.
3609
.\"*********************************************************
3611
.B \-\-mute-replay-warnings
3612
Silence the output of replay warnings, which are a common
3613
false alarm on WiFi networks. This option preserves
3614
the security of the replay protection code without
3615
the verbosity associated with warnings about duplicate
3617
.\"*********************************************************
3619
.B \-\-replay-persist file
3620
Persist replay-protection state across sessions using
3622
to save and reload the state.
3624
This option will strengthen protection against replay attacks,
3625
especially when you are using OpenVPN in a dynamic context (such
3628
when OpenVPN sessions are frequently started and stopped.
3630
This option will keep a disk copy of the current replay protection
3631
state (i.e. the most recent packet timestamp and sequence number
3632
received from the remote peer), so that if an OpenVPN session
3633
is stopped and restarted, it will reject any replays of packets
3634
which were already received by the prior session.
3636
This option only makes sense when replay protection is enabled
3637
(the default) and you are using either
3639
(shared-secret key mode) or TLS mode with
3641
.\"*********************************************************
3644
(Advanced) Disable OpenVPN's use of IV (cipher initialization vector).
3645
Don't use this option unless you are prepared to make
3646
a tradeoff of greater efficiency in exchange for less
3649
OpenVPN uses an IV by default, and requires it for CFB and
3650
OFB cipher modes (which are totally insecure without it).
3651
Using an IV is important for security when multiple
3652
messages are being encrypted/decrypted with the same key.
3654
IV is implemented differently depending on the cipher mode used.
3656
In CBC mode, OpenVPN uses a pseudo-random IV for each packet.
3658
In CFB/OFB mode, OpenVPN uses a unique sequence number and time stamp
3659
as the IV. In fact, in CFB/OFB mode, OpenVPN uses a datagram
3660
space-saving optimization that uses the unique identifier for
3661
datagram replay protection as the IV.
3662
.\"*********************************************************
3665
Do a self-test of OpenVPN's crypto options by encrypting and
3666
decrypting test packets using the data channel encryption options
3667
specified above. This option does not require a peer to function,
3668
and therefore can be specified without
3673
The typical usage of
3675
would be something like this:
3677
.B openvpn \-\-test-crypto \-\-secret key
3681
.B openvpn \-\-test-crypto \-\-secret key \-\-verb 9
3683
This option is very useful to test OpenVPN after it has been ported to
3684
a new platform, or to isolate problems in the compiler, OpenSSL
3685
crypto library, or OpenVPN's crypto code. Since it is a self-test mode,
3686
problems with encryption and authentication can be debugged independently
3687
of network and tunnel issues.
3688
.\"*********************************************************
3689
.SS TLS Mode Options:
3690
TLS mode is the most powerful crypto mode of OpenVPN in both security and flexibility.
3691
TLS mode works by establishing control and
3692
data channels which are multiplexed over a single TCP/UDP port. OpenVPN initiates
3693
a TLS session over the control channel and uses it to exchange cipher
3694
and HMAC keys to protect the data channel. TLS mode uses a robust reliability
3695
layer over the UDP connection for all control channel communication, while
3696
the data channel, over which encrypted tunnel data passes, is forwarded without
3697
any mediation. The result is the best of both worlds: a fast data channel
3698
that forwards over UDP with only the overhead of encrypt,
3699
decrypt, and HMAC functions,
3700
and a control channel that provides all of the security features of TLS,
3701
including certificate-based authentication and Diffie Hellman forward secrecy.
3703
To use TLS mode, each peer that runs OpenVPN should have its own local
3704
certificate/key pair (
3708
), signed by the root certificate which is specified
3712
When two OpenVPN peers connect, each presents its local certificate to the
3713
other. Each peer will then check that its partner peer presented a
3714
certificate which was signed by the master root certificate as specified in
3717
If that check on both peers succeeds, then the TLS negotiation
3718
will succeed, both OpenVPN
3719
peers will exchange temporary session keys, and the tunnel will begin
3722
The OpenVPN distribution contains a set of scripts for
3723
managing RSA certificates & keys,
3728
The easy-rsa package is also rendered in web form here:
3729
.I http://openvpn.net/easyrsa.html
3730
.\"*********************************************************
3733
Enable TLS and assume server role during TLS handshake. Note that
3734
OpenVPN is designed as a peer-to-peer application. The designation
3735
of client or server is only for the purpose of negotiating the TLS
3737
.\"*********************************************************
3740
Enable TLS and assume client role during TLS handshake.
3741
.\"*********************************************************
3744
Certificate authority (CA) file in .pem format, also referred to as the
3746
certificate. This file can have multiple
3747
certificates in .pem format, concatenated together. You can construct your own
3748
certificate authority certificate and private key by using a command such as:
3750
.B openssl req -nodes -new -x509 -keyout ca.key -out ca.crt
3752
Then edit your openssl.cnf file and edit the
3754
variable to point to your new root certificate
3757
For testing purposes only, the OpenVPN distribution includes a sample
3758
CA certificate (ca.crt).
3759
Of course you should never use
3760
the test certificates and test keys distributed with OpenVPN in a
3761
production environment, since by virtue of the fact that
3762
they are distributed with OpenVPN, they are totally insecure.
3763
.\"*********************************************************
3766
File containing Diffie Hellman parameters
3767
in .pem format (required for
3771
.B openssl dhparam -out dh1024.pem 1024
3773
to generate your own, or use the existing dh1024.pem file
3774
included with the OpenVPN distribution. Diffie Hellman parameters
3775
may be considered public.
3776
.\"*********************************************************
3779
Local peer's signed certificate in .pem format \-\- must be signed
3780
by a certificate authority whose certificate is in
3782
Each peer in an OpenVPN link running in TLS mode should have its own
3783
certificate and private key file. In addition, each certificate should
3784
have been signed by the key of a certificate
3785
authority whose public key resides in the
3787
certificate authority file.
3788
You can easily make your own certificate authority (see above) or pay money
3789
to use a commercial service such as thawte.com (in which case you will be
3790
helping to finance the world's second space tourist :).
3791
To generate a certificate,
3792
you can use a command such as:
3794
.B openssl req -nodes -new -keyout mycert.key -out mycert.csr
3796
If your certificate authority private key lives on another machine, copy
3797
the certificate signing request (mycert.csr) to this other machine (this can
3798
be done over an insecure channel such as email). Now sign the certificate
3799
with a command such as:
3801
.B openssl ca -out mycert.crt -in mycert.csr
3803
Now copy the certificate (mycert.crt)
3804
back to the peer which initially generated the .csr file (this
3805
can be over a public medium).
3808
command reads the location of the certificate authority key from its
3809
configuration file such as
3810
.B /usr/share/ssl/openssl.cnf
3812
that for certificate authority functions, you must set up the files
3820
.\"*********************************************************
3823
Local peer's private key in .pem format. Use the private key which was generated
3824
when you built your peer's certificate (see
3827
.\"*********************************************************
3830
Specify a PKCS #12 file containing local private key,
3831
local certificate, and root CA certificate.
3832
This option can be used instead of
3833
.B \-\-ca, \-\-cert,
3836
.\"*********************************************************
3838
.B \-\-pkcs11-cert-private [0|1]...
3839
Set if access to certificate object should be performed after login.
3840
Every provider has its own setting.
3841
.\"*********************************************************
3843
.B \-\-pkcs11-id name
3844
Specify the serialized certificate id to be used. The id can be gotten
3846
.B \-\-show-pkcs11-ids
3848
.\"*********************************************************
3850
.B \-\-pkcs11-id-management
3851
Acquire PKCS#11 id from management interface. In this case a NEED-STR 'pkcs11-id-request'
3852
real-time message will be triggered, application may use pkcs11-id-count command to
3853
retrieve available number of certificates, and pkcs11-id-get command to retrieve certificate
3854
id and certificate body.
3855
.\"*********************************************************
3857
.B \-\-pkcs11-pin-cache seconds
3858
Specify how many seconds the PIN can be cached, the default is until the token is removed.
3859
.\"*********************************************************
3861
.B \-\-pkcs11-protected-authentication [0|1]...
3862
Use PKCS#11 protected authentication path, useful for biometric and external
3864
Every provider has its own setting.
3865
.\"*********************************************************
3867
.B \-\-pkcs11-providers provider...
3868
Specify a RSA Security Inc. PKCS #11 Cryptographic Token Interface (Cryptoki) providers
3870
This option can be used instead of
3871
.B \-\-cert, \-\-key,
3874
.\"*********************************************************
3876
.B \-\-pkcs11-private-mode mode...
3877
Specify which method to use in order to perform private key operations.
3878
A different mode can be specified for each provider.
3879
Mode is encoded as hex number, and can be a mask one of the following:
3882
(default) -- Try to determind automatically.
3888
-- Use sign recover.
3896
.\"*********************************************************
3898
.B \-\-cryptoapicert select-string
3899
Load the certificate and private key from the
3900
Windows Certificate System Store (Windows Only).
3902
Use this option instead of
3908
it possible to use any smart card, supported by Windows, but also any
3909
kind of certificate, residing in the Cert Store, where you have access to
3910
the private key. This option has been tested with a couple of different
3911
smart cards (GemSAFE, Cryptoflex, and Swedish Post Office eID) on the
3912
client side, and also an imported PKCS12 software certificate on the
3915
To select a certificate, based on a substring search in the
3916
certificate's subject:
3919
"SUBJ:Peter Runestig"
3921
To select a certificate, based on certificate's thumbprint:
3924
"THUMB:f6 49 24 41 01 b4 ..."
3926
The thumbprint hex string can easily be copy-and-pasted from the Windows
3927
Certificate Store GUI.
3929
.\"*********************************************************
3932
Use data channel key negotiation method
3934
The key method must match on both sides of the connection.
3936
After OpenVPN negotiates a TLS session, a new set of keys
3937
for protecting the tunnel data channel is generated and
3938
exchanged over the TLS session.
3940
In method 1 (the default for OpenVPN 1.x), both sides generate
3941
random encrypt and HMAC-send keys which are forwarded to
3942
the other host over the TLS channel.
3944
In method 2, (the default for OpenVPN 2.0)
3945
the client generates a random key. Both client
3946
and server also generate some random seed material. All key source
3947
material is exchanged over the TLS channel. The actual
3948
keys are generated using the TLS PRF function, taking source
3949
entropy from both client and server. Method 2 is designed to
3950
closely parallel the key generation process used by TLS 1.0.
3952
Note that in TLS mode, two separate levels
3955
(1) The TLS connection is initially negotiated, with both sides
3956
of the connection producing certificates and verifying the certificate
3957
(or other authentication info provided) of
3960
parameter has no effect on this process.
3962
(2) After the TLS connection is established, the tunnel session keys are
3963
separately negotiated over the existing secure TLS channel. Here,
3965
determines the derivation of the tunnel session keys.
3966
.\"*********************************************************
3971
of allowable TLS ciphers delimited by a colon (":").
3972
If you require a high level of security,
3973
you may want to set this parameter manually, to prevent a
3974
version rollback attack where a man-in-the-middle attacker tries
3975
to force two peers to negotiate to the lowest level
3976
of security they both support.
3979
to see a list of supported TLS ciphers.
3980
.\"*********************************************************
3982
.B \-\-tls-timeout n
3983
Packet retransmit timeout on TLS control channel
3984
if no acknowledgment from remote within
3986
seconds (default=2). When OpenVPN sends a control
3987
packet to its peer, it will expect to receive an
3988
acknowledgement within
3990
seconds or it will retransmit the packet, subject
3991
to a TCP-like exponential backoff algorithm. This parameter
3992
only applies to control channel packets. Data channel
3993
packets (which carry encrypted tunnel data) are never
3994
acknowledged, sequenced, or retransmitted by OpenVPN because
3995
the higher level network protocols running on top of the tunnel
3996
such as TCP expect this role to be left to them.
3997
.\"*********************************************************
3999
.B \-\-reneg-bytes n
4000
Renegotiate data channel key after
4002
bytes sent or received (disabled by default).
4003
OpenVPN allows the lifetime of a key
4004
to be expressed as a number of bytes encrypted/decrypted, a number of packets, or
4005
a number of seconds. A key renegotiation will be forced
4006
if any of these three criteria are met by either peer.
4007
.\"*********************************************************
4010
Renegotiate data channel key after
4012
packets sent and received (disabled by default).
4013
.\"*********************************************************
4016
Renegotiate data channel key after
4018
seconds (default=3600).
4020
When using dual-factor authentication, note that this default value may
4021
cause the end user to be challenged to reauthorize once per hour.
4023
Also, keep in mind that this option can be used on both the client and server,
4024
and whichever uses the lower value will be the one to trigger the renegotiation.
4025
A common mistake is to set
4027
to a higher value on either the client or server, while the other side of the connection
4028
is still using the default value of 3600 seconds, meaning that the renegotiation will
4029
still occur once per 3600 seconds. The solution is to increase \-\-reneg-sec on both the
4030
client and server, or set it to 0 on one side of the connection (to disable), and to
4031
your chosen value on the other side.
4032
.\"*********************************************************
4034
.B \-\-hand-window n
4035
Handshake Window \-\- the TLS-based key exchange must finalize within
4038
of handshake initiation by any peer (default = 60 seconds).
4039
If the handshake fails
4040
we will attempt to reset our connection with our peer and try again.
4041
Even in the event of handshake failure we will still use
4042
our expiring key for up to
4044
seconds to maintain continuity of transmission of tunnel
4046
.\"*********************************************************
4048
.B \-\-tran-window n
4049
Transition window \-\- our old key can live this many seconds
4050
after a new a key renegotiation begins (default = 3600 seconds).
4051
This feature allows for a graceful transition from old to new
4052
key, and removes the key renegotiation sequence from the critical
4053
path of tunnel data forwarding.
4054
.\"*********************************************************
4056
.B \-\-single-session
4057
After initially connecting to a remote peer, disallow any new connections.
4059
option means that a remote peer cannot connect, disconnect, and then
4062
If the daemon is reset by a signal or
4063
.B \-\-ping-restart,
4064
it will allow one new connection.
4066
.B \-\-single-session
4071
to create a single dynamic session that will exit when finished.
4072
.\"*********************************************************
4075
Exit on TLS negotiation failure.
4076
.\"*********************************************************
4078
.B \-\-tls-auth file [direction]
4079
Add an additional layer of HMAC authentication on top of the TLS
4080
control channel to protect against DoS attacks.
4084
enables a kind of "HMAC firewall" on OpenVPN's TCP/UDP port,
4085
where TLS control channel packets
4086
bearing an incorrect HMAC signature can be dropped immediately without
4090
(required) is a key file which can be in one of two formats:
4093
An OpenVPN static key file generated by
4100
A freeform passphrase file. In this case the HMAC key will
4101
be derived by taking a secure hash of this file, similar to
4108
OpenVPN will first try format (1), and if the file fails to parse as
4109
a static key file, format (2) will be used.
4113
option for more information on the optional
4118
is recommended when you are running OpenVPN in a mode where
4119
it is listening for packets from any IP address, such as when
4121
is not specified, or
4127
this feature is as follows. TLS requires a multi-packet exchange
4128
before it is able to authenticate a peer. During this time
4129
before authentication, OpenVPN is allocating resources (memory
4130
and CPU) to this potential peer. The potential peer is also
4131
exposing many parts of OpenVPN and the OpenSSL library to the packets
4132
it is sending. Most successful network attacks today seek
4133
to either exploit bugs in programs (such as buffer overflow attacks) or
4134
force a program to consume so many resources that it becomes unusable.
4135
Of course the first line of defense is always to produce clean,
4136
well-audited code. OpenVPN has been written with buffer overflow
4137
attack prevention as a top priority.
4138
But as history has shown, many of the most widely used
4139
network applications have, from time to time,
4140
fallen to buffer overflow attacks.
4142
So as a second line of defense, OpenVPN offers
4143
this special layer of authentication on top of the TLS control channel so that
4144
every packet on the control channel is authenticated by an
4145
HMAC signature and a unique ID for replay protection.
4146
This signature will also help protect against DoS (Denial of Service) attacks.
4147
An important rule of thumb in reducing vulnerability to DoS attacks is to
4148
minimize the amount of resources a potential, but as yet unauthenticated,
4149
client is able to consume.
4152
does this by signing every TLS control channel packet with an HMAC signature,
4153
including packets which are sent before the TLS level has had a chance
4154
to authenticate the peer.
4155
The result is that packets without
4156
the correct signature can be dropped immediately upon reception,
4157
before they have a chance to consume additional system resources
4158
such as by initiating a TLS handshake.
4160
can be strengthened by adding the
4161
.B \-\-replay-persist
4162
option which will keep OpenVPN's replay protection state
4163
in a file so that it is not lost across restarts.
4165
It should be emphasized that this feature is optional and that the
4166
passphrase/key file used with
4168
gives a peer nothing more than the power to initiate a TLS
4169
handshake. It is not used to encrypt or authenticate any tunnel data.
4170
.\"*********************************************************
4172
.B \-\-askpass [file]
4173
Get certificate password from console or
4175
before we daemonize.
4178
security conscious, it is possible to protect your private key with
4179
a password. Of course this means that every time the OpenVPN
4180
daemon is started you must be there to type the password. The
4182
option allows you to start OpenVPN from the command line. It will
4183
query you for a password before it daemonizes. To protect a private
4184
key with a password you should omit the
4186
option when you use the
4188
command line tool to manage certificates and private keys.
4192
is specified, read the password from the first line of
4194
Keep in mind that storing your password in a file
4195
to a certain extent invalidates the extra security provided by
4196
using an encrypted key (Note: OpenVPN
4197
will only read passwords from a file if it has been built
4198
with the \-\-enable-password-save configure option, or on Windows
4199
by defining ENABLE_PASSWORD_SAVE in config-win32.h).
4200
.\"*********************************************************
4206
.B \-\-auth-user-pass
4207
username/passwords in virtual memory.
4209
If specified, this directive will cause OpenVPN to immediately
4210
forget username/password inputs after they are used. As a result,
4211
when OpenVPN needs a username/password, it will prompt for input
4212
from stdin, which may be multiple times during the duration of an
4215
This directive does not affect the
4217
username/password. It is always cached.
4218
.\"*********************************************************
4220
.B \-\-tls-verify cmd
4221
Execute shell command
4223
to verify the X509 name of a
4224
pending TLS connection that has otherwise passed all other
4225
tests of certification (except for revocation via
4227
directive; the revocation test occurs after the
4232
should return 0 to allow the TLS handshake to proceed, or 1 to fail.
4236
.B cmd certificate_depth X509_NAME_oneline
4238
This feature is useful if the peer you want to trust has a certificate
4239
which was signed by a certificate authority who also signed many
4240
other certificates, where you don't necessarily want to trust all of them,
4241
but rather be selective about which
4242
peer certificate you will accept. This feature allows you to write a script
4243
which will test the X509 name on a certificate and decide whether or
4244
not it should be accepted. For a simple perl script which will test
4245
the common name field on the certificate, see the file
4247
in the OpenVPN distribution.
4249
See the "Environmental Variables" section below for
4250
additional parameters passed as environmental variables.
4254
can be a shell command with multiple arguments, in which
4255
case all OpenVPN-generated arguments will be appended
4258
to build a command line which will be passed to the script.
4259
.\"*********************************************************
4261
.B \-\-tls-remote name
4262
Accept connections only from a host with X509 name
4263
or common name equal to
4265
The remote host must also pass all other tests
4268
Name can also be a common name prefix, for example if you
4269
want a client to only accept connections to "Server-1",
4270
"Server-2", etc., you can simply use
4271
.B \-\-tls-remote Server
4273
Using a common name prefix is a useful alternative to managing
4274
a CRL (Certificate Revocation List) on the client, since it allows the client
4275
to refuse all certificates except for those associated
4276
with designated servers.
4279
is a useful replacement for the
4281
option to verify the remote host, because
4286
.\"*********************************************************
4288
.B \-\-ns-cert-type client|server
4289
Require that peer certificate was signed with an explicit
4291
designation of "client" or "server".
4293
This is a useful security option for clients, to ensure that
4294
the host they connect with is a designated server.
4296
See the easy-rsa/build-key-server script for an example
4297
of how to generate a certificate with the
4299
field set to "server".
4301
If the server certificate's nsCertType field is set
4302
to "server", then the clients can verify this with
4303
.B \-\-ns-cert-type server.
4305
This is an important security precaution to protect against
4306
a man-in-the-middle attack where an authorized client
4307
attempts to connect to another client by impersonating the server.
4308
The attack is easily prevented by having clients verify
4309
the server certificate using any one of
4310
.B \-\-ns-cert-type, \-\-tls-remote,
4313
.\"*********************************************************
4315
.B \-\-remote-cert-ku v...
4316
Require that peer certificate was signed with an explicit
4319
This is a useful security option for clients, to ensure that
4320
the host they connect to is a designated server.
4322
The key usage should be encoded in hex, more than one key
4323
usage can be specified.
4324
.\"*********************************************************
4326
.B \-\-remote-cert-eku oid
4327
Require that peer certificate was signed with an explicit
4328
.B extended key usage.
4330
This is a useful security option for clients, to ensure that
4331
the host they connect to is a designated server.
4333
The extended key usage should be encoded in oid notation, or
4334
OpenSSL symbolic representation.
4335
.\"*********************************************************
4337
.B \-\-remote-cert-tls client|server
4338
Require that peer certificate was signed with an explicit
4341
.B extended key usage
4342
based on RFC3280 TLS rules.
4344
This is a useful security option for clients, to ensure that
4345
the host they connect to is a designated server.
4348
.B \-\-remote-cert-tls client
4349
option is equivalent to
4351
\-\-remote-cert-ku 80 08 88 \-\-remote-cert-eku "TLS Web Client Authentication"
4353
The key usage is digitalSignature and/or keyAgreement.
4356
.B \-\-remote-cert-tls server
4357
option is equivalent to
4359
\-\-remote-cert-ku a0 88 \-\-remote-cert-eku "TLS Web Server Authentication"
4361
The key usage is digitalSignature and ( keyEncipherment or keyAgreement ).
4363
This is an important security precaution to protect against
4364
a man-in-the-middle attack where an authorized client
4365
attempts to connect to another client by impersonating the server.
4366
The attack is easily prevented by having clients verify
4367
the server certificate using any one of
4368
.B \-\-remote-cert-tls, \-\-tls-remote,
4371
.\"*********************************************************
4373
.B \-\-crl-verify crl
4374
Check peer certificate against the file
4378
A CRL (certificate revocation list) is used when a particular key is
4379
compromised but when the overall PKI is still intact.
4381
Suppose you had a PKI consisting of a CA, root certificate, and a number of
4382
client certificates. Suppose a laptop computer containing a client key and
4383
certificate was stolen. By adding the stolen certificate to the CRL file,
4384
you could reject any connection which attempts to use it, while preserving the
4385
overall integrity of the PKI.
4387
The only time when it would be necessary to rebuild the entire PKI from scratch would be
4388
if the root certificate key itself was compromised.
4389
.\"*********************************************************
4390
.SS SSL Library information:
4391
.\"*********************************************************
4395
Show all cipher algorithms to use with the
4398
.\"*********************************************************
4402
Show all message digest algorithms to use with the
4405
.\"*********************************************************
4409
Show all TLS ciphers (TLS used only as a control channel). The TLS
4410
ciphers will be sorted from highest preference (most secure) to
4412
.\"*********************************************************
4416
Show currently available hardware-based crypto acceleration
4417
engines supported by the OpenSSL library.
4418
.\"*********************************************************
4419
.SS Generate a random key:
4420
Used only for non-TLS static key encryption mode.
4421
.\"*********************************************************
4425
Generate a random key to be used as a shared secret,
4428
option. This file must be shared with the
4429
peer over a pre-existing secure channel such as
4432
.\"*********************************************************
4437
.\"*********************************************************
4438
.SS TUN/TAP persistent tunnel config mode:
4439
Available with linux 2.4.7+. These options comprise a standalone mode
4440
of OpenVPN which can be used to create and delete persistent tunnels.
4441
.\"*********************************************************
4445
Create a persistent tunnel on platforms which support them such
4446
as Linux. Normally TUN/TAP tunnels exist only for
4447
the period of time that an application has them open. This option
4448
takes advantage of the TUN/TAP driver's ability to build persistent
4449
tunnels that live through multiple instantiations of OpenVPN and die
4450
only when they are deleted or the machine is rebooted.
4452
One of the advantages of persistent tunnels is that they eliminate the
4457
scripts to run the appropriate
4461
commands. These commands can be placed in the the same shell script
4462
which starts or terminates an OpenVPN session.
4464
Another advantage is that open connections through the TUN/TAP-based tunnel
4465
will not be reset if the OpenVPN peer restarts. This can be useful to
4466
provide uninterrupted connectivity through the tunnel in the event of a DHCP
4467
reset of the peer's public IP address (see the
4471
One disadvantage of persistent tunnels is that it is harder to automatically
4472
configure their MTU value (see
4478
On some platforms such as Windows, TAP-Win32 tunnels are persistent by
4480
.\"*********************************************************
4484
Remove a persistent tunnel.
4485
.\"*********************************************************
4487
.B \-\-dev tunX | tapX
4489
.\"*********************************************************
4492
Optional user to be owner of this tunnel.
4493
.\"*********************************************************
4496
Optional group to be owner of this tunnel.
4497
.\"*********************************************************
4498
.SS Windows-Specific Options:
4499
.\"*********************************************************
4501
.B \-\-win-sys path|'env'
4502
Set the Windows system directory pathname to use when looking for system
4507
By default, if this directive is
4508
not specified, the pathname will be set to "C:\\WINDOWS"
4512
indicates that the pathname should be read from the
4514
environmental variable.
4515
.\"*********************************************************
4517
.B \-\-ip-win32 method
4520
on Windows, set the TAP-Win32 adapter
4521
IP address and netmask using
4523
Don't use this option unless you are also using
4527
Don't set the IP address or netmask automatically.
4528
Instead output a message
4529
to the console telling the user to configure the
4530
adapter manually and indicating the IP/netmask which
4531
OpenVPN expects the adapter to be set to.
4533
.B dynamic [offset] [lease-time] --
4534
Automatically set the IP address and netmask by replying to
4535
DHCP query messages generated by the kernel. This mode is
4536
probably the "cleanest" solution
4537
for setting the TCP/IP properties since it uses the well-known
4538
DHCP protocol. There are, however, two prerequisites for using
4539
this mode: (1) The TCP/IP properties for the TAP-Win32
4540
adapter must be set to "Obtain an IP address automatically," and
4541
(2) OpenVPN needs to claim an IP address in the subnet for use
4542
as the virtual DHCP server address. By default in
4545
take the normally unused first address in the subnet. For example,
4546
if your subnet is 192.168.4.0 netmask 255.255.255.0, then
4547
OpenVPN will take the IP address 192.168.4.0 to use as the
4548
virtual DHCP server address. In
4550
mode, OpenVPN will cause the DHCP server to masquerade as if it were
4551
coming from the remote endpoint. The optional offset parameter is
4552
an integer which is > -256 and < 256 and which defaults to 0.
4553
If offset is positive, the DHCP server will masquerade as the IP
4554
address at network address + offset.
4555
If offset is negative, the DHCP server will masquerade as the IP
4556
address at broadcast address + offset. The Windows
4558
command can be used to show what Windows thinks the DHCP server
4559
address is. OpenVPN will "claim" this address, so make sure to
4560
use a free address. Having said that, different OpenVPN instantiations,
4561
including different ends of the same connection, can share the same
4562
virtual DHCP server address. The
4564
parameter controls the lease time of the DHCP assignment given to
4565
the TAP-Win32 adapter, and is denoted in seconds.
4566
Normally a very long lease time is preferred
4567
because it prevents routes involving the TAP-Win32 adapter from
4568
being lost when the system goes to sleep. The default
4569
lease time is one year.
4572
Automatically set the IP address and netmask using
4573
the Windows command-line "netsh"
4574
command. This method appears to work correctly on
4575
Windows XP but not Windows 2000.
4578
Automatically set the IP address and netmask using the
4579
Windows IP Helper API. This approach
4580
does not have ideal semantics, though testing has indicated
4581
that it works okay in practice. If you use this option,
4582
it is best to leave the TCP/IP properties for the TAP-Win32
4583
adapter in their default state, i.e. "Obtain an IP address
4589
method initially and fail over to
4591
if the DHCP negotiation with the TAP-Win32 adapter does
4592
not succeed in 20 seconds. Such failures have been known
4593
to occur when certain third-party firewall packages installed
4594
on the client machine block the DHCP negotiation used by
4595
the TAP-Win32 adapter.
4598
failover occurs, the TAP-Win32 adapter
4599
TCP/IP properties will be reset from DHCP to static, and this
4600
will cause future OpenVPN startups using the
4604
immediately, rather than trying
4606
first. To "unstick" the
4610
run OpenVPN at least once using the
4612
mode to restore the TAP-Win32 adapter TCP/IP properties
4613
to a DHCP configuration.
4614
.\"*********************************************************
4616
.B \-\-route-method m
4619
to use for adding routes on Windows?
4622
(default) \-\- Try IP helper API first. If that fails, fall
4623
back to the route.exe shell command.
4626
\-\- Use IP helper API.
4629
\-\- Call the route.exe shell command.
4630
.\"*********************************************************
4632
.B \-\-dhcp-option type [parm]
4633
Set extended TAP-Win32 TCP/IP properties, must
4635
.B \-\-ip-win32 dynamic
4637
.B \-\-ip-win32 adaptive.
4638
This option can be used to set additional TCP/IP properties
4639
on the TAP-Win32 adapter, and is particularly useful for
4640
configuring an OpenVPN client to access a Samba server
4644
Set Connection-specific DNS Suffix.
4647
Set primary domain name server address. Repeat
4648
this option to set secondary DNS server addresses.
4651
Set primary WINS server address (NetBIOS over TCP/IP Name Server).
4652
Repeat this option to set secondary WINS server addresses.
4655
Set primary NBDD server address (NetBIOS over TCP/IP Datagram Distribution Server)
4657
to set secondary NBDD server addresses.
4660
Set primary NTP server address (Network Time Protocol).
4662
to set secondary NTP server addresses.
4665
Set NetBIOS over TCP/IP Node type. Possible options:
4667
= b-node (broadcasts),
4669
= p-node (point-to-point
4670
name queries to a WINS server),
4673
then query name server), and
4675
= h-node (query name server, then broadcast).
4677
.B NBS scope-id \-\-
4678
Set NetBIOS over TCP/IP Scope. A NetBIOS Scope ID provides an extended
4679
naming service for the NetBIOS over TCP/IP (Known as NBT) module. The
4680
primary purpose of a NetBIOS scope ID is to isolate NetBIOS traffic on
4681
a single network to only those nodes with the same NetBIOS scope ID.
4682
The NetBIOS scope ID is a character string that is appended to the NetBIOS
4683
name. The NetBIOS scope ID on two hosts must match, or the two hosts
4684
will not be able to communicate. The NetBIOS Scope ID also allows
4685
computers to use the same computer name, as they have different
4686
scope IDs. The Scope ID becomes a part of the NetBIOS name, making the name unique.
4687
(This description of NetBIOS scopes courtesy of NeonSurge@abyss.com)
4690
Disable Netbios-over-TCP/IP.
4696
to a non-windows client, the option will be saved in the client's
4697
environment before the up script is called, under
4698
the name "foreign_option_{n}".
4699
.\"*********************************************************
4702
Cause OpenVPN to sleep for
4704
seconds immediately after the TAP-Win32 adapter state
4705
is set to "connected".
4707
This option is intended to be used to troubleshoot problems
4712
options, and is used to give
4713
the TAP-Win32 adapter time to come up before
4714
Windows IP Helper API operations are applied to it.
4715
.\"*********************************************************
4718
Output OpenVPN's view of the system routing table and network
4719
adapter list to the syslog or log file after the TUN/TAP adapter
4720
has been brought up and any routes have been added.
4721
.\"*********************************************************
4724
Ask Windows to renew the TAP adapter lease on startup.
4725
This option is normally unnecessary, as Windows automatically
4726
triggers a DHCP renegotiation on the TAP adapter when it
4727
comes up, however if you set the TAP-Win32 adapter
4728
Media Status property to "Always Connected", you may need this
4730
.\"*********************************************************
4733
Ask Windows to release the TAP adapter lease on shutdown.
4734
This option has the same caveats as
4737
.\"*********************************************************
4740
Put up a "press any key to continue" message on the console prior
4741
to OpenVPN program exit. This option is automatically used by the
4742
Windows explorer when OpenVPN is run on a configuration
4743
file using the right-click explorer menu.
4744
.\"*********************************************************
4746
.B \-\-service exit-event [0|1]
4747
Should be used when OpenVPN is being automatically executed by another
4749
a context that no interaction with the user via display or keyboard
4750
is possible. In general, end-users should never need to explicitly
4751
use this option, as it is automatically added by the OpenVPN service wrapper
4752
when a given OpenVPN configuration is being run as a service.
4755
is the name of a Windows global event object, and OpenVPN will continuously
4756
monitor the state of this event object and exit when it becomes signaled.
4758
The second parameter indicates the initial state of
4760
and normally defaults to 0.
4762
Multiple OpenVPN processes can be simultaneously executed with the same
4764
parameter. In any case, the controlling process can signal
4766
causing all such OpenVPN processes to exit.
4768
When executing an OpenVPN process using the
4770
directive, OpenVPN will probably not have a console
4771
window to output status/error
4772
messages, therefore it is useful to use
4776
to write these messages to a file.
4777
.\"*********************************************************
4779
.B \-\-show-adapters
4781
Show available TAP-Win32 adapters which can be selected using the
4783
option. On non-Windows systems, the
4785
command provides similar functionality.
4786
.\"*********************************************************
4788
.B \-\-allow-nonadmin [TAP-adapter]
4792
to allow access from non-administrative accounts. If
4794
is omitted, all TAP adapters on the system will be configured to allow
4796
The non-admin access setting will only persist for the length of time that
4797
the TAP-Win32 device object and driver remain loaded, and will need
4798
to be re-enabled after a reboot, or if the driver is unloaded
4800
This directive can only be used by an administrator.
4801
.\"*********************************************************
4803
.B \-\-show-valid-subnets
4805
Show valid subnets for
4807
emulation. Since the TAP-Win32 driver
4808
exports an ethernet interface to Windows, and since TUN devices are
4809
point-to-point in nature, it is necessary for the TAP-Win32 driver
4810
to impose certain constraints on TUN endpoint address selection.
4812
Namely, the point-to-point endpoints used in TUN device emulation
4813
must be the middle two addresses of a /30 subnet (netmask 255.255.255.252).
4814
.\"*********************************************************
4818
Show OpenVPN's view of the system routing table and network
4820
.\"*********************************************************
4821
.SS PKCS#11 Standalone Options:
4822
.\"*********************************************************
4824
.B \-\-show-pkcs11-ids provider [cert_private]
4826
Show PKCS#11 token object list. Specify cert_private as 1
4827
if certificates are stored as private objects.
4830
option can be used BEFORE this option to produce debugging information.
4831
.\"*********************************************************
4832
.SH SCRIPTING AND ENVIRONMENTAL VARIABLES
4833
OpenVPN exports a series
4834
of environmental variables for use by user-defined scripts.
4835
.\"*********************************************************
4836
.SS Script Order of Execution
4837
.\"*********************************************************
4840
Executed after TCP/UDP socket bind and TUN/TAP open.
4841
.\"*********************************************************
4844
Executed when we have a still untrusted remote peer.
4845
.\"*********************************************************
4848
Executed after connection authentication, or remote IP address change.
4849
.\"*********************************************************
4851
.B \-\-client-connect
4854
mode immediately after client authentication.
4855
.\"*********************************************************
4858
Executed after connection authentication, either
4859
immediately after, or some number of seconds after
4863
.\"*********************************************************
4865
.B \-\-client-disconnect
4868
mode on client instance shutdown.
4869
.\"*********************************************************
4872
Executed after TCP/UDP and TUN/TAP close.
4873
.\"*********************************************************
4875
.B \-\-learn-address
4878
mode whenever an IPv4 address/route or MAC address is added to OpenVPN's
4879
internal routing table.
4880
.\"*********************************************************
4882
.B \-\-auth-user-pass-verify
4885
mode on new client connections, when the client is
4887
.\"*********************************************************
4888
.SS String Types and Remapping
4889
In certain cases, OpenVPN will perform remapping of characters
4890
in strings. Essentially, any characters outside the set of
4891
permitted characters for each string type will be converted
4895
Why is string remapping necessary?
4898
It's an important security feature to prevent the malicious coding of
4899
strings from untrusted sources to be passed as parameters to scripts,
4900
saved in the environment, used as a common name, translated to a filename,
4904
Can string remapping be disabled?
4908
.B \-\-no-name-remapping
4909
option, however this should be considered an advanced option.
4911
Here is a brief rundown of OpenVPN's current string types and the
4912
permitted character class for each string:
4915
Alphanumeric, underbar ('_'), dash ('-'), dot ('.'), at
4916
('@'), colon (':'), slash ('/'), and equal ('='). Alphanumeric is defined
4917
as a character which will cause the C library isalnum() function to return
4921
Alphanumeric, underbar ('_'), dash ('-'), dot ('.'), and at
4924
.B \-\-auth-user-pass username:
4925
Same as Common Name, with one exception: starting with OpenVPN 2.0.1,
4926
the username is passed to the OPENVPN_PLUGIN_AUTH_USER_PASS_VERIFY plugin in its raw form,
4927
without string remapping.
4929
.B \-\-auth-user-pass password:
4930
Any "printable" character except CR or LF.
4931
Printable is defined to be a character which will cause the C library
4932
isprint() function to return true.
4934
.B \-\-client-config-dir filename as derived from common name or username:
4935
Alphanumeric, underbar ('_'), dash ('-'), and dot ('.') except for "." or
4936
".." as standalone strings. As of 2.0.1-rc6, the at ('@') character has
4937
been added as well for compatibility with the common name character class.
4939
.B Environmental variable names:
4940
Alphanumeric or underbar ('_').
4942
.B Environmental variable values:
4943
Any printable character.
4945
For all cases, characters in a string which are not members of the legal
4946
character class for that string type will be remapped to underbar ('_').
4947
.\"*********************************************************
4948
.SS Environmental Variables
4949
Once set, a variable is persisted
4950
indefinitely until it is reset by a new value or a restart,
4952
As of OpenVPN 2.0-beta12, in server mode, environmental
4953
variables set by OpenVPN
4954
are scoped according to the client objects
4956
associated with, so there should not be any issues with
4957
scripts having access to stale, previously set variables
4958
which refer to different client instances.
4959
.\"*********************************************************
4962
Total number of bytes received from client during VPN session.
4963
Set prior to execution of the
4964
.B \-\-client-disconnect
4966
.\"*********************************************************
4969
Total number of bytes sent to client during VPN session.
4970
Set prior to execution of the
4971
.B \-\-client-disconnect
4973
.\"*********************************************************
4976
The X509 common name of an authenticated client.
4977
Set prior to execution of
4978
.B \-\-client-connect, \-\-client-disconnect,
4980
.B \-\-auth-user-pass-verify
4982
.\"*********************************************************
4988
Set on program initiation and reset on SIGHUP.
4989
.\"*********************************************************
4994
directive is specified, or "0" otherwise.
4995
Set on program initiation and reset on SIGHUP.
4996
.\"*********************************************************
4998
.B daemon_log_redirect
5003
directives are specified, or "0" otherwise.
5004
Set on program initiation and reset on SIGHUP.
5005
.\"*********************************************************
5008
The actual name of the TUN/TAP device, including
5009
a unit number if it exists.
5015
.\"*********************************************************
5017
.B foreign_option_{n}
5018
An option pushed via
5020
to a client which does not natively support it,
5023
on a non-Windows system, will be recorded to this
5024
environmental variable sequence prior to
5027
.\"*********************************************************
5029
.B ifconfig_broadcast
5030
The broadcast address for the virtual
5031
ethernet segment which is derived from the
5036
Set prior to OpenVPN calling the
5040
(windows version of ifconfig) commands which
5041
normally occurs prior to
5044
.\"*********************************************************
5047
The local VPN endpoint IP address specified in the
5049
option (first parameter).
5050
Set prior to OpenVPN calling the
5054
(windows version of ifconfig) commands which
5055
normally occurs prior to
5058
.\"*********************************************************
5061
The remote VPN endpoint IP address specified in the
5063
option (second parameter) when
5066
Set prior to OpenVPN calling the
5070
(windows version of ifconfig) commands which
5071
normally occurs prior to
5074
.\"*********************************************************
5077
The subnet mask of the virtual ethernet segment
5078
that is specified as the second parameter to
5083
Set prior to OpenVPN calling the
5087
(windows version of ifconfig) commands which
5088
normally occurs prior to
5091
.\"*********************************************************
5093
.B ifconfig_pool_local_ip
5095
virtual IP address for the TUN/TAP tunnel taken from an
5096
.B \-\-ifconfig-push
5097
directive if specified, or otherwise from
5098
the ifconfig pool (controlled by the
5099
.B \-\-ifconfig-pool
5100
config file directive).
5104
This option is set on the server prior to execution
5106
.B \-\-client-connect
5108
.B \-\-client-disconnect
5110
.\"*********************************************************
5112
.B ifconfig_pool_netmask
5114
virtual IP netmask for the TUN/TAP tunnel taken from an
5115
.B \-\-ifconfig-push
5116
directive if specified, or otherwise from
5117
the ifconfig pool (controlled by the
5118
.B \-\-ifconfig-pool
5119
config file directive).
5123
This option is set on the server prior to execution
5125
.B \-\-client-connect
5127
.B \-\-client-disconnect
5129
.\"*********************************************************
5131
.B ifconfig_pool_remote_ip
5133
virtual IP address for the TUN/TAP tunnel taken from an
5134
.B \-\-ifconfig-push
5135
directive if specified, or otherwise from
5136
the ifconfig pool (controlled by the
5137
.B \-\-ifconfig-pool
5138
config file directive).
5139
This option is set on the server prior to execution
5141
.B \-\-client-connect
5143
.B \-\-client-disconnect
5145
.\"*********************************************************
5148
The maximum packet size (not including the IP header)
5149
of tunnel data in UDP tunnel transport mode.
5155
.\"*********************************************************
5161
Set on program initiation and reset on SIGHUP.
5162
.\"*********************************************************
5165
The local port number, specified by
5169
Set on program initiation and reset on SIGHUP.
5170
.\"*********************************************************
5173
The password provided by a connecting client.
5175
.B \-\-auth-user-pass-verify
5176
script execution only when the
5178
modifier is specified, and deleted from the environment
5179
after the script returns.
5180
.\"*********************************************************
5186
Set on program initiation and reset on SIGHUP.
5187
.\"*********************************************************
5193
Set on program initiation and reset on SIGHUP.
5194
.\"*********************************************************
5197
The remote port number, specified by
5201
Set on program initiation and reset on SIGHUP.
5202
.\"*********************************************************
5204
.B route_net_gateway
5205
The pre-existing default IP gateway in the system routing
5210
.\"*********************************************************
5212
.B route_vpn_gateway
5213
The default gateway used by
5215
options, as specified in either the
5216
.B \-\-route-gateway
5217
option or the second parameter to
5225
.\"*********************************************************
5228
A set of variables which define each route to be added, and
5234
will be one of "network", "netmask", "gateway", or "metric".
5237
is the OpenVPN route number, starting from 1.
5239
If the network or gateway are resolvable DNS names,
5240
their IP address translations will be recorded rather
5241
than their names as denoted on the command line
5242
or configuration file.
5243
.\"*********************************************************
5246
Set to "init" or "restart" prior to up/down script execution.
5247
For more information, see
5250
.\"*********************************************************
5254
.B up, down, ipchange, route-up, tls-verify, auth-user-pass-verify,
5255
.B client-connect, client-disconnect,
5258
Set prior to execution of any script.
5259
.\"*********************************************************
5262
The reason for exit or restart. Can be one of
5263
.B sigusr1, sighup, sigterm, sigint, inactive
5276
(triggered on TCP connection reset),
5280
(unknown signal). This variable is set just prior to down script execution.
5281
.\"*********************************************************
5284
Client connection timestamp, formatted as a human-readable
5286
Set prior to execution of the
5287
.B \-\-client-connect
5289
.\"*********************************************************
5292
The duration (in seconds) of the client session which is now
5294
Set prior to execution of the
5295
.B \-\-client-disconnect
5297
.\"*********************************************************
5300
Client connection timestamp, formatted as a unix integer
5302
Set prior to execution of the
5303
.B \-\-client-connect
5305
.\"*********************************************************
5308
A series of certificate fields from the remote peer,
5311
is the verification level. Only set for TLS connections. Set prior
5315
.\"*********************************************************
5318
The serial number of the certificate from the remote peer,
5321
is the verification level. Only set for TLS connections. Set prior
5325
.\"*********************************************************
5328
The MTU of the TUN/TAP device.
5334
.\"*********************************************************
5337
Actual IP address of connecting client or peer which has been authenticated.
5338
Set prior to execution of
5339
.B \-\-ipchange, \-\-client-connect,
5341
.B \-\-client-disconnect
5343
.\"*********************************************************
5346
Actual port number of connecting client or peer which has been authenticated.
5347
Set prior to execution of
5348
.B \-\-ipchange, \-\-client-connect,
5350
.B \-\-client-disconnect
5352
.\"*********************************************************
5355
Actual IP address of connecting client or peer which has not been authenticated
5356
yet. Sometimes used to
5358
the connecting host in a
5360
script to ensure it is firewalled properly.
5361
Set prior to execution of
5364
.B \-\-auth-user-pass-verify
5366
.\"*********************************************************
5369
Actual port number of connecting client or peer which has not been authenticated
5371
Set prior to execution of
5374
.B \-\-auth-user-pass-verify
5376
.\"*********************************************************
5379
The username provided by a connecting client.
5381
.B \-\-auth-user-pass-verify
5382
script execution only when the
5384
modifier is specified.
5385
.\"*********************************************************
5387
.B X509_{n}_{subject_field}
5388
An X509 subject field from the remote peer certificate,
5391
is the verification level. Only set for TLS connections. Set prior
5394
script. This variable is similar to
5396
except the component X509 subject fields are broken out, and
5397
no string remapping occurs on these field values (except for remapping
5398
of control characters to "_").
5399
For example, the following variables would be set on the
5400
OpenVPN server using the sample client certificate
5401
in sample-keys (client.crt).
5402
Note that the verification level is 0 for the client certificate
5403
and 1 for the CA certificate.
5408
X509_0_emailAddress=me@myhost.mydomain
5409
X509_0_CN=Test-Client
5410
X509_0_O=OpenVPN-TEST
5413
X509_1_emailAddress=me@myhost.mydomain
5414
X509_1_O=OpenVPN-TEST
5421
.\"*********************************************************
5425
Cause OpenVPN to close all TUN/TAP and
5426
network connections,
5427
restart, re-read the configuration file (if any),
5428
and reopen TUN/TAP and network connections.
5429
.\"*********************************************************
5434
except don't re-read configuration file, and possibly don't close and reopen TUN/TAP
5435
device, re-read key files, preserve local IP address/port, or preserve most recently authenticated
5436
remote IP address/port based on
5437
.B \-\-persist-tun, \-\-persist-key, \-\-persist-local-ip,
5439
.B \-\-persist-remote-ip
5440
options respectively (see above).
5442
This signal may also be internally generated by a timeout condition, governed
5447
This signal, when combined with
5448
.B \-\-persist-remote-ip,
5450
sent when the underlying parameters of the host's network interface change
5451
such as when the host is a DHCP client and is assigned a new IP address.
5454
above for more information.
5455
.\"*********************************************************
5458
Causes OpenVPN to display its current statistics (to the syslog
5461
is used, or stdout otherwise).
5462
.\"*********************************************************
5465
Causes OpenVPN to exit gracefully.
5466
.\"*********************************************************
5467
.SH TUN/TAP DRIVER SETUP
5468
If you are running Linux 2.4.7 or higher, you probably have the TUN/TAP driver
5469
already installed. If so, there are still a few things you need to do:
5472
.B mknod /dev/net/tun c 10 200
5477
If you have Linux 2.2 or earlier, you should obtain version 1.1 of the
5479
.I http://vtun.sourceforge.net/tun/
5480
and follow the installation instructions.
5481
.\"*********************************************************
5483
Prior to running these examples, you should have OpenVPN installed on two
5484
machines with network connectivity between them. If you have not
5485
yet installed OpenVPN, consult the INSTALL file included in the OpenVPN
5487
.\"*********************************************************
5489
If you are using Linux 2.4 or higher,
5490
make the tun device node and load the tun module:
5492
.B mknod /dev/net/tun c 10 200
5497
If you installed from RPM, the
5499
step may be omitted, because the RPM install does that for you.
5501
If you have Linux 2.2, you should obtain version 1.1 of the
5503
.I http://vtun.sourceforge.net/tun/
5504
and follow the installation instructions.
5506
For other platforms, consult the INSTALL file at
5507
.I http://openvpn.net/install.html
5508
for more information.
5509
.\"*********************************************************
5511
If firewalls exist between
5512
the two machines, they should be set to forward UDP port 1194
5513
in both directions. If you do not have control over the firewalls
5514
between the two machines, you may still be able to use OpenVPN by adding
5518
commands used below in the examples (this will cause each peer to send out
5519
a UDP ping to its remote peer once every 15 seconds which will cause many
5520
stateful firewalls to forward packets in both directions
5521
without an explicit firewall rule).
5523
If you are using a Linux iptables-based firewall, you may need to enter
5524
the following command to allow incoming packets on the TUN device:
5526
.B iptables -A INPUT -i tun+ -j ACCEPT
5528
See the firewalls section below for more information on configuring firewalls
5529
for use with OpenVPN.
5530
.\"*********************************************************
5531
.SS VPN Address Setup:
5533
of our example, our two machines will be called
5537
If you are constructing a VPN over the internet, then replace
5541
with the internet hostname or IP address that each machine will use
5542
to contact the other over the internet.
5544
Now we will choose the tunnel endpoints. Tunnel endpoints are
5545
private IP addresses that only have meaning in the context of
5546
the VPN. Each machine will use the tunnel endpoint of the other
5547
machine to access it over the VPN. In our example,
5548
the tunnel endpoint for may.kg
5549
will be 10.4.0.1 and for june.kg, 10.4.0.2.
5551
Once the VPN is established, you have essentially
5552
created a secure alternate path between the two hosts
5553
which is addressed by using the tunnel endpoints. You can
5554
control which network
5555
traffic passes between the hosts
5556
(a) over the VPN or (b) independently of the VPN, by choosing whether to use
5557
(a) the VPN endpoint address or (b) the public internet address,
5558
to access the remote host. For example if you are on may.kg and you wish to connect to june.kg
5561
without using the VPN (since
5563
has its own built-in security) you would use the command
5565
However in the same scenario, you could also use the command
5567
to create a telnet session with june.kg over the VPN, that would
5568
use the VPN to secure the session rather than
5571
You can use any address you wish for the
5573
but make sure that they are private addresses
5574
(such as those that begin with 10 or 192.168) and that they are
5575
not part of any existing subnet on the networks of
5576
either peer, unless you are bridging. If you use an address that is part of
5577
your local subnet for either of the tunnel endpoints,
5578
you will get a weird feedback loop.
5579
.\"*********************************************************
5580
.SS Example 1: A simple tunnel without security
5584
.B openvpn \-\-remote june.kg \-\-dev tun1 \-\-ifconfig 10.4.0.1 10.4.0.2 \-\-verb 9
5588
.B openvpn \-\-remote may.kg \-\-dev tun1 \-\-ifconfig 10.4.0.2 10.4.0.1 \-\-verb 9
5590
Now verify the tunnel is working by pinging across the tunnel.
5602
option will produce verbose output, similar to the
5606
option to have OpenVPN run quietly.
5607
.\"*********************************************************
5608
.SS Example 2: A tunnel with static-key security (i.e. using a pre-shared secret)
5609
First build a static key on may.
5611
.B openvpn \-\-genkey \-\-secret key
5613
This command will build a random key file called
5618
to june over a secure medium such as by
5625
.B openvpn \-\-remote june.kg \-\-dev tun1 \-\-ifconfig 10.4.0.1 10.4.0.2 \-\-verb 5 \-\-secret key
5629
.B openvpn \-\-remote may.kg \-\-dev tun1 \-\-ifconfig 10.4.0.2 10.4.0.1 \-\-verb 5 \-\-secret key
5631
Now verify the tunnel is working by pinging across the tunnel.
5640
.\"*********************************************************
5641
.SS Example 3: A tunnel with full TLS-based security
5642
For this test, we will designate
5644
as the TLS client and
5647
.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.
5649
First, build a separate certificate/key pair
5650
for both may and june (see above where
5652
is discussed for more info). Then construct
5653
Diffie Hellman parameters (see above where
5655
is discussed for more info). You can also use the
5656
included test files client.crt, client.key,
5657
server.crt, server.key and ca.crt.
5658
The .crt files are certificates/public-keys, the .key
5659
files are private keys, and ca.crt is a certification
5660
authority who has signed both
5661
client.crt and server.crt. For Diffie Hellman
5662
parameters you can use the included file dh1024.pem.
5663
.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.
5667
.B openvpn \-\-remote june.kg \-\-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
5671
.B openvpn \-\-remote may.kg \-\-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
5673
Now verify the tunnel is working by pinging across the tunnel.
5685
option we used above. That tells OpenVPN to renegotiate
5686
the data channel keys every minute.
5689
above, you will see status information on each new key negotiation.
5691
For production operations, a key renegotiation interval of 60 seconds
5692
is probably too frequent. Omit the
5694
option to use OpenVPN's default key renegotiation interval of one hour.
5695
.\"*********************************************************
5697
Assuming you can ping across the tunnel,
5698
the next step is to route a real subnet over
5699
the secure tunnel. Suppose that may and june have two network
5700
interfaces each, one connected
5701
to the internet, and the other to a private
5702
network. Our goal is to securely connect
5703
both private networks. We will assume that may's private subnet
5704
is 10.0.0.0/24 and june's is 10.0.1.0/24.
5706
First, ensure that IP forwarding is enabled on both peers.
5707
On Linux, enable routing:
5709
.B echo 1 > /proc/sys/net/ipv4/ip_forward
5711
and enable TUN packet forwarding through the firewall:
5713
.B iptables -A FORWARD -i tun+ -j ACCEPT
5717
.B route add -net 10.0.1.0 netmask 255.255.255.0 gw 10.4.0.2
5721
.B route add -net 10.0.0.0 netmask 255.255.255.0 gw 10.4.0.1
5723
Now any machine on the 10.0.0.0/24 subnet can
5724
access any machine on the 10.0.1.0/24 subnet
5725
over the secure tunnel (or vice versa).
5727
In a production environment, you could put the route command(s)
5728
in a shell script and execute with the
5731
.\"*********************************************************
5733
OpenVPN's usage of a single UDP port makes it fairly firewall-friendly.
5734
You should add an entry to your firewall rules to allow incoming OpenVPN
5735
packets. On Linux 2.4+:
5737
.B iptables -A INPUT -p udp -s 1.2.3.4 \-\-dport 1194 -j ACCEPT
5739
This will allow incoming packets on UDP port 1194 (OpenVPN's default UDP port)
5740
from an OpenVPN peer at 1.2.3.4.
5742
If you are using HMAC-based packet authentication (the default in any of
5743
OpenVPN's secure modes), having the firewall filter on source
5744
address can be considered optional, since HMAC packet authentication
5745
is a much more secure method of verifying the authenticity of
5746
a packet source. In that case:
5748
.B iptables -A INPUT -p udp \-\-dport 1194 -j ACCEPT
5750
would be adequate and would not render the host inflexible with
5751
respect to its peer having a dynamic IP address.
5753
OpenVPN also works well on stateful firewalls. In some cases, you may
5754
not need to add any static rules to the firewall list if you are
5755
using a stateful firewall that knows how to track UDP connections.
5758
OpenVPN will be guaranteed
5759
to send a packet to its peer at least once every
5763
is less than the stateful firewall connection timeout, you can
5764
maintain an OpenVPN connection indefinitely without explicit
5767
You should also add firewall rules to allow incoming IP traffic on
5768
TUN or TAP devices such as:
5770
.B iptables -A INPUT -i tun+ -j ACCEPT
5772
to allow input packets from tun devices,
5774
.B iptables -A FORWARD -i tun+ -j ACCEPT
5776
to allow input packets from tun devices to be forwarded to
5777
other hosts on the local network,
5779
.B iptables -A INPUT -i tap+ -j ACCEPT
5781
to allow input packets from tap devices, and
5783
.B iptables -A FORWARD -i tap+ -j ACCEPT
5785
to allow input packets from tap devices to be forwarded to
5786
other hosts on the local network.
5788
These rules are secure if you use packet authentication,
5789
since no incoming packets will arrive on a TUN or TAP
5791
unless they first pass an HMAC authentication test.
5792
.\"*********************************************************
5794
.I http://openvpn.net/faq.html
5795
.\"*********************************************************
5797
For a more comprehensive guide to setting up OpenVPN
5798
in a production setting, see the OpenVPN HOWTO at
5799
.I http://openvpn.net/howto.html
5800
.\"*********************************************************
5802
For a description of OpenVPN's underlying protocol,
5804
.I http://openvpn.net/security.html
5805
.\"*********************************************************
5807
OpenVPN's web site is at
5808
.I http://openvpn.net/
5810
Go here to download the latest version of OpenVPN, subscribe
5811
to the mailing lists, read the mailing list
5812
archives, or browse the SVN repository.
5813
.\"*********************************************************
5815
Report all bugs to the OpenVPN team <info@openvpn.net>.
5816
.\"*********************************************************
5824
.\"*********************************************************
5827
This product includes software developed by the
5829
.I http://www.openssl.org/
5832
For more information on the TLS protocol, see
5833
.I http://www.ietf.org/rfc/rfc2246.txt
5835
For more information on the LZO real-time compression library see
5836
.I http://www.oberhumer.com/opensource/lzo/
5837
.\"*********************************************************
5839
Copyright (C) 2002-2009 OpenVPN Technologies, Inc. This program is free software;
5840
you can redistribute it and/or modify
5841
it under the terms of the GNU General Public License version 2
5842
as published by the Free Software Foundation.
5843
.\"*********************************************************
5845
James Yonan <jim@yonan.net>