ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/gvpe/doc/gvpe.texi
Revision: 1.6
Committed: Wed Jun 18 20:40:52 2014 UTC (9 years, 11 months ago) by root
Content type: application/x-texinfo
Branch: MAIN
Changes since 1.5: +222 -37 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 pcg 1.1 \input texinfo @c -*-texinfo-*-
2     @c GENERATED FILE, gvpe.texi.pod is the source, not gvpe.texi!
3     @c GENERATED FILE, gvpe.texi.pod is the source, not gvpe.texi!
4     @c GENERATED FILE, gvpe.texi.pod is the source, not gvpe.texi!
5     @c GENERATED FILE, gvpe.texi.pod is the source, not gvpe.texi!
6     @c GENERATED FILE, gvpe.texi.pod is the source, not gvpe.texi!
7     @c GENERATED FILE, gvpe.texi.pod is the source, not gvpe.texi!
8     @c %**start of header
9     @finalout
10     @setfilename gvpe.info
11     @settitle GNU Virtual Private Ethernet Manual
12     @setchapternewpage odd
13     @c %**end of header
14    
15     @ifinfo
16     @dircategory Networking tools
17     @direntry
18     * gvpe: (gvpe). The GNU VPE Manual.
19     @end direntry
20    
21     This is the info manual for vpe, the Virtual Private Ethernet daemon.
22    
23 pcg 1.3 Copyright @copyright{} 2003-2008 Marc Lehmann <gvpe@@schmorp.de>.
24 pcg 1.1
25     Permission is granted to make and distribute verbatim copies of this
26     manual provided the copyright notice and this permission notice are
27     preserved on all copies.
28    
29     Permission is granted to copy and distribute modified versions of this
30     manual under the conditions for verbatim copying, provided that the
31     entire resulting derived work is distributed under the terms of a
32     permission notice identical to this one.
33    
34     @end ifinfo
35    
36     @titlepage
37     @title gvpe Manual
38 root 1.5 @author Marc Lehmann
39 pcg 1.1
40     @page
41     @vskip 0pt plus 1filll
42     @cindex copyright
43    
44 pcg 1.3 Copyright @copyright{} 2003-2008 Marc Lehmann <gvpe@@schmorp.de>.
45 pcg 1.1
46     Permission is granted to make and distribute verbatim copies of this
47     manual provided the copyright notice and this permission notice are
48     preserved on all copies.
49    
50     Permission is granted to copy and distribute modified versions of this
51     manual under the conditions for verbatim copying, provided that the
52     entire resulting derived work is distributed under the terms of a
53     permission notice identical to this one.
54    
55     @end titlepage
56    
57     @contents
58    
59     @node Top,Overview,,(dir)
60    
61     @chapter Introduction
62     This is the documentation for the GNU Virtual Private Ethernet suite.
63     @refill
64     The GNU Virtual Private Ethernet suite implements a virtual (uses udp, tcp, rawip and other protocols for tunneling), private (encrypted, authenticated) ethernet (mac-based, broadcast-based network) that is shared among multiple nodes, in effect implementing an ethernet bus over public networks.
65     @refill
66    
67     @menu
68     * Overview:: Introduction to and Tutorial for GVPE (gvpe(5))
69     * OS Dependencies:: OS-Dependent Installation and Configuration Notes (gvpe.osdep(5))
70     * gvpe.conf:: The main configuration file (gvpe.conf(5))
71     * gvpectrl:: Configuration/Control Program Reference (gvpectrl(8))
72     * gvpe:: The GVPE Daemon (gvpe(8))
73     * gvpe.protocol:: The GVPE Transport and VPN Protocols (gvpe.protocol(7))
74     * Simple Example:: A simple yet realistic Example
75     * Complex Example:: A non-trivial Example
76     * Index:: Keyword and Concept index
77     @end menu
78    
79    
80     @node Overview,OS Dependencies,Top,Top
81    
82     @chapter Overview
83    
84     @section NAME
85     GNU-VPE - Overview of the GNU Virtual Private Ethernet suite.
86     @refill
87    
88    
89     @section DESCRIPTION
90     GVPE is a suite designed to provide a virtual private network for multiple nodes over an untrusted network. This document first gives an introduction to VPNs in general and then describes the specific implementation of GVPE.
91     @refill
92    
93    
94     @subsection WHAT IS A VPN?
95     VPN is an acronym, it stands for:
96     @refill
97    
98    
99     @itemize
100    
101    
102     @item
103 pcg 1.3 Virtual
104 pcg 1.1
105     Virtual means that no physical network is created (of course), but a network is @emph{emulated} by creating multiple tunnels between the member nodes by encapsulating and sending data over another transport network.
106     @refill
107     Usually the emulated network is a normal IP or Ethernet, and the transport network is the Internet. However, using a VPN system like GVPE to connect nodes over other untrusted networks such as Wireless LAN is not uncommon.
108     @refill
109    
110    
111     @item
112 pcg 1.3 Private
113 pcg 1.1
114     Private means that non-participating nodes cannot decode ("sniff)" nor inject ("spoof") packets. This means that nodes can be connected over untrusted networks such as the public Internet without fear of being eavesdropped while at the same time being able to trust data sent by other nodes.
115     @refill
116     In the case of GVPE, even participating nodes cannot sniff packets send to other nodes or spoof packets as if sent from other nodes, so communications between any two nodes is private to those two nodes.
117     @refill
118    
119    
120     @item
121 pcg 1.3 Network
122 pcg 1.1
123 root 1.5 Network means that more than two parties can participate in the network, so for instance it's possible to connect multiple branches of a company into a single network. Many so-called "VPN" solutions only create point-to-point tunnels, which in turn can be used to build larger networks.
124 pcg 1.1 @refill
125 root 1.5 GVPE provides a true multi-point network in which any number of nodes (at least a few dozen in practise, the theoretical limit is 4095 nodes) can participate.
126 pcg 1.1 @refill
127     @end itemize
128    
129    
130    
131     @subsection GVPE DESIGN GOALS
132    
133    
134     @itemize
135    
136    
137     @item
138 pcg 1.3 SIMPLE DESIGN
139 pcg 1.1
140     Cipher, HMAC algorithms and other key parameters must be selected at compile time - this makes it possible to only link in algorithms you actually need. It also makes the crypto part of the source very transparent and easy to inspect, and last not least this makes it possible to hardcode the layout of all packets into the binary. GVPE goes a step further and internally reserves blocks of the same length for all packets, which virtually removes all possibilities of buffer overflows, as there is only a single type of buffer and it's always of fixed length.
141     @refill
142    
143    
144     @item
145 pcg 1.3 EASY TO SETUP
146 pcg 1.1
147     A few lines of config (the config file is shared unmodified between all hosts) and a single run of @t{gvpectrl} to generate the keys suffices to make it work.
148     @refill
149    
150    
151     @item
152 pcg 1.3 MAC-BASED SECURITY
153 pcg 1.1
154     Since every host has it's own private key, other hosts cannot spoof traffic from this host. That makes it possible to filter packet by MAC address, e.g. to ensure that packets from a specific IP address come, in fact, from a specific host that is associated with that IP and not from another host.
155     @refill
156     @end itemize
157    
158    
159    
160     @section PROGRAMS
161 root 1.5 Gvpe comes with two programs: one daemon (@t{gvpe}) and one control program (@t{gvpectrl}).
162 pcg 1.1 @refill
163    
164    
165     @itemize
166    
167    
168     @item
169 pcg 1.3 gvpectrl
170 pcg 1.1
171 root 1.5 This program is used to generate the keys, check and give an overview of of the configuration and to control the daemon (restarting etc.).
172 pcg 1.1 @refill
173    
174    
175     @item
176 pcg 1.3 gvpe
177 pcg 1.1
178 root 1.5 This is the daemon used to establish and maintain connections to the other network nodes. It should be run on the gateway of each VPN subnet.
179 pcg 1.1 @refill
180     @end itemize
181    
182    
183    
184     @section COMPILETIME CONFIGURATION
185     Please have a look at the @t{gvpe.osdep(5)} manpage for platform-specific information.
186     @refill
187 root 1.5 Gvpe hardcodes most encryption parameters. While this reduces flexibility, it makes the program much simpler and helps making buffer overflows impossible under most circumstances.
188     @refill
189     Here are a few recipes for compiling your gvpe, showing the extremes (fast, small, insecure OR slow, large, more secure), between which you should choose:
190 pcg 1.1 @refill
191    
192    
193     @subsection AS LOW PACKET OVERHEAD AS POSSIBLE
194    
195    
196     @example
197     ./configure --enable-hmac-length=4 --enable-rand-length=0
198     @end example
199    
200 root 1.6 Minimize the header overhead of VPN packets (the above will result in only 4 bytes of overhead over the raw ethernet frame). This is a insecure configuration because a HMAC length of 4 makes collision attacks almost trivial.
201 pcg 1.1 @refill
202    
203    
204     @subsection MINIMIZE CPU TIME REQUIRED
205    
206    
207     @example
208     ./configure --enable-cipher=bf --enable-digest=md4
209     @end example
210    
211 root 1.5 Use the fastest cipher and digest algorithms currently available in gvpe. MD4 has been broken and is quite insecure, though, so using another digest algorithm is recommended.
212 pcg 1.1 @refill
213    
214    
215     @subsection MAXIMIZE SECURITY
216    
217    
218     @example
219 root 1.6 ./configure --enable-hmac-length=16 --enable-rand-length=12 --enable-digest=ripemd610
220 pcg 1.1 @end example
221    
222 root 1.6 This uses a 16 byte HMAC checksum to authenticate packets (I guess 8-12 would also be pretty secure ;) and will additionally prefix each packet with 12 bytes of random data.
223 pcg 1.1 @refill
224 root 1.5 In general, remember that AES-128 seems to be as secure but faster than AES-192 or AES-256, more randomness helps against sniffing and a longer HMAC helps against spoofing. MD4 is a fast digest, SHA1, RIPEMD160, SHA256 are consecutively better, and Blowfish is a fast cipher (and also quite secure).
225 pcg 1.1 @refill
226    
227    
228     @section HOW TO SET UP A SIMPLE VPN
229     In this section I will describe how to get a simple VPN consisting of three hosts up and running.
230     @refill
231    
232    
233     @subsection STEP 1: configuration
234 root 1.5 First you have to create a daemon configuration file and put it into the configuration directory. This is usually @t{/etc/gvpe}, depending on how you configured gvpe, and can be overwritten using the @t{-c} command line switch.
235 pcg 1.1 @refill
236     Put the following lines into @t{/etc/gvpe/gvpe.conf}:
237     @refill
238    
239    
240     @example
241     udp-port = 50000 # the external port to listen on (configure your firewall)
242     mtu = 1400 # minimum MTU of all outgoing interfaces on all hosts
243     ifname = vpn0 # the local network device name
244    
245     node = first # just a nickname
246     hostname = first.example.net # the DNS name or IP address of the host
247    
248     node = second
249     hostname = 133.55.82.9
250    
251     node = third
252     hostname = third.example.net
253     @end example
254    
255 root 1.5 The only other file necessary is the @t{if-up} script that initializes the virtual ethernet interface on the local host. Put the following lines into @t{/etc/gvpe/if-up} and make it executable (@t{chmod 755 /etc/gvpe/if-up}):
256 pcg 1.1 @refill
257    
258    
259     @example
260     #!/bin/sh
261     ip link set $IFNAME address $MAC mtu $MTU up
262     [ $NODENAME = first ] && ip addr add 10.0.1.1 dev $IFNAME
263     [ $NODENAME = second ] && ip addr add 10.0.2.1 dev $IFNAME
264     [ $NODENAME = third ] && ip addr add 10.0.3.1 dev $IFNAME
265     ip route add 10.0.0.0/16 dev $IFNAME
266     @end example
267    
268 root 1.5 This script will give each node a different IP address in the @t{10.0/16} network. The internal network (if gvpe runs on a router) should then be set to a subset of that network, e.g. @t{10.0.1.0/24} on node @t{first}, @t{10.0.2.0/24} on node @t{second}, and so on.
269 pcg 1.1 @refill
270 root 1.5 By enabling routing on the gateway host that runs @t{gvpe} all nodes will be able to reach the other nodes. You can, of course, also use proxy ARP or other means of pseudo-bridging, or (best) full routing - the choice is yours.
271 pcg 1.1 @refill
272    
273    
274     @subsection STEP 2: create the RSA key pairs for all hosts
275 root 1.5 Run the following command to generate all key pairs for all nodes (that might take a while):
276 pcg 1.1 @refill
277    
278    
279     @example
280     gvpectrl -c /etc/gvpe -g
281     @end example
282    
283     This command will put the public keys into @t{/etc/gvpe/pubkeys/@emph{nodename}} and the private keys into @t{/etc/gvpe/hostkeys/@emph{nodename}}.
284     @refill
285    
286    
287     @subsection STEP 3: distribute the config files to all nodes
288 root 1.5 Now distribute the config files and private keys to the other nodes. This should be done in two steps, since only the private keys meant for a node should be distributed (so each node has only it's own private key).
289     @refill
290     The example uses rsync-over-ssh
291 pcg 1.1 @refill
292     First all the config files without the hostkeys should be distributed:
293     @refill
294    
295    
296     @example
297     rsync -avzessh /etc/gvpe first.example.net:/etc/. --exclude hostkeys
298     rsync -avzessh /etc/gvpe 133.55.82.9:/etc/. --exclude hostkeys
299     rsync -avzessh /etc/gvpe third.example.net:/etc/. --exclude hostkeys
300     @end example
301    
302     Then the hostkeys should be copied:
303     @refill
304    
305    
306     @example
307     rsync -avzessh /etc/gvpe/hostkeys/first first.example.net:/etc/hostkey
308     rsync -avzessh /etc/gvpe/hostkeys/second 133.55.82.9:/etc/hostkey
309     rsync -avzessh /etc/gvpe/hostkeys/third third.example.net:/etc/hostkey
310     @end example
311    
312 root 1.5 You should now check the configuration by issuing the command @t{gvpectrl -c /etc/gvpe -s} on each node and verify it's output.
313 pcg 1.1 @refill
314    
315    
316     @subsection STEP 4: starting gvpe
317     You should then start gvpe on each node by issuing a command like:
318     @refill
319    
320    
321     @example
322 root 1.5 gvpe -D -l info first # first is the nodename
323 pcg 1.1 @end example
324    
325 root 1.5 This will make the gvpe daemon stay in foreground. You should then see "connection established" messages. If you don't see them check your firewall and routing (use tcpdump ;).
326 pcg 1.1 @refill
327     If this works you should check your networking setup by pinging various endpoints.
328     @refill
329 root 1.5 To make gvpe run more permanently you can either run it as a daemon (by starting it without the @t{-D} switch), or, much better, from your inittab or equivalent. I use a line like this on all my systems:
330 pcg 1.1 @refill
331    
332    
333     @example
334     t1:2345:respawn:/opt/gvpe/sbin/gvpe -D -L first >/dev/null 2>&1
335     @end example
336    
337    
338    
339     @subsection STEP 5: enjoy
340     ... and play around. Sending a -HUP (@t{gvpectrl -kHUP}) to the daemon will make it try to connect to all other nodes again. If you run it from inittab, as is recommended, @t{gvpectrl -k} (or simply @t{killall gvpe}) will kill the daemon, start it again, making it read it's configuration files again.
341     @refill
342    
343    
344     @section COPYRIGHTS AND LICENSES
345     GVPE itself is distributed under the GENERAL PUBLIC LICENSE (see the file COPYING that should be part of your distribution).
346     @refill
347     In some configurations it uses modified versions of the tinc vpn suite, which is also available under the GENERAL PUBLIC LICENSE.
348     @refill
349    
350    
351    
352     @node OS Dependencies,gvpe.conf,Overview,Top
353    
354     @chapter OS Dependencies
355    
356     @section NAME
357     gvpe.osdep - os dependent information
358     @refill
359    
360    
361     @section DESCRIPTION
362     This file tries to capture OS-dependent configuration or build issues, quirks and platform limitations, as known.
363     @refill
364    
365    
366     @section TUN vs. TAP interface
367 root 1.5 Most operating systems nowadays support something called a @emph{tunnel}-device, which makes it possible to divert IPv4 (and often other protocols, too) into a user space daemon like @t{gvpe}. This is being referred to as a TUN-device.
368 pcg 1.1 @refill
369     This is fine for point-to-point tunnels, but for a virtual ethernet, an additional ethernet header is needed. This functionality (called a TAP device here) is only provided by a subset of the configurations.
370     @refill
371     On platforms only supporting a TUN-device, gvpe will invoke it's magical ethernet emulation package, which currently only handles ARP requests for the IPv4 protocol (but more could be added, bu the tincd network drivers might need to be modified for this to work). This means that on those platforms, only IPv4 will be supported.
372     @refill
373     Also, since there is no way (currently) to tell gvpe which IP subnets are found on a specific host, you will either need to hardwire the MAC address for TUN-style hosts on all networks (and avoid ARP altogether, which is possible), or you need to send a packet from these hosts into the vpn network to tell gvpe the local interface address.
374     @refill
375    
376    
377     @section Interface Initialisation
378     Unless otherwise notes, the network interface will be initialized with the expected MAC address and correct MTU value. With most interface drivers, this is done by running @t{/sbin/ifconfig}, so make sure that this command exists.
379     @refill
380    
381    
382     @section Interface Types
383    
384    
385     @subsection native/linux
386     TAP-device; already part of the kernel (only 2.4+ supported, but see tincd/linux). This is the configuration tested best, as gvpe is being developed on this platform.
387     @refill
388     @t{ifname} should be set to the name of the network device.
389     @refill
390     To hardwire ARP addresses, use iproute2 (@t{arp} can do it, too):
391     @refill
392    
393    
394     @example
395     MAC=fe:fd:80:00:00:$(printf "%02x" $NODEID)
396     ip neighbour add 10.11.12.13 lladdr $MAC nud permanent dev $IFNAME
397     @end example
398    
399    
400    
401     @subsection tincd/linux
402     TAP-device; already part of the kernel (2.2 only). See @t{native/linux} for more info.
403     @refill
404     @t{ifname} should be set to the path of a tap device, e.g. @t{/dev/tap0}. The interface will be named accordingly.
405     @refill
406    
407    
408     @subsection native/cygwin
409     TAP-device; The TAP device to be used must either be the CIPE driver (@t{http://cipe-win32.sourceforge.net/}), or (highly recommended) the newer TAP-Win32 driver bundled with openvpn (http://openvpn.sf.net/). Just download and run the openvpn installer. The only option you need to select is the TAP driver.
410     @refill
411     @t{ifname} should be set to the name of the device, found in the registry at (no kidding :):
412     @refill
413    
414    
415     @example
416     HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Network\@{4D36E972-E325-11CE-BFC1-08002BE10318@}\<adapterid>\Connection\Name
417     @end example
418    
419     The MAC address is dynamically being patched into packets and ARP-requests, so only IPv4 works with ARP on this platform.
420     @refill
421    
422    
423     @subsection tincd/bsd
424     TAP-device, maybe; migth work for many bsd variants.
425     @refill
426     This driver is a newer version of the @t{tincd/*bsd} drivers. It @emph{might} provide a TAP device, or might not work at all. You might try this interface type first, and, if it doesn't work, try one of the OS-specific drivers.
427     @refill
428    
429    
430     @subsection tincd/freebsd
431     TAP-device; part of the kernel (since 4.x, maybe earlier).
432     @refill
433     @t{ifname} should be set to the path of a tap device, e.g. @t{/dev/tap0}. The interface will be named accordingly.
434     @refill
435     These commands might be helpful examples:
436     @refill
437    
438    
439     @example
440     ifconfig $IFNAME 10.0.0.$NODEID
441     route add -net 10.0.0.0 -netmask 255.255.255.0 -interface $IFNAME 10.0.0.$NODEID
442     @end example
443    
444    
445    
446     @subsection tincd/netbsd
447     TUN-device; The interface is a point-to-point device. To initialize it, you currently need to configure it as a point-to-point device, giving it an address on your vpn (the exact address doesn't matter), like this:
448     @refill
449    
450    
451     @example
452     ifconfig $IFNAME mtu $MTU up
453     ifconfig $IFNAME 10.11.12.13 10.55.66.77
454     route add -net 10.0.0.0 10.55.66.77 255.0.0.0
455     ping -c1 10.55.66.77 # ping once to tell gvpe your gw ip
456     @end example
457    
458     The ping is required to tell the ARP emulator inside GVPE the local IP address.
459     @refill
460     @t{ifname} should be set to the path of a tun device, e.g. @t{/dev/tun0}. The interface will be named accordingly.
461     @refill
462    
463    
464     @subsection tincd/openbsd
465     TUN-device; already part of the kernel. See @t{tincd/netbsd} for more information.
466     @refill
467    
468    
469     @subsection native/darwin
470     TAP-device;
471     @refill
472     The necessary kernel extension can be found here:
473     @refill
474    
475    
476     @example
477     http://www-user.rhrk.uni-kl.de/~nissler/tuntap/
478     @end example
479    
480     There are two drivers, the one to use is the "tap" driver. It driver must be loaded before use, read the docs on how to install it as a startup item.
481     @refill
482     @t{ifname} should be set to the path of a tap device, e.g. @t{/dev/tap0}. The interface will be named accordingly.
483     @refill
484     These commands might be helpful examples:
485     @refill
486    
487    
488     @example
489     ifconfig $IFNAME 10.0.0.$NODEID
490     route add -net 10.0.0.0 -interface $IFNAME 255.255.255.0
491     @end example
492    
493    
494    
495     @subsection tincd/darwin
496     TUN-device; See @t{tincd/netbsd} for more information. @t{native/darwin} is preferable.
497     @refill
498     The necessary kernel extension can be found here:
499     @refill
500    
501    
502     @example
503     http://chrisp.de/en/projects/tunnel.html
504     @end example
505    
506     @t{ifname} should be set to the path of a tun device, e.g. @t{/dev/tun0}. The interface will be named accordingly.
507     @refill
508     The driver must be loaded before use:
509     @refill
510    
511    
512     @example
513     kmodload tunnel
514     @end example
515    
516    
517    
518     @subsection tincd/solaris
519     TUN-device; already part of the kernel(?), or available here:
520     @refill
521    
522    
523     @example
524     http://vtun.sourceforge.net/tun/
525     @end example
526    
527     Some precompiled tun drivers might be available here:
528     @refill
529    
530    
531     @example
532     http://www.monkey.org/~dugsong/fragroute/
533     @end example
534    
535     The interface MAC and MTU are @emph{NOT} set up for you. Please try it out and send me an @t{ifconfig} command invocation that does that.
536     @refill
537     See @t{tincd/netbsd} for more information.
538     @refill
539 root 1.5 Completely untested so far.
540 pcg 1.1 @refill
541    
542    
543     @subsection tincd/mingw
544     TAP-device; see @t{native/cygwin} for more information.
545     @refill
546     The setup is likely to be similar to @t{native/cygwin}.
547     @refill
548     Completely untested so far.
549     @refill
550    
551    
552     @subsection tincd/raw_socket
553     TAP-device; purpose unknown and untested, probably binds itself on an existing ethernet device (given by @t{ifname}). It must be down prior to running the command, and GVPE will try to set it's MAC address and MTU to the "correct" values.
554     @refill
555     Completely untested so far.
556     @refill
557    
558    
559     @subsection tincd/uml_socket
560 root 1.5 TAP-device; purpose unknown and untested, probably creates a UNIX datagram socket (path given by @t{ifname}) and reads and writes raw packets, so might be useful in other than UML contexts.
561 pcg 1.1 @refill
562 root 1.5 No network interface is created, and the MAC and MTU must be set as appropriate on the other side of the socket. GVPE will exit if the MAC address doesn't match what it expects.
563 pcg 1.1 @refill
564     Completely untested so far.
565     @refill
566    
567    
568     @subsection tincd/cygwin
569     Known to be broken, use @t{native/cygwin} instead.
570     @refill
571    
572    
573    
574     @node gvpe.conf,gvpectrl,OS Dependencies,Top
575    
576     @chapter gvpe.conf
577    
578     @section NAME
579     gvpe.conf - configuration file for the GNU VPE daemon
580     @refill
581    
582    
583     @section SYNOPSIS
584    
585    
586     @example
587 root 1.5 # global options for all nodes
588 pcg 1.1 udp-port = 407
589     mtu = 1492
590     ifname = vpn0
591    
592 root 1.5 # first node is named branch1 and is at 1.2.3.4
593 pcg 1.1 node = branch1
594     hostname = 1.2.3.4
595    
596 root 1.5 # second node uses dns to resolve the address
597 pcg 1.1 node = branch2
598     hostname = www.example.net
599     udp-port = 500 # this host uses a different udp-port
600    
601 root 1.5 # third node has no fixed ip address
602 pcg 1.1 node = branch3
603     connect = ondemand
604     @end example
605    
606    
607    
608     @section DESCRIPTION
609     The gvpe config file consists of a series of lines that contain @t{variable = value} pairs. Empty lines are ignored. Comments start with a @t{#} and extend to the end of the line. They can be used on their own lines, or after any directives. Whitespace is allowed around the @t{=} sign or after values, but not within the variable names or values themselves.
610     @refill
611 root 1.6 All settings are applied "in order", that is, later settings of the same variable overwrite earlier ones.
612     @refill
613     The only exceptions to the above are the following directives:
614     @refill
615    
616    
617     @itemize
618    
619    
620     @item
621     node nodename
622    
623     Introduces a node section. The nodename is used to select the right configuration section and is the same string as is passed as an argument to the gvpe daemon.
624     @refill
625     Multiple @t{node} statements with the same node name are supported and will be merged together.
626     @refill
627    
628    
629     @item
630     global
631    
632     This statement switches back to the global section, which is mainly useful if you want to include a second config file, e..g for local customisations. To do that, simply include this at the very end of your config file:
633     @refill
634    
635    
636     @example
637     global
638     include local.conf
639     @end example
640    
641    
642    
643     @item
644     on nodename ...
645    
646    
647    
648     @item
649     on !nodename ...
650    
651     You can prefix any configuration directive with @t{on} and a nodename. GVPE will will only "execute" it on the named node, or (if the nodename starts with @t{!}) on all nodes except the named one.
652 pcg 1.1 @refill
653 root 1.6 Example: set the MTU to @t{1450} everywhere, @t{loglevel} to @t{noise} on @t{branch1}, and @t{connect} to @t{ondemand} everywhere but on branch2.
654 root 1.5 @refill
655 pcg 1.1
656    
657     @example
658 root 1.5 mtu = 1450
659 pcg 1.1 on branch1 loglevel = noise
660     on !branch2 connect = ondemand
661     @end example
662    
663 root 1.6
664    
665     @item
666     include relative-or-absolute-path
667    
668     Reads the specified file (the path must not contain whitespace or @t{=} characters) and evaluate all config directives in it as if they were spelled out in place of the @t{include} directive.
669     @refill
670     The path is a printf format string, that is, you must escape any @t{%} by doubling it, and you can have a single @t{%s} inside, which will be replaced by the current nodename.
671     @refill
672     Relative paths are interpreted relative to the GVPE config directory.
673     @refill
674     Example: include the file @file{local.conf} in the config directory on every node.
675     @refill
676    
677    
678     @example
679     include local.conf
680     @end example
681    
682     Example: include a file @file{conf/}nodename@file{.conf}
683 pcg 1.1 @refill
684    
685    
686 root 1.6 @example
687     include conf/%s.conf
688     @end example
689    
690     @end itemize
691    
692    
693    
694 pcg 1.1 @section ANATOMY OF A CONFIG FILE
695 root 1.5 Usually, a config file starts with a few global settings (like the UDP port to listen on), followed by node-specific sections that begin with a @t{node = nickname} line.
696 pcg 1.1 @refill
697 pcg 1.3 Every node that is part of the network must have a section that starts with @t{node = nickname}. The number and order of the nodes is important and must be the same on all nodes. It is not uncommon for node sections to be completely empty - if the default values are right.
698 pcg 1.1 @refill
699     Node-specific settings can be used at any time. If used before the first node section they will set the default values for all following nodes.
700     @refill
701    
702    
703     @section CONFIG VARIABLES
704    
705    
706     @subsection GLOBAL SETTINGS
707     Global settings will affect the behaviour of the running gvpe daemon, that is, they are in some sense node-specific (config files can set different values on different nodes using @t{on}), but will affect the behaviour of the gvpe daemon and all connections it creates.
708     @refill
709    
710    
711     @itemize
712    
713    
714     @item
715 root 1.6 chroot = path or /
716    
717     @cindex chroot
718     Tells GVPE to chroot(2) to the specified path after reading all necessary files, binding to sockets and running the @t{if-up} script, but before running @t{node-up} or any other scripts.
719     @refill
720     The special path @file{/} instructs GVPE to create (and remove) an empty temporary directory to use as new root. This is most secure, but makes it impossible to use any scripts other than the @t{if-up} one.
721     @refill
722    
723    
724     @item
725     chuid = numerical-uid
726    
727     @cindex chuid
728    
729    
730     @item
731     chgid = numerical-gid
732    
733     @cindex chgid
734     These two options tell GVPE to change to the given user and/or group id after reading all necessary files, binding to sockets and running the @t{if-up} script.
735     @refill
736     Other scripts, such as @t{node-up}, are run with the new user id or group id.
737     @refill
738    
739    
740     @item
741     chuser = username
742    
743     @cindex chuser
744     Alternative to @t{chuid} and @t{chgid}: Sets both @t{chuid} and @t{chgid} to the user and (primary) group ids of the specified user (for example, @t{nobody}).
745     @refill
746    
747    
748     @item
749 pcg 1.3 dns-forw-host = hostname/ip
750 pcg 1.1
751     @cindex dns-forw-host
752 root 1.5 The DNS server to forward DNS requests to for the DNS tunnel protocol (default: @t{127.0.0.1}, changing it is highly recommended).
753 pcg 1.1 @refill
754    
755    
756     @item
757 pcg 1.3 dns-forw-port = port-number
758 pcg 1.1
759     @cindex dns-forw-port
760     The port where the @t{dns-forw-host} is to be contacted (default: @t{53}, which is fine in most cases).
761     @refill
762    
763    
764     @item
765 root 1.6 dns-case-preserving = yes|true|on | no|false|off
766    
767     @cindex dns-case-preserving
768     Sets whether the DNS transport forwarding server preserves case (DNS servers have to, but some access systems are even more broken than others) (default: true).
769     @refill
770     Normally, when the forwarding server changes the case of domain names then GVPE will automatically set this to false.
771     @refill
772    
773    
774     @item
775 pcg 1.3 dns-max-outstanding = integer-number-of-requests
776 pcg 1.1
777     @cindex dns-max-outstanding
778     The maximum number of outstanding DNS transport requests (default: @t{100}). GVPE will never issue more requests then the given limit without receiving replies. In heavily overloaded situations it might help to set this to a low number (e.g. @t{3} or even @t{1}) to limit the number of parallel requests.
779     @refill
780 root 1.5 The default should be working OK for most links.
781 pcg 1.1 @refill
782    
783    
784     @item
785 pcg 1.3 dns-overlap-factor = float
786 pcg 1.1
787     @cindex dns-overlap-factor
788     The DNS transport uses the minimum request latency (@strong{min_latency}) seen during a connection as it's timing base. This factor (default: @t{0.5}, must be > 0) is multiplied by @strong{min_latency} to get the maximum sending rate (= minimum send interval), i.e. a factor of @t{1} means that a new request might be generated every @strong{min_latency} seconds, which means on average there should only ever be one outstanding request. A factor of @t{0.5} means that GVPE will send requests twice as often as the minimum latency measured.
789     @refill
790 root 1.5 For congested or picky DNS forwarders you could use a value nearer to or exceeding @t{1}.
791 pcg 1.1 @refill
792 root 1.5 The default should be working OK for most links.
793 pcg 1.1 @refill
794    
795    
796     @item
797 pcg 1.3 dns-send-interval = send-interval-in-seconds
798 pcg 1.1
799     @cindex dns-send-interval
800     The minimum send interval (= maximum rate) that the DNS transport will use to send new DNS requests. GVPE will not exceed this rate even when the latency is very low. The default is @t{0.01}, which means GVPE will not send more than 100 DNS requests per connection per second. For high-bandwidth links you could go lower, e.g. to @t{0.001} or so. For congested or rate-limited links, you might want to go higher, say @t{0.1}, @t{0.2} or even higher.
801     @refill
802 root 1.5 The default should be working OK for most links.
803 pcg 1.1 @refill
804    
805    
806     @item
807 pcg 1.3 dns-timeout-factor = float
808 pcg 1.1
809     @cindex dns-timeout-factor
810     Factor to multiply the @t{min_latency} (see @t{dns-overlap-factor}) by to get request timeouts. The default of @t{8} means that the DNS transport will resend the request when no reply has been received for longer than eight times the minimum (= expected) latency, assuming the request or reply has been lost.
811     @refill
812     For congested links a higher value might be necessary (e.g. @t{30}). If the link is very stable lower values (e.g. @t{2}) might work nicely. Values near or below @t{1} makes no sense whatsoever.
813     @refill
814 root 1.5 The default should be working OK for most links but will result in low throughput if packet loss is high.
815 pcg 1.1 @refill
816    
817    
818     @item
819 pcg 1.3 if-up = relative-or-absolute-path
820 pcg 1.1
821     @cindex if-up
822 root 1.5 Sets the path of a script that should be called immediately after the network interface is initialized (but not necessarily up). The following environment variables are passed to it (the values are just examples).
823 pcg 1.1 @refill
824     Variables that have the same value on all nodes:
825     @refill
826    
827    
828     @itemize
829    
830    
831     @item
832 pcg 1.3 CONFBASE=/etc/gvpe
833 pcg 1.1
834     @cindex CONFBASE
835     The configuration base directory.
836     @refill
837    
838    
839     @item
840 pcg 1.3 IFNAME=vpn0
841 pcg 1.1
842     @cindex IFNAME
843     The network interface to initialize.
844     @refill
845    
846    
847     @item
848 pcg 1.3 IFTYPE=native # or tincd
849 pcg 1.1
850     @cindex IFTYPE
851    
852    
853     @item
854 pcg 1.3 IFSUBTYPE=linux # or freebsd, darwin etc..
855 pcg 1.1
856     @cindex IFSUBTYPE
857     The interface type (@t{native} or @t{tincd}) and the subtype (usually the OS name in lowercase) that this GVPE was configured for. Can be used to select the correct syntax to use for network-related commands.
858     @refill
859    
860    
861     @item
862 pcg 1.3 MTU=1436
863 pcg 1.1
864     @cindex MTU
865 pcg 1.3 The MTU to set the interface to. You can use lower values (if done consistently on all nodes), but this is usually either inefficient or simply ineffective.
866 pcg 1.1 @refill
867    
868    
869     @item
870 pcg 1.3 NODES=5
871 pcg 1.1
872     @cindex NODES
873     The number of nodes in this GVPE network.
874     @refill
875     @end itemize
876    
877     Variables that are node-specific and with values pertaining to the node running this GVPE:
878     @refill
879    
880    
881     @itemize
882    
883    
884     @item
885 pcg 1.3 IFUPDATA=string
886 pcg 1.1
887     @cindex IFUPDATA
888     The value of the configuration directive @t{if-up-data}.
889     @refill
890    
891    
892     @item
893 pcg 1.3 MAC=fe:fd:80:00:00:01
894 pcg 1.1
895     @cindex MAC
896     The MAC address the network interface has to use.
897     @refill
898 root 1.5 Might be used to initialize interfaces on platforms where GVPE does not do this automatically. Please see the @t{gvpe.osdep(5)} man page for platform-specific information.
899 pcg 1.1 @refill
900    
901    
902     @item
903 pcg 1.3 NODENAME=branch1
904 pcg 1.1
905     @cindex NODENAME
906     The nickname of the node.
907     @refill
908    
909    
910     @item
911 pcg 1.3 NODEID=1
912 pcg 1.1
913     @cindex NODEID
914     The numerical node ID of the node running this instance of GVPE. The first node mentioned in the config file gets ID 1, the second ID 2 and so on.
915     @refill
916     @end itemize
917    
918     In addition, all node-specific variables (except @t{NODEID}) will be available with a postfix of @t{_nodeid}, which contains the value for that node, e.g. the @t{MAC_1} variable contains the MAC address of node #1, while the @t{NODENAME_22} variable contains the name of node #22.
919     @refill
920     Here is a simple if-up script:
921     @refill
922    
923    
924     @example
925     #!/bin/sh
926     ip link set $IFNAME up
927     [ $NODENAME = branch1 ] && ip addr add 10.0.0.1 dev $IFNAME
928     [ $NODENAME = branch2 ] && ip addr add 10.1.0.1 dev $IFNAME
929     ip route add 10.0.0.0/8 dev $IFNAME
930     @end example
931    
932 root 1.5 More complicated examples (using routing to reduce ARP traffic) can be found in the @file{etc/} subdirectory of the distribution.
933 pcg 1.1 @refill
934    
935    
936     @item
937 pcg 1.3 ifname = devname
938 pcg 1.1
939     @cindex ifname
940     Sets the tun interface name to the given name. The default is OS-specific and most probably something like @t{tun0}.
941     @refill
942    
943    
944     @item
945 pcg 1.3 ifpersist = yes|true|on | no|false|off
946 pcg 1.1
947     @cindex ifpersist
948     Should the tun/tap device be made persistent, that is, should the device stay up even when gvpe exits? Some versions of the tunnel device have problems sending packets when gvpe is restarted in persistent mode, so if the connections can be established but you cannot send packets from the local node, try to set this to @t{off} and do an ifconfig down on the device.
949     @refill
950    
951    
952     @item
953 pcg 1.3 ip-proto = numerical-ip-protocol
954 pcg 1.1
955     @cindex ip-proto
956 pcg 1.3 Sets the protocol number to be used for the rawip protocol. This is a global option because all nodes must use the same protocol, and since there are no port numbers, you cannot easily run more than one gvpe instance using the same protocol, nor can you share the protocol with other programs.
957 pcg 1.1 @refill
958 root 1.5 The default is 47 (GRE), which has a good chance of tunneling through firewalls (but note that gvpe's rawip protocol is not GRE compatible). Other common choices are 50 (IPSEC, ESP), 51 (IPSEC, AH), 4 (IPIP tunnels) or 98 (ENCAP, rfc1241).
959     @refill
960     Many versions of Linux seem to have a bug that causes them to reorder packets for some ip protocols (GRE, ESP) but not for others (AH), so choose wisely (that is, use 51, AH).
961 pcg 1.1 @refill
962    
963    
964     @item
965 pcg 1.3 http-proxy-host = hostname/ip
966 pcg 1.1
967     @cindex http-proxy-host
968     The @t{http-proxy-*} family of options are only available if gvpe was compiled with the @t{--enable-http-proxy} option and enable tunneling of tcp connections through a http proxy server.
969     @refill
970     @t{http-proxy-host} and @t{http-proxy-port} should specify the hostname and port number of the proxy server. See @t{http-proxy-loginpw} if your proxy requires authentication.
971     @refill
972 root 1.5 Please note that gvpe will still try to resolve all hostnames in the configuration file, so if you are behind a proxy without access to a DNS server better use numerical IP addresses.
973 pcg 1.1 @refill
974 root 1.5 To make best use of this option disable all protocols except TCP in your config file and make sure your routers (or all other nodes) are listening on a port that the proxy allows (443, https, is a common choice).
975 pcg 1.1 @refill
976 root 1.5 If you have a router, connecting to it will suffice. Otherwise TCP must be enabled on all nodes.
977 pcg 1.1 @refill
978     Example:
979     @refill
980    
981    
982     @example
983     http-proxy-host = proxy.example.com
984     http-proxy-port = 3128 # 8080 is another common choice
985     http-proxy-auth = schmorp:grumbeere
986     @end example
987    
988    
989    
990     @item
991 pcg 1.3 http-proxy-port = proxy-tcp-port
992 pcg 1.1
993     @cindex http-proxy-port
994     The port where your proxy server listens.
995     @refill
996    
997    
998     @item
999 pcg 1.3 http-proxy-auth = login:password
1000 pcg 1.1
1001     @cindex http-proxy-auth
1002 root 1.5 The optional login and password used to authenticate to the proxy server, separated by a literal colon (@t{:}). Only basic authentication is currently supported.
1003 pcg 1.1 @refill
1004    
1005    
1006     @item
1007 pcg 1.3 keepalive = seconds
1008 pcg 1.1
1009     @cindex keepalive
1010 root 1.6 Sets the keepalive probe interval in seconds (default: @t{60}). After this many seconds of inactivity the daemon will start to send keepalive probe every 3 seconds until it receives a reply from the other end. If no reply is received within 15 seconds, the peer is considered unreachable and the connection is closed.
1011 pcg 1.1 @refill
1012    
1013    
1014     @item
1015 pcg 1.3 loglevel = noise|trace|debug|info|notice|warn|error|critical
1016 pcg 1.1
1017     @cindex loglevel
1018     Set the logging level. Connection established messages are logged at level @t{info}, notable errors are logged with @t{error}. Default is @t{info}.
1019     @refill
1020    
1021    
1022     @item
1023 pcg 1.3 mtu = bytes
1024 pcg 1.1
1025     @cindex mtu
1026 root 1.5 Sets the maximum MTU that should be used on outgoing packets (basically the MTU of the outgoing interface) The daemon will automatically calculate maximum overhead (e.g. UDP header size, encryption blocksize...) and pass this information to the @t{if-up} script.
1027 pcg 1.1 @refill
1028     Recommended values are 1500 (ethernet), 1492 (pppoe), 1472 (pptp).
1029     @refill
1030 root 1.5 This value must be the minimum of the MTU values of all nodes.
1031 pcg 1.1 @refill
1032    
1033    
1034     @item
1035 root 1.6 nfmark = integer
1036 pcg 1.1
1037 root 1.6 @cindex nfmark
1038     This advanced option, when set to a nonzero value (default: @t{0}), tries to set the netfilter mark (or fwmark) value on all sockets gvpe uses to send packets.
1039     @refill
1040     This can be used to make gvpe use a different set of routing rules. For example, on GNU/Linux, the @t{if-up} could set @t{nfmark} to 1000 and then put all routing rules into table @t{99} and then use an ip rule to make gvpe traffic avoid that routing table, in effect routing normal traffic via gvpe and gvpe traffic via the normal system routing tables:
1041 pcg 1.1 @refill
1042    
1043    
1044 root 1.6 @example
1045     ip rule add not fwmark 1000 lookup 99
1046     @end example
1047    
1048    
1049    
1050 pcg 1.1 @item
1051 pcg 1.3 node-up = relative-or-absolute-path
1052 pcg 1.1
1053     @cindex node-up
1054 pcg 1.3 Sets a command (default: none) that should be called whenever a connection is established (even on rekeying operations). Note that node-up/down scripts will be run asynchronously, but execution is serialised, so there will only ever be one such script running.
1055     @refill
1056 root 1.5 In addition to all the variables passed to @t{if-up} scripts, the following environment variables will be set (values are just examples):
1057 pcg 1.1 @refill
1058    
1059    
1060     @itemize
1061    
1062    
1063     @item
1064 pcg 1.3 DESTNODE=branch2
1065 pcg 1.1
1066     @cindex DESTNODE
1067     The name of the remote node.
1068     @refill
1069    
1070    
1071     @item
1072 pcg 1.3 DESTID=2
1073 pcg 1.1
1074     @cindex DESTID
1075     The node id of the remote node.
1076     @refill
1077    
1078    
1079     @item
1080 root 1.5 DESTSI=rawip/88.99.77.55:0
1081    
1082     @cindex DESTSI
1083     The "socket info" of the target node, protocol dependent but usually in the format protocol/ip:port.
1084     @refill
1085    
1086    
1087     @item
1088 pcg 1.3 DESTIP=188.13.66.8
1089 pcg 1.1
1090     @cindex DESTIP
1091 pcg 1.3 The numerical IP address of the remote node (gvpe accepts connections from everywhere, as long as the other node can authenticate itself).
1092 pcg 1.1 @refill
1093    
1094    
1095     @item
1096 pcg 1.3 DESTPORT=655 # deprecated
1097 pcg 1.1
1098     @cindex DESTPORT
1099 root 1.5 The protocol port used by the other side, if applicable.
1100 pcg 1.1 @refill
1101    
1102    
1103     @item
1104 root 1.5 STATE=up
1105 pcg 1.1
1106     @cindex STATE
1107 root 1.5 Node-up scripts get called with STATE=up, node-change scripts get called with STATE=change and node-down scripts get called with STATE=down.
1108 pcg 1.1 @refill
1109     @end itemize
1110    
1111 root 1.5 Here is a nontrivial example that uses nsupdate to update the name => ip mapping in some DNS zone:
1112 pcg 1.1 @refill
1113    
1114    
1115     @example
1116     #!/bin/sh
1117     @{
1118     echo update delete $DESTNODE.lowttl.example.net. a
1119     echo update add $DESTNODE.lowttl.example.net. 1 in a $DESTIP
1120 root 1.6 echo
1121 pcg 1.1 @} | nsupdate -d -k $CONFBASE:key.example.net.
1122     @end example
1123    
1124    
1125    
1126     @item
1127 root 1.5 node-change = relative-or-absolute-path
1128    
1129     @cindex node-change
1130     Same as @t{node-change}, but gets called whenever something about a connection changes (such as the source IP address).
1131     @refill
1132    
1133    
1134     @item
1135 pcg 1.3 node-down = relative-or-absolute-path
1136 pcg 1.1
1137     @cindex node-down
1138     Same as @t{node-up}, but gets called whenever a connection is lost.
1139     @refill
1140    
1141    
1142     @item
1143 pcg 1.3 pid-file = path
1144 pcg 1.1
1145     @cindex pid-file
1146 root 1.6 The path to the pid file to check and create (default: @t{LOCALSTATEDIR/run/gvpe.pid}). The first @t{%s} is replaced by the nodename - any other use of @t{%} must be written as @t{%%}.
1147 pcg 1.1 @refill
1148    
1149    
1150     @item
1151 pcg 1.3 private-key = relative-path-to-key
1152 pcg 1.1
1153     @cindex private-key
1154     Sets the path (relative to the config directory) to the private key (default: @t{hostkey}). This is a printf format string so every @t{%} must be doubled. A single @t{%s} is replaced by the hostname, so you could use paths like @t{hostkeys/%s} to fetch the files at the location where @t{gvpectrl} puts them.
1155     @refill
1156 root 1.5 Since only the private key file of the current node is used and the private key file should be kept secret per-node to avoid spoofing, it is not recommended to use this feature.
1157 pcg 1.1 @refill
1158    
1159    
1160     @item
1161 pcg 1.3 rekey = seconds
1162 pcg 1.1
1163     @cindex rekey
1164 root 1.6 Sets the rekeying interval in seconds (default: @t{3607}). Connections are reestablished every @t{rekey} seconds, making them use a new encryption key.
1165 root 1.5 @refill
1166    
1167    
1168     @item
1169 root 1.6 seed-device = path
1170 root 1.5
1171 root 1.6 @cindex seed-device
1172     The random device used to initially and regularly seed the random number generator (default: @file{/dev/urandom}). Randomness is of paramount importance to the security of the algorithms used in gvpe.
1173     @refill
1174     On program start and every seed-interval, gvpe will read 64 octets.
1175     @refill
1176     Setting this path to the empty string will disable this functionality completely (the underlying crypto library will likely look for entropy sources on it's own though, so not all is lost).
1177 root 1.5 @refill
1178 root 1.6
1179    
1180     @item
1181     seed-interval = seconds
1182    
1183     @cindex seed-interval
1184     The number of seconds between reseeds of the random number generator (default: @t{3613}). A value of @t{0} disables this regular reseeding.
1185 pcg 1.1 @refill
1186 root 1.5
1187    
1188 root 1.6 @item
1189     serial = string
1190 root 1.5
1191 root 1.6 @cindex serial
1192     The configuration serial number. This can be any string up to 16 bytes length. Only when the serial matches on both sides of a conenction will the connection succeed. This is @emph{not} a security mechanism and eay to spoof, this mechanism exists to alert users that their config is outdated.
1193     @refill
1194     It's recommended to specify this is a date string such as @t{2013-05-05} or @t{20121205084417).}
1195     @refill
1196     The exact algorithm is as this: if a connection request is received form a node with an identical serial, then it succeeds normally.
1197     @refill
1198     If the remote serial is lower than the local serial, it is ignored.
1199     @refill
1200     If the remote serial is higher than the local serial, a warning message is logged.
1201     @refill
1202 pcg 1.1 @end itemize
1203    
1204    
1205    
1206     @subsection NODE SPECIFIC SETTINGS
1207     The following settings are node-specific, that is, every node can have different settings, even within the same gvpe instance. Settings that are set before the first node section set the defaults, settings that are set within a node section only apply to the given node.
1208     @refill
1209    
1210    
1211     @itemize
1212    
1213    
1214     @item
1215 pcg 1.3 allow-direct = nodename
1216 pcg 1.1
1217     @cindex allow-direct
1218     Allow direct connections to this node. See @t{deny-direct} for more info.
1219     @refill
1220    
1221    
1222     @item
1223 pcg 1.3 compress = yes|true|on | no|false|off
1224 pcg 1.1
1225     @cindex compress
1226 root 1.5 For the current node, this specified whether it will accept compressed packets, and for all other nodes, this specifies whether to try to compress data packets sent to this node (default: @t{yes}). Compression is really cheap even on slow computers, has no size overhead at all and will only be used when the other side supports compression, so enabling this is often a good idea.
1227 pcg 1.1 @refill
1228    
1229    
1230     @item
1231 pcg 1.3 connect = ondemand | never | always | disabled
1232 pcg 1.1
1233     @cindex connect
1234 pcg 1.3 Sets the connect mode (default: @t{always}). It can be @t{always} (always try to establish and keep a connection to the given node), @t{never} (never initiate a connection to the given host, but accept connections), @t{ondemand} (try to establish a connection when there are outstanding packets in the queue and take it down after the keepalive interval) or @t{disabled} (node is bad, don't talk to it).
1235     @refill
1236     Routers will automatically be forced to @t{always} unless they are @t{disabled}, to ensure all nodes can talk to each other.
1237 pcg 1.1 @refill
1238    
1239    
1240     @item
1241 pcg 1.3 deny-direct = nodename | *
1242 pcg 1.1
1243     @cindex deny-direct
1244     Deny direct connections to the specified node (or all nodes when @t{*} is given). Only one node can be specified, but you can use multiple @t{allow-direct} and @t{deny-direct} statements. This only makes sense in networks with routers, as routers are required for indirect connections.
1245     @refill
1246 root 1.5 Sometimes, a node cannot reach some other nodes for reasons of network connectivity. For example, a node behind a firewall that only allows connections to/from a single other node in the network. In this case one should specify @t{deny-direct = *} and @t{allow-direct = othernodename} (the other node @emph{must} be a router for this to work).
1247 pcg 1.1 @refill
1248 root 1.5 The algorithm to check whether a connection may be direct is as follows:
1249 pcg 1.1 @refill
1250 root 1.5 1. Other node mentioned in an @t{allow-direct}? If yes, allow the connection.
1251 pcg 1.1 @refill
1252     2. Other node mentioned in a @t{deny-direct}? If yes, deny direct connections.
1253     @refill
1254     3. Allow the connection.
1255     @refill
1256 pcg 1.2 That is, @t{allow-direct} takes precedence over @t{deny-direct}.
1257 pcg 1.1 @refill
1258     The check is done in both directions, i.e. both nodes must allow a direct connection before one is attempted, so you only need to specify connect limitations on one node.
1259     @refill
1260    
1261    
1262     @item
1263 pcg 1.3 dns-domain = domain-suffix
1264 pcg 1.1
1265     @cindex dns-domain
1266     The DNS domain suffix that points to the DNS tunnel server for this node.
1267     @refill
1268     The domain must point to a NS record that points to the @emph{dns-hostname}, i.e.
1269     @refill
1270    
1271    
1272     @example
1273     dns-domainname = tunnel.example.net
1274     dns-hostname = tunnel-server.example.net
1275     @end example
1276    
1277     Corresponds to the following DNS entries in the @t{example.net} domain:
1278     @refill
1279    
1280    
1281     @example
1282     tunnel.example.net. NS tunnel-server.example.net.
1283     tunnel-server.example.net. A 13.13.13.13
1284     @end example
1285    
1286    
1287    
1288     @item
1289 pcg 1.3 dns-hostname = hostname/ip
1290 pcg 1.1
1291     @cindex dns-hostname
1292     The address to bind the DNS tunnel socket to, similar to the @t{hostname}, but for the DNS tunnel protocol only. Default: @t{0.0.0.0}, but that might change.
1293     @refill
1294    
1295    
1296     @item
1297 pcg 1.3 dns-port = port-number
1298 pcg 1.1
1299     @cindex dns-port
1300     The port to bind the DNS tunnel socket to. Must be @t{53} on DNS tunnel servers.
1301     @refill
1302    
1303    
1304     @item
1305 pcg 1.3 enable-dns = yes|true|on | no|false|off
1306 pcg 1.1
1307     @cindex enable-dns
1308     See gvpe.protocol(7) for a description of the DNS transport protocol. Avoid this protocol if you can.
1309     @refill
1310     Enable the DNS tunneling protocol on this node, either as server or as client. Support for this transport protocol is only available when gvpe was compiled using the @t{--enable-dns} option.
1311     @refill
1312    
1313    
1314     @item
1315 pcg 1.3 enable-icmp = yes|true|on | no|false|off
1316 pcg 1.1
1317     @cindex enable-icmp
1318     See gvpe.protocol(7) for a description of the ICMP transport protocol.
1319     @refill
1320 root 1.5 Enable the ICMP transport using ICMP packets of type @t{icmp-type} on this node.
1321 pcg 1.1 @refill
1322    
1323    
1324     @item
1325 pcg 1.3 enable-rawip = yes|true|on | no|false|off
1326 pcg 1.1
1327     @cindex enable-rawip
1328     See gvpe.protocol(7) for a description of the RAW IP transport protocol.
1329     @refill
1330     Enable the RAW IPv4 transport using the @t{ip-proto} protocol (default: @t{no}).
1331     @refill
1332    
1333    
1334     @item
1335 pcg 1.3 enable-tcp = yes|true|on | no|false|off
1336 pcg 1.1
1337     @cindex enable-tcp
1338     See gvpe.protocol(7) for a description of the TCP transport protocol.
1339     @refill
1340     Enable the TCPv4 transport using the @t{tcp-port} port (default: @t{no}). Support for this transport protocol is only available when gvpe was compiled using the @t{--enable-tcp} option.
1341     @refill
1342    
1343    
1344     @item
1345 pcg 1.3 enable-udp = yes|true|on | no|false|off
1346 pcg 1.1
1347     @cindex enable-udp
1348     See gvpe.protocol(7) for a description of the UDP transport protocol.
1349     @refill
1350 root 1.6 Enable the UDPv4 transport using the @t{udp-port} port (default: @t{no}).
1351 pcg 1.1 @refill
1352    
1353    
1354     @item
1355 pcg 1.3 hostname = hostname | ip [can not be defaulted]
1356 pcg 1.1
1357     @cindex hostname
1358 root 1.5 Forces the address of this node to be set to the given DNS hostname or IP address. It will be resolved before each connect request, so dyndns should work fine. If this setting is not specified and a router is available, then the router will be queried for the address of this node. Otherwise, the connection attempt will fail.
1359     @refill
1360     Note that DNS resolving is done synchronously, pausing the daemon. If that is an issue you need to specify IP addresses.
1361 pcg 1.1 @refill
1362    
1363    
1364     @item
1365 pcg 1.3 icmp-type = integer
1366 pcg 1.1
1367     @cindex icmp-type
1368     Sets the type value to be used for outgoing (and incoming) packets sent via the ICMP transport.
1369     @refill
1370 root 1.5 The default is @t{0} (which is @t{echo-reply}, also known as "ping-reply"). Other useful values include @t{8} (@t{echo-request}, a.k.a. "ping") and @t{11} (@t{time-exceeded}), but any 8-bit value can be used.
1371 pcg 1.1 @refill
1372    
1373    
1374     @item
1375 pcg 1.3 if-up-data = value
1376 pcg 1.1
1377     @cindex if-up-data
1378     The value specified using this directive will be passed to the @t{if-up} script in the environment variable @t{IFUPDATA}.
1379     @refill
1380    
1381    
1382     @item
1383 pcg 1.3 inherit-tos = yes|true|on | no|false|off
1384 pcg 1.1
1385     @cindex inherit-tos
1386 root 1.5 Whether to inherit the TOS settings of packets sent to the tunnel when sending packets to this node (default: @t{yes}). If set to @t{yes} then outgoing tunnel packets will have the same TOS setting as the packets sent to the tunnel device, which is usually what you want.
1387 pcg 1.1 @refill
1388    
1389    
1390     @item
1391 root 1.6 low-power = yes|true|on | no|false|off
1392    
1393     @cindex low-power
1394     If true, designates a node as a low-power node. Low-power nodes use larger timeouts and try to reduce cpu time. Other nodes talking to a low-power node will also use larger timeouts, and will use less aggressive optimisations, in the hope of reducing load. Security is not compromised.
1395     @refill
1396     The typical low-power node would be a mobile phone, where wakeups and encryption can significantly increase power drain.
1397     @refill
1398    
1399    
1400     @item
1401 pcg 1.3 max-retry = positive-number
1402 pcg 1.1
1403     @cindex max-retry
1404 root 1.5 The maximum interval in seconds (default: @t{3600}, one hour) between retries to establish a connection to this node. When a connection cannot be established, gvpe uses exponential back-off capped at this value. It's sometimes useful to set this to a much lower value (e.g. @t{120}) on connections to routers that usually are stable but sometimes are down, to assure quick reconnections even after longer downtimes.
1405 pcg 1.1 @refill
1406    
1407    
1408     @item
1409 pcg 1.3 max-ttl = seconds
1410    
1411     @cindex max-ttl
1412     Expire packets that couldn't be sent after this many seconds (default: @t{60}). Gvpe will normally queue packets for a node without an active connection, in the hope of establishing a connection soon. This value specifies the maximum lifetime a packet will stay in the queue, if a packet gets older, it will be thrown away.
1413     @refill
1414    
1415    
1416     @item
1417     max-queue = positive-number>=1
1418    
1419     @cindex max-queue
1420     The maximum number of packets that will be queued (default: @t{512}) for this node. If more packets are sent then earlier packets will be expired. See @t{max-ttl}, above.
1421     @refill
1422    
1423    
1424     @item
1425     router-priority = 0 | 1 | positive-number>=2
1426 pcg 1.1
1427     @cindex router-priority
1428 pcg 1.3 Sets the router priority of the given node (default: @t{0}, disabled).
1429 pcg 1.1 @refill
1430 pcg 1.3 If some node tries to connect to another node but it doesn't have a hostname, it asks a router node for it's IP address. The router node chosen is the one with the highest priority larger than @t{1} that is currently reachable. This is called a @emph{mediated} connection, as the connection itself will still be direct, but it uses another node to mediate between the two nodes.
1431 pcg 1.1 @refill
1432 pcg 1.3 The value @t{0} disables routing, that means if the node receives a packet not for itself it will not forward it but instead drop it.
1433     @refill
1434     The special value @t{1} allows other hosts to route through the router host, but they will never route through it by default (i.e. the config file of another node needs to specify a router priority higher than one to choose such a node for routing).
1435     @refill
1436     The idea behind this is that some hosts can, if required, bump the @t{router-priority} setting to higher than @t{1} in their local config to route through specific hosts. If @t{router-priority} is @t{0}, then routing will be refused, so @t{1} serves as a "enable, but do not use by default" switch.
1437     @refill
1438     Nodes with @t{router-priority} set to @t{2} or higher will always be forced to @t{connect} = @t{always} (unless they are @t{disabled}).
1439 pcg 1.1 @refill
1440    
1441    
1442     @item
1443 pcg 1.3 tcp-port = port-number
1444 pcg 1.1
1445     @cindex tcp-port
1446     Similar to @t{udp-port} (default: @t{655}), but sets the TCP port number.
1447     @refill
1448    
1449    
1450     @item
1451 pcg 1.3 udp-port = port-number
1452 pcg 1.1
1453     @cindex udp-port
1454     Sets the port number used by the UDP protocol (default: @t{655}, not officially assigned by IANA!).
1455     @refill
1456     @end itemize
1457    
1458    
1459    
1460     @section CONFIG DIRECTORY LAYOUT
1461     The default (or recommended) directory layout for the config directory is:
1462     @refill
1463    
1464    
1465     @itemize
1466    
1467    
1468     @item
1469 pcg 1.3 gvpe.conf
1470 pcg 1.1
1471     The config file.
1472     @refill
1473    
1474    
1475     @item
1476 pcg 1.3 if-up
1477 pcg 1.1
1478     The if-up script
1479     @refill
1480    
1481    
1482     @item
1483 root 1.5 node-up, node-down
1484 pcg 1.1
1485     If used the node up or node-down scripts.
1486     @refill
1487    
1488    
1489     @item
1490 pcg 1.3 hostkey
1491 pcg 1.1
1492 root 1.6 The (default path of the) private key of the current host.
1493 pcg 1.1 @refill
1494    
1495    
1496     @item
1497 pcg 1.3 pubkey/nodename
1498 pcg 1.1
1499     The public keys of the other nodes, one file per node.
1500     @refill
1501     @end itemize
1502    
1503    
1504    
1505    
1506     @node gvpectrl,gvpe,gvpe.conf,Top
1507    
1508     @chapter gvpectrl
1509    
1510     @section NAME
1511     @t{gvpectrl} - GNU Virtual Private Ethernet Control Program
1512     @refill
1513    
1514    
1515     @section SYNOPSIS
1516     @t{gvpectrl} [@strong{-ckgs}] [@strong{--config=}@emph{DIR}] [@strong{--generate-keys}] [@strong{--help}] [@strong{--kill}[@strong{=}@emph{SIGNAL}]] [@strong{--show-config}] [@strong{--version}]
1517     @refill
1518    
1519    
1520     @section DESCRIPTION
1521     This is the control program for the @t{gvpe}, the virtual private ethernet daemon.
1522     @refill
1523    
1524    
1525     @section OPTIONS
1526    
1527    
1528     @itemize
1529    
1530    
1531     @item
1532 pcg 1.3 @strong{-c}, @strong{--config=}@emph{DIR}
1533 pcg 1.1
1534     Read configuration options from @emph{DIR}.
1535     @refill
1536    
1537    
1538     @item
1539 pcg 1.3 @strong{-g}, @strong{--generate-keys}
1540 pcg 1.1
1541 root 1.5 Generate public/private RSA key-pair and exit.
1542 pcg 1.1 @refill
1543    
1544    
1545     @item
1546 pcg 1.3 @strong{-q}, @strong{--quiet}
1547    
1548     Suppresses messages the author finds nonessential for scripting purposes.
1549     @refill
1550    
1551    
1552     @item
1553     @strong{--help}
1554 pcg 1.1
1555     Display short list of options.
1556     @refill
1557    
1558    
1559     @item
1560 pcg 1.3 @strong{--kill}[@strong{=}@emph{SIGNAL}]
1561 pcg 1.1
1562     Attempt to kill a running @t{gvpectrl} (optionally with the specified @emph{SIGNAL} instead of @t{SIGTERM}) and exit.
1563     @refill
1564    
1565    
1566     @item
1567 pcg 1.3 @strong{--show-config}
1568 pcg 1.1
1569     Show a summary of the configuration, and how gvpe interprets it. Can also be very useful when designing firewall scripts.
1570     @refill
1571    
1572    
1573     @item
1574 pcg 1.3 @strong{--version}
1575 pcg 1.1
1576     Output version information and exit.
1577     @refill
1578     @end itemize
1579    
1580    
1581    
1582     @section BUGS
1583     If you find any bugs, report them to @t{gvpe@@schmorp.de}.
1584     @refill
1585    
1586    
1587    
1588     @node gvpe,gvpe.protocol,gvpectrl,Top
1589    
1590     @chapter gvpe
1591    
1592     @section NAME
1593     @t{gvpe} - GNU Virtual Private Ethernet Daemon
1594     @refill
1595    
1596    
1597     @section SYNOPSIS
1598     @t{gvpe} [@strong{-cDlL}] [@strong{--config=}@emph{DIR}] [@strong{--no-detach}] [@strong{-l=}@emph{LEVEL]}] [@strong{--kill}[@strong{=}@emph{SIGNAL}]] [@strong{--mlock}] [@strong{--help}] [@strong{--version}] @emph{NODENAME} [@emph{option...}]
1599     @refill
1600    
1601    
1602     @section DESCRIPTION
1603 root 1.5 See the gvpe(5) man page for an introduction to the gvpe suite.
1604 pcg 1.1 @refill
1605 root 1.5 This is the manual page for gvpe, the virtual private ethernet daemon. When started, @t{gvpe} will read it's configuration file to determine the network topology, and other configuration information, assuming the role of node @emph{NODENAME}
1606     @refill
1607     It will then create/connect to the tun/tap device and set up a socket for incoming connections. Then a @t{if-up} script will be executed to further configure the virtual network device. If that succeeds, it will detach from the controlling terminal and continue in the background, accepting and setting up connections to other gvpe daemons that are part of the same virtual private ethernet.
1608 pcg 1.1 @refill
1609     The optional arguments after the node name have to be of the form:
1610     @refill
1611    
1612    
1613     @example
1614     [I<nodename>.]var=value
1615     @end example
1616    
1617 root 1.5 If the argument has a prefix of @t{nodename.} (i.e. @t{laptop.enable-dns=yes}) then it will be parsed after all the config directives for that node, if not, it is parsed before the first node directive in the config file, and can be used to set global options or default variables.
1618 pcg 1.1 @refill
1619     For example, to start @t{gvpe} in the foreground, with log-level @t{info} on the node @t{laptop}, with TCP enabled and HTTP-Proxy host and Port set, use this:
1620     @refill
1621    
1622    
1623     @example
1624     gvpe -D -l info laptop \
1625     http-proxy-host=10.0.0.18 http-proxy-port=3128 \
1626     laptop.enable-tcp=yes
1627     @end example
1628    
1629    
1630    
1631     @section OPTIONS
1632    
1633    
1634     @itemize
1635    
1636    
1637     @item
1638 pcg 1.3 @strong{-c}, @strong{--config=}@emph{DIR}
1639 pcg 1.1
1640     Read configuration options from @emph{DIR}
1641     @refill
1642    
1643    
1644     @item
1645 pcg 1.3 @strong{-d}, @strong{--l=}@emph{LEVEL}
1646 pcg 1.1
1647     Set logging level to @emph{LEVEL} (one of: noise, trace, debug, info, notice, warn, error, critical).
1648     @refill
1649    
1650    
1651     @item
1652 pcg 1.3 @strong{--help}
1653 pcg 1.1
1654     Display short list of options.
1655     @refill
1656    
1657    
1658     @item
1659 pcg 1.3 @strong{-D}, @strong{--no-detach}
1660 pcg 1.1
1661     Don't fork and detach but stay in foreground and log messages to stderr in addition to syslog.
1662     @refill
1663    
1664    
1665     @item
1666 pcg 1.3 @strong{-L}, @strong{--mlock}
1667 pcg 1.1
1668 root 1.5 Lock @t{gvpe} into main memory. This will prevent sensitive data like shared private keys to be written to the system swap files/partitions.
1669 pcg 1.1 @refill
1670    
1671    
1672     @item
1673 pcg 1.3 @strong{--version}
1674 pcg 1.1
1675     Output version information and exit.
1676     @refill
1677     @end itemize
1678    
1679    
1680    
1681     @section SIGNALS
1682    
1683    
1684     @itemize
1685    
1686    
1687     @item
1688 pcg 1.3 HUP
1689 pcg 1.1
1690     Closes/resets all connections, resets the retry time and will start connecting again (it will NOT re-read the config file). This is useful e.g. in a @t{/etc/ppp/if-up} script.
1691     @refill
1692    
1693    
1694     @item
1695 pcg 1.3 TERM
1696 pcg 1.1
1697     Closes/resets all connections and exits.
1698     @refill
1699    
1700    
1701     @item
1702 pcg 1.3 USR1
1703 pcg 1.1
1704     Dump current network status into the syslog (at loglevel @t{notice}, so make sure your loglevel allows this).
1705     @refill
1706     @end itemize
1707    
1708    
1709    
1710     @section FILES
1711    
1712    
1713     @itemize
1714    
1715    
1716     @item
1717 pcg 1.3 @t{/etc/gvpe/gvpe.conf}
1718 pcg 1.1
1719     The configuration file for @t{gvpe}.
1720     @refill
1721    
1722    
1723     @item
1724 pcg 1.3 @t{/etc/gvpe/if-up}
1725 pcg 1.1
1726     Script which is executed as soon as the virtual network device has been allocated. Purpose is to further configure that device.
1727     @refill
1728    
1729    
1730     @item
1731 pcg 1.3 @t{/etc/gvpe/node-up}
1732 pcg 1.1
1733     Script which is executed whenever a node connects to this node. This can be used for example to run nsupdate.
1734     @refill
1735    
1736    
1737     @item
1738 pcg 1.3 @t{/etc/gvpe/node-down}
1739 pcg 1.1
1740     Script which is executed whenever a connection to another node is lost. for example to run nsupdate.
1741     @refill
1742    
1743    
1744     @item
1745 pcg 1.3 @t{/etc/gvpe/pubkey/*}
1746 pcg 1.1
1747     The directory containing the public keys for every node, usually autogenerated by executing @t{gvpectrl --generate-keys}.
1748     @refill
1749    
1750    
1751     @item
1752 pcg 1.3 @t{/var/run/gvpe.pid}
1753 pcg 1.1
1754     The PID of the currently running @t{gvpe} is stored in this file.
1755     @refill
1756     @end itemize
1757    
1758    
1759    
1760     @section BUGS
1761     The cryptography in gvpe has not been thoroughly checked by many people yet. Use it at your own risk!
1762     @refill
1763     If you find any bugs, report them to @t{gvpe@@schmorp.de}.
1764     @refill
1765    
1766    
1767    
1768     @node gvpe.protocol,Simple Example,gvpe,Top
1769    
1770     @chapter gvpe.protocol
1771    
1772     @section The GNU-VPE Protocols
1773    
1774    
1775     @section Overview
1776     GVPE can make use of a number of protocols. One of them is the GNU VPE protocol which is used to authenticate tunnels and send encrypted data packets. This protocol is described in more detail the second part of this document.
1777     @refill
1778 root 1.6 The first part of this document describes the transport protocols which are used by GVPE to send its data packets over the network.
1779 pcg 1.1 @refill
1780    
1781    
1782     @section PART 1: Transport protocols
1783 pcg 1.3 GVPE offers a wide range of transport protocols that can be used to interchange data between nodes. Protocols differ in their overhead, speed, reliability, and robustness.
1784 pcg 1.1 @refill
1785     The following sections describe each transport protocol in more detail. They are sorted by overhead/efficiency, the most efficient transport is listed first:
1786     @refill
1787    
1788    
1789     @subsection RAW IP
1790     This protocol is the best choice, performance-wise, as the minimum overhead per packet is only 38 bytes.
1791     @refill
1792 root 1.5 It works by sending the VPN payload using raw IP frames (using the protocol set by @t{ip-proto}).
1793 pcg 1.1 @refill
1794 root 1.5 Using raw IP frames has the drawback that many firewalls block "unknown" protocols, so this transport only works if you have full IP connectivity between nodes.
1795 pcg 1.1 @refill
1796    
1797    
1798     @subsection ICMP
1799 pcg 1.3 This protocol offers very low overhead (minimum 42 bytes), and can sometimes tunnel through firewalls when other protocols can not.
1800 pcg 1.1 @refill
1801 root 1.5 It works by prepending an ICMP header with type @t{icmp-type} and a code of @t{255}. The default @t{icmp-type} is @t{echo-reply}, so the resulting packets look like echo replies, which looks rather strange to network administrators.
1802 pcg 1.1 @refill
1803 root 1.5 This transport should only be used if other transports (i.e. raw IP) are not available or undesirable (due to their overhead).
1804 pcg 1.1 @refill
1805    
1806    
1807     @subsection UDP
1808     This is a good general choice for the transport protocol as UDP packets tunnel well through most firewalls and routers, and the overhead per packet is moderate (minimum 58 bytes).
1809     @refill
1810     It should be used if RAW IP is not available.
1811     @refill
1812    
1813    
1814     @subsection TCP
1815 root 1.6 This protocol is a very bad choice, as it not only has high overhead (more than 60 bytes), but the transport also retries on its own, which leads to congestion when the link has moderate packet loss (as both the TCP transport and the tunneled traffic will retry, increasing congestion more and more). It also has high latency and is quite inefficient.
1816 pcg 1.1 @refill
1817     It's only useful when tunneling through firewalls that block better protocols. If a node doesn't have direct internet access but a HTTP proxy that supports the CONNECT method it can be used to tunnel through a web proxy. For this to work, the @t{tcp-port} should be @t{443} (@t{https}), as most proxies do not allow connections to other ports.
1818     @refill
1819     It is an abuse of the usage a proxy was designed for, so make sure you are allowed to use it for GVPE.
1820     @refill
1821 pcg 1.3 This protocol also has server and client sides. If the @t{tcp-port} is set to zero, other nodes cannot connect to this node directly. If the @t{tcp-port} is non-zero, the node can act both as a client as well as a server.
1822 pcg 1.1 @refill
1823    
1824    
1825     @subsection DNS
1826     @strong{WARNING:} Parsing and generating DNS packets is rather tricky. The code almost certainly contains buffer overflows and other, likely exploitable, bugs. You have been warned.
1827     @refill
1828     This is the worst choice of transport protocol with respect to overhead (overhead can be 2-3 times higher than the transferred data), and latency (which can be many seconds). Some DNS servers might not be prepared to handle the traffic and drop or corrupt packets. The client also has to constantly poll the server for data, so the client will constantly create traffic even if it doesn't need to transport packets.
1829     @refill
1830     In addition, the same problems as the TCP transport also plague this protocol.
1831     @refill
1832 root 1.6 Its only use is to tunnel through firewalls that do not allow direct internet access. Similar to using a HTTP proxy (as the TCP transport does), it uses a local DNS server/forwarder (given by the @t{dns-forw-host} configuration value) as a proxy to send and receive data as a client, and an @t{NS} record pointing to the GVPE server (as given by the @t{dns-hostname} directive).
1833 pcg 1.1 @refill
1834 root 1.5 The only good side of this protocol is that it can tunnel through most firewalls mostly undetected, iff the local DNS server/forwarder is sane (which is true for most routers, wireless LAN gateways and nameservers).
1835 pcg 1.1 @refill
1836 root 1.5 Fine-tuning needs to be done by editing @t{src/vpn_dns.C} directly.
1837 pcg 1.1 @refill
1838    
1839    
1840     @section PART 2: The GNU VPE protocol
1841     This section, unfortunately, is not yet finished, although the protocol is stable (until bugs in the cryptography are found, which will likely completely change the following description). Nevertheless, it should give you some overview over the protocol.
1842     @refill
1843    
1844    
1845     @subsection Anatomy of a VPN packet
1846 root 1.5 The exact layout and field lengths of a VPN packet is determined at compile time and doesn't change. The same structure is used for all transport protocols, be it RAWIP or TCP.
1847 pcg 1.1 @refill
1848    
1849    
1850     @example
1851     +------+------+--------+------+
1852     | HMAC | TYPE | SRCDST | DATA |
1853     +------+------+--------+------+
1854     @end example
1855    
1856 root 1.6 The HMAC field is present in all packets, even if not used (e.g. in auth request packets), in which case it is set to all zeroes. The MAC itself is calculated over the TYPE, SRCDST and DATA fields in all cases.
1857 pcg 1.1 @refill
1858     The TYPE field is a single byte and determines the purpose of the packet (e.g. RESET, COMPRESSED/UNCOMPRESSED DATA, PING, AUTH REQUEST/RESPONSE, CONNECT REQUEST/INFO etc.).
1859     @refill
1860 pcg 1.3 SRCDST is a three byte field which contains the source and destination node IDs (12 bits each).
1861 pcg 1.1 @refill
1862     The DATA portion differs between each packet type, naturally, and is the only part that can be encrypted. Data packets contain more fields, as shown:
1863     @refill
1864    
1865    
1866     @example
1867     +------+------+--------+------+-------+------+
1868     | HMAC | TYPE | SRCDST | RAND | SEQNO | DATA |
1869     +------+------+--------+------+-------+------+
1870     @end example
1871    
1872     RAND is a sequence of fully random bytes, used to increase the entropy of the data for encryption purposes.
1873     @refill
1874 root 1.6 SEQNO is a 32-bit sequence number. It is negotiated at every connection initialization and starts at some random 31 bit value. GVPE currently uses a sliding window of 512 packets/sequence numbers to detect reordering, duplication and replay attacks.
1875     @refill
1876     The encryption is done on RAND+SEQNO+DATA in CBC mode with zero IV (or, equivalently, the IV is RAND+SEQNO, encrypted with the block cipher, unless RAND size is decreased or increased over the default value).
1877     @refill
1878     The random prefix itself is generated by using AES in CTR mode with a random key and starting value, which should make them unpredictable even before encrypting them again. The sequence number additionally ensures that the IV is unique.
1879 pcg 1.1 @refill
1880    
1881    
1882 root 1.6 @subsection The authentication/key exchange protocol
1883 root 1.5 Before nodes can exchange packets, they need to establish authenticity of the other side and a key. Every node has a private RSA key and the public RSA keys of all other nodes.
1884 pcg 1.1 @refill
1885 root 1.6 When a node wants to establish a connection to another node, it sends an RSA-OEAP-encrypted challenge and an ECDH (curve25519) key. The other node replies with its own ECDH key and a HKDF of the challenge and both ECDH keys to prove its identity.
1886     @refill
1887     The remote node enganges in exactly the same protocol. When both nodes have exchanged their challenge and verified the response, they calculate a cipher key and a HMAC key and start exchanging data packets.
1888     @refill
1889     In detail, the challenge consist of:
1890     @refill
1891    
1892    
1893     @example
1894     RSA-OAEP (SEQNO MAC CIPHER SALT EXTRA-AUTH) ECDH1
1895     @end example
1896    
1897     That is, it encrypts (with the public key of the remote node) an initial sequence number for data packets, key material for the HMAC key, key material for the cipher key, a salt used by the HKDF (as shown later) and some extra random bytes that are unused except for authentication. It also sends the public key of a curve25519 exchange.
1898     @refill
1899     The remote node decrypts the RSA data, generates its own ECDH key (ECDH2), and replies with:
1900     @refill
1901    
1902    
1903     @example
1904     HKDF-Expand (HKDF-Extract (ECDH2, RSA), ECDH1, AUTH_DIGEST_SIZE) ECDH2
1905     @end example
1906    
1907     That is, it extracts from the decrypted RSA challenge, using its ECDH key as salt, and then expands using the requesting node's ECDH1 key. The resulting hash is returned as a proof that the node could decrypt the RSA challenge data, together with the ECDH key.
1908     @refill
1909     After both nodes have done this to each other, they calculate the shared ECDH secret, cipher and HMAC keys for the session (each node generates two cipher and HMAC keys, one for sending and one for receiving).
1910     @refill
1911     The HMAC key for sending is generated as follow:
1912     @refill
1913    
1914    
1915     @example
1916     HMAC_KEY = HKDF-Expand (HKDF-Extract (REMOTE_SALT, MAC ECDH_SECRET), info, HMAC_MD_SIZE)
1917     @end example
1918    
1919     It extracts from MAC and ECDH_SECRET using the @emph{remote} SALT, then expands using a static info string.
1920 pcg 1.1 @refill
1921 root 1.6 The cipher key is generated in the same way, except using the CIPHER part of the original challenge.
1922 pcg 1.1 @refill
1923 root 1.6 The result of this process is to authenticate each node to the other node, while exchanging keys using both RSA and ECDH, the latter providing perfect forward secrecy.
1924 pcg 1.1 @refill
1925 root 1.6 The protocol has been overdesigned where this was possible without increasing implementation complexity, in an attempt to protect against implementation or protocol failures. For example, if the ECDH challenge was found to be flawed, perfect forward secrecy would be lost, but the data would likely still be protected. Likewise, standard algorithms and implementations are used where possible.
1926 pcg 1.1 @refill
1927    
1928    
1929     @subsection Retrying
1930 root 1.5 When there is no response to an auth request, the node will send auth requests in bursts with an exponential back-off. After some time it will resort to PING packets, which are very small (8 bytes + protocol header) and lightweight (no RSA operations required). A node that receives ping requests from an unconnected peer will respond by trying to create a connection.
1931 pcg 1.1 @refill
1932 root 1.5 In addition to the exponential back-off, there is a global rate-limit on a per-IP base. It allows long bursts but will limit total packet rate to something like one control packet every ten seconds, to avoid accidental floods due to protocol problems (like a RSA key file mismatch between two nodes).
1933 pcg 1.1 @refill
1934 pcg 1.3 The intervals between retries are limited by the @t{max-retry} configuration value. A node with @t{connect} = @t{always} will always retry, a node with @t{connect} = @t{ondemand} will only try (and re-try) to connect as long as there are packets in the queue, usually this limits the retry period to @t{max-ttl} seconds.
1935     @refill
1936     Sending packets over the VPN will reset the retry intervals as well, which means as long as somebody is trying to send packets to a given node, GVPE will try to connect every few seconds.
1937     @refill
1938 pcg 1.1
1939    
1940     @subsection Routing and Protocol translation
1941 root 1.6 The GVPE routing algorithm is easy: there isn't much routing to speak of: When routing packets to another node, GVPE tries the following options, in order:
1942 pcg 1.1 @refill
1943 pcg 1.3
1944    
1945     @itemize
1946    
1947    
1948     @item
1949 root 1.5 If the two nodes should be able to reach each other directly (common protocol, port known), then GVPE will send the packet directly to the other node.
1950 pcg 1.3
1951    
1952    
1953     @item
1954     If this isn't possible (e.g. because the node doesn't have a @t{hostname} or known port), but the nodes speak a common protocol and a router is available, then GVPE will ask a router to "mediate" between both nodes (see below).
1955    
1956    
1957    
1958     @item
1959     If a direct connection isn't possible (no common protocols) or forbidden (@t{deny-direct}) and there are any routers, then GVPE will try to send packets to the router with the highest priority that is connected already @emph{and} is able (as specified by the config file) to connect directly to the target node.
1960    
1961    
1962    
1963     @item
1964     If no such router exists, then GVPE will simply send the packet to the node with the highest priority available.
1965    
1966    
1967    
1968     @item
1969     Failing all that, the packet will be dropped.
1970    
1971     @end itemize
1972    
1973 root 1.6 A host can usually declare itself unreachable directly by setting its port number(s) to zero. It can declare other hosts as unreachable by using a config-file that disables all protocols for these other hosts. Another option is to disable all protocols on that host in the other config files.
1974 pcg 1.1 @refill
1975 root 1.5 If two hosts cannot connect to each other because their IP address(es) are not known (such as dial-up hosts), one side will send a @emph{mediated} connection request to a router (routers must be configured to act as routers!), which will send both the originating and the destination host a connection info request with protocol information and IP address of the other host (if known). Both hosts will then try to establish a direct connection to the other peer, which is usually possible even when both hosts are behind a NAT gateway.
1976 pcg 1.1 @refill
1977 root 1.6 Routing via other nodes works because the SRCDST field is not encrypted, so the router can just forward the packet to the destination host. Since each host uses its own private key, the router will not be able to decrypt or encrypt packets, it will just act as a simple router and protocol translator.
1978 pcg 1.1 @refill
1979    
1980    
1981    
1982     @node Simple Example,Complex Example,gvpe.protocol,Top
1983    
1984     @chapter Simple Example
1985     In this example, gvpe is used to implement a simple, UDP-based ethernet on three hosts.
1986     @refill
1987     The config file (@t{gvpe.conf}) is the same on all hosts:
1988     @refill
1989    
1990    
1991     @example
1992     enable-udp = yes # use UDP
1993     udp-port = 407 # use this UDP port
1994     mtu = 1492 # handy for TDSL
1995     ifname = vpn0 # I prefer vpn0 over e.g. tap0
1996    
1997     node = huffy # arbitrary node name
1998     hostname = 1.2.3.4 # ip address if this host
1999    
2000     node = welshy
2001     hostname = www.example.net # resolve at connection time
2002    
2003     node = wheelery
2004     # no hostname, will be determinded dynamically using router1 or router2
2005     @end example
2006    
2007     @t{gvpe} will execute the @t{if-up} script on every hosts, which, for linux, could look like this for all three hosts:
2008     @refill
2009    
2010    
2011     @example
2012     ifconfig $IFNAME hw ether $MAC mtu $MTU
2013     ifconfig $IFNAME 10.0.0.$NODE
2014     route add -net 10.0.0.0 netmask 255.0.0.0 dev $IFNAME
2015     @end example
2016    
2017     The @t{10.0.0.$NODE} resolves to @t{10.0.0.1} on @t{huffy}, @t{10.0.0.2} on @t{welshy} and so on. Other schemes, such as @t{10.$NODE.0.1} might be useful, too.
2018     @refill
2019     After generating the keys (gvpectrl) and starting the daemon (@t{gvpe -D -l info }@emph{NODENAME} for test purposes) the three hosts should be able to ping each other.
2020     @refill
2021     If you have an internal @t{10.x.x.x} network (with a tighter netmask then @t{255.0.0.0}, e.g. @t{10.1.0.0} on @t{huffy}, @t{10.2.0.0} on @t{welshy} and so on), you can now enable ip-forwarding and proxy-arp (or set the hosts as default gateway), and your three hosts should forward traffic from each network to each other.
2022     @refill
2023    
2024    
2025     @node Complex Example,complex/gvpe.conf,Simple Example,Top
2026    
2027     @chapter Complex Example
2028     These files are configuration files for "our" internal network.
2029    
2030     It is highly non-trivial, so don't use this configuration as the basis of
2031     your network unless you know what you are doing.
2032    
2033     It features: around 30 hosts, many of them have additional networks behind
2034     them and use an assortment of different tunneling protocols. The vpn is
2035     fully routed, no arp is used at all.
2036    
2037     The public IP addresses of connecting nodes are automatically registered
2038     via dns on the node ruth, using a node-up/node-down script.
2039    
2040     And last not least: the if-up script can generate information to be used
2041     in firewall rules (IP-net/MAC-address pairs) so ensure packet integrity so
2042     you can use your iptables etc. firewall to filter by IP address only.
2043    
2044     @menu
2045     * complex/gvpe.conf:: An example gvpe configuration
2046     * complex/if-up:: A fully-routing if-up config
2047     * complex/node-up:: A node-up/node-down script utilizing dynds
2048     @end menu
2049    
2050    
2051     @node complex/gvpe.conf,complex/if-up,Complex Example,Complex Example
2052    
2053     @chapter complex/gvpe.conf
2054    
2055    
2056     @example
2057     # sample configfile
2058     # the config file must be exactly(!) the same on all nodes
2059    
2060     rekey = 54321 # the rekeying interval
2061     keepalive = 300 # the keepalive interval
2062     on ruth keepalive = 120 # ruth is important and demands lower keepalives
2063     on surfer keepalive = 40
2064     mtu = 1492 # the mtu (minimum mtu of attached host)
2065     ifname = vpn0 # the tunnel interface name to use
2066     ifpersist = no # the tun device should be persistent
2067     inherit-tos = yes # should tunnel packets inherit tos flags?
2068     compress = yes # wether compression should be used (NYI)
2069     connect = ondemand # connect to this host always/never or ondemand
2070     router-priority = 1 # route for everybody - if necessary
2071    
2072     loglevel = notice # info logs connects, notice only important messages
2073     on mobil loglevel = info
2074     on doom loglevel = info
2075     on ruth loglevel = info
2076    
2077     udp-port = 407 # the udp port to use for sending/receiving packets
2078     tcp-port = 443 # the tcp port to listen for connections (we use https over proxy)
2079     ip-proto = 50 # (ab)use the ipsec protocol as rawip
2080     icmp-type = 0 # (ab)use echo replies for tunneling
2081     enable-udp = yes # udp is spoken almost everywhere
2082     enable-tcp = no # tcp is not spoken everywhere
2083     enable-rawip = no # rawip is not spoken everywhere
2084     enable-icmp = no # most hosts don't bother to icmp
2085    
2086     # every "node =" introduces a new node in the network
2087     # the options following it don't set defaults but are
2088     # node-specific.
2089    
2090     # marc@@lap
2091     node = mobil
2092    
2093     # marc@@home
2094     node = doom
2095     enable-rawip = yes
2096     enable-tcp = yes
2097    
2098     # marc@@uni
2099     node = ruth
2100     enable-rawip = yes
2101     enable-tcp = yes
2102     enable-icmp = yes
2103     hostname = 200.100.162.95
2104     connect = always
2105     router-priority = 30
2106     on ruth node-up = node-up
2107     on ruth node-down = node-up
2108    
2109     # marc@@mu
2110     node = frank
2111     enable-rawip = yes
2112     hostname = 44.88.167.250
2113     router-priority = 20
2114     connect = always
2115    
2116     # nethype
2117     node = rain
2118     enable-rawip = yes
2119     hostname = 145.253.105.130
2120     router-priority = 10
2121     connect = always
2122    
2123     # marco@@home
2124     node = marco
2125     enable-rawip = yes
2126    
2127     # stefan@@ka
2128     node = wappla
2129     connect = never
2130    
2131     # stefan@@lap
2132     node = stefan
2133     udp-port = 408
2134     connect = never
2135    
2136     # paul@@wg
2137     node = n8geil
2138     on ruth enable-icmp = yes
2139     on n8geil enable-icmp = yes
2140     enable-udp = no
2141    
2142     # paul@@lap
2143     node = syrr
2144    
2145     # paul@@lu
2146     node = donomos
2147    
2148     # marco@@hn
2149     node = core
2150    
2151     # elmex@@home
2152     node = elmex
2153     enable-rawip = yes
2154     hostname = 100.251.143.181
2155    
2156     # stefan@@kwc.at
2157     node = fwkw
2158     connect = never
2159     on stefan connect = always
2160     on wappla connect = always
2161     hostname = 182.73.81.146
2162    
2163     # elmex@@home
2164     node = jungfrau
2165     enable-rawip = yes
2166    
2167     # uni main router
2168     node = surfer
2169     enable-rawip = yes
2170     enable-tcp = no
2171     enable-icmp = yes
2172     hostname = 200.100.162.79
2173     connect = always
2174     router-priority = 40
2175    
2176     # jkneer@@marvin
2177     node = marvin
2178     enable-rawip = yes
2179     enable-udp = no
2180    
2181     # jkneer@@entrophy
2182     node = entrophy
2183     enable-udp = no
2184     enable-tcp = yes
2185    
2186     # mr. primitive
2187     node = voyager
2188     enable-udp = no
2189     enable-tcp = no
2190     on voyager enable-tcp = yes
2191     on voyager enable-udp = yes
2192    
2193     # v-server (barbados.dn-systems.de)
2194     #node = vserver
2195     #enable-udp = yes
2196     #hostname = 193.108.181.74
2197     @end example
2198    
2199    
2200    
2201     @node complex/if-up,complex/node-up,complex/gvpe.conf,Complex Example
2202    
2203     @chapter complex/if-up
2204    
2205    
2206     @example
2207     #!/bin/bash
2208    
2209     # Some environment variables will be set:
2210     #
2211     # CONFBASE=/etc/vpe # the configuration directory prefix
2212     # IFNAME=vpn0 # the network interface (ifname)
2213     # MAC=fe:fd:80:00:00:01 # the mac-address to use for the interface
2214     # NODENAME=cerebro # the selected nodename (-n switch)
2215     # NODEID=1 # the numerical node id
2216     # MTU=1436 # the tunnel packet overhead (set mtu to 1500-$OVERHEAD)
2217    
2218     # this if-up script is rather full-featured, and is used to
2219     # generate a fully-routed (no arp traffic) vpn. the main portion
2220     # consists of "ipn" calls (see below).
2221    
2222     # some hosts require additional specific configuration, this is handled
2223     # using if statements near the end of the script.
2224    
2225     # with the --fw switch, outputs mac/net pairs for your firewall use:
2226     # if-up --fw | while read mac net; do
2227     # iptables -t filter -A INPUT -i vpn0 -p all -m mac --mac-source \! $mac -s $net -j DROP
2228     # done
2229    
2230     ipn() @{
2231     local id="$1"; shift
2232     local mac=fe:fd:80:00:00:$(printf "%02x" $id)
2233     if [ -n "$FW" ]; then
2234     for net in "$@@"; do
2235     echo "$mac $net"
2236     done
2237     else
2238     local ip="$1"; shift
2239     if [ "$id" == $NODEID ]; then
2240     [ -n "$ADDR_ONLY" ] && ip addr add $ip broadcast 10.255.255.255 dev $IFNAME
2241     elif [ -z "$ADDR_ONLY" ]; then
2242     ip neighbour add $ip lladdr $mac nud permanent dev $IFNAME
2243     for route in "$@@"; do
2244     ip route add $route via $ip dev vpn0
2245     done
2246     fi
2247     fi
2248     @}
2249    
2250     ipns() @{
2251     # this contains the generic routing information for the vpn
2252     # each call to ipn has the following parameters:
2253     # ipn <node-id> <gateway-ip> [<route> ...]
2254     # the second line (ipn 2) means:
2255     # the second node (doom in the config file) has the ip address 10.0.0.5,
2256     # which is the gateway for the 10.0/28 network and three additional ip
2257     # addresses
2258    
2259     ipn 1 10.0.0.20
2260     ipn 2 10.0.0.5 10.0.0.0/28 #200.100.162.92 200.100.162.93 100.99.218.222
2261     ipn 3 10.0.0.17
2262     ipn 4 10.0.0.18
2263     ipn 5 10.0.0.19 10.3.0.0/16
2264     ipn 6 10.0.0.21 10.0.2.0/26 #200.100.162.17
2265     ipn 7 10.0.0.22 10.1.2.0/24 # wappla, off
2266     ipn 8 10.0.0.23 # stefan, off
2267     ipn 9 10.0.0.24 10.13.0.0/16
2268     ipn 10 10.0.0.25
2269     ipn 11 10.0.0.26
2270     ipn 12 10.0.0.27 10.0.2.64/26
2271     ipn 13 10.0.0.28 10.0.3.0/24
2272     ipn 14 10.0.0.29 10.1.1.0/24 # fwkw, off
2273     # mind the gateway ip gap
2274     ipn 15 10.9.0.30 10.0.4.0/24
2275     ipn 16 10.9.0.31
2276     ipn 17 10.9.0.32 10.42.0.0/16
2277     ipn 18 10.9.0.33
2278     ipn 19 10.9.0.34
2279     #ipn 20 10.9.0.35
2280     @}
2281    
2282     if [ "$1" == "--fw" ]; then
2283     FW=1
2284    
2285     ipns
2286     else
2287     exec >/var/log/vpe.if-up 2>&1
2288     set -x
2289    
2290     [ $NODENAME = "ruth" ] && ip link set $IFNAME down # hack
2291    
2292     # first set the link up and initialize the interface ip
2293     # address.
2294     ip link set $IFNAME address $MAC
2295     ip link set $IFNAME mtu $MTU up
2296     ADDR_ONLY=1 ipns # set addr only
2297    
2298     # now initialize the main vpn routes (10.0/8)
2299     # the second route is a hack to to reach some funnily-connected
2300     # machines.
2301     ip route add 10.0.0.0/8 dev $IFNAME
2302     ip route add 10.0.0.0/27 dev $IFNAME
2303    
2304     ipns # set the interface routes
2305    
2306     # now for something completely different, ehr, something not
2307     # easily doable with ipn, namely some extra specific highly complicated
2308     # and non-regular setups for some machines.
2309     if [ $NODENAME = doom ]; then
2310     ip addr add 200.100.162.92 dev $IFNAME
2311     ip route add 200.100.0.0/16 via 10.0.0.17 dev $IFNAME
2312     ip route flush table 101
2313     ip route add table 101 default src 200.100.162.92 via 10.0.0.17 dev $IFNAME
2314    
2315     ip addr add 100.99.218.222 dev $IFNAME
2316     ip route add 100.99.218.192/27 via 10.0.0.19 dev $IFNAME
2317     ip route flush table 103
2318     ip route add table 103 default src 100.99.218.222 via 10.0.0.19
2319    
2320     elif [ $NODENAME = marco ]; then
2321     ip addr add 200.100.162.17 dev $IFNAME
2322    
2323     for addr in 79 89 90 91 92 93 94 95; do
2324     ip route add 200.100.162.$addr dev ppp0
2325     done
2326     ip route add 200.100.76.0/23 dev ppp0
2327     ip route add src 200.100.162.17 200.100.0.0/16 via 10.0.0.17 dev $IFNAME
2328    
2329     elif [ $NODENAME = ruth ]; then
2330     ip route add 200.100.162.17 via 10.0.0.21 dev vpn0
2331     ip route add 200.100.162.92 via 10.0.0.5 dev vpn0
2332     ip route add 200.100.162.93 via 10.0.0.5 dev vpn0
2333    
2334     fi
2335    
2336     # and this is the second part of the 10.0/27 hack. don't ask.
2337     [ $NODENAME != fwkw ] && ip route add 10.0.0.0/24 via 10.0.0.29 dev $IFNAME
2338     fi
2339     @end example
2340    
2341    
2342    
2343     @node complex/node-up,Index,complex/if-up,Complex Example
2344    
2345     @chapter complex/node-up
2346    
2347    
2348     @example
2349     #!/bin/sh
2350    
2351     # Some environment variables will be set (in addition the ones
2352     # set in if-up, too):
2353     #
2354     # DESTNODE=doom # others nodename
2355     # DESTID=5 # others node id
2356     # DESTIP=188.13.66.8 # others ip
2357     # DESTPORT=407 # others port
2358     # STATE=up/down # node-up gets UP, node-down script gets DOWN
2359    
2360     if [ $STATE = up ]; then
2361     @{
2362     echo update delete $DESTNODE.lowttl.example.com. a
2363     echo update delete $DESTNODE-last.lowttl.example.com. a
2364     echo update add $DESTNODE.lowttl.example.com. 1 in a $DESTIP
2365     echo update add $DESTNODE-last.lowttl.example.com. 1 in a $DESTIP
2366     echo
2367     @} | nsupdate -d -k $CONFBASE:marc.example.net.
2368     else
2369     @{
2370     echo update delete $DESTNODE.lowttl.example.com. a
2371     echo update delete $DESTNODE-last.lowttl.example.com. a
2372     echo update add $DESTNODE-last.lowttl.example.com. 1 in a $DESTIP
2373     echo
2374     @} | nsupdate -d -k $CONFBASE:marc.example.net.
2375     fi
2376     @end example
2377    
2378    
2379    
2380     @node Index,,complex/node-up,Top
2381    
2382     @chapter Index
2383     @printindex cp
2384    
2385    
2386    
2387     @bye
2388