Made OpenVPN uci-aware (patch from xmff)
[openwrt/svn-archive/archive.git] / net / openvpn / files / openvpn.config
1 package openvpn
2
3 #################################################
4 # Sample OpenVPN 2.0 config file for #
5 # multi-client server. #
6 #################################################
7
8 config openvpn sample_server
9
10 # Set to 1 to enable this instance:
11 option enable 0
12
13 # Which local IP address should OpenVPN
14 # listen on? (optional)
15 # option local 0.0.0.0
16
17 # Which TCP/UDP port should OpenVPN listen on?
18 # If you want to run multiple OpenVPN instances
19 # on the same machine, use a different port
20 # number for each one. You will need to
21 # open up this port on your firewall.
22 option port 1194
23
24 # TCP or UDP server?
25 # option proto tcp
26 option proto udp
27
28 # "dev tun" will create a routed IP tunnel,
29 # "dev tap" will create an ethernet tunnel.
30 # Use "dev tap0" if you are ethernet bridging
31 # and have precreated a tap0 virtual interface
32 # and bridged it with your ethernet interface.
33 # If you want to control access policies
34 # over the VPN, you must create firewall
35 # rules for the the TUN/TAP interface.
36 # On non-Windows systems, you can give
37 # an explicit unit number, such as tun0.
38 # On Windows, use "dev-node" for this.
39 # On most systems, the VPN will not function
40 # unless you partially or fully disable
41 # the firewall for the TUN/TAP interface.
42 # option dev tap
43 option dev tun
44
45 # SSL/TLS root certificate (ca), certificate
46 # (cert), and private key (key). Each client
47 # and the server must have their own cert and
48 # key file. The server and all clients will
49 # use the same ca file.
50 #
51 # See the "easy-rsa" directory for a series
52 # of scripts for generating RSA certificates
53 # and private keys. Remember to use
54 # a unique Common Name for the server
55 # and each of the client certificates.
56 #
57 # Any X509 key management system can be used.
58 # OpenVPN can also use a PKCS #12 formatted key file
59 # (see "pkcs12" directive in man page).
60 option ca ca.crt
61 option cert server.crt
62 # This file should be kept secret:
63 option key server.key
64
65 # Diffie hellman parameters.
66 # Generate your own with:
67 # openssl dhparam -out dh1024.pem 1024
68 # Substitute 2048 for 1024 if you are using
69 # 2048 bit keys.
70 option dh dh1024.pem
71
72 # Configure server mode and supply a VPN subnet
73 # for OpenVPN to draw client addresses from.
74 # The server will take 10.8.0.1 for itself,
75 # the rest will be made available to clients.
76 # Each client will be able to reach the server
77 # on 10.8.0.1. Comment this line out if you are
78 # ethernet bridging. See the man page for more info.
79 option server "10.8.0.0 255.255.255.0"
80
81 # Maintain a record of client <-> virtual IP address
82 # associations in this file. If OpenVPN goes down or
83 # is restarted, reconnecting clients can be assigned
84 # the same virtual IP address from the pool that was
85 # previously assigned.
86 option ifconfig_pool_persist ipp.txt
87
88 # Configure server mode for ethernet bridging.
89 # You must first use your OS's bridging capability
90 # to bridge the TAP interface with the ethernet
91 # NIC interface. Then you must manually set the
92 # IP/netmask on the bridge interface, here we
93 # assume 10.8.0.4/255.255.255.0. Finally we
94 # must set aside an IP range in this subnet
95 # (start=10.8.0.50 end=10.8.0.100) to allocate
96 # to connecting clients. Leave this line commented
97 # out unless you are ethernet bridging.
98 # option server_bridge "10.8.0.4 255.255.255.0 10.8.0.50 10.8.0.100"
99
100 # Push routes to the client to allow it
101 # to reach other private subnets behind
102 # the server. Remember that these
103 # private subnets will also need
104 # to know to route the OpenVPN client
105 # address pool (10.8.0.0/255.255.255.0)
106 # back to the OpenVPN server.
107 # list push "route 192.168.10.0 255.255.255.0"
108 # list push "route 192.168.20.0 255.255.255.0"
109
110 # To assign specific IP addresses to specific
111 # clients or if a connecting client has a private
112 # subnet behind it that should also have VPN access,
113 # use the subdirectory "ccd" for client-specific
114 # configuration files (see man page for more info).
115
116 # EXAMPLE: Suppose the client
117 # having the certificate common name "Thelonious"
118 # also has a small subnet behind his connecting
119 # machine, such as 192.168.40.128/255.255.255.248.
120 # First, uncomment out these lines:
121 # option client_config_dir ccd
122 # list route "192.168.40.128 255.255.255.248"
123 # Then create a file ccd/Thelonious with this line:
124 # iroute 192.168.40.128 255.255.255.248
125 # This will allow Thelonious' private subnet to
126 # access the VPN. This example will only work
127 # if you are routing, not bridging, i.e. you are
128 # using "dev tun" and "server" directives.
129
130 # EXAMPLE: Suppose you want to give
131 # Thelonious a fixed VPN IP address of 10.9.0.1.
132 # First uncomment out these lines:
133 # option client_config_dir ccd
134 # list route "10.9.0.0 255.255.255.252"
135 # list route "192.168.100.0 255.255.255.0"
136 # Then add this line to ccd/Thelonious:
137 # ifconfig-push "10.9.0.1 10.9.0.2"
138
139 # Suppose that you want to enable different
140 # firewall access policies for different groups
141 # of clients. There are two methods:
142 # (1) Run multiple OpenVPN daemons, one for each
143 # group, and firewall the TUN/TAP interface
144 # for each group/daemon appropriately.
145 # (2) (Advanced) Create a script to dynamically
146 # modify the firewall in response to access
147 # from different clients. See man
148 # page for more info on learn-address script.
149 # option learn_address ./script
150
151 # If enabled, this directive will configure
152 # all clients to redirect their default
153 # network gateway through the VPN, causing
154 # all IP traffic such as web browsing and
155 # and DNS lookups to go through the VPN
156 # (The OpenVPN server machine may need to NAT
157 # the TUN/TAP interface to the internet in
158 # order for this to work properly).
159 # CAVEAT: May break client's network config if
160 # client's local DHCP server packets get routed
161 # through the tunnel. Solution: make sure
162 # client's local DHCP server is reachable via
163 # a more specific route than the default route
164 # of 0.0.0.0/0.0.0.0.
165 # list push "redirect-gateway"
166
167 # Certain Windows-specific network settings
168 # can be pushed to clients, such as DNS
169 # or WINS server addresses. CAVEAT:
170 # http://openvpn.net/faq.html#dhcpcaveats
171 # list push "dhcp-option DNS 10.8.0.1"
172 # list push "dhcp-option WINS 10.8.0.1"
173
174 # Uncomment this directive to allow different
175 # clients to be able to "see" each other.
176 # By default, clients will only see the server.
177 # To force clients to only see the server, you
178 # will also need to appropriately firewall the
179 # server's TUN/TAP interface.
180 # option client_to_client 1
181
182 # Uncomment this directive if multiple clients
183 # might connect with the same certificate/key
184 # files or common names. This is recommended
185 # only for testing purposes. For production use,
186 # each client should have its own certificate/key
187 # pair.
188 #
189 # IF YOU HAVE NOT GENERATED INDIVIDUAL
190 # CERTIFICATE/KEY PAIRS FOR EACH CLIENT,
191 # EACH HAVING ITS OWN UNIQUE "COMMON NAME",
192 # UNCOMMENT THIS LINE OUT.
193 # option duplicate_cn 1
194
195 # The keepalive directive causes ping-like
196 # messages to be sent back and forth over
197 # the link so that each side knows when
198 # the other side has gone down.
199 # Ping every 10 seconds, assume that remote
200 # peer is down if no ping received during
201 # a 120 second time period.
202 option keepalive "10 120"
203
204 # For extra security beyond that provided
205 # by SSL/TLS, create an "HMAC firewall"
206 # to help block DoS attacks and UDP port flooding.
207 #
208 # Generate with:
209 # openvpn --genkey --secret ta.key
210 #
211 # The server and each client must have
212 # a copy of this key.
213 # The second parameter should be '0'
214 # on the server and '1' on the clients.
215 # This file is secret:
216 # option tls_auth "ta.key 0"
217
218 # Select a cryptographic cipher.
219 # This config item must be copied to
220 # the client config file as well.
221 # Blowfish (default):
222 # option cipher BF-CBC
223 # AES:
224 # option cipher AES-128-CBC
225 # Triple-DES:
226 # option cipher DES-EDE3-CBC
227
228 # Enable compression on the VPN link.
229 # If you enable it here, you must also
230 # enable it in the client config file.
231 option comp_lzo 1
232
233 # The maximum number of concurrently connected
234 # clients we want to allow.
235 # option max_clients 100
236
237 # The persist options will try to avoid
238 # accessing certain resources on restart
239 # that may no longer be accessible because
240 # of the privilege downgrade.
241 option persist_key 1
242 option persist_tun 1
243
244 # Output a short status file showing
245 # current connections, truncated
246 # and rewritten every minute.
247 option status openvpn-status.log
248
249 # By default, log messages will go to the syslog (or
250 # on Windows, if running as a service, they will go to
251 # the "\Program Files\OpenVPN\log" directory).
252 # Use log or log-append to override this default.
253 # "log" will truncate the log file on OpenVPN startup,
254 # while "log-append" will append to it. Use one
255 # or the other (but not both).
256 # option log openvpn.log
257 # option log_append openvpn.log
258
259 # Set the appropriate level of log
260 # file verbosity.
261 #
262 # 0 is silent, except for fatal errors
263 # 4 is reasonable for general usage
264 # 5 and 6 can help to debug connection problems
265 # 9 is extremely verbose
266 option verb 3
267
268 # Silence repeating messages. At most 20
269 # sequential messages of the same message
270 # category will be output to the log.
271 # option mute 20
272
273
274 ##############################################
275 # Sample client-side OpenVPN 2.0 config file #
276 # for connecting to multi-client server. #
277 ##############################################
278
279 config openvpn sample_client
280
281 # Set to 1 to enable this instance:
282 option enable 0
283
284 # Specify that we are a client and that we
285 # will be pulling certain config file directives
286 # from the server.
287 option client 1
288
289 # Use the same setting as you are using on
290 # the server.
291 # On most systems, the VPN will not function
292 # unless you partially or fully disable
293 # the firewall for the TUN/TAP interface.
294 # option dev tap
295 option dev tun
296
297 # Are we connecting to a TCP or
298 # UDP server? Use the same setting as
299 # on the server.
300 # option proto tcp
301 option proto udp
302
303 # The hostname/IP and port of the server.
304 # You can have multiple remote entries
305 # to load balance between the servers.
306 list remote "my_server_1 1194"
307 # list remote "my_server_2 1194"
308
309 # Choose a random host from the remote
310 # list for load_balancing. Otherwise
311 # try hosts in the order specified.
312 # option remote_random 1
313
314 # Keep trying indefinitely to resolve the
315 # host name of the OpenVPN server. Very useful
316 # on machines which are not permanently connected
317 # to the internet such as laptops.
318 option resolv_retry infinite
319
320 # Most clients don't need to bind to
321 # a specific local port number.
322 option nobind 1
323
324 # Try to preserve some state across restarts.
325 option persist_key 1
326 option persist_tun 1
327
328 # If you are connecting through an
329 # HTTP proxy to reach the actual OpenVPN
330 # server, put the proxy server/IP and
331 # port number here. See the man page
332 # if your proxy server requires
333 # authentication.
334 # retry on connection failures:
335 # option http_proxy_retry 1
336 # specify http proxy address and port:
337 # option http_proxy "192.168.1.100 8080"
338
339 # Wireless networks often produce a lot
340 # of duplicate packets. Set this flag
341 # to silence duplicate packet warnings.
342 # option mute_replay_warnings 1
343
344 # SSL/TLS parms.
345 # See the server config file for more
346 # description. It's best to use
347 # a separate .crt/.key file pair
348 # for each client. A single ca
349 # file can be used for all clients.
350 option ca ca.crt
351 option cert client.crt
352 option key client.key
353
354 # Verify server certificate by checking
355 # that the certicate has the nsCertType
356 # field set to "server". This is an
357 # important precaution to protect against
358 # a potential attack discussed here:
359 # http://openvpn.net/howto.html#mitm
360 #
361 # To use this feature, you will need to generate
362 # your server certificates with the nsCertType
363 # field set to "server". The build_key_server
364 # script in the easy_rsa folder will do this.
365 # option ns_cert_type server
366
367 # If a tls_auth key is used on the server
368 # then every client must also have the key.
369 # option tls_auth "ta.key 1"
370
371 # Select a cryptographic cipher.
372 # If the cipher option is used on the server
373 # then you must also specify it here.
374 # option cipher x
375
376 # Enable compression on the VPN link.
377 # Don't enable this unless it is also
378 # enabled in the server config file.
379 option comp_lzo 1
380
381 # Set log file verbosity.
382 option verb 3
383
384 # Silence repeating messages
385 # option mute 20