Remove unused stuff from doc/.
[tinc] / doc / tinc.texi
1 \input texinfo   @c -*-texinfo-*-
2 @c $Id: tinc.texi,v 1.8.4.43 2003/08/08 14:07:12 guus Exp $
3 @c %**start of header
4 @setfilename tinc.info
5 @settitle tinc Manual
6 @setchapternewpage odd
7 @c %**end of header
8
9 @include tincinclude.texi
10
11 @ifinfo
12 @dircategory Networking tools
13 @direntry
14 * tinc: (tinc).              The tinc Manual.
15 @end direntry
16
17 This is the info manual for @value{PACKAGE} version @value{VERSION}, a Virtual Private Network daemon.
18
19 Copyright @copyright{} 1998-2003 Ivo Timmermans
20 <ivo@@o2w.nl>, Guus Sliepen <guus@@sliepen.eu.org> and
21 Wessel Dankers <wsl@@nl.linux.org>.
22
23 $Id: tinc.texi,v 1.8.4.43 2003/08/08 14:07:12 guus Exp $
24
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 tinc Manual
38 @subtitle Setting up a Virtual Private Network with tinc
39 @author Ivo Timmermans and Guus Sliepen
40
41 @page
42 @vskip 0pt plus 1filll
43 @cindex copyright
44 This is the info manual for @value{PACKAGE} version @value{VERSION}, a Virtual Private Network daemon.
45
46 Copyright @copyright{} 1998-2003 Ivo Timmermans
47 <ivo@@o2w.nl>, Guus Sliepen <guus@@sliepen.eu.org> and
48 Wessel Dankers <wsl@@nl.linux.org>.
49
50 $Id: tinc.texi,v 1.8.4.43 2003/08/08 14:07:12 guus Exp $
51
52 Permission is granted to make and distribute verbatim copies of this
53 manual provided the copyright notice and this permission notice are
54 preserved on all copies.
55
56 Permission is granted to copy and distribute modified versions of this
57 manual under the conditions for verbatim copying, provided that the
58 entire resulting derived work is distributed under the terms of a
59 permission notice identical to this one.
60
61 @end titlepage
62
63 @c ==================================================================
64 @node Top, Introduction, (dir), (dir)
65
66 @menu
67 * Introduction::                Introduction
68 * Preparations::
69 * Installation::
70 * Configuration::
71 * Running tinc::
72 * Technical information::
73 * About us::
74 * Concept Index::               All used terms explained
75 @end menu
76
77
78 @contents
79
80 @c ==================================================================
81 @node    Introduction, Preparations, Top, Top
82 @chapter Introduction
83
84 @cindex tinc
85 tinc is a Virtual Private Network (VPN) daemon that uses tunneling and
86 encryption to create a secure private network between hosts on the
87 Internet.
88
89 Because the tunnel appears to the IP level network code as a normal
90 network device, there is no need to adapt any existing software.
91 The encrypted tunnels allows VPN sites to share information with each other
92 over the Internet without exposing any information to others.
93
94 This document is the manual for tinc.  Included are chapters on how to
95 configure your computer to use tinc, as well as the configuration
96 process of tinc itself.
97
98 @menu
99 * VPNs::                        Virtual Private Networks in general
100 * tinc::                        about tinc
101 * Supported platforms::
102 @end menu
103
104 @c ==================================================================
105 @node    VPNs, tinc, Introduction, Introduction
106 @section Virtual Private Networks
107
108 @cindex VPN
109 A Virtual Private Network or VPN is a network that can only be accessed
110 by a few elected computers that participate.  This goal is achievable in
111 more than just one way.
112
113 @cindex private
114 Private networks can consist of a single stand-alone Ethernet LAN.  Or
115 even two computers hooked up using a null-modem cable.  In these cases,
116 it is
117 obvious that the network is @emph{private}, no one can access it from the
118 outside.  But if your computers are linked to the Internet, the network
119 is not private anymore, unless one uses firewalls to block all private
120 traffic.  But then, there is no way to send private data to trusted
121 computers on the other end of the Internet.
122
123 @cindex virtual
124 This problem can be solved by using @emph{virtual} networks.  Virtual
125 networks can live on top of other networks, but they use encapsulation to
126 keep using their private address space so they do not interfere with
127 the Internet.  Mostly, virtual networks appear like a singe LAN, even though
128 they can span the entire world.  But virtual networks can't be secured
129 by using firewalls, because the traffic that flows through it has to go
130 through the Internet, where other people can look at it.
131
132 As is the case with either type of VPN, anybody could eavesdrop.  Or
133 worse, alter data.  Hence it's probably advisable to encrypt the data
134 that flows over the network.
135
136 When one introduces encryption, we can form a true VPN.  Other people may
137 see encrypted traffic, but if they don't know how to decipher it (they
138 need to know the key for that), they cannot read the information that flows
139 through the VPN.  This is what tinc was made for.
140
141
142 @c ==================================================================
143 @node    tinc, Supported platforms, VPNs, Introduction
144 @section tinc
145
146 @cindex vpnd
147 I really don't quite remember what got us started, but it must have been
148 Guus' idea.  He wrote a simple implementation (about 50 lines of C) that
149 used the ethertap device that Linux knows of since somewhere
150 about kernel 2.1.60.  It didn't work immediately and he improved it a
151 bit.  At this stage, the project was still simply called @samp{vpnd}.
152
153 Since then, a lot has changed---to say the least.
154
155 @cindex tincd
156 tinc now supports encryption, it consists of a single daemon (tincd) for
157 both the receiving and sending end, it has become largely
158 runtime-configurable---in short, it has become a full-fledged
159 professional package.
160
161 @cindex Traditional VPNs
162 @cindex scalability
163 tinc also allows more than two sites to connect to eachother and form a single VPN.
164 Traditionally VPNs are created by making tunnels, which only have two endpoints.
165 Larger VPNs with more sites are created by adding more tunnels.
166 tinc takes another approach: only endpoints are specified,
167 the software itself will take care of creating the tunnels.
168 This allows for easier configuration and improved scalability.
169
170 A lot can---and will be---changed. We have a number of things that we would like to
171 see in the future releases of tinc.  Not everything will be available in
172 the near future.  Our first objective is to make tinc work perfectly as
173 it stands, and then add more advanced features.
174
175 Meanwhile, we're always open-minded towards new ideas.  And we're
176 available too.
177
178
179 @c ==================================================================
180 @node    Supported platforms,  , tinc, Introduction
181 @section Supported platforms
182
183 @cindex platforms
184 tinc has been verified to work under Linux, FreeBSD, OpenBSD, NetBSD, MacOS/X (Darwin), Solaris, and Windows (in a Cygwin environment),
185 with various hardware architectures.  These are some of the platforms
186 that are supported by the universal tun/tap device driver or other virtual network device drivers.
187 Without such a driver, tinc will most
188 likely compile and run, but it will not be able to send or receive data
189 packets.
190
191 @cindex release
192 For an up to date list of supported platforms, please check the list on
193 our website:
194 @uref{http://tinc.nl.linux.org/platforms}.
195
196
197 @c ==================================================================
198 @subsection Linux
199
200 @cindex Linux
201 tinc was first written for Linux running on an intel x86 processor, so
202 this is the best supported platform.  The protocol however, and actually
203 anything about tinc, has been rewritten to support random byte ordering
204 and arbitrary word length.  So in theory it should run on other
205 processors that Linux runs on.  It has already been verified to run on
206 alpha and sparc processors as well.
207
208 tinc uses the ethertap device or the universal tun/tap driver. The former is provided in the standard kernel
209 from version 2.1.60 up to 2.3.x, but has been replaced in favour of the tun/tap driver in kernel versions 2.4.0 and later.
210
211
212 @c ==================================================================
213 @subsection FreeBSD
214
215 @cindex FreeBSD
216 tinc on FreeBSD relies on the universal tun/tap driver for its data
217 acquisition from the kernel.  Therefore, tinc will work on the same platforms
218 as this driver.  These are: FreeBSD 3.x, 4.x, 5.x.
219
220
221 @c ==================================================================
222 @subsection OpenBSD
223
224 @cindex OpenBSD
225 tinc on OpenBSD relies on the tun driver for its data
226 acquisition from the kernel. It has been verified to work under at least OpenBSD 2.9.
227
228 Tunneling IPv6 packets may not work on OpenBSD.
229
230
231 @c ==================================================================
232 @subsection Solaris
233
234 @c ==================================================================
235 @subsection NetBSD
236
237 @cindex NetBSD
238 tinc on NetBSD relies on the tun driver for its data
239 acquisition from the kernel. It has been verified to work under at least NetBSD 1.5.2.
240
241 Tunneling IPv6 does not work on OpenBSD.
242
243
244 @c ==================================================================
245 @subsection Solaris
246
247 @cindex Solaris
248 tinc on Solaris relies on the universal tun/tap driver for its data
249 acquisition from the kernel.  Therefore, tinc will work on the same platforms
250 as this driver.  These are: Solaris 8 (SunOS 5.8).
251
252 IPv6 packets cannot be tunneled on Solaris.
253
254 @c ==================================================================
255 @subsection Darwin (MacOS/X)
256
257 @cindex Darwin
258 @cindex MacOS/X
259 tinc on Darwin relies on the tunnel driver for its data
260 acquisition from the kernel. This driver is not part of Darwin but can be
261 downloaded from @uref{http://chrisp.de/en/projects/tunnel.html}.
262
263 IPv6 packets cannot be tunneled on Darwin.
264
265 @c ==================================================================
266 @subsection Cygwin (Windows)
267
268 @cindex Cygwin
269 @cindex Windows
270 tinc on Windows, in a Cygwin environment, relies on the CIPE driver for its data
271 acquisition from the kernel. This driver is not part of Windows but can be
272 downloaded from @uref{http://cipe-win32.sourceforge.net/}.
273
274 @c ==================================================================
275 @subsection MinGW (Windows)
276
277 @cindex MinGW
278 @cindex Windows
279 tinc on Windows (native), compiled using MinGW, relies on the CIPE driver for its data
280 acquisition from the kernel. This driver is not part of Windows but can be
281 downloaded from @uref{http://cipe-win32.sourceforge.net/}.
282
283
284 @c
285 @c
286 @c
287 @c
288 @c
289 @c
290 @c       Preparing your system
291 @c
292 @c
293 @c
294 @c
295 @c
296
297 @c ==================================================================
298 @node    Preparations, Installation, Introduction, Top
299 @chapter Preparations
300
301 This chapter contains information on how to prepare your system to
302 support tinc.
303
304 @menu
305 * Configuring the kernel::
306 * Libraries::
307 @end menu
308
309
310 @c ==================================================================
311 @node    Configuring the kernel, Libraries, Preparations, Preparations
312 @section Configuring the kernel
313
314 @cindex RedHat
315 @cindex Debian
316 @cindex netlink_dev
317 @cindex tun
318 @cindex ethertap
319 If you are running Linux, chances are good that your kernel already supports
320 all the devices that tinc needs for proper operation.  For example, the
321 standard kernel from Redhat Linux already has support for ethertap and netlink
322 compiled in.  Debian users can use the modconf utility to select the modules.
323 If your Linux distribution supports this method of selecting devices, look out
324 for something called `ethertap', and `netlink_dev' if it is using a kernel
325 version prior to 2.4.0. In that case you will need both these devices.  If you
326 are using kernel 2.4.0 or later, you need to select `tun'.
327
328 @cindex Kernel-HOWTO
329 If you can install these devices in a similar manner, you may skip this section.
330 Otherwise, you will have to recompile the kernel in order to turn on the required features.
331 If you are unfamiliar with the process of configuring and compiling a new kernel,
332 you should read the @uref{http://howto.linuxberg.com/LDP/HOWTO/Kernel-HOWTO.html, Kernel HOWTO} first.
333
334 @menu
335 * Configuration of Linux kernels 2.1.60 up to 2.4.0::
336 * Configuration of Linux kernels 2.4.0 and higher::
337 * Configuration of FreeBSD kernels::
338 * Configuration of OpenBSD kernels::
339 * Configuration of NetBSD kernels::
340 * Configuration of Solaris kernels::
341 * Configuration of Darwin (MacOS/X) kernels::
342 * Configuration of Cygwin (Windows)::
343 * Configuration of MinGW (Windows)::
344 @end menu
345
346
347 @c ==================================================================
348 @node       Configuration of Linux kernels 2.1.60 up to 2.4.0, Configuration of Linux kernels 2.4.0 and higher, Configuring the kernel, Configuring the kernel
349 @subsection Configuration of Linux kernels 2.1.60 up to 2.4.0
350
351 Here are the options you have to turn on when configuring a new kernel:
352
353 @example
354 Code maturity level options
355 [*] Prompt for development and/or incomplete code/drivers
356 Networking options
357 [*] Kernel/User netlink socket
358 <M> Netlink device emulation
359 Network device support
360 <M> Ethertap network tap
361 @end example
362
363 If you want to run more than one instance of tinc or other programs that use
364 the ethertap, you have to compile the ethertap driver as a module, otherwise
365 you can also choose to compile it directly into the kernel.
366
367 If you decide to build any of these as dynamic kernel modules, it's a good idea
368 to add these lines to @file{/etc/modules.conf}:
369
370 @example
371 alias char-major-36 netlink_dev
372 alias tap0 ethertap
373 options tap0 -o tap0 unit=0
374 alias tap1 ethertap
375 options tap1 -o tap1 unit=1
376 ...
377 alias tap@emph{N} ethertap
378 options tap@emph{N} -o tap@emph{N} unit=@emph{N}
379 @end example
380
381 Add as much alias/options lines as necessary.
382
383
384 @c ==================================================================
385 @node       Configuration of Linux kernels 2.4.0 and higher, Configuration of FreeBSD kernels, Configuration of Linux kernels 2.1.60 up to 2.4.0, Configuring the kernel
386 @subsection Configuration of Linux kernels 2.4.0 and higher
387
388 Here are the options you have to turn on when configuring a new kernel:
389
390 @example
391 Code maturity level options
392 [*] Prompt for development and/or incomplete code/drivers
393 Network device support
394 <M> Universal tun/tap device driver support
395 @end example
396
397 It's not necessary to compile this driver as a module, even if you are going to
398 run more than one instance of tinc.
399
400 If you have an early 2.4 kernel, you can choose both the tun/tap driver and the
401 `Ethertap network tap' device.  This latter is marked obsolete, and chances are
402 that it won't even function correctly anymore.  Make sure you select the
403 universal tun/tap driver.
404
405 If you decide to build the tun/tap driver as a kernel module, add these lines
406 to @file{/etc/modules.conf}:
407
408 @example
409 alias char-major-10-200 tun
410 @end example
411
412
413 @c ==================================================================
414 @node       Configuration of FreeBSD kernels, Configuration of OpenBSD kernels, Configuration of Linux kernels 2.4.0 and higher, Configuring the kernel
415 @subsection Configuration of FreeBSD kernels
416
417 For FreeBSD version 4.1 and higher, the tap driver is included in the default kernel configuration, for earlier
418 systems (4.0 and earlier), you need to install the universal tun/tap driver
419 yourself.
420
421
422 @c ==================================================================
423 @node       Configuration of OpenBSD kernels, Configuration of NetBSD kernels, Configuration of FreeBSD kernels, Configuring the kernel
424 @subsection Configuration of OpenBSD kernels
425
426 For OpenBSD version 2.9 and higher,
427 the tun driver is included in the default kernel configuration.
428
429
430 @c ==================================================================
431 @node       Configuration of NetBSD kernels, Configuration of Solaris kernels, Configuration of OpenBSD kernels, Configuring the kernel
432 @subsection Configuration of NetBSD kernels
433
434 For NetBSD version 1.5.2 and higher,
435 the tun driver is included in the default kernel configuration.
436
437
438 @c ==================================================================
439 @node       Configuration of Solaris kernels, Configuration of Darwin (MacOS/X) kernels, Configuration of NetBSD kernels, Configuring the kernel
440 @subsection Configuration of Solaris kernels
441
442 For Solaris 8 (SunOS 5.8) and higher,
443 the tun driver is included in the default kernel configuration.
444
445
446 @c ==================================================================
447 @node       Configuration of Darwin (MacOS/X) kernels, Configuration of Cygwin (Windows), Configuration of Solaris kernels, Configuring the kernel
448 @subsection Configuration of Darwin (MacOS/X) kernels
449
450 Darwin does not come with a tunnel driver. You must download it at
451 @uref{http://chrisp.de/en/projects/tunnel.html}. If compiling the source fails,
452 try the binary module. The tunnel driver must be loaded before starting tinc
453 with the following command:
454
455 @example
456 kmodload tunnel
457 @end example
458
459 Once loaded, the tunnel driver will automatically create @file{/dev/tun0}..@file{/dev/tun3}
460 and the corresponding network interfaces.
461
462
463 @c ==================================================================
464 @node       Configuration of Cygwin (Windows), Configuration of MinGW (Windows), Configuration of Darwin (MacOS/X) kernels, Configuring the kernel
465 @subsection Configuration of Cygwin (Windows)
466
467 You will need to install the CIPE driver, you can download it from
468 @uref{http://cipe-win32.sourceforge.net}.  Configure the CIPE network device in
469 the same way as you would do from the tinc-up script.
470
471
472 @c ==================================================================
473 @node       Configuration of MinGW (Windows), , Configuration of Cygwin (Windows), Configuring the kernel
474 @subsection Configuration of MinGW (Windows)
475
476 You will need to install the CIPE driver, you can download it from
477 @uref{http://cipe-win32.sourceforge.net}.  Configure the CIPE network device in
478 the same way as you would do from the tinc-up script.
479
480
481 @c ==================================================================
482 @node    Libraries,  , Configuring the kernel, Preparations
483 @section Libraries
484
485 @cindex requirements
486 @cindex libraries
487 Before you can configure or build tinc, you need to have the OpenSSL,
488 zlib and lzo libraries installed on your system.  If you try to configure tinc without
489 having them installed, configure will give you an error message, and stop.
490
491 @menu
492 * OpenSSL::
493 * zlib::
494 * lzo::
495 @end menu
496
497
498 @c ==================================================================
499 @node       OpenSSL, zlib, Libraries, Libraries
500 @subsection OpenSSL
501
502 @cindex OpenSSL
503 For all cryptography-related functions, tinc uses the functions provided
504 by the OpenSSL library.
505
506 If this library is not installed, you wil get an error when configuring
507 tinc for build.  Support for running tinc without having OpenSSL
508 installed @emph{may} be added in the future.
509
510 You can use your operating system's package manager to install this if
511 available.  Make sure you install the development AND runtime versions
512 of this package.
513
514 If you have to install OpenSSL manually, you can get the source code
515 from @url{http://www.openssl.org/}.  Instructions on how to configure,
516 build and install this package are included within the package.  Please
517 make sure you build development and runtime libraries (which is the
518 default).
519
520 If you installed the OpenSSL libraries from source, it may be necessary
521 to let configure know where they are, by passing configure one of the
522 --with-openssl-* parameters.
523
524 @example
525 --with-openssl=DIR      OpenSSL library and headers prefix
526 --with-openssl-include=DIR OpenSSL headers directory
527                         (Default is OPENSSL_DIR/include)
528 --with-openssl-lib=DIR  OpenSSL library directory
529                         (Default is OPENSSL_DIR/lib)
530 @end example
531
532
533 @subsubheading License
534
535 @cindex license
536 Since the license under which OpenSSL is distributed is not directly
537 compatible with the terms of the GNU GPL
538 @uref{http://www.openssl.org/support/faq.html#LEGAL2}, therefore we
539 include an addition to the GPL (see also the file COPYING.README):
540
541 @quotation
542 This program is released under the GPL with the additional exemption
543 that compiling, linking, and/or using OpenSSL is allowed.  You may
544 provide binary packages linked to the OpenSSL libraries, provided that
545 all other requirements of the GPL are met.
546 @end quotation
547
548
549 @c ==================================================================
550 @node       zlib, lzo, OpenSSL, Libraries
551 @subsection zlib
552
553 @cindex zlib
554 For the optional compression of UDP packets, tinc uses the functions provided
555 by the zlib library.
556
557 If this library is not installed, you wil get an error when configuring
558 tinc for build.  Support for running tinc without having zlib
559 installed @emph{may} be added in the future.
560
561 You can use your operating system's package manager to install this if
562 available.  Make sure you install the development AND runtime versions
563 of this package.
564
565 If you have to install zlib manually, you can get the source code
566 from @url{http://www.gzip.org/zlib/}.  Instructions on how to configure,
567 build and install this package are included within the package.  Please
568 make sure you build development and runtime libraries (which is the
569 default).
570
571
572 @c ==================================================================
573 @node       lzo,  , zlib, Libraries
574 @subsection lzo
575
576 @cindex lzo
577 Another form of compression is offered using the lzo library.
578
579 If this library is not installed, you wil get an error when configuring
580 tinc for build.  Support for running tinc without having lzo
581 installed @emph{may} be added in the future.
582
583 You can use your operating system's package manager to install this if
584 available.  Make sure you install the development AND runtime versions
585 of this package.
586
587 If you have to install lzo manually, you can get the source code
588 from @url{http://www.oberhumer.com/opensource/lzo/}.  Instructions on how to configure,
589 build and install this package are included within the package.  Please
590 make sure you build development and runtime libraries (which is the
591 default).
592
593
594 @c
595 @c
596 @c
597 @c      Installing tinc
598 @c
599 @c
600 @c
601 @c
602
603 @c ==================================================================
604 @node    Installation, Configuration, Preparations, Top
605 @chapter Installation
606
607 If you use Debian, you may want to install one of the
608 precompiled packages for your system.  These packages are equipped with
609 system startup scripts and sample configurations.
610
611 If you cannot use one of the precompiled packages, or you want to compile tinc
612 for yourself, you can use the source.  The source is distributed under
613 the GNU General Public License (GPL).  Download the source from the
614 @uref{http://tinc.nl.linux.org/download, download page}, which has
615 the checksums of these files listed; you may wish to check these with
616 md5sum before continuing.
617
618 tinc comes in a convenient autoconf/automake package, which you can just
619 treat the same as any other package.  Which is just untar it, type
620 `./configure' and then `make'.
621 More detailed instructions are in the file @file{INSTALL}, which is
622 included in the source distribution.
623
624 @menu
625 * Building and installing tinc::
626 * System files::
627 @end menu
628
629
630 @c ==================================================================
631 @node    Building and installing tinc, System files, Installation, Installation
632 @section Building and installing tinc
633
634 Detailed instructions on configuring the source, building tinc and installing tinc
635 can be found in the file called @file{INSTALL}.
636
637 @cindex binary package
638 If you happen to have a binary package for tinc for your distribution,
639 you can use the package management tools of that distribution to install tinc.
640 The documentation that comes along with your distribution will tell you how to do that.
641
642 @menu
643 * Darwin (MacOS/X) build environment::
644 * Cygwin (Windows) build environment::
645 * MinGW (Windows) build environment::
646 @end menu
647
648
649 @c ==================================================================
650 @node       Darwin (MacOS/X) build environment, Cygwin (Windows) build environment,  , Building and installing tinc
651 @subsection Darwin (MacOS/X) build environment
652
653 In order to build tinc on Darwin, you need to install the MacOS/X Developer Tools
654 from @uref{http://developer.apple.com/tools/macosxtools.html} and
655 a recent version of Fink from @uref{http://fink.sourceforge.net/}.
656
657 After installation use fink to download and install the following packages:
658 autoconf25, automake, dlcompat, m4, openssl, zlib and lzo.
659
660 @c ==================================================================
661 @node       Cygwin (Windows) build environment, MinGW (Windows) build environment, Darwin (MacOS/X) build environment, Building and installing tinc
662 @subsection Cygwin (Windows) build environment
663
664 If Cygwin hasn't already been installed, install it directly from
665 @uref{http://www.cygwin.com/}.
666
667 When tinc is compiled in a Cygwin environment, it can only be run in this environment,
668 but all programs, including those started outside the Cygwin environment, will be able to use the VPN.
669 It will also support all features.
670
671 @c ==================================================================
672 @node       MinGW (Windows) build environment, , Cygwin (Windows) build environment, Building and installing tinc
673 @subsection MinGW (Windows) build environment
674
675 You will need to install the MinGW environment from @uref{http://www.mingw.org}.
676
677 When tinc is compiled using MinGW it runs natively under Windows,
678 it is not necessary to keep MinGW installed.
679
680 When running natively, tinc is not able to start scripts,
681 nor is tinc able to receive signals.
682 When detaching, tinc will install itself as a service,
683 which will be restarted automatically after reboots.
684
685
686 @c ==================================================================
687 @node    System files,  , Building and installing tinc, Installation
688 @section System files
689
690 Before you can run tinc, you must make sure you have all the needed
691 files on your system.
692
693 @menu
694 * Device files::
695 * Other files::
696 @end menu
697
698
699 @c ==================================================================
700 @node       Device files, Other files, System files, System files
701 @subsection Device files
702
703 @cindex device files
704 First, you'll need the special device file(s) that form the interface
705 between the kernel and the daemon.
706
707 The permissions for these files have to be such that only the super user
708 may read/write to this file.  You'd want this, because otherwise
709 eavesdropping would become a bit too easy.  This does, however, imply
710 that you'd have to run tincd as root.
711
712 If you use Linux and have a kernel version prior to 2.4.0, you have to make the
713 ethertap devices:
714
715 @example
716 mknod -m 600 /dev/tap0 c 36 16
717 mknod -m 600 /dev/tap1 c 36 17
718 ...
719 mknod -m 600 /dev/tap@emph{N} c 36 @emph{N+16}
720 @end example
721
722 There is a maximum of 16 ethertap devices.
723
724 If you use the universal tun/tap driver, you have to create the
725 following device file (unless it already exist):
726
727 @example
728 mknod -m 600 /dev/tun c 10 200
729 @end example
730
731 If you use Linux, and you run the new 2.4 kernel using the devfs filesystem,
732 then the tun/tap device will probably be automatically generated as
733 @file{/dev/net/tun}.
734
735 Unlike the ethertap device, you do not need multiple device files if
736 you are planning to run multiple tinc daemons.
737
738
739 @c ==================================================================
740 @node       Other files,  , Device files, System files
741 @subsection Other files
742
743 @subsubheading @file{/etc/networks}
744
745 You may add a line to @file{/etc/networks} so that your VPN will get a
746 symbolic name.  For example:
747
748 @example
749 myvpn 10.0.0.0
750 @end example
751
752 @subsubheading @file{/etc/services}
753
754 @cindex port numbers
755 You may add this line to @file{/etc/services}.  The effect is that you
756 may supply a @samp{tinc} as a valid port number to some programs.  The
757 number 655 is registered with the IANA.
758
759 @example
760 tinc            655/tcp    TINC
761 tinc            655/udp    TINC
762 #                          Ivo Timmermans <ivo@@o2w.nl>
763 @end example
764
765
766 @c
767 @c
768 @c
769 @c
770 @c         Configuring tinc
771 @c
772 @c
773 @c
774 @c
775
776
777 @c ==================================================================
778 @node    Configuration, Running tinc, Installation, Top
779 @chapter Configuration
780
781 @menu
782 * Configuration introduction::
783 * Multiple networks::
784 * How connections work::
785 * Configuration files::
786 * Generating keypairs::
787 * Network interfaces::
788 * Example configuration::
789 @end menu
790
791 @c ==================================================================
792 @node    Configuration introduction, Multiple networks, Configuration, Configuration
793 @section Configuration introduction
794
795 @cindex Network Administrators Guide
796 Before actually starting to configure tinc and editing files,
797 make sure you have read this entire section so you know what to expect.
798 Then, make it clear to yourself how you want to organize your VPN:
799 What are the nodes (computers running tinc)?
800 What IP addresses/subnets do they have?
801 What is the network mask of the entire VPN?
802 Do you need special firewall rules?
803 Do you have to set up masquerading or forwarding rules?
804 Do you want to run tinc in router mode or switch mode?
805 These questions can only be answered by yourself,
806 you will not find the answers in this documentation.
807 Make sure you have an adequate understanding of networks in general.
808 A good resource on networking is the
809 @uref{http://www.linuxdoc.org/LDP/nag2/, Linux Network Administrators Guide}.
810
811 If you have everything clearly pictured in your mind,
812 proceed in the following order:
813 First, generate the configuration files (@file{tinc.conf}, your host configuration file, @file{tinc-up} and perhaps @file{tinc-down}).
814 Then generate the keypairs.
815 Finally, distribute the host configuration files.
816 These steps are described in the subsections below.
817
818
819 @c ==================================================================
820 @node    Multiple networks, How connections work, Configuration introduction, Configuration
821 @section Multiple networks
822
823 @cindex multiple networks
824 @cindex netname
825 In order to allow you to run more than one tinc daemon on one computer,
826 for instance if your computer is part of more than one VPN,
827 you can assign a ``netname'' to your VPN.
828 It is not required if you only run one tinc daemon,
829 it doesn't even have to be the same on all the sites of your VPN,
830 but it is recommended that you choose one anyway.
831
832 We will asume you use a netname throughout this document.
833 This means that you call tincd with the -n argument,
834 which will assign a netname to this daemon.
835
836 The effect of this is that the daemon will set its configuration
837 ``root'' to @value{sysconfdir}/tinc/@emph{netname}/, where @emph{netname} is your argument to the -n
838 option.  You'll notice that it appears in syslog as ``tinc.@emph{netname}''.
839
840 However, it is not strictly necessary that you call tinc with the -n
841 option.  In this case, the network name would just be empty, and it will
842 be used as such.  tinc now looks for files in @value{sysconfdir}/tinc/, instead of
843 @value{sysconfdir}/tinc/@emph{netname}/; the configuration file should be @value{sysconfdir}/tinc/tinc.conf,
844 and the host configuration files are now expected to be in @value{sysconfdir}/tinc/hosts/.
845
846 But it is highly recommended that you use this feature of tinc, because
847 it will be so much clearer whom your daemon talks to.  Hence, we will
848 assume that you use it.
849
850
851 @c ==================================================================
852 @node    How connections work, Configuration files, Multiple networks, Configuration
853 @section How connections work
854
855 When tinc starts up, it parses the command-line options and then
856 reads in the configuration file tinc.conf.
857 If it sees one or more  `ConnectTo' values pointing to other tinc daemons in that file,
858 it will try to connect to those other daemons.
859 Whether this succeeds or not and whether `ConnectTo' is specified or not,
860 tinc will listen for incoming connection from other deamons.
861 If you did specify a `ConnectTo' value and the other side is not responding,
862 tinc will keep retrying.
863 This means that once started, tinc will stay running until you tell it to stop,
864 and failures to connect to other tinc daemons will not stop your tinc daemon
865 for trying again later.
866 This means you don't have to intervene if there are temporary network problems.
867
868 @cindex client
869 @cindex server
870 There is no real distinction between a server and a client in tinc.
871 If you wish, you can view a tinc daemon without a `ConnectTo' value as a server,
872 and one which does specify such a value as a client.
873 It does not matter if two tinc daemons have a `ConnectTo' value pointing to each other however.
874
875
876 @c ==================================================================
877 @node    Configuration files, Generating keypairs, How connections work, Configuration
878 @section Configuration files
879
880 The actual configuration of the daemon is done in the file
881 @file{@value{sysconfdir}/tinc/@emph{netname}/tinc.conf} and at least one other file in the directory
882 @file{@value{sysconfdir}/tinc/@emph{netname}/hosts/}.
883
884 These file consists of comments (lines started with a #) or assignments
885 in the form of
886
887 @example
888 Variable = Value.
889 @end example
890
891 The variable names are case insensitive, and any spaces, tabs, newlines
892 and carriage returns are ignored.  Note: it is not required that you put
893 in the `=' sign, but doing so improves readability.  If you leave it
894 out, remember to replace it with at least one space character.
895
896 In this section all valid variables are listed in alphabetical order.
897 The default value is given between parentheses,
898 other comments are between square brackets and
899 required directives are given in @strong{bold}.
900
901 @menu
902 * Main configuration variables::
903 * Host configuration variables::
904 * How to configure::
905 @end menu
906
907
908 @c ==================================================================
909 @node    Main configuration variables, Host configuration variables, Configuration files, Configuration files
910 @subsection Main configuration variables
911
912 @table @asis
913 @cindex AddressFamily
914 @item AddressFamily = <ipv4|ipv6|any> (any)
915 This option affects the address family of listening and outgoing sockets.
916 If "any" is selected, then depending on the operating system
917 both IPv4 and IPv6 or just IPv6 listening sockets will be created.
918
919 @cindex BindToAddress
920 @item BindToAddress = <address> [experimental]
921 If your computer has more than one IPv4 or IPv6 address, tinc
922 will by default listen on all of them for incoming connections.
923 It is possible to bind only to a single address with this variable.
924
925 This option may not work on all platforms.
926
927 @cindex BindToInterface
928 @item BindToInterface = <interface> [experimental]
929 If you have more than one network interface in your computer, tinc will
930 by default listen on all of them for incoming connections.  It is
931 possible to bind tinc to a single interface like eth0 or ppp0 with this
932 variable.
933
934 This option may not work on all platforms.
935
936 @cindex ConnectTo
937 @item @strong{ConnectTo = <name>}
938 Specifies which other tinc daemon to connect to on startup.
939 Multiple ConnectTo variables may be specified,
940 in which case outgoing connections to each specified tinc daemon are made.
941 The names should be known to this tinc daemon
942 (i.e., there should be a host configuration file for the name on the ConnectTo line).
943
944 If you don't specify a host with ConnectTo,
945 tinc won't try to connect to other daemons at all,
946 and will instead just listen for incoming connections.
947
948 @cindex Device
949 @item @strong{Device = <device>} (/dev/tap0 or /dev/net/tun)
950 The virtual network device to use.  Note that you can only use one device per
951 daemon.  See also @ref{Device files}.
952
953 @cindex Hostnames
954 @item Hostnames = <yes|no> (no)
955 This option selects whether IP addresses (both real and on the VPN)
956 should be resolved.  Since DNS lookups are blocking, it might affect
957 tinc's efficiency, even stopping the daemon for a few seconds everytime
958 it does a lookup if your DNS server is not responding.
959
960 This does not affect resolving hostnames to IP addresses from the
961 configuration file.
962
963 @cindex Interface
964 @item Interface = <interface>
965 Defines the name of the interface corresponding to the virtual network device.
966 Depending on the operating system and the type of device this may or may not actually set the name of the interface
967 or choose the device corresponding to this interface.
968
969 @cindex Mode
970 @item Mode = <router|switch|hub> (router)
971 This option selects the way packets are routed to other daemons.
972
973 @table @asis
974 @cindex router
975 @item router
976 In this mode Subnet
977 variables in the host configuration files will be used to form a routing table.
978 Only unicast packets of routable protocols (IPv4 and IPv6) are supported in this mode.
979
980 This is the default mode, and unless you really know you need another mode, don't change it.
981
982 @cindex switch
983 @item switch
984 In this mode the MAC addresses of the packets on the VPN will be used to
985 dynamically create a routing table just like an Ethernet switch does.
986 Unicast, multicast and broadcast packets of every protocol that runs over Ethernet are supported in this mode
987 at the cost of frequent broadcast ARP requests and routing table updates.
988
989 This mode is primarily useful if you want to bridge Ethernet segments.
990
991 @cindex hub
992 @item hub
993 This mode is almost the same as the switch mode, but instead
994 every packet will be broadcast to the other daemons
995 while no routing table is managed.
996 @end table
997
998 @cindex KeyExpire
999 @item KeyExpire = <seconds> (3600)
1000 This option controls the time the encryption keys used to encrypt the data
1001 are valid.  It is common practice to change keys at regular intervals to
1002 make it even harder for crackers, even though it is thought to be nearly
1003 impossible to crack a single key.
1004
1005 @cindex MACExpire
1006 @item MACExpire = <seconds> (600)
1007 This option controls the amount of time MAC addresses are kept before they are removed.
1008 This only has effect when Mode is set to "switch".
1009
1010 @cindex Name
1011 @item @strong{Name = <name>}
1012 This is a symbolic name for this connection.  It can be anything
1013
1014 @cindex PingTimeout
1015 @item PingTimeout = <seconds> (60)
1016 The number of seconds of inactivity that tinc will wait before sending a
1017 probe to the other end.  If that other end doesn't answer within that
1018 same amount of seconds, the connection is terminated, and the others
1019 will be notified of this.
1020
1021 @cindex PriorityInheritance
1022 @item PriorityInheritance = <yes|no> (no) [experimental]
1023 When this option is enabled the value of the TOS field of tunneled IPv4 packets
1024 will be inherited by the UDP packets that are sent out.
1025
1026 @cindex PrivateKey
1027 @item PrivateKey = <key> [obsolete]
1028 This is the RSA private key for tinc. However, for safety reasons it is
1029 advised to store private keys of any kind in separate files. This prevents
1030 accidental eavesdropping if you are editting the configuration file.
1031
1032 @cindex PrivateKeyFile
1033 @item @strong{PrivateKeyFile = <path>} [recommended]
1034 This is the full path name of the RSA private key file that was
1035 generated by ``tincd --generate-keys''.  It must be a full path, not a
1036 relative directory.
1037
1038 Note that there must be exactly one of PrivateKey
1039 or PrivateKeyFile
1040 specified in the configuration file.
1041
1042 @end table
1043
1044
1045 @c ==================================================================
1046 @node    Host configuration variables, How to configure, Main configuration variables, Configuration files
1047 @subsection Host configuration variables
1048
1049 @table @asis
1050 @cindex Address
1051 @item @strong{Address = <IP address|hostname>} [recommended]
1052 This variable is only required if you want to connect to this host.  It
1053 must resolve to the external IP address where the host can be reached,
1054 not the one that is internal to the VPN.
1055
1056 @cindex Cipher
1057 @item Cipher = <cipher> (blowfish)
1058 The symmetric cipher algorithm used to encrypt UDP packets.
1059 Any cipher supported by OpenSSL is recognized.
1060
1061 @cindex Compression
1062 @item Compression = <level> (0)
1063 This option sets the level of compression used for UDP packets.
1064 Possible values are 0 (off), 1 (fast zlib) and any integer up to 9 (best zlib),
1065 10 (fast lzo) and 11 (best lzo).
1066
1067 @cindex Digest
1068 @item Digest = <digest> (sha1)
1069 The digest algorithm used to authenticate UDP packets.
1070 Any digest supported by OpenSSL is recognized.
1071 Furthermore, specifying "none" will turn off packet authentication.
1072
1073 @cindex IndirectData
1074 @item IndirectData = <yes|no> (no)
1075 This option specifies whether other tinc daemons besides the one you
1076 specified with ConnectTo can make a direct connection to you.  This is
1077 especially useful if you are behind a firewall and it is impossible to
1078 make a connection from the outside to your tinc daemon.  Otherwise, it
1079 is best to leave this option out or set it to no.
1080
1081 @cindex MACLength
1082 @item MACLength = <length> (4)
1083 The length of the message authentication code used to authenticate UDP packets.
1084 Can be anything from 0
1085 up to the length of the digest produced by the digest algorithm.
1086
1087 @cindex Port
1088 @item Port = <port> (655)
1089 This is the port this tinc daemon listens on.
1090 You can use decimal portnumbers or symbolic names (as listed in /etc/services).
1091
1092 @cindex PublicKey
1093 @item PublicKey = <key> [obsolete]
1094 This is the RSA public key for this host.
1095
1096 @cindex PublicKeyFile
1097 @item PublicKeyFile = <path> [obsolete]
1098 This is the full path name of the RSA public key file that was generated
1099 by ``tincd --generate-keys''.  It must be a full path, not a relative
1100 directory.
1101
1102 @cindex PEM format
1103 From version 1.0pre4 on tinc will store the public key directly into the
1104 host configuration file in PEM format, the above two options then are not
1105 necessary. Either the PEM format is used, or exactly
1106 @strong{one of the above two options} must be specified
1107 in each host configuration file, if you want to be able to establish a
1108 connection with that host.
1109
1110 @cindex Subnet
1111 @item Subnet = <address[/prefixlength]>
1112 The subnet which this tinc daemon will serve.
1113 tinc tries to look up which other daemon it should send a packet to by searching the appropiate subnet.
1114 If the packet matches a subnet,
1115 it will be sent to the daemon who has this subnet in his host configuration file.
1116 Multiple subnet lines can be specified for each daemon.
1117
1118 Subnets can either be single MAC, IPv4 or IPv6 addresses,
1119 in which case a subnet consisting of only that single address is assumed,
1120 or they can be a IPv4 or IPv6 network address with a prefixlength.
1121 Shorthand notations are not supported.
1122 For example, IPv4 subnets must be in a form like 192.168.1.0/24,
1123 where 192.168.1.0 is the network address and 24 is the number of bits set in the netmask.
1124 Note that subnets like 192.168.1.1/24 are invalid!
1125 Read a networking HOWTO/FAQ/guide if you don't understand this.
1126 IPv6 subnets are notated like fec0:0:0:1:0:0:0:0/64.
1127 MAC addresses are notated like 0:1a:2b:3c:4d:5e.
1128
1129 @cindex CIDR notation
1130 prefixlength is the number of bits set to 1 in the netmask part; for
1131 example: netmask 255.255.255.0 would become /24, 255.255.252.0 becomes
1132 /22. This conforms to standard CIDR notation as described in
1133 @uref{ftp://ftp.isi.edu/in-notes/rfc1519.txt, RFC1519}
1134
1135 @cindex TCPonly
1136 @item TCPonly = <yes|no> (no) [experimental]
1137 If this variable is set to yes, then the packets are tunnelled over a
1138 TCP connection instead of a UDP connection.  This is especially useful
1139 for those who want to run a tinc daemon from behind a masquerading
1140 firewall, or if UDP packet routing is disabled somehow.
1141 Setting this options also implicitly sets IndirectData.
1142 @end table
1143
1144
1145 @c ==================================================================
1146 @node    How to configure,  , Host configuration variables, Configuration files
1147 @subsection How to configure
1148
1149 @subsubheading Step 1.  Creating the main configuration file
1150
1151 The main configuration file will be called @file{@value{sysconfdir}/tinc/@emph{netname}/tinc.conf}.
1152 Adapt the following example to create a basic configuration file:
1153
1154 @example
1155 Name = @emph{yourname}
1156 Device = @emph{/dev/tap0}
1157 PrivateKeyFile = @value{sysconfdir}/tinc/@emph{netname}/rsa_key.priv
1158 @end example
1159
1160 Then, if you know to which other tinc daemon(s) yours is going to connect,
1161 add `ConnectTo' values.
1162
1163 @subsubheading Step 2.  Creating your host configuration file
1164
1165 If you added a line containing `Name = yourname' in the main configuarion file,
1166 you will need to create a host configuration file @file{@value{sysconfdir}/tinc/@emph{netname}/hosts/yourname}.
1167 Adapt the following example to create a host configuration file:
1168
1169 @example
1170 Address = @emph{your.real.hostname.org}
1171 Subnet = @emph{192.168.1.0/24}
1172 @end example
1173
1174 You can also use an IP address instead of a hostname.
1175 The `Subnet' specifies the address range that is local for @emph{your part of the VPN only}.
1176 If you have multiple address ranges you can specify more than one `Subnet'.
1177 You might also need to add a `Port' if you want your tinc daemon to run on a different port number than the default (655).
1178
1179
1180 @c ==================================================================
1181 @node    Generating keypairs, Network interfaces, Configuration files, Configuration
1182 @section Generating keypairs
1183
1184 @cindex key generation
1185 Now that you have already created the main configuration file and your host configuration file,
1186 you can easily create a public/private keypair by entering the following command:
1187
1188 @example
1189 tincd -n @emph{netname} -K
1190 @end example
1191
1192 tinc will generate a public and a private key and ask you where to put them.
1193 Just press enter to accept the defaults.
1194
1195
1196 @c ==================================================================
1197 @node    Network interfaces, Example configuration, Generating keypairs, Configuration
1198 @section Network interfaces
1199
1200 Before tinc can start transmitting data over the tunnel, it must
1201 set up the virtual network interface.
1202
1203 First, decide which IP addresses you want to have associated with these
1204 devices, and what network mask they must have.
1205
1206 tinc will open a virtual network device (@file{/dev/tun}, @file{/dev/tap0} or similar),
1207 which will also create a network interface called something like `tun0', `tap0', or,
1208 if you are using the Linux tun/tap driver, the network interface will by default have the same name as the netname.
1209
1210 @cindex tinc-up
1211 You can configure the network interface by putting ordinary ifconfig, route, and other commands
1212 to a script named @file{@value{sysconfdir}/tinc/@emph{netname}/tinc-up}. When tinc starts, this script
1213 will be executed. When tinc exits, it will execute the script named
1214 @file{@value{sysconfdir}/tinc/@emph{netname}/tinc-down}, but normally you don't need to create that script.
1215
1216 An example @file{tinc-up} script:
1217
1218 @example
1219 #!/bin/sh
1220 ifconfig $INTERFACE 192.168.1.1 netmask 255.255.0.0
1221 @end example
1222
1223 This script gives the interface an IP address and a netmask.
1224 The kernel will also automatically add a route to this interface, so normally you don't need
1225 to add route commands to the @file{tinc-up} script.
1226 The kernel will also bring the interface up after this command.
1227 @cindex netmask
1228 The netmask is the mask of the @emph{entire} VPN network, not just your
1229 own subnet.
1230
1231
1232 @c ==================================================================
1233 @node    Example configuration,  , Network interfaces, Configuration
1234 @section Example configuration
1235
1236
1237 @cindex example
1238 Imagine the following situation.  Branch A of our example `company' wants to connect
1239 three branch offices in B, C and D using the Internet.  All four offices
1240 have a 24/7 connection to the Internet.
1241
1242 A is going to serve as the center of the network.  B and C will connect
1243 to A, and D will connect to C.  Each office will be assigned their own IP
1244 network, 10.x.0.0.
1245
1246 @example
1247 A: net 10.1.0.0 mask 255.255.0.0 gateway 10.1.54.1 internet IP 1.2.3.4
1248 B: net 10.2.0.0 mask 255.255.0.0 gateway 10.2.1.12 internet IP 2.3.4.5
1249 C: net 10.3.0.0 mask 255.255.0.0 gateway 10.3.69.254 internet IP 3.4.5.6
1250 D: net 10.4.0.0 mask 255.255.0.0 gateway 10.4.3.32 internet IP 4.5.6.7
1251 @end example
1252
1253 ``gateway'' is the VPN IP address of the machine that is running the
1254 tincd.  ``internet IP'' is the IP address of the firewall, which does not
1255 need to run tincd, but it must do a port forwarding of TCP&UDP on port
1256 655 (unless otherwise configured).
1257
1258 In this example, it is assumed that eth0 is the interface that points to
1259 the inner (physical) LAN of the office, although this could also be the
1260 same as the interface that leads to the Internet.  The configuration of
1261 the real interface is also shown as a comment, to give you an idea of
1262 how these example host is set up. All branches use the netname `company'
1263 for this particular VPN.
1264
1265 @subsubheading For Branch A
1266
1267 @emph{BranchA} would be configured like this:
1268
1269 In @file{@value{sysconfdir}/tinc/company/tinc-up}:
1270
1271 @example
1272 # Real interface of internal network:
1273 # ifconfig eth0 10.1.54.1 netmask 255.255.0.0 broadcast 10.1.255.255
1274
1275 ifconfig $INTERFACE 10.1.54.1 netmask 255.0.0.0
1276 @end example
1277
1278 and in @file{@value{sysconfdir}/tinc/company/tinc.conf}:
1279
1280 @example
1281 Name = BranchA
1282 PrivateKeyFile = @value{sysconfdir}/tinc/company/rsa_key.priv
1283 Device = /dev/tap0
1284 @end example
1285
1286 On all hosts, @value{sysconfdir}/tinc/company/hosts/BranchA contains:
1287
1288 @example
1289 Subnet = 10.1.0.0/16
1290 Address = 1.2.3.4
1291
1292 -----BEGIN RSA PUBLIC KEY-----
1293 ...
1294 -----END RSA PUBLIC KEY-----
1295 @end example
1296
1297 Note that the IP addresses of eth0 and tap0 are the same.
1298 This is quite possible, if you make sure that the netmasks of the interfaces are different.
1299 It is in fact recommended to give give both real internal network interfaces and tap interfaces the same IP address,
1300 since that will make things a lot easier to remember and set up.
1301
1302
1303 @subsubheading For Branch B
1304
1305 In @file{@value{sysconfdir}/tinc/company/tinc-up}:
1306
1307 @example
1308 # Real interface of internal network:
1309 # ifconfig eth0 10.2.43.8 netmask 255.255.0.0 broadcast 10.2.255.255
1310
1311 ifconfig $INTERFACE 10.2.1.12 netmask 255.0.0.0
1312 @end example
1313
1314 and in @file{@value{sysconfdir}/tinc/company/tinc.conf}:
1315
1316 @example
1317 Name = BranchB
1318 ConnectTo = BranchA
1319 PrivateKeyFile = @value{sysconfdir}/tinc/company/rsa_key.priv
1320 @end example
1321
1322 Note here that the internal address (on eth0) doesn't have to be the
1323 same as on the tap0 device.  Also, ConnectTo is given so that no-one can
1324 connect to this node.
1325
1326 On all hosts, in @file{@value{sysconfdir}/tinc/company/hosts/BranchB}:
1327
1328 @example
1329 Subnet = 10.2.0.0/16
1330 Address = 2.3.4.5
1331
1332 -----BEGIN RSA PUBLIC KEY-----
1333 ...
1334 -----END RSA PUBLIC KEY-----
1335 @end example
1336
1337
1338 @subsubheading For Branch C
1339
1340 In @file{@value{sysconfdir}/tinc/company/tinc-up}:
1341
1342 @example
1343 # Real interface of internal network:
1344 # ifconfig eth0 10.3.69.254 netmask 255.255.0.0 broadcast 10.3.255.255
1345
1346 ifconfig $INTERFACE 10.3.69.254 netmask 255.0.0.0
1347 @end example
1348
1349 and in @file{@value{sysconfdir}/tinc/company/tinc.conf}:
1350
1351 @example
1352 Name = BranchC
1353 ConnectTo = BranchA
1354 Device = /dev/tap1
1355 @end example
1356
1357 C already has another daemon that runs on port 655, so they have to
1358 reserve another port for tinc. It knows the portnumber it has to listen on
1359 from it's own host configuration file.
1360
1361 On all hosts, in @file{@value{sysconfdir}/tinc/company/hosts/BranchC}:
1362
1363 @example
1364 Address = 3.4.5.6
1365 Subnet = 10.3.0.0/16
1366 Port = 2000
1367
1368 -----BEGIN RSA PUBLIC KEY-----
1369 ...
1370 -----END RSA PUBLIC KEY-----
1371 @end example
1372
1373
1374 @subsubheading For Branch D
1375
1376 In @file{@value{sysconfdir}/tinc/company/tinc-up}:
1377
1378 @example
1379 # Real interface of internal network:
1380 # ifconfig eth0 10.4.3.32 netmask 255.255.0.0 broadcast 10.4.255.255
1381
1382 ifconfig $INTERFACE 10.4.3.32 netmask 255.0.0.0
1383 @end example
1384
1385 and in @file{@value{sysconfdir}/tinc/company/tinc.conf}:
1386
1387 @example
1388 Name = BranchD
1389 ConnectTo = BranchC
1390 Device = /dev/net/tun
1391 PrivateKeyFile = @value{sysconfdir}/tinc/company/rsa_key.priv
1392 @end example
1393
1394 D will be connecting to C, which has a tincd running for this network on
1395 port 2000. It knows the port number from the host configuration file.
1396 Also note that since D uses the tun/tap driver, the network interface
1397 will not be called `tun' or `tap0' or something like that, but will
1398 have the same name as netname.
1399
1400 On all hosts, in @file{@value{sysconfdir}/tinc/company/hosts/BranchD}:
1401
1402 @example
1403 Subnet = 10.4.0.0/16
1404 Address = 4.5.6.7
1405
1406 -----BEGIN RSA PUBLIC KEY-----
1407 ...
1408 -----END RSA PUBLIC KEY-----
1409 @end example
1410
1411 @subsubheading Key files
1412
1413 A, B, C and D all have generated a public/private keypair with the following command:
1414
1415 @example
1416 tincd -n company -K
1417 @end example
1418
1419 The private key is stored in @file{@value{sysconfdir}/tinc/company/rsa_key.priv},
1420 the public key is put into the host configuration file in the @file{@value{sysconfdir}/tinc/company/hosts/} directory.
1421 During key generation, tinc automatically guesses the right filenames based on the -n option and
1422 the Name directive in the @file{tinc.conf} file (if it is available).
1423
1424 @subsubheading Starting
1425
1426 After each branch has finished configuration and they have distributed
1427 the host configuration files amongst them, they can start their tinc daemons.
1428 They don't necessarily have to wait for the other branches to have started
1429 their daemons, tinc will try connecting until they are available.
1430
1431
1432 @c ==================================================================
1433 @node    Running tinc, Technical information, Configuration, Top
1434 @chapter Running tinc
1435
1436 If everything else is done, you can start tinc by typing the following command:
1437
1438 @example
1439 tincd -n @emph{netname}
1440 @end example
1441
1442 @cindex daemon
1443 tinc will detach from the terminal and continue to run in the background like a good daemon.
1444 If there are any problems however you can try to increase the debug level
1445 and look in the syslog to find out what the problems are.
1446
1447 @menu
1448 * Runtime options::
1449 * Error messages::
1450 @end menu
1451
1452
1453 @c ==================================================================
1454 @node    Runtime options, Error messages,  , Running tinc
1455 @section Runtime options
1456
1457 Besides the settings in the configuration file, tinc also accepts some
1458 command line options.
1459
1460 @cindex command line
1461 @cindex runtime options
1462 @cindex options
1463 @c from the manpage
1464 @table @samp
1465 @item -c, --config=PATH
1466 Read configuration options from the directory PATH.  The default is
1467 @file{@value{sysconfdir}/tinc/@emph{netname}/}.
1468
1469 @item -D, --no-detach
1470 Don't fork and detach.
1471 This will also disable the automatic restart mechanism for fatal errors.
1472
1473 @cindex debug level
1474 @item -d, --debug=LEVEL
1475 Set debug level to LEVEL.  The higher the debug level, the more gets
1476 logged.  Everything goes via syslog.
1477
1478 @item -k, --kill[=SIGNAL]
1479 Attempt to kill a running tincd (optionally with the specified SIGNAL instead of SIGTERM) and exit.
1480 Use it in conjunction with the -n option to make sure you kill the right tinc daemon.
1481 Under native Windows the optional argument is ignored,
1482 the service will always be stopped and removed.
1483
1484 @item -n, --net=NETNAME
1485 Connect to net NETNAME.  @xref{Multiple networks}.
1486
1487 @item -K, --generate-keys[=BITS]
1488 Generate public/private keypair of BITS length. If BITS is not specified,
1489 1024 is the default. tinc will ask where you want to store the files,
1490 but will default to the configuration directory (you can use the -c or -n option
1491 in combination with -K). After that, tinc will quit.
1492
1493 @item -L, --mlock
1494 Lock tinc into main memory.
1495 This will prevent sensitive data like shared private keys to be written to the system swap files/partitions.
1496
1497 @item --logfile[=FILE]
1498 Write log entries to a file instead of to the system logging facility.
1499 If FILE is omitted, the default is @value{localstatedir}/log/tinc.NETNAME.log.
1500
1501 @item --pidfile=FILE
1502 Write PID to FILE instead of @value{localstatedir}/run/tinc.NETNAME.pid.
1503
1504 @item --bypass-security
1505 Disables encryption and authentication.
1506 Only useful for debugging.
1507
1508 @item --help
1509 Display a short reminder of these runtime options and terminate.
1510
1511 @item --version
1512 Output version information and exit.
1513
1514 @end table
1515
1516
1517 @c ==================================================================
1518 @node    Error messages,  , Runtime options, Running tinc
1519 @section Error messages
1520
1521 What follows is a list of the most common error messages you can see
1522 when configuring tinc.  Most of these messages are visible in the syslog
1523 only, so keep an eye on it!
1524
1525 @table @strong
1526 @item Could not open /dev/tap0: No such device
1527
1528 @itemize
1529 @item You forgot to `modprobe netlink_dev' or `modprobe ethertap'.
1530 @item You forgot to compile `Netlink device emulation' in the kernel.
1531 @end itemize
1532
1533 @item Can't write to /dev/net/tun: No such device
1534
1535 @itemize
1536 @item You forgot to `modprobe tun'.
1537 @item You forgot to compile `Universal TUN/TAP driver' in the kernel.
1538 @end itemize
1539
1540 @item Packet with destination 1.2.3.4 is looping back to us!
1541
1542 @itemize
1543 @item Something is not configured right. Packets are being sent out to the
1544 virtual network device, but according to the Subnet directives in your host configuration
1545 file, those packets should go to your own host. Most common mistake is that
1546 you have a Subnet line in your host configuration file with a prefix length which is
1547 just as large as the prefix of the virtual network interface. The latter should in almost all
1548 cases be larger. Rethink your configuration.
1549 Note that you will only see this message if you specified a debug
1550 level of 5 or higher!
1551 @item Chances are that a `Subnet = ...' line in the host configuration file of this tinc daemon is wrong.
1552 Change it to a subnet that is accepted locally by another interface,
1553 or if that is not the case, try changing the prefix length into /32. 
1554 @end itemize
1555
1556 @item Network doesn't work, syslog shows only packets of length 46
1557
1558 @item Network address and prefix length do not match!
1559
1560 @itemize
1561 @item The Subnet field must contain a @emph{network} address.
1562 @item If you only want to use one IP address, set the netmask to /32.
1563 @end itemize
1564
1565 @item This is a bug: net.c:253: 24: Some error
1566
1567 @itemize
1568 @item This is something that should not have happened.
1569 Please report this, and tell us exactly what went wrong before you got
1570 this message.  In normal operation, these errors should not occur.
1571 @end itemize
1572
1573 @item Error reading RSA key file `rsa_key.priv': No such file or directory
1574
1575 @itemize
1576 @item You must specify the complete pathname.
1577 Specifying a relative path does not make sense here.  tinc changes its
1578 directory to / when starting (to avoid keeping a mount point busy).
1579 @end itemize
1580
1581 @end table
1582
1583 @c ==================================================================
1584 @node    Technical information, About us, Running tinc, Top
1585 @chapter Technical information
1586
1587
1588 @menu
1589 * The connection::
1590 * The meta-protocol::
1591 * Security::
1592 @end menu
1593
1594
1595 @c ==================================================================
1596 @node    The connection, The meta-protocol, Technical information, Technical information
1597 @section The connection
1598
1599 @cindex connection
1600 tinc is a daemon that takes VPN data and transmit that to another host
1601 computer over the existing Internet infrastructure.
1602
1603 @menu
1604 * The UDP tunnel::
1605 * The meta-connection::
1606 @end menu
1607
1608
1609 @c ==================================================================
1610 @node    The UDP tunnel, The meta-connection, The connection, The connection
1611 @subsection The UDP tunnel
1612
1613 @cindex virtual network device
1614 @cindex frame type
1615 The data itself is read from a character device file, the so-called
1616 @emph{virtual network device}.  This device is associated with a network
1617 interface.  Any data sent to this interface can be read from the device,
1618 and any data written to the device gets sent from the interface.
1619 There are two possible types of virtual network devices:
1620 `tun' style, which are point-to-point devices which can only handle IPv4 and/or IPv6 packets,
1621 and `tap' style, which are Ethernet devices and handle complete Ethernet frames.
1622
1623 So when tinc reads an Ethernet frame from the device, it determines its
1624 type. When tinc is in it's default routing mode, it can handle IPv4 and IPv6
1625 packets. Depending on the Subnet lines, it will send the packets off to their destination IP address.
1626 In the `switch' and `hub' mode, tinc will use broadcasts and MAC address discovery
1627 to deduce the destination of the packets.
1628 Since the latter modes only depend on the link layer information,
1629 any protocol that runs over Ethernet is supported (for instance IPX and Appletalk).
1630 However, only `tap' style devices provide this information.
1631
1632 After the destination has been determined,
1633 the packet will be compressed (optionally),
1634 a sequence number will be added to the packet,
1635 the packet will then be encrypted
1636 and a message authentication code will be appended.
1637
1638 @cindex encapsulating
1639 @cindex UDP
1640 When that is done, time has come to actually transport the
1641 packet to the destination computer.  We do this by sending the packet
1642 over an UDP connection to the destination host.  This is called
1643 @emph{encapsulating}, the VPN packet (though now encrypted) is
1644 encapsulated in another IP datagram.
1645
1646 When the destination receives this packet, the same thing happens, only
1647 in reverse.  So it checks the message authentication code, decrypts the contents of the UDP datagram,
1648 checks the sequence number
1649 and writes the decrypted information to its own virtual network device.
1650
1651 If the virtual network device is a `tun' device (a point-to-point tunnel),
1652 there is no problem for the kernel to accept a packet.
1653 However, if it is a `tap' device (this is the only available type on FreeBSD),
1654 the destination MAC address must match that of the virtual network interface.
1655 If tinc is in it's default routing mode, ARP does not work, so the correct destination MAC 
1656 can not be known by the sending host.
1657 tinc solves this by letting the receiving end detect the MAC address of its own virtual network interface
1658 and overwriting the destination MAC address of the received packet.
1659
1660 In switch or hub modes ARP does work so the sender already knows the correct destination MAC address.
1661 In those modes every interface should have a unique MAC address, so make sure they are not the same.
1662 Because switch and hub modes rely on MAC addresses to function correctly,
1663 these modes cannot be used on the following operating systems which don't have a `tap' style virtual network device:
1664 OpenBSD, NetBSD, Darwin and Solaris.
1665
1666
1667 @c ==================================================================
1668 @node    The meta-connection,  , The UDP tunnel, The connection
1669 @subsection The meta-connection
1670
1671 Having only a UDP connection available is not enough.  Though suitable
1672 for transmitting data, we want to be able to reliably send other
1673 information, such as routing and session key information to somebody.
1674
1675 @cindex TCP
1676 TCP is a better alternative, because it already contains protection
1677 against information being lost, unlike UDP.
1678
1679 So we establish two connections.  One for the encrypted VPN data, and one
1680 for other information, the meta-data.  Hence, we call the second
1681 connection the meta-connection.  We can now be sure that the
1682 meta-information doesn't get lost on the way to another computer.
1683
1684 @cindex data-protocol
1685 @cindex meta-protocol
1686 Like with any communication, we must have a protocol, so that everybody
1687 knows what everything stands for, and how she should react.  Because we
1688 have two connections, we also have two protocols.  The protocol used for
1689 the UDP data is the ``data-protocol,'' the other one is the
1690 ``meta-protocol.''
1691
1692 The reason we don't use TCP for both protocols is that UDP is much
1693 better for encapsulation, even while it is less reliable.  The real
1694 problem is that when TCP would be used to encapsulate a TCP stream
1695 that's on the private network, for every packet sent there would be
1696 three ACKs sent instead of just one.  Furthermore, if there would be
1697 a timeout, both TCP streams would sense the timeout, and both would
1698 start re-sending packets.
1699
1700
1701 @c ==================================================================
1702 @node    The meta-protocol, Security, The connection, Technical information
1703 @section The meta-protocol
1704
1705 The meta protocol is used to tie all tinc daemons together, and
1706 exchange information about which tinc daemon serves which virtual
1707 subnet.
1708
1709 The meta protocol consists of requests that can be sent to the other
1710 side.  Each request has a unique number and several parameters.  All
1711 requests are represented in the standard ASCII character set.  It is
1712 possible to use tools such as telnet or netcat to connect to a tinc
1713 daemon started with the --bypass-security option
1714 and to read and write requests by hand, provided that one
1715 understands the numeric codes sent.
1716
1717 The authentication scheme is described in @ref{Authentication protocol}. After a
1718 successful authentication, the server and the client will exchange all the
1719 information about other tinc daemons and subnets they know of, so that both
1720 sides (and all the other tinc daemons behind them) have their information
1721 synchronised.
1722
1723 @cindex ADD_EDGE
1724 @cindex ADD_SUBNET
1725 @example
1726 daemon  message
1727 --------------------------------------------------------------------------
1728 origin  ADD_EDGE node1 node2 21.32.43.54 655 222 0
1729                    |     |        |       |   |  +-> options
1730                    |     |        |       |   +----> weight
1731                            |     |        |       +--------> UDP port of node2
1732                            |     |        +----------------> real address of node2
1733                            |     +-------------------------> name of destination node
1734                    +-------------------------------> name of source node
1735
1736 origin  ADD_SUBNET node 192.168.1.0/24
1737                      |         |     +--> prefixlength
1738                      |         +--------> network address
1739                      +------------------> owner of this subnet
1740 --------------------------------------------------------------------------
1741 @end example
1742
1743 The ADD_EDGE messages are to inform other tinc daemons that a connection between
1744 two nodes exist. The address of the destination node is available so that
1745 VPN packets can be sent directly to that node.
1746
1747 The ADD_SUBNET messages inform other tinc daemons that certain subnets belong
1748 to certain nodes. tinc will use it to determine to which node a VPN packet has
1749 to be sent.
1750
1751 @cindex DEL_EDGE
1752 @cindex DEL_SUBNET
1753 @example
1754 message
1755 ------------------------------------------------------------------
1756 DEL_EDGE node1 node2
1757                    |     +----> name of destination node
1758            +----------> name of source node
1759
1760 DEL_SUBNET node 192.168.1.0/24
1761              |         |     +--> prefixlength
1762              |         +--------> network address
1763              +------------------> owner of this subnet
1764 ------------------------------------------------------------------
1765 @end example
1766
1767 In case a connection between two daemons is closed or broken, DEL_EDGE messages
1768 are sent to inform the other daemons of that fact. Each daemon will calculate a
1769 new route to the the daemons, or mark them unreachable if there isn't any.
1770
1771 @cindex REQ_KEY
1772 @cindex ANS_KEY
1773 @cindex KEY_CHANGED
1774 @example
1775 message
1776 ------------------------------------------------------------------
1777 REQ_KEY origin destination
1778            |       +--> name of the tinc daemon it wants the key from
1779            +----------> name of the daemon that wants the key      
1780
1781 ANS_KEY origin destination 4ae0b0a82d6e0078 91 64 4
1782            |       |       \______________/ |  |  +--> MAC length
1783            |       |               |        |  +-----> digest algorithm
1784            |       |               |        +--------> cipher algorithm
1785            |       |               +--> 128 bits key
1786            |       +--> name of the daemon that wants the key
1787            +----------> name of the daemon that uses this key
1788
1789 KEY_CHANGED origin
1790               +--> daemon that has changed it's packet key
1791 --------------------------------------------------------------------------
1792 @end example
1793
1794 The keys used to encrypt VPN packets are not sent out directly. This is
1795 because it would generate a lot of traffic on VPNs with many daemons, and
1796 chances are that not every tinc daemon will ever send a packet to every
1797 other daemon. Instead, if a daemon needs a key it sends a request for it
1798 via the meta connection of the nearest hop in the direction of the
1799 destination.
1800
1801 @cindex PING
1802 @cindex PONG
1803 @example
1804 daemon  message
1805 --------------------------------------------------------------------------
1806 origin  PING
1807 dest.   PONG
1808 --------------------------------------------------------------------------
1809 @end example
1810
1811 There is also a mechanism to check if hosts are still alive. Since network
1812 failures or a crash can cause a daemon to be killed without properly
1813 shutting down the TCP connection, this is necessary to keep an up to date
1814 connection list. PINGs are sent at regular intervals, except when there
1815 is also some other traffic. A little bit of salt (random data) is added
1816 with each PING and PONG message, to make sure that long sequences of PING/PONG
1817 messages without any other traffic won't result in known plaintext.
1818
1819 This basically covers what is sent over the meta connection by
1820 tinc.
1821
1822
1823 @c ==================================================================
1824 @node    Security,  , The meta-protocol, Technical information
1825 @section About tinc's encryption and other security-related issues.
1826
1827 @cindex TINC
1828 @cindex Cabal
1829 tinc got its name from ``TINC,'' short for @emph{There Is No Cabal}; the
1830 alleged Cabal was/is an organisation that was said to keep an eye on the
1831 entire Internet.  As this is exactly what you @emph{don't} want, we named
1832 the tinc project after TINC.
1833
1834 @cindex SVPN
1835 But in order to be ``immune'' to eavesdropping, you'll have to encrypt
1836 your data.  Because tinc is a @emph{Secure} VPN (SVPN) daemon, it does
1837 exactly that: encrypt.
1838 tinc by default uses blowfish encryption with 128 bit keys in CBC mode, 32 bit
1839 sequence numbers and 4 byte long message authentication codes to make sure
1840 eavesdroppers cannot get and cannot change any information at all from the
1841 packets they can intercept. The encryption algorithm and message authentication
1842 algorithm can be changed in the configuration. The length of the message
1843 authentication codes is also adjustable. The length of the key for the
1844 encryption algorithm is always the default length used by OpenSSL.
1845
1846 @menu
1847 * Authentication protocol::
1848 * Encryption of network packets::
1849 @end menu
1850
1851
1852 @c ==================================================================
1853 @node    Authentication protocol, Encryption of network packets, Security, Security
1854 @subsection Authentication protocol
1855
1856 @cindex authentication
1857 A new scheme for authentication in tinc has been devised, which offers some
1858 improvements over the protocol used in 1.0pre2 and 1.0pre3. Explanation is
1859 below.
1860
1861 @cindex ID
1862 @cindex META_KEY
1863 @cindex CHALLENGE
1864 @cindex CHAL_REPLY
1865 @cindex ACK
1866 @example
1867 daemon  message
1868 --------------------------------------------------------------------------
1869 client  <attempts connection>
1870
1871 server  <accepts connection>
1872
1873 client  ID client 12
1874               |   +---> version
1875               +-------> name of tinc daemon
1876
1877 server  ID server 12
1878               |   +---> version
1879               +-------> name of tinc daemon
1880
1881 client  META_KEY 5f0823a93e35b69e...7086ec7866ce582b
1882                  \_________________________________/
1883                                  +-> RSAKEYLEN bits totally random string S1,
1884                                      encrypted with server's public RSA key
1885
1886 server  META_KEY 6ab9c1640388f8f0...45d1a07f8a672630
1887                  \_________________________________/
1888                                  +-> RSAKEYLEN bits totally random string S2,
1889                                      encrypted with client's public RSA key
1890
1891 From now on:
1892  - the client will symmetrically encrypt outgoing traffic using S1
1893  - the server will symmetrically encrypt outgoing traffic using S2
1894
1895 client  CHALLENGE da02add1817c1920989ba6ae2a49cecbda0
1896                   \_________________________________/
1897                                  +-> CHALLEN bits totally random string H1
1898
1899 server  CHALLENGE 57fb4b2ccd70d6bb35a64c142f47e61d57f
1900                   \_________________________________/
1901                                  +-> CHALLEN bits totally random string H2
1902
1903 client  CHAL_REPLY 816a86
1904                       +-> 160 bits SHA1 of H2
1905
1906 server  CHAL_REPLY 928ffe
1907                       +-> 160 bits SHA1 of H1
1908
1909 After the correct challenge replies are received, both ends have proved
1910 their identity. Further information is exchanged.
1911
1912 client  ACK 655 123 0
1913              |   |  +-> options
1914                  |   +----> estimated weight
1915                  +--------> listening port of client
1916
1917 server  ACK 655 321 0
1918              |   |  +-> options
1919                  |   +----> estimated weight
1920                  +--------> listening port of server
1921 --------------------------------------------------------------------------
1922 @end example
1923
1924 This new scheme has several improvements, both in efficiency and security.
1925
1926 First of all, the server sends exactly the same kind of messages over the wire
1927 as the client. The previous versions of tinc first authenticated the client,
1928 and then the server. This scheme even allows both sides to send their messages
1929 simultaneously, there is no need to wait for the other to send something first.
1930 This means that any calculations that need to be done upon sending or receiving
1931 a message can also be done in parallel. This is especially important when doing
1932 RSA encryption/decryption. Given that these calculations are the main part of
1933 the CPU time spent for the authentication, speed is improved by a factor 2.
1934
1935 Second, only one RSA encrypted message is sent instead of two. This reduces the
1936 amount of information attackers can see (and thus use for a cryptographic
1937 attack). It also improves speed by a factor two, making the total speedup a
1938 factor 4.
1939
1940 Third, and most important:
1941 The symmetric cipher keys are exchanged first, the challenge is done
1942 afterwards. In the previous authentication scheme, because a man-in-the-middle
1943 could pass the challenge/chal_reply phase (by just copying the messages between
1944 the two real tinc daemons), but no information was exchanged that was really
1945 needed to read the rest of the messages, the challenge/chal_reply phase was of
1946 no real use. The man-in-the-middle was only stopped by the fact that only after
1947 the ACK messages were encrypted with the symmetric cipher. Potentially, it
1948 could even send it's own symmetric key to the server (if it knew the server's
1949 public key) and read some of the metadata the server would send it (it was
1950 impossible for the mitm to read actual network packets though). The new scheme
1951 however prevents this.
1952
1953 This new scheme makes sure that first of all, symmetric keys are exchanged. The
1954 rest of the messages are then encrypted with the symmetric cipher. Then, each
1955 side can only read received messages if they have their private key. The
1956 challenge is there to let the other side know that the private key is really
1957 known, because a challenge reply can only be sent back if the challenge is
1958 decrypted correctly, and that can only be done with knowledge of the private
1959 key.
1960
1961 Fourth: the first thing that is sent via the symmetric cipher encrypted
1962 connection is a totally random string, so that there is no known plaintext (for
1963 an attacker) in the beginning of the encrypted stream.
1964
1965
1966 @c ==================================================================
1967 @node    Encryption of network packets,  , Authentication protocol, Security
1968 @subsection Encryption of network packet
1969 @cindex encryption
1970
1971 A data packet can only be sent if the encryption key is known to both
1972 parties, and the connection is  activated. If the encryption key is not
1973 known, a request is sent to the destination using the meta connection
1974 to retrieve it. The packet is stored in a queue while waiting for the
1975 key to arrive.
1976
1977 @cindex UDP
1978 The UDP packet containing the network packet from the VPN has the following layout:
1979
1980 @example
1981 ... | IP header | UDP header | seqno | VPN packet | MAC | UDP trailer
1982                              \___________________/\_____/
1983                                        |             |
1984                                        V             +---> digest algorithm
1985                          Encrypted with symmetric cipher
1986 @end example
1987
1988 So, the entire VPN packet is encrypted using a symmetric cipher, including a 32 bits
1989 sequence number that is added in front of the actual VPN packet, to act as a unique
1990 IV for each packet and to prevent replay attacks. A message authentication code
1991 is added to the UDP packet to prevent alteration of packets. By default the
1992 first 4 bytes of the digest are used for this, but this can be changed using
1993 the MACLength configuration variable.
1994
1995 @c ==================================================================
1996 @node    About us, Concept Index, Technical information, Top
1997 @chapter About us
1998
1999
2000 @menu
2001 * Contact Information::
2002 * Authors::
2003 @end menu
2004
2005
2006 @c ==================================================================
2007 @node    Contact Information, Authors, About us, About us
2008 @section Contact information
2009
2010 @cindex website
2011 tinc's website is at @url{http://tinc.nl.linux.org/},
2012 this server is located in the Netherlands.
2013
2014 @cindex IRC
2015 We have an IRC channel on the FreeNode and OFTC IRC networks. Connect to
2016 @uref{http://www.freenode.net/, irc.freenode.net}
2017 or
2018 @uref{http://www.oftc.net/, irc.oftc.net}
2019 and join channel #tinc.
2020
2021
2022 @c ==================================================================
2023 @node    Authors,  , Contact Information, About us
2024 @section Authors
2025
2026 @table @asis
2027 @item Ivo Timmermans (zarq) (@email{ivo@@o2w.nl})
2028 @item Guus Sliepen (guus) (@email{guus@@sliepen.eu.org})
2029 @end table
2030
2031 We have received a lot of valuable input from users.  With their help,
2032 tinc has become the flexible and robust tool that it is today.  We have
2033 composed a list of contributions, in the file called @file{THANKS} in
2034 the source distribution.
2035
2036
2037 @c ==================================================================
2038 @node    Concept Index,  , About us, Top
2039 @c        node-name,    next, previous,        up
2040 @unnumbered Concept Index
2041
2042 @c ==================================================================
2043 @printindex cp
2044
2045
2046 @c ==================================================================
2047 @contents
2048 @bye