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.
111
# Windows needs the TAP-Win32 adapter name
113
# from the Network Connections panel if you
115
# have more than one. On XP SP2 or higher,
117
# you may need to selectively disable the
119
# Windows firewall for the TAP adapter.
121
# Non-Windows systems usually don't need this.
127
# SSL/TLS root certificate (ca), certificate
129
# (cert), and private key (key). Each client
131
# and the server must have their own cert and
133
# key file. The server and all clients will
135
# use the same ca file.
139
# See the "easy-rsa" directory for a series
141
# of scripts for generating RSA certificates
143
# and private keys. Remember to use
145
# a unique Common Name for the server
147
# and each of the client certificates.
151
# Any X509 key management system can be used.
153
# OpenVPN can also use a PKCS #12 formatted key file
155
# (see "pkcs12" directive in man page).
161
key server.key # This file should be kept secret
165
# Diffie hellman parameters.
167
# Generate your own with:
169
# openssl dhparam -out dh1024.pem 1024
171
# Substitute 2048 for 1024 if you are using
179
# Configure server mode and supply a VPN subnet
181
# for OpenVPN to draw client addresses from.
183
# The server will take 10.8.0.1 for itself,
185
# the rest will be made available to clients.
187
# Each client will be able to reach the server
189
# on 10.8.0.1. Comment this line out if you are
191
# ethernet bridging. See the man page for more info.
193
server 10.8.0.0 255.255.255.0
197
# Maintain a record of client <-> virtual IP address
199
# associations in this file. If OpenVPN goes down or
201
# is restarted, reconnecting clients can be assigned
203
# the same virtual IP address from the pool that was
205
# previously assigned.
207
ifconfig-pool-persist ipp.txt
211
# Configure server mode for ethernet bridging.
213
# You must first use your OS's bridging capability
215
# to bridge the TAP interface with the ethernet
217
# NIC interface. Then you must manually set the
219
# IP/netmask on the bridge interface, here we
221
# assume 10.8.0.4/255.255.255.0. Finally we
223
# must set aside an IP range in this subnet
225
# (start=10.8.0.50 end=10.8.0.100) to allocate
227
# to connecting clients. Leave this line commented
229
# out unless you are ethernet bridging.
231
;server-bridge 10.8.0.4 255.255.255.0 10.8.0.50 10.8.0.100
235
# Configure server mode for ethernet bridging
237
# using a DHCP-proxy, where clients talk
239
# to the OpenVPN server-side DHCP server
241
# to receive their IP address allocation
243
# and DNS server addresses. You must first use
245
# your OS's bridging capability to bridge the TAP
247
# interface with the ethernet NIC interface.
249
# Note: this mode only works on clients (such as
251
# Windows), where the client-side TAP adapter is
253
# bound to a DHCP client.
259
# Push routes to the client to allow it
261
# to reach other private subnets behind
263
# the server. Remember that these
265
# private subnets will also need
267
# to know to route the OpenVPN client
269
# address pool (10.8.0.0/255.255.255.0)
271
# back to the OpenVPN server.
273
push "route 192.168.11.0 255.255.255.0"
275
;push "route 192.168.20.0 255.255.255.0"
279
# To assign specific IP addresses to specific
281
# clients or if a connecting client has a private
283
# subnet behind it that should also have VPN access,
285
# use the subdirectory "ccd" for client-specific
287
# configuration files (see man page for more info).
291
# EXAMPLE: Suppose the client
293
# having the certificate common name "Thelonious"
295
# also has a small subnet behind his connecting
297
# machine, such as 192.168.40.128/255.255.255.248.
299
# First, uncomment out these lines:
301
;client-config-dir ccd
303
;route 192.168.40.128 255.255.255.248
305
# Then create a file ccd/Thelonious with this line:
307
# iroute 192.168.40.128 255.255.255.248
309
# This will allow Thelonious' private subnet to
311
# access the VPN. This example will only work
313
# if you are routing, not bridging, i.e. you are
315
# using "dev tun" and "server" directives.
319
# EXAMPLE: Suppose you want to give
321
# Thelonious a fixed VPN IP address of 10.9.0.1.
323
# First uncomment out these lines:
325
;client-config-dir ccd
327
;route 10.9.0.0 255.255.255.252
329
# Then add this line to ccd/Thelonious:
331
# ifconfig-push 10.9.0.1 10.9.0.2
333
;client-config-dir ccd
337
# Suppose that you want to enable different
339
# firewall access policies for different groups
341
# of clients. There are two methods:
343
# (1) Run multiple OpenVPN daemons, one for each
345
# group, and firewall the TUN/TAP interface
347
# for each group/daemon appropriately.
349
# (2) (Advanced) Create a script to dynamically
351
# modify the firewall in response to access
353
# from different clients. See man
355
# page for more info on learn-address script.
357
;learn-address ./script
361
# If enabled, this directive will configure
363
# all clients to redirect their default
365
# network gateway through the VPN, causing
367
# all IP traffic such as web browsing and
369
# and DNS lookups to go through the VPN
371
# (The OpenVPN server machine may need to NAT
373
# or bridge the TUN/TAP interface to the internet
375
# in order for this to work properly).
377
push "redirect-gateway def1 bypass-dhcp"
381
# Certain Windows-specific network settings
383
# can be pushed to clients, such as DNS
385
# or WINS server addresses. CAVEAT:
389
# The addresses below refer to the public
391
# DNS servers provided by opendns.com.
393
;push "dhcp-option DNS 208.67.222.222"
395
;push "dhcp-option DNS 208.67.220.220"
397
push "dhcp-option DNS 192.168.11.1"
401
# push "block-outside-dns"
405
# Uncomment this directive to allow different
407
# clients to be able to "see" each other.
409
# By default, clients will only see the server.
411
# To force clients to only see the server, you
413
# will also need to appropriately firewall the
415
# server's TUN/TAP interface.
421
# Uncomment this directive if multiple clients
423
# might connect with the same certificate/key
425
# files or common names. This is recommended
427
# only for testing purposes. For production use,
429
# each client should have its own certificate/key
435
# IF YOU HAVE NOT GENERATED INDIVIDUAL
437
# CERTIFICATE/KEY PAIRS FOR EACH CLIENT,
439
# EACH HAVING ITS OWN UNIQUE "COMMON NAME",
441
# UNCOMMENT THIS LINE OUT.
447
# The keepalive directive causes ping-like
449
# messages to be sent back and forth over
451
# the link so that each side knows when
453
# the other side has gone down.
455
# Ping every 10 seconds, assume that remote
457
# peer is down if no ping received during
459
# a 120 second time period.
465
# For extra security beyond that provided
467
# by SSL/TLS, create an "HMAC firewall"
469
# to help block DoS attacks and UDP port flooding.
475
# openvpn --genkey --secret ta.key
479
# The server and each client must have
483
# The second parameter should be '0'
485
# on the server and '1' on the clients.
487
;tls-auth ta.key 0 # This file is secret
491
# Select a cryptographic cipher.
493
# This config item must be copied to
495
# the client config file as well.
497
;cipher BF-CBC # Blowfish (default)
499
;cipher AES-128-CBC # AES
501
;cipher DES-EDE3-CBC # Triple-DES
505
# Enable compression on the VPN link.
507
# If you enable it here, you must also
509
# enable it in the client config file.
515
# The maximum number of concurrently connected
517
# clients we want to allow.
523
# It's a good idea to reduce the OpenVPN
525
# daemon's privileges after initialization.
529
# You can uncomment this out on
531
# non-Windows systems.
539
# The persist options will try to avoid
541
# accessing certain resources on restart
543
# that may no longer be accessible because
545
# of the privilege downgrade.
553
# Username and Password authentication.
555
client-cert-not-required
557
username-as-common-name
559
plugin /usr/lib/openvpn/openvpn-plugin-auth-pam.so openvpn
561
;auth-user-pass-verify auth-pam.pl via-file
565
# Output a short status file showing
567
# current connections, truncated
569
# and rewritten every minute.
571
status openvpn-status.log
575
# By default, log messages will go to the syslog (or
577
# on Windows, if running as a service, they will go to
579
# the "\Program Files\OpenVPN\log" directory).
581
# Use log or log-append to override this default.
583
# "log" will truncate the log file on OpenVPN startup,
585
# while "log-append" will append to it. Use one
587
# or the other (but not both).
591
;log-append openvpn.log
595
# Set the appropriate level of log
601
# 0 is silent, except for fatal errors
603
# 4 is reasonable for general usage
605
# 5 and 6 can help to debug connection problems
607
# 9 is extremely verbose
613
# Silence repeating messages. At most 20
615
# sequential messages of the same message
617
# category will be output to the log.