… | |
… | |
28 | = value> pairs. Empty lines are ignored. Comments start with a C<#> and |
28 | = value> pairs. Empty lines are ignored. Comments start with a C<#> and |
29 | extend to the end of the line. They can be used on their own lines, or |
29 | extend to the end of the line. They can be used on their own lines, or |
30 | after any directives. Whitespace is allowed around the C<=> sign or after |
30 | after any directives. Whitespace is allowed around the C<=> sign or after |
31 | values, but not within the variable names or values themselves. |
31 | values, but not within the variable names or values themselves. |
32 | |
32 | |
33 | The only exception to the above is the "on" directive that can prefix any |
33 | All settings are applied "in order", that is, later settings of the same |
34 | C<name = value> setting and will only "execute" it on the named node, or |
34 | variable overwrite earlier ones. |
35 | (if the nodename starts with "!") on all nodes except the named one. |
|
|
36 | |
35 | |
|
|
36 | The only exceptions to the above are the "on" and "include" directives: |
|
|
37 | |
|
|
38 | =over 4 |
|
|
39 | |
|
|
40 | =item on nodename ... |
|
|
41 | |
|
|
42 | =item on !nodename ... |
|
|
43 | |
|
|
44 | You can prefix any configuration directive with C<on> and a nodename. GVPE |
|
|
45 | will will only "execute" it on the named node, or (if the nodename starts |
|
|
46 | with C<!>) on all nodes except the named one. |
|
|
47 | |
37 | For example, set the MTU to C<1450> everywhere, loglevel to C<noise> on |
48 | Example: set the MTU to C<1450> everywhere, C<loglevel> to C<noise> on |
38 | branch1, and connect to C<ondemand> everywhere but on branch2: |
49 | C<branch1>, and C<connect> to C<ondemand> everywhere but on branch2. |
39 | |
50 | |
40 | mtu = 1450 |
51 | mtu = 1450 |
41 | on branch1 loglevel = noise |
52 | on branch1 loglevel = noise |
42 | on !branch2 connect = ondemand |
53 | on !branch2 connect = ondemand |
43 | |
54 | |
44 | All settings are applied "in order", that is, later settings of the same |
55 | =item include relative-or-absolute-path |
45 | variable overwrite earlier ones. |
56 | |
|
|
57 | Reads the specified file (the path must not contain whitespace or C<=> |
|
|
58 | characters) and evaluate all config directives in it as if they were |
|
|
59 | spelled out in place of the C<include> directive. |
|
|
60 | |
|
|
61 | The path is a printf format string, that is, you must escape any C<%> |
|
|
62 | by doubling it, and you can have a single C<%s> inside, which will be |
|
|
63 | replaced by the current nodename. |
|
|
64 | |
|
|
65 | Relative paths are interpreted relative to the GVPE config directory. |
|
|
66 | |
|
|
67 | Example: include the file F<local.conf> in the config directory on every |
|
|
68 | node. |
|
|
69 | |
|
|
70 | include local.conf |
|
|
71 | |
|
|
72 | Example: include a file F<conf/>nodenameF<.conf> |
|
|
73 | |
|
|
74 | include conf/%s.conf |
|
|
75 | |
|
|
76 | =back |
46 | |
77 | |
47 | =head1 ANATOMY OF A CONFIG FILE |
78 | =head1 ANATOMY OF A CONFIG FILE |
48 | |
79 | |
49 | Usually, a config file starts with a few global settings (like the UDP |
80 | Usually, a config file starts with a few global settings (like the UDP |
50 | port to listen on), followed by node-specific sections that begin with a |
81 | port to listen on), followed by node-specific sections that begin with a |
… | |
… | |
76 | |
107 | |
77 | =item dns-forw-port = port-number |
108 | =item dns-forw-port = port-number |
78 | |
109 | |
79 | The port where the C<dns-forw-host> is to be contacted (default: C<53>, |
110 | The port where the C<dns-forw-host> is to be contacted (default: C<53>, |
80 | which is fine in most cases). |
111 | which is fine in most cases). |
|
|
112 | |
|
|
113 | =item dns-case-preserving = yes|true|on | no|false|off |
|
|
114 | |
|
|
115 | Sets whether the DNS transport forwarding server preserves case (DNS |
|
|
116 | servers have to, but some access systems are even more broken than others) |
|
|
117 | (default: true). |
|
|
118 | |
|
|
119 | Normally, when the forwarding server changes the case of domain names then |
|
|
120 | GVPE will automatically set this to false. |
81 | |
121 | |
82 | =item dns-max-outstanding = integer-number-of-requests |
122 | =item dns-max-outstanding = integer-number-of-requests |
83 | |
123 | |
84 | The maximum number of outstanding DNS transport requests |
124 | The maximum number of outstanding DNS transport requests |
85 | (default: C<100>). GVPE will never issue more requests then the given |
125 | (default: C<100>). GVPE will never issue more requests then the given |
… | |
… | |
237 | other programs. |
277 | other programs. |
238 | |
278 | |
239 | The default is 47 (GRE), which has a good chance of tunneling |
279 | The default is 47 (GRE), which has a good chance of tunneling |
240 | through firewalls (but note that gvpe's rawip protocol is not GRE |
280 | through firewalls (but note that gvpe's rawip protocol is not GRE |
241 | compatible). Other common choices are 50 (IPSEC, ESP), 51 (IPSEC, AH), 4 |
281 | compatible). Other common choices are 50 (IPSEC, ESP), 51 (IPSEC, AH), 4 |
242 | (IPIP tunnels) or 98 (ENCAP, rfc1241) |
282 | (IPIP tunnels) or 98 (ENCAP, rfc1241). |
|
|
283 | |
|
|
284 | Many versions of Linux seem to have a bug that causes them to reorder |
|
|
285 | packets for some ip protocols (GRE, ESP) but not for others (AH), so |
|
|
286 | choose wisely (that is, use 51, AH). |
243 | |
287 | |
244 | =item http-proxy-host = hostname/ip |
288 | =item http-proxy-host = hostname/ip |
245 | |
289 | |
246 | The C<http-proxy-*> family of options are only available if gvpe was |
290 | The C<http-proxy-*> family of options are only available if gvpe was |
247 | compiled with the C<--enable-http-proxy> option and enable tunneling of |
291 | compiled with the C<--enable-http-proxy> option and enable tunneling of |
… | |
… | |
314 | is established (even on rekeying operations). Note that node-up/down |
358 | is established (even on rekeying operations). Note that node-up/down |
315 | scripts will be run asynchronously, but execution is serialised, so there |
359 | scripts will be run asynchronously, but execution is serialised, so there |
316 | will only ever be one such script running. |
360 | will only ever be one such script running. |
317 | |
361 | |
318 | In addition to all the variables passed to C<if-up> scripts, the following |
362 | In addition to all the variables passed to C<if-up> scripts, the following |
319 | environment variables will be set: |
363 | environment variables will be set (values are just examples): |
320 | |
364 | |
321 | =over 4 |
365 | =over 4 |
322 | |
366 | |
323 | =item DESTNODE=branch2 |
367 | =item DESTNODE=branch2 |
324 | |
368 | |
325 | The name of the remote node. |
369 | The name of the remote node. |
326 | |
370 | |
327 | =item DESTID=2 |
371 | =item DESTID=2 |
328 | |
372 | |
329 | The node id of the remote node. |
373 | The node id of the remote node. |
|
|
374 | |
|
|
375 | =item DESTSI=rawip/88.99.77.55:0 |
|
|
376 | |
|
|
377 | The "socket info" of the target node, protocol dependent but usually in |
|
|
378 | the format protocol/ip:port. |
330 | |
379 | |
331 | =item DESTIP=188.13.66.8 |
380 | =item DESTIP=188.13.66.8 |
332 | |
381 | |
333 | The numerical IP address of the remote node (gvpe accepts connections from |
382 | The numerical IP address of the remote node (gvpe accepts connections from |
334 | everywhere, as long as the other node can authenticate itself). |
383 | everywhere, as long as the other node can authenticate itself). |
335 | |
384 | |
336 | =item DESTPORT=655 # deprecated |
385 | =item DESTPORT=655 # deprecated |
337 | |
386 | |
338 | The UDP port used by the other side. |
387 | The protocol port used by the other side, if applicable. |
339 | |
388 | |
340 | =item STATE=UP |
389 | =item STATE=up |
341 | |
390 | |
342 | Node-up scripts get called with STATE=UP, node-down scripts get called |
391 | Node-up scripts get called with STATE=up, node-change scripts get called |
343 | with STATE=DOWN. |
392 | with STATE=change and node-down scripts get called with STATE=down. |
344 | |
393 | |
345 | =back |
394 | =back |
346 | |
395 | |
347 | Here is a nontrivial example that uses nsupdate to update the name => ip |
396 | Here is a nontrivial example that uses nsupdate to update the name => ip |
348 | mapping in some DNS zone: |
397 | mapping in some DNS zone: |
… | |
… | |
352 | echo update delete $DESTNODE.lowttl.example.net. a |
401 | echo update delete $DESTNODE.lowttl.example.net. a |
353 | echo update add $DESTNODE.lowttl.example.net. 1 in a $DESTIP |
402 | echo update add $DESTNODE.lowttl.example.net. 1 in a $DESTIP |
354 | echo |
403 | echo |
355 | } | nsupdate -d -k $CONFBASE:key.example.net. |
404 | } | nsupdate -d -k $CONFBASE:key.example.net. |
356 | |
405 | |
|
|
406 | =item node-change = relative-or-absolute-path |
|
|
407 | |
|
|
408 | Same as C<node-change>, but gets called whenever something about a |
|
|
409 | connection changes (such as the source IP address). |
|
|
410 | |
357 | =item node-down = relative-or-absolute-path |
411 | =item node-down = relative-or-absolute-path |
358 | |
412 | |
359 | Same as C<node-up>, but gets called whenever a connection is lost. |
413 | Same as C<node-up>, but gets called whenever a connection is lost. |
360 | |
414 | |
361 | =item pid-file = path |
415 | =item pid-file = path |
… | |
… | |
379 | |
433 | |
380 | Sets the rekeying interval in seconds (default: C<3600>). Connections are |
434 | Sets the rekeying interval in seconds (default: C<3600>). Connections are |
381 | reestablished every C<rekey> seconds, making them use a new encryption |
435 | reestablished every C<rekey> seconds, making them use a new encryption |
382 | key. |
436 | key. |
383 | |
437 | |
|
|
438 | =item nfmark = integer |
|
|
439 | |
|
|
440 | This advanced option, when set to a nonzero value (default: C<0>), tries |
|
|
441 | to set the netfilter mark (or fwmark) value on all sockets gvpe uses to |
|
|
442 | send packets. |
|
|
443 | |
|
|
444 | This can be used to make gvpe use a different set of routing rules. For |
|
|
445 | example, on GNU/Linux, the C<if-up> could set C<nfmark> to 1000 and then |
|
|
446 | put all routing rules into table C<99> and then use an ip rule to make |
|
|
447 | gvpe traffic avoid that routing table, in effect routing normal traffic |
|
|
448 | via gvpe and gvpe traffic via the normal system routing tables: |
|
|
449 | |
|
|
450 | ip rule add not fwmark 1000 lookup 99 |
|
|
451 | |
384 | =back |
452 | =back |
385 | |
453 | |
386 | =head2 NODE SPECIFIC SETTINGS |
454 | =head2 NODE SPECIFIC SETTINGS |
387 | |
455 | |
388 | The following settings are node-specific, that is, every node can have |
456 | The following settings are node-specific, that is, every node can have |
… | |
… | |
396 | |
464 | |
397 | Allow direct connections to this node. See C<deny-direct> for more info. |
465 | Allow direct connections to this node. See C<deny-direct> for more info. |
398 | |
466 | |
399 | =item compress = yes|true|on | no|false|off |
467 | =item compress = yes|true|on | no|false|off |
400 | |
468 | |
|
|
469 | For the current node, this specified whether it will accept compressed |
|
|
470 | packets, and for all other nodes, this specifies whether to try to |
401 | Wether to compress data packets sent to this node (default: C<yes>). |
471 | compress data packets sent to this node (default: C<yes>). Compression is |
402 | Compression is really cheap even on slow computers and has no size |
472 | really cheap even on slow computers, has no size overhead at all and will |
403 | overhead at all, so enabling this is often a good idea. |
473 | only be used when the other side supports compression, so enabling this is |
|
|
474 | often a good idea. |
404 | |
475 | |
405 | =item connect = ondemand | never | always | disabled |
476 | =item connect = ondemand | never | always | disabled |
406 | |
477 | |
407 | Sets the connect mode (default: C<always>). It can be C<always> (always |
478 | Sets the connect mode (default: C<always>). It can be C<always> (always |
408 | try to establish and keep a connection to the given node), C<never> |
479 | try to establish and keep a connection to the given node), C<never> |
… | |
… | |
499 | |
570 | |
500 | =item enable-udp = yes|true|on | no|false|off |
571 | =item enable-udp = yes|true|on | no|false|off |
501 | |
572 | |
502 | See gvpe.protocol(7) for a description of the UDP transport protocol. |
573 | See gvpe.protocol(7) for a description of the UDP transport protocol. |
503 | |
574 | |
504 | Enable the UDPv4 transport using the C<udp-port> port (default: C<no>, |
575 | Enable the UDPv4 transport using the C<udp-port> port (default: C<no>). |
505 | unless no other protocol is enabled for a node, in which case this |
|
|
506 | protocol is enabled automatically). |
|
|
507 | |
|
|
508 | NOTE: Please specify C<enable-udp = yes> if you want to use it even though |
|
|
509 | it might get switched on automatically, as some future version might |
|
|
510 | default to another default protocol. |
|
|
511 | |
576 | |
512 | =item hostname = hostname | ip [can not be defaulted] |
577 | =item hostname = hostname | ip [can not be defaulted] |
513 | |
578 | |
514 | Forces the address of this node to be set to the given DNS hostname or IP |
579 | Forces the address of this node to be set to the given DNS hostname or IP |
515 | address. It will be resolved before each connect request, so dyndns should |
580 | address. It will be resolved before each connect request, so dyndns should |
… | |
… | |
534 | The value specified using this directive will be passed to the C<if-up> |
599 | The value specified using this directive will be passed to the C<if-up> |
535 | script in the environment variable C<IFUPDATA>. |
600 | script in the environment variable C<IFUPDATA>. |
536 | |
601 | |
537 | =item inherit-tos = yes|true|on | no|false|off |
602 | =item inherit-tos = yes|true|on | no|false|off |
538 | |
603 | |
539 | Wether to inherit the TOS settings of packets sent to the tunnel when |
604 | Whether to inherit the TOS settings of packets sent to the tunnel when |
540 | sending packets to this node (default: C<yes>). If set to C<yes> then |
605 | sending packets to this node (default: C<yes>). If set to C<yes> then |
541 | outgoing tunnel packets will have the same TOS setting as the packets sent |
606 | outgoing tunnel packets will have the same TOS setting as the packets sent |
542 | to the tunnel device, which is usually what you want. |
607 | to the tunnel device, which is usually what you want. |
543 | |
608 | |
544 | =item max-retry = positive-number |
609 | =item max-retry = positive-number |