1
#################################################
3
# Sample OpenVPN 2.0 config file for #
5
# multi-client server. #
9
# This file is for the server side #
11
# of a many-clients <-> one-server #
13
# OpenVPN configuration. #
17
# OpenVPN also supports #
19
# single-machine <-> single-machine #
21
# configurations (See the Examples page #
23
# on the web site for more info). #
27
# This config should work on Windows #
29
# or Linux/BSD systems. Remember on #
31
# Windows to quote pathnames and use #
33
# double backslashes, e.g.: #
35
# "C:\\Program Files\\OpenVPN\\config\\foo.key" #
39
# Comments are preceded with '#' or ';' #
41
#################################################
45
# Which local IP address should OpenVPN
47
# listen on? (optional)
53
# Which TCP/UDP port should OpenVPN listen on?
55
# If you want to run multiple OpenVPN instances
57
# on the same machine, use a different port
59
# number for each one. You will need to
61
# open up this port on your firewall.
75
# "dev tun" will create a routed IP tunnel,
77
# "dev tap" will create an ethernet tunnel.
79
# Use "dev tap0" if you are ethernet bridging
81
# and have precreated a tap0 virtual interface
83
# and bridged it with your ethernet interface.
85
# If you want to control access policies
87
# over the VPN, you must create firewall
89
# rules for the the TUN/TAP interface.
91
# On non-Windows systems, you can give
93
# an explicit unit number, such as tun0.
95
# On Windows, use "dev-node" for this.
97
# On most systems, the VPN will not function
99
# unless you partially or fully disable
101
# the firewall for the TUN/TAP interface.
109
# Windows needs the TAP-Win32 adapter name
111
# from the Network Connections panel if you
113
# have more than one. On XP SP2 or higher,
115
# you may need to selectively disable the
117
# Windows firewall for the TAP adapter.
119
# Non-Windows systems usually don't need this.
125
# SSL/TLS root certificate (ca), certificate
127
# (cert), and private key (key). Each client
129
# and the server must have their own cert and
131
# key file. The server and all clients will
133
# use the same ca file.
137
# See the "easy-rsa" directory for a series
139
# of scripts for generating RSA certificates
141
# and private keys. Remember to use
143
# a unique Common Name for the server
145
# and each of the client certificates.
149
# Any X509 key management system can be used.
151
# OpenVPN can also use a PKCS #12 formatted key file
153
# (see "pkcs12" directive in man page).
159
key server.key # This file should be kept secret
163
# Diffie hellman parameters.
165
# Generate your own with:
167
# openssl dhparam -out dh2048.pem 2048
175
# Should be subnet (addressing via IP)
177
# unless Windows clients v2.0.9 and lower have to
179
# be supported (then net30, i.e. a /30 per client)
181
# Defaults to net30 (not recommended)
187
# Configure server mode and supply a VPN subnet
189
# for OpenVPN to draw client addresses from.
191
# The server will take 10.8.0.1 for itself,
193
# the rest will be made available to clients.
195
# Each client will be able to reach the server
197
# on 10.8.0.1. Comment this line out if you are
199
# ethernet bridging. See the man page for more info.
201
server 10.8.0.0 255.255.255.0
205
# Maintain a record of client <-> virtual IP address
207
# associations in this file. If OpenVPN goes down or
209
# is restarted, reconnecting clients can be assigned
211
# the same virtual IP address from the pool that was
213
# previously assigned.
215
ifconfig-pool-persist ipp.txt
219
# Configure server mode for ethernet bridging.
221
# You must first use your OS's bridging capability
223
# to bridge the TAP interface with the ethernet
225
# NIC interface. Then you must manually set the
227
# IP/netmask on the bridge interface, here we
229
# assume 10.8.0.4/255.255.255.0. Finally we
231
# must set aside an IP range in this subnet
233
# (start=10.8.0.50 end=10.8.0.100) to allocate
235
# to connecting clients. Leave this line commented
237
# out unless you are ethernet bridging.
239
;server-bridge 10.8.0.4 255.255.255.0 10.8.0.50 10.8.0.100
243
# Configure server mode for ethernet bridging
245
# using a DHCP-proxy, where clients talk
247
# to the OpenVPN server-side DHCP server
249
# to receive their IP address allocation
251
# and DNS server addresses. You must first use
253
# your OS's bridging capability to bridge the TAP
255
# interface with the ethernet NIC interface.
257
# Note: this mode only works on clients (such as
259
# Windows), where the client-side TAP adapter is
261
# bound to a DHCP client.
267
# Push routes to the client to allow it
269
# to reach other private subnets behind
271
# the server. Remember that these
273
# private subnets will also need
275
# to know to route the OpenVPN client
277
# address pool (10.8.0.0/255.255.255.0)
279
# back to the OpenVPN server.
281
;push "route 192.168.10.0 255.255.255.0"
283
;push "route 192.168.20.0 255.255.255.0"
287
# To assign specific IP addresses to specific
289
# clients or if a connecting client has a private
291
# subnet behind it that should also have VPN access,
293
# use the subdirectory "ccd" for client-specific
295
# configuration files (see man page for more info).
299
# EXAMPLE: Suppose the client
301
# having the certificate common name "Thelonious"
303
# also has a small subnet behind his connecting
305
# machine, such as 192.168.40.128/255.255.255.248.
307
# First, uncomment out these lines:
309
;client-config-dir ccd
311
;route 192.168.40.128 255.255.255.248
313
# Then create a file ccd/Thelonious with this line:
315
# iroute 192.168.40.128 255.255.255.248
317
# This will allow Thelonious' private subnet to
319
# access the VPN. This example will only work
321
# if you are routing, not bridging, i.e. you are
323
# using "dev tun" and "server" directives.
327
# EXAMPLE: Suppose you want to give
329
# Thelonious a fixed VPN IP address of 10.9.0.1.
331
# First uncomment out these lines:
333
;client-config-dir ccd
335
;route 10.9.0.0 255.255.255.252
337
# Then add this line to ccd/Thelonious:
339
# ifconfig-push 10.9.0.1 10.9.0.2
343
# Suppose that you want to enable different
345
# firewall access policies for different groups
347
# of clients. There are two methods:
349
# (1) Run multiple OpenVPN daemons, one for each
351
# group, and firewall the TUN/TAP interface
353
# for each group/daemon appropriately.
355
# (2) (Advanced) Create a script to dynamically
357
# modify the firewall in response to access
359
# from different clients. See man
361
# page for more info on learn-address script.
363
;learn-address ./script
367
# If enabled, this directive will configure
369
# all clients to redirect their default
371
# network gateway through the VPN, causing
373
# all IP traffic such as web browsing and
375
# and DNS lookups to go through the VPN
377
# (The OpenVPN server machine may need to NAT
379
# or bridge the TUN/TAP interface to the internet
381
# in order for this to work properly).
383
push "redirect-gateway def1 bypass-dhcp"
387
# Certain Windows-specific network settings
389
# can be pushed to clients, such as DNS
391
# or WINS server addresses. CAVEAT:
395
# The addresses below refer to the public
397
# DNS servers provided by opendns.com.
399
push "dhcp-option DNS 208.67.222.222"
401
push "dhcp-option DNS 208.67.220.220"
403
push "block-outside-dns"
407
# Uncomment this directive to allow different
409
# clients to be able to "see" each other.
411
# By default, clients will only see the server.
413
# To force clients to only see the server, you
415
# will also need to appropriately firewall the
417
# server's TUN/TAP interface.
423
# Uncomment this directive if multiple clients
425
# might connect with the same certificate/key
427
# files or common names. This is recommended
429
# only for testing purposes. For production use,
431
# each client should have its own certificate/key
437
# IF YOU HAVE NOT GENERATED INDIVIDUAL
439
# CERTIFICATE/KEY PAIRS FOR EACH CLIENT,
441
# EACH HAVING ITS OWN UNIQUE "COMMON NAME",
443
# UNCOMMENT THIS LINE OUT.
449
# The keepalive directive causes ping-like
451
# messages to be sent back and forth over
453
# the link so that each side knows when
455
# the other side has gone down.
457
# Ping every 10 seconds, assume that remote
459
# peer is down if no ping received during
461
# a 120 second time period.
467
# For extra security beyond that provided
469
# by SSL/TLS, create an "HMAC firewall"
471
# to help block DoS attacks and UDP port flooding.
477
# openvpn --genkey --secret ta.key
481
# The server and each client must have
485
# The second parameter should be '0'
487
# on the server and '1' on the clients.
489
tls-auth ta.key 0 # This file is secret
495
# Select a cryptographic cipher.
497
# This config item must be copied to
499
# the client config file as well.
501
;cipher BF-CBC # Blowfish (default)
503
cipher AES-128-CBC # AES
507
;cipher DES-EDE3-CBC # Triple-DES
511
# Enable compression on the VPN link.
513
# If you enable it here, you must also
515
# enable it in the client config file.
521
# The maximum number of concurrently connected
523
# clients we want to allow.
529
# It's a good idea to reduce the OpenVPN
531
# daemon's privileges after initialization.
535
# You can uncomment this out on
537
# non-Windows systems.
545
# The persist options will try to avoid
547
# accessing certain resources on restart
549
# that may no longer be accessible because
551
# of the privilege downgrade.
559
# Output a short status file showing
561
# current connections, truncated
563
# and rewritten every minute.
565
status openvpn-status.log
569
# By default, log messages will go to the syslog (or
571
# on Windows, if running as a service, they will go to
573
# the "\Program Files\OpenVPN\log" directory).
575
# Use log or log-append to override this default.
577
# "log" will truncate the log file on OpenVPN startup,
579
# while "log-append" will append to it. Use one
581
# or the other (but not both).
585
;log-append openvpn.log
589
# Set the appropriate level of log
595
# 0 is silent, except for fatal errors
597
# 4 is reasonable for general usage
599
# 5 and 6 can help to debug connection problems
601
# 9 is extremely verbose
607
# Silence repeating messages. At most 20
609
# sequential messages of the same message
611
# category will be output to the log.