… | |
… | |
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 |
… | |
… | |
67 | values on different nodes using C<on>), but will affect the behaviour of |
98 | values on different nodes using C<on>), but will affect the behaviour of |
68 | the gvpe daemon and all connections it creates. |
99 | the gvpe daemon and all connections it creates. |
69 | |
100 | |
70 | =over 4 |
101 | =over 4 |
71 | |
102 | |
|
|
103 | =item chroot = path or / |
|
|
104 | |
|
|
105 | Tells GVPE to chroot(2) to the specified path after reading all necessary |
|
|
106 | files, binding to sockets and running the C<if-up> script, but before |
|
|
107 | running C<node-up> or any other scripts. |
|
|
108 | |
|
|
109 | The special path F</> instructs GVPE to create (and remove) an empty |
|
|
110 | temporary directory to use as new root. This is most secure, but makes it |
|
|
111 | impossible to use any scripts other than the C<if-up> one. |
|
|
112 | |
|
|
113 | =item chuid = numerical-uid |
|
|
114 | |
|
|
115 | =item chgid = numerical-gid |
|
|
116 | |
|
|
117 | These two options tell GVPE to change to the given user and/or group id |
|
|
118 | after reading all necessary files, binding to sockets and running the |
|
|
119 | C<if-up> script. |
|
|
120 | |
|
|
121 | Other scripts, such as C<node-up>, are run with the new user id or group id. |
|
|
122 | |
|
|
123 | =item chuser = username |
|
|
124 | |
|
|
125 | Alternative to C<chuid> and C<chgid>: Sets both C<chuid> and C<chgid> |
|
|
126 | to the user and (primary) group ids of the specified user (for example, |
|
|
127 | C<nobody>). |
|
|
128 | |
72 | =item dns-forw-host = hostname/ip |
129 | =item dns-forw-host = hostname/ip |
73 | |
130 | |
74 | The DNS server to forward DNS requests to for the DNS tunnel protocol |
131 | The DNS server to forward DNS requests to for the DNS tunnel protocol |
75 | (default: C<127.0.0.1>, changing it is highly recommended). |
132 | (default: C<127.0.0.1>, changing it is highly recommended). |
76 | |
133 | |
77 | =item dns-forw-port = port-number |
134 | =item dns-forw-port = port-number |
78 | |
135 | |
79 | The port where the C<dns-forw-host> is to be contacted (default: C<53>, |
136 | The port where the C<dns-forw-host> is to be contacted (default: C<53>, |
80 | which is fine in most cases). |
137 | which is fine in most cases). |
|
|
138 | |
|
|
139 | =item dns-case-preserving = yes|true|on | no|false|off |
|
|
140 | |
|
|
141 | Sets whether the DNS transport forwarding server preserves case (DNS |
|
|
142 | servers have to, but some access systems are even more broken than others) |
|
|
143 | (default: true). |
|
|
144 | |
|
|
145 | Normally, when the forwarding server changes the case of domain names then |
|
|
146 | GVPE will automatically set this to false. |
81 | |
147 | |
82 | =item dns-max-outstanding = integer-number-of-requests |
148 | =item dns-max-outstanding = integer-number-of-requests |
83 | |
149 | |
84 | The maximum number of outstanding DNS transport requests |
150 | The maximum number of outstanding DNS transport requests |
85 | (default: C<100>). GVPE will never issue more requests then the given |
151 | (default: C<100>). GVPE will never issue more requests then the given |
… | |
… | |
237 | other programs. |
303 | other programs. |
238 | |
304 | |
239 | The default is 47 (GRE), which has a good chance of tunneling |
305 | 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 |
306 | 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 |
307 | compatible). Other common choices are 50 (IPSEC, ESP), 51 (IPSEC, AH), 4 |
242 | (IPIP tunnels) or 98 (ENCAP, rfc1241) |
308 | (IPIP tunnels) or 98 (ENCAP, rfc1241). |
|
|
309 | |
|
|
310 | Many versions of Linux seem to have a bug that causes them to reorder |
|
|
311 | packets for some ip protocols (GRE, ESP) but not for others (AH), so |
|
|
312 | choose wisely (that is, use 51, AH). |
243 | |
313 | |
244 | =item http-proxy-host = hostname/ip |
314 | =item http-proxy-host = hostname/ip |
245 | |
315 | |
246 | The C<http-proxy-*> family of options are only available if gvpe was |
316 | 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 |
317 | compiled with the C<--enable-http-proxy> option and enable tunneling of |
… | |
… | |
280 | |
350 | |
281 | =item keepalive = seconds |
351 | =item keepalive = seconds |
282 | |
352 | |
283 | Sets the keepalive probe interval in seconds (default: C<60>). After this |
353 | Sets the keepalive probe interval in seconds (default: C<60>). After this |
284 | many seconds of inactivity the daemon will start to send keepalive probe |
354 | many seconds of inactivity the daemon will start to send keepalive probe |
285 | every 3 seconds until it receives a reply from the other end. If no reply |
355 | every 3 seconds until it receives a reply from the other end. If no reply |
286 | is received within 15 seconds, the peer is considered unreachable and the |
356 | is received within 15 seconds, the peer is considered unreachable and the |
287 | connection is closed. |
357 | connection is closed. |
288 | |
358 | |
289 | =item loglevel = noise|trace|debug|info|notice|warn|error|critical |
359 | =item loglevel = noise|trace|debug|info|notice|warn|error|critical |
290 | |
360 | |
… | |
… | |
300 | |
370 | |
301 | Recommended values are 1500 (ethernet), 1492 (pppoe), 1472 (pptp). |
371 | Recommended values are 1500 (ethernet), 1492 (pppoe), 1472 (pptp). |
302 | |
372 | |
303 | This value must be the minimum of the MTU values of all nodes. |
373 | This value must be the minimum of the MTU values of all nodes. |
304 | |
374 | |
|
|
375 | =item nfmark = integer |
|
|
376 | |
|
|
377 | This advanced option, when set to a nonzero value (default: C<0>), tries |
|
|
378 | to set the netfilter mark (or fwmark) value on all sockets gvpe uses to |
|
|
379 | send packets. |
|
|
380 | |
|
|
381 | This can be used to make gvpe use a different set of routing rules. For |
|
|
382 | example, on GNU/Linux, the C<if-up> could set C<nfmark> to 1000 and then |
|
|
383 | put all routing rules into table C<99> and then use an ip rule to make |
|
|
384 | gvpe traffic avoid that routing table, in effect routing normal traffic |
|
|
385 | via gvpe and gvpe traffic via the normal system routing tables: |
|
|
386 | |
|
|
387 | ip rule add not fwmark 1000 lookup 99 |
|
|
388 | |
305 | =item node = nickname |
389 | =item node = nickname |
306 | |
390 | |
307 | Not really a config setting but introduces a node section. The nickname is |
391 | Not really a config setting but introduces a node section. The nickname is |
308 | used to select the right configuration section and must be passed as an |
392 | used to select the right configuration section and must be passed as an |
309 | argument to the gvpe daemon. |
393 | argument to the gvpe daemon. |
… | |
… | |
354 | |
438 | |
355 | #!/bin/sh |
439 | #!/bin/sh |
356 | { |
440 | { |
357 | echo update delete $DESTNODE.lowttl.example.net. a |
441 | echo update delete $DESTNODE.lowttl.example.net. a |
358 | echo update add $DESTNODE.lowttl.example.net. 1 in a $DESTIP |
442 | echo update add $DESTNODE.lowttl.example.net. 1 in a $DESTIP |
359 | echo |
443 | echo |
360 | } | nsupdate -d -k $CONFBASE:key.example.net. |
444 | } | nsupdate -d -k $CONFBASE:key.example.net. |
361 | |
445 | |
362 | =item node-change = relative-or-absolute-path |
446 | =item node-change = relative-or-absolute-path |
363 | |
447 | |
364 | Same as C<node-change>, but gets called whenever something about a |
448 | Same as C<node-change>, but gets called whenever something about a |
… | |
… | |
385 | private key file should be kept secret per-node to avoid spoofing, it is |
469 | private key file should be kept secret per-node to avoid spoofing, it is |
386 | not recommended to use this feature. |
470 | not recommended to use this feature. |
387 | |
471 | |
388 | =item rekey = seconds |
472 | =item rekey = seconds |
389 | |
473 | |
390 | Sets the rekeying interval in seconds (default: C<3600>). Connections are |
474 | Sets the rekeying interval in seconds (default: C<3607>). Connections are |
391 | reestablished every C<rekey> seconds, making them use a new encryption |
475 | reestablished every C<rekey> seconds, making them use a new encryption |
392 | key. |
476 | key. |
393 | |
477 | |
394 | =item nfmark = integer |
478 | =item seed-device = path |
395 | |
479 | |
396 | This advanced option, when set to a nonzero value (default: C<0>), tries |
480 | The random device used to initially and regularly seed the random |
397 | to set the netfilter mark (or fwmark) value on all sockets gvpe uses to |
481 | number generator (default: F</dev/urandom>). Randomness is of paramount |
398 | send packets. |
482 | importance to the security of the algorithms used in gvpe. |
399 | |
483 | |
400 | This can be used to make gvpe use a different set of routing rules. For |
484 | On program start and every seed-interval, gvpe will read 64 octets. |
401 | example, on GNU/Linux, the C<if-up> could set C<nfmark> to 1000 and then |
|
|
402 | put all routing rules into table C<99> and then use an ip rule to make |
|
|
403 | gvpe traffic avoid that routing table, in effect routing normal traffic |
|
|
404 | via gvpe and gvpe traffic via the normal system routing tables: |
|
|
405 | |
485 | |
406 | ip rule add not fwmark 1000 lookup 99 |
486 | Setting this path to the empty string will disable this functionality |
|
|
487 | completely (the underlying crypto library will likely look for entropy |
|
|
488 | sources on it's own though, so not all is lost). |
|
|
489 | |
|
|
490 | =item seed-interval = seconds |
|
|
491 | |
|
|
492 | The number of seconds between reseeds of the random number generator |
|
|
493 | (default: C<3613>). A value of C<0> disables this regular reseeding. |
407 | |
494 | |
408 | =back |
495 | =back |
409 | |
496 | |
410 | =head2 NODE SPECIFIC SETTINGS |
497 | =head2 NODE SPECIFIC SETTINGS |
411 | |
498 | |
… | |
… | |
420 | |
507 | |
421 | Allow direct connections to this node. See C<deny-direct> for more info. |
508 | Allow direct connections to this node. See C<deny-direct> for more info. |
422 | |
509 | |
423 | =item compress = yes|true|on | no|false|off |
510 | =item compress = yes|true|on | no|false|off |
424 | |
511 | |
|
|
512 | For the current node, this specified whether it will accept compressed |
|
|
513 | packets, and for all other nodes, this specifies whether to try to |
425 | Wether to compress data packets sent to this node (default: C<yes>). |
514 | compress data packets sent to this node (default: C<yes>). Compression is |
426 | Compression is really cheap even on slow computers and has no size |
515 | really cheap even on slow computers, has no size overhead at all and will |
427 | overhead at all, so enabling this is often a good idea. |
516 | only be used when the other side supports compression, so enabling this is |
|
|
517 | often a good idea. |
428 | |
518 | |
429 | =item connect = ondemand | never | always | disabled |
519 | =item connect = ondemand | never | always | disabled |
430 | |
520 | |
431 | Sets the connect mode (default: C<always>). It can be C<always> (always |
521 | Sets the connect mode (default: C<always>). It can be C<always> (always |
432 | try to establish and keep a connection to the given node), C<never> |
522 | try to establish and keep a connection to the given node), C<never> |
… | |
… | |
523 | |
613 | |
524 | =item enable-udp = yes|true|on | no|false|off |
614 | =item enable-udp = yes|true|on | no|false|off |
525 | |
615 | |
526 | See gvpe.protocol(7) for a description of the UDP transport protocol. |
616 | See gvpe.protocol(7) for a description of the UDP transport protocol. |
527 | |
617 | |
528 | Enable the UDPv4 transport using the C<udp-port> port (default: C<no>, |
618 | Enable the UDPv4 transport using the C<udp-port> port (default: C<no>). |
529 | unless no other protocol is enabled for a node, in which case this |
|
|
530 | protocol is enabled automatically). |
|
|
531 | |
|
|
532 | NOTE: Please specify C<enable-udp = yes> if you want to use it even though |
|
|
533 | it might get switched on automatically, as some future version might |
|
|
534 | default to another default protocol. |
|
|
535 | |
619 | |
536 | =item hostname = hostname | ip [can not be defaulted] |
620 | =item hostname = hostname | ip [can not be defaulted] |
537 | |
621 | |
538 | Forces the address of this node to be set to the given DNS hostname or IP |
622 | Forces the address of this node to be set to the given DNS hostname or IP |
539 | address. It will be resolved before each connect request, so dyndns should |
623 | address. It will be resolved before each connect request, so dyndns should |
… | |
… | |
558 | The value specified using this directive will be passed to the C<if-up> |
642 | The value specified using this directive will be passed to the C<if-up> |
559 | script in the environment variable C<IFUPDATA>. |
643 | script in the environment variable C<IFUPDATA>. |
560 | |
644 | |
561 | =item inherit-tos = yes|true|on | no|false|off |
645 | =item inherit-tos = yes|true|on | no|false|off |
562 | |
646 | |
563 | Wether to inherit the TOS settings of packets sent to the tunnel when |
647 | Whether to inherit the TOS settings of packets sent to the tunnel when |
564 | sending packets to this node (default: C<yes>). If set to C<yes> then |
648 | sending packets to this node (default: C<yes>). If set to C<yes> then |
565 | outgoing tunnel packets will have the same TOS setting as the packets sent |
649 | outgoing tunnel packets will have the same TOS setting as the packets sent |
566 | to the tunnel device, which is usually what you want. |
650 | to the tunnel device, which is usually what you want. |
567 | |
651 | |
568 | =item max-retry = positive-number |
652 | =item max-retry = positive-number |