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