… | |
… | |
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 following directives: |
|
|
37 | |
|
|
38 | =over 4 |
|
|
39 | |
|
|
40 | =item node nodename |
|
|
41 | |
|
|
42 | Introduces a node section. The nodename is used to select the right |
|
|
43 | configuration section and is the same string as is passed as an argument |
|
|
44 | to the gvpe daemon. |
|
|
45 | |
|
|
46 | Multiple C<node> statements with the same node name are supported and will |
|
|
47 | be merged together. |
|
|
48 | |
|
|
49 | =item global |
|
|
50 | |
|
|
51 | This statement switches back to the global section, which is mainly |
|
|
52 | useful if you want to include a second config file, e..g for local |
|
|
53 | customisations. To do that, simply include this at the very end of your |
|
|
54 | config file: |
|
|
55 | |
|
|
56 | global |
|
|
57 | include local.conf |
|
|
58 | |
|
|
59 | =item on nodename ... |
|
|
60 | |
|
|
61 | =item on !nodename ... |
|
|
62 | |
|
|
63 | You can prefix any configuration directive with C<on> and a nodename. GVPE |
|
|
64 | will will only "execute" it on the named node, or (if the nodename starts |
|
|
65 | with C<!>) on all nodes except the named one. |
|
|
66 | |
37 | For example, set the MTU to C<1450> everywhere, loglevel to C<noise> on |
67 | 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: |
68 | C<branch1>, and C<connect> to C<ondemand> everywhere but on branch2. |
39 | |
69 | |
40 | mtu = 1450 |
70 | mtu = 1450 |
41 | on branch1 loglevel = noise |
71 | on branch1 loglevel = noise |
42 | on !branch2 connect = ondemand |
72 | on !branch2 connect = ondemand |
43 | |
73 | |
44 | All settings are applied "in order", that is, later settings of the same |
74 | =item include relative-or-absolute-path |
45 | variable overwrite earlier ones. |
75 | |
|
|
76 | Reads the specified file (the path must not contain whitespace or C<=> |
|
|
77 | characters) and evaluate all config directives in it as if they were |
|
|
78 | spelled out in place of the C<include> directive. |
|
|
79 | |
|
|
80 | The path is a printf format string, that is, you must escape any C<%> |
|
|
81 | by doubling it, and you can have a single C<%s> inside, which will be |
|
|
82 | replaced by the current nodename. |
|
|
83 | |
|
|
84 | Relative paths are interpreted relative to the GVPE config directory. |
|
|
85 | |
|
|
86 | Example: include the file F<local.conf> in the config directory on every |
|
|
87 | node. |
|
|
88 | |
|
|
89 | include local.conf |
|
|
90 | |
|
|
91 | Example: include a file F<conf/>nodenameF<.conf> |
|
|
92 | |
|
|
93 | include conf/%s.conf |
|
|
94 | |
|
|
95 | =back |
46 | |
96 | |
47 | =head1 ANATOMY OF A CONFIG FILE |
97 | =head1 ANATOMY OF A CONFIG FILE |
48 | |
98 | |
49 | Usually, a config file starts with a few global settings (like the UDP |
99 | 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 |
100 | 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 |
117 | values on different nodes using C<on>), but will affect the behaviour of |
68 | the gvpe daemon and all connections it creates. |
118 | the gvpe daemon and all connections it creates. |
69 | |
119 | |
70 | =over 4 |
120 | =over 4 |
71 | |
121 | |
|
|
122 | =item chroot = path or / |
|
|
123 | |
|
|
124 | Tells GVPE to chroot(2) to the specified path after reading all necessary |
|
|
125 | files, binding to sockets and running the C<if-up> script, but before |
|
|
126 | running C<node-up> or any other scripts. |
|
|
127 | |
|
|
128 | The special path F</> instructs GVPE to create (and remove) an empty |
|
|
129 | temporary directory to use as new root. This is most secure, but makes it |
|
|
130 | impossible to use any scripts other than the C<if-up> one. |
|
|
131 | |
|
|
132 | =item chuid = numerical-uid |
|
|
133 | |
|
|
134 | =item chgid = numerical-gid |
|
|
135 | |
|
|
136 | These two options tell GVPE to change to the given user and/or group id |
|
|
137 | after reading all necessary files, binding to sockets and running the |
|
|
138 | C<if-up> script. |
|
|
139 | |
|
|
140 | Other scripts, such as C<node-up>, are run with the new user id or group id. |
|
|
141 | |
|
|
142 | =item chuser = username |
|
|
143 | |
|
|
144 | Alternative to C<chuid> and C<chgid>: Sets both C<chuid> and C<chgid> |
|
|
145 | to the user and (primary) group ids of the specified user (for example, |
|
|
146 | C<nobody>). |
|
|
147 | |
72 | =item dns-forw-host = hostname/ip |
148 | =item dns-forw-host = hostname/ip |
73 | |
149 | |
74 | The DNS server to forward DNS requests to for the DNS tunnel protocol |
150 | 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). |
151 | (default: C<127.0.0.1>, changing it is highly recommended). |
76 | |
152 | |
77 | =item dns-forw-port = port-number |
153 | =item dns-forw-port = port-number |
78 | |
154 | |
79 | The port where the C<dns-forw-host> is to be contacted (default: C<53>, |
155 | The port where the C<dns-forw-host> is to be contacted (default: C<53>, |
80 | which is fine in most cases). |
156 | which is fine in most cases). |
|
|
157 | |
|
|
158 | =item dns-case-preserving = yes|true|on | no|false|off |
|
|
159 | |
|
|
160 | Sets whether the DNS transport forwarding server preserves case (DNS |
|
|
161 | servers have to, but some access systems are even more broken than others) |
|
|
162 | (default: true). |
|
|
163 | |
|
|
164 | Normally, when the forwarding server changes the case of domain names then |
|
|
165 | GVPE will automatically set this to false. |
81 | |
166 | |
82 | =item dns-max-outstanding = integer-number-of-requests |
167 | =item dns-max-outstanding = integer-number-of-requests |
83 | |
168 | |
84 | The maximum number of outstanding DNS transport requests |
169 | The maximum number of outstanding DNS transport requests |
85 | (default: C<100>). GVPE will never issue more requests then the given |
170 | (default: C<100>). GVPE will never issue more requests then the given |
… | |
… | |
237 | other programs. |
322 | other programs. |
238 | |
323 | |
239 | The default is 47 (GRE), which has a good chance of tunneling |
324 | 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 |
325 | 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 |
326 | compatible). Other common choices are 50 (IPSEC, ESP), 51 (IPSEC, AH), 4 |
242 | (IPIP tunnels) or 98 (ENCAP, rfc1241) |
327 | (IPIP tunnels) or 98 (ENCAP, rfc1241). |
|
|
328 | |
|
|
329 | Many versions of Linux seem to have a bug that causes them to reorder |
|
|
330 | packets for some ip protocols (GRE, ESP) but not for others (AH), so |
|
|
331 | choose wisely (that is, use 51, AH). |
243 | |
332 | |
244 | =item http-proxy-host = hostname/ip |
333 | =item http-proxy-host = hostname/ip |
245 | |
334 | |
246 | The C<http-proxy-*> family of options are only available if gvpe was |
335 | 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 |
336 | compiled with the C<--enable-http-proxy> option and enable tunneling of |
… | |
… | |
280 | |
369 | |
281 | =item keepalive = seconds |
370 | =item keepalive = seconds |
282 | |
371 | |
283 | Sets the keepalive probe interval in seconds (default: C<60>). After this |
372 | 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 |
373 | 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 |
374 | 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 |
375 | is received within 15 seconds, the peer is considered unreachable and the |
287 | connection is closed. |
376 | connection is closed. |
288 | |
377 | |
289 | =item loglevel = noise|trace|debug|info|notice|warn|error|critical |
378 | =item loglevel = noise|trace|debug|info|notice|warn|error|critical |
290 | |
379 | |
… | |
… | |
300 | |
389 | |
301 | Recommended values are 1500 (ethernet), 1492 (pppoe), 1472 (pptp). |
390 | Recommended values are 1500 (ethernet), 1492 (pppoe), 1472 (pptp). |
302 | |
391 | |
303 | This value must be the minimum of the MTU values of all nodes. |
392 | This value must be the minimum of the MTU values of all nodes. |
304 | |
393 | |
305 | =item node = nickname |
394 | =item nfmark = integer |
306 | |
395 | |
307 | Not really a config setting but introduces a node section. The nickname is |
396 | This advanced option, when set to a nonzero value (default: C<0>), tries |
308 | used to select the right configuration section and must be passed as an |
397 | to set the netfilter mark (or fwmark) value on all sockets gvpe uses to |
309 | argument to the gvpe daemon. |
398 | send packets. |
|
|
399 | |
|
|
400 | This can be used to make gvpe use a different set of routing rules. For |
|
|
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 | |
|
|
406 | ip rule add not fwmark 1000 lookup 99 |
310 | |
407 | |
311 | =item node-up = relative-or-absolute-path |
408 | =item node-up = relative-or-absolute-path |
312 | |
409 | |
313 | Sets a command (default: none) that should be called whenever a connection |
410 | Sets a command (default: none) that should be called whenever a connection |
314 | is established (even on rekeying operations). Note that node-up/down |
411 | is established (even on rekeying operations). Note that node-up/down |
… | |
… | |
354 | |
451 | |
355 | #!/bin/sh |
452 | #!/bin/sh |
356 | { |
453 | { |
357 | echo update delete $DESTNODE.lowttl.example.net. a |
454 | echo update delete $DESTNODE.lowttl.example.net. a |
358 | echo update add $DESTNODE.lowttl.example.net. 1 in a $DESTIP |
455 | echo update add $DESTNODE.lowttl.example.net. 1 in a $DESTIP |
359 | echo |
456 | echo |
360 | } | nsupdate -d -k $CONFBASE:key.example.net. |
457 | } | nsupdate -d -k $CONFBASE:key.example.net. |
361 | |
458 | |
362 | =item node-change = relative-or-absolute-path |
459 | =item node-change = relative-or-absolute-path |
363 | |
460 | |
364 | Same as C<node-change>, but gets called whenever something about a |
461 | Same as C<node-change>, but gets called whenever something about a |
… | |
… | |
369 | Same as C<node-up>, but gets called whenever a connection is lost. |
466 | Same as C<node-up>, but gets called whenever a connection is lost. |
370 | |
467 | |
371 | =item pid-file = path |
468 | =item pid-file = path |
372 | |
469 | |
373 | The path to the pid file to check and create |
470 | The path to the pid file to check and create |
374 | (default: C<LOCALSTATEDIR/run/gvpe.pid>). |
471 | (default: C<LOCALSTATEDIR/run/gvpe.pid>). The first C<%s> is replaced by |
|
|
472 | the nodename - any other use of C<%> must be written as C<%%>. |
375 | |
473 | |
376 | =item private-key = relative-path-to-key |
474 | =item private-key = relative-path-to-key |
377 | |
475 | |
378 | Sets the path (relative to the config directory) to the private key |
476 | Sets the path (relative to the config directory) to the private key |
379 | (default: C<hostkey>). This is a printf format string so every C<%> must |
477 | (default: C<hostkey>). This is a printf format string so every C<%> must |
… | |
… | |
385 | private key file should be kept secret per-node to avoid spoofing, it is |
483 | private key file should be kept secret per-node to avoid spoofing, it is |
386 | not recommended to use this feature. |
484 | not recommended to use this feature. |
387 | |
485 | |
388 | =item rekey = seconds |
486 | =item rekey = seconds |
389 | |
487 | |
390 | Sets the rekeying interval in seconds (default: C<3600>). Connections are |
488 | Sets the rekeying interval in seconds (default: C<3607>). Connections are |
391 | reestablished every C<rekey> seconds, making them use a new encryption |
489 | reestablished every C<rekey> seconds, making them use a new encryption |
392 | key. |
490 | key. |
393 | |
491 | |
394 | =item nfmark = integer |
492 | =item seed-device = path |
395 | |
493 | |
396 | This advanced option, when set to a nonzero value (default: C<0>), tries |
494 | 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 |
495 | number generator (default: F</dev/urandom>). Randomness is of paramount |
398 | send packets. |
496 | importance to the security of the algorithms used in gvpe. |
399 | |
497 | |
400 | This can be used to make gvpe use a different set of routing rules. For |
498 | 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 | |
499 | |
406 | ip rule add not fwmark 1000 lookup 99 |
500 | Setting this path to the empty string will disable this functionality |
|
|
501 | completely (the underlying crypto library will likely look for entropy |
|
|
502 | sources on it's own though, so not all is lost). |
|
|
503 | |
|
|
504 | =item seed-interval = seconds |
|
|
505 | |
|
|
506 | The number of seconds between reseeds of the random number generator |
|
|
507 | (default: C<3613>). A value of C<0> disables this regular reseeding. |
|
|
508 | |
|
|
509 | =item serial = string |
|
|
510 | |
|
|
511 | The configuration serial number. This can be any string up to 16 bytes |
|
|
512 | length. Only when the serial matches on both sides of a conenction will |
|
|
513 | the connection succeed. This is I<not> a security mechanism and eay to |
|
|
514 | spoof, this mechanism exists to alert users that their config is outdated. |
|
|
515 | |
|
|
516 | It's recommended to specify this is a date string such as C<2013-05-05> or |
|
|
517 | C<20121205084417>. |
|
|
518 | |
|
|
519 | The exact algorithm is as this: if a connection request is received form a |
|
|
520 | node with an identical serial, then it succeeds normally. |
|
|
521 | |
|
|
522 | If the remote serial is lower than the local serial, it is ignored. |
|
|
523 | |
|
|
524 | If the remote serial is higher than the local serial, a warning message is |
|
|
525 | logged. |
407 | |
526 | |
408 | =back |
527 | =back |
409 | |
528 | |
410 | =head2 NODE SPECIFIC SETTINGS |
529 | =head2 NODE SPECIFIC SETTINGS |
411 | |
530 | |
… | |
… | |
420 | |
539 | |
421 | Allow direct connections to this node. See C<deny-direct> for more info. |
540 | Allow direct connections to this node. See C<deny-direct> for more info. |
422 | |
541 | |
423 | =item compress = yes|true|on | no|false|off |
542 | =item compress = yes|true|on | no|false|off |
424 | |
543 | |
|
|
544 | For the current node, this specified whether it will accept compressed |
|
|
545 | 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>). |
546 | 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 |
547 | 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. |
548 | only be used when the other side supports compression, so enabling this is |
|
|
549 | often a good idea. |
428 | |
550 | |
429 | =item connect = ondemand | never | always | disabled |
551 | =item connect = ondemand | never | always | disabled |
430 | |
552 | |
431 | Sets the connect mode (default: C<always>). It can be C<always> (always |
553 | 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> |
554 | try to establish and keep a connection to the given node), C<never> |
… | |
… | |
523 | |
645 | |
524 | =item enable-udp = yes|true|on | no|false|off |
646 | =item enable-udp = yes|true|on | no|false|off |
525 | |
647 | |
526 | See gvpe.protocol(7) for a description of the UDP transport protocol. |
648 | See gvpe.protocol(7) for a description of the UDP transport protocol. |
527 | |
649 | |
528 | Enable the UDPv4 transport using the C<udp-port> port (default: C<no>, |
650 | 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 | |
651 | |
536 | =item hostname = hostname | ip [can not be defaulted] |
652 | =item hostname = hostname | ip [can not be defaulted] |
537 | |
653 | |
538 | Forces the address of this node to be set to the given DNS hostname or IP |
654 | 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 |
655 | 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> |
674 | The value specified using this directive will be passed to the C<if-up> |
559 | script in the environment variable C<IFUPDATA>. |
675 | script in the environment variable C<IFUPDATA>. |
560 | |
676 | |
561 | =item inherit-tos = yes|true|on | no|false|off |
677 | =item inherit-tos = yes|true|on | no|false|off |
562 | |
678 | |
563 | Wether to inherit the TOS settings of packets sent to the tunnel when |
679 | 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 |
680 | 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 |
681 | outgoing tunnel packets will have the same TOS setting as the packets sent |
566 | to the tunnel device, which is usually what you want. |
682 | to the tunnel device, which is usually what you want. |
|
|
683 | |
|
|
684 | =item low-power = yes|true|on | no|false|off |
|
|
685 | |
|
|
686 | If true, designates a node as a low-power node. Low-power nodes use |
|
|
687 | larger timeouts and try to reduce cpu time. Other nodes talking to a |
|
|
688 | low-power node will also use larger timeouts, and will use less aggressive |
|
|
689 | optimisations, in the hope of reducing load. Security is not compromised. |
|
|
690 | |
|
|
691 | The typical low-power node would be a mobile phone, where wakeups and |
|
|
692 | encryption can significantly increase power drain. |
567 | |
693 | |
568 | =item max-retry = positive-number |
694 | =item max-retry = positive-number |
569 | |
695 | |
570 | The maximum interval in seconds (default: C<3600>, one hour) between |
696 | The maximum interval in seconds (default: C<3600>, one hour) between |
571 | retries to establish a connection to this node. When a connection cannot |
697 | retries to establish a connection to this node. When a connection cannot |
… | |
… | |
645 | |
771 | |
646 | If used the node up or node-down scripts. |
772 | If used the node up or node-down scripts. |
647 | |
773 | |
648 | =item hostkey |
774 | =item hostkey |
649 | |
775 | |
650 | The private key (taken from C<hostkeys/nodename>) of the current host. |
776 | The (default path of the) private key of the current host. |
651 | |
777 | |
652 | =item pubkey/nodename |
778 | =item pubkey/nodename |
653 | |
779 | |
654 | The public keys of the other nodes, one file per node. |
780 | The public keys of the other nodes, one file per node. |
655 | |
781 | |