74951c9257b486c35b80e348563b8f502c6a1c31
[tinc] / doc / tinc.texi
1 \input texinfo   @c -*-texinfo-*-
2 @c $Id: tinc.texi,v 1.8.4.16 2001/05/24 20:24: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 @ifinfo
10 @direntry
11 * tinc: (tinc).              The tinc Manual.
12 @end direntry
13
14 This is the info manual for tinc, a Virtual Private Network daemon.
15
16 Copyright @copyright{} 1998-2001 Ivo Timmermans
17 <itimmermans@@bigfoot.com>, Guus Sliepen <guus@@sliepen.warande.net> and
18 Wessel Dankers <wsl@@nl.linux.org>.
19
20 $Id: tinc.texi,v 1.8.4.16 2001/05/24 20:24:12 guus Exp $
21
22 Permission is granted to make and distribute verbatim copies of this
23 manual provided the copyright notice and this permission notice are
24 preserved on all copies.
25
26 Permission is granted to copy and distribute modified versions of this
27 manual under the conditions for verbatim copying, provided that the
28 entire resulting derived work is distributed under the terms of a
29 permission notice identical to this one.
30
31 @end ifinfo
32
33 @titlepage
34 @title tinc Manual
35 @subtitle Setting up a Virtual Private Network with tinc
36 @author Ivo Timmermans and Guus Sliepen
37
38 @page
39 @vskip 0pt plus 1filll
40 @cindex copyright
41 Copyright @copyright{} 1998-2001 Ivo Timmermans
42 <itimmermans@@bigfoot.com>, Guus Sliepen <guus@@sliepen.warande.net> and
43 Wessel Dankers <wsl@@nl.linux.org>.
44
45 $Id: tinc.texi,v 1.8.4.16 2001/05/24 20:24:12 guus Exp $
46
47 Permission is granted to make and distribute verbatim copies of this
48 manual provided the copyright notice and this permission notice are
49 preserved on all copies.
50
51 Permission is granted to copy and distribute modified versions of this
52 manual under the conditions for verbatim copying, provided that the
53 entire resulting derived work is distributed under the terms of a
54 permission notice identical to this one.
55
56 @end titlepage
57
58 @c ==================================================================
59 @node Top, Introduction, (dir), (dir)
60
61 @menu
62 * Introduction::                Introduction
63 * Preparations::
64 * Installation::
65 * Configuration::
66 * Running tinc::
67 * Technical information::
68 * About us::
69 * Concept Index::               All used terms explained
70 @end menu
71
72
73 @contents
74
75 @c ==================================================================
76 @node    Introduction, Preparations, Top, Top
77 @chapter Introduction
78
79 @cindex tinc
80 tinc is a Virtual Private Network (VPN) daemon that uses tunneling and
81 encryption to create a secure private network between hosts on the
82 Internet.
83
84 Because the tunnel appears to the IP level network code as a normal
85 network device, there is no need to adapt any existing software.
86 The encrypted tunnels allows VPN sites to share information with each other
87 over the Internet without exposing any information to others.
88
89 This document is the manual for tinc.  Included are chapters on how to
90 configure your computer to use tinc, as well as the configuration
91 process of tinc itself.
92
93 @menu
94 * VPNs::                        Virtual Private Networks in general
95 * tinc::                        about tinc
96 * Supported platforms::
97 @end menu
98
99 @c ==================================================================
100 @node    VPNs, tinc, Introduction, Introduction
101 @section Virtual Private Networks
102
103 @cindex VPN
104 A Virtual Private Network or VPN is a network that can only be accessed
105 by a few elected computers that participate.  This goal is achievable in
106 more than just one way.
107
108 @cindex private
109 Private networks can consist of a single stand-alone Ethernet LAN.  Or
110 even two computers hooked up using a null-modem cable.  In these cases,
111 it is
112 obvious that the network is @emph{private}, no one can access it from the
113 outside.  But if your computers are linked to the Internet, the network
114 is not private anymore, unless one uses firewalls to block all private
115 traffic.  But then, there is no way to send private data to trusted
116 computers on the other end of the Internet.
117
118 @cindex virtual
119 This problem can be solved by using @emph{virtual} networks.  Virtual
120 networks can live on top of other networks, but they use encapsulation to
121 keep using their private address space so they do not interfere with
122 the Internet.  Mostly, virtual networks appear like a singe LAN, even though
123 they can span the entire world.  But virtual networks can't be secured
124 by using firewalls, because the traffic that flows through it has to go
125 through the Internet, where other people can look at it.
126
127 As is the case with either type of VPN, anybody could eavesdrop.  Or
128 worse, alter data.  Hence it's probably advisable to encrypt the data
129 that flows over the network.
130
131 When one introduces encryption, we can form a true VPN.  Other people may
132 see encrypted traffic, but if they don't know how to decipher it (they
133 need to know the key for that), they cannot read the information that flows
134 through the VPN.  This is what tinc was made for.
135
136
137 @c ==================================================================
138 @node    tinc, Supported platforms, VPNs, Introduction
139 @section tinc
140
141 @cindex vpnd
142 I really don't quite remember what got us started, but it must have been
143 Guus' idea.  He wrote a simple implementation (about 50 lines of C) that
144 used the ethertap device that Linux knows of since somewhere
145 about kernel 2.1.60.  It didn't work immediately and he improved it a
146 bit.  At this stage, the project was still simply called @samp{vpnd}.
147
148 Since then, a lot has changed---to say the least.
149
150 @cindex tincd
151 tinc now supports encryption, it consists of a single daemon (tincd) for
152 both the receiving and sending end, it has become largely
153 runtime-configurable---in short, it has become a full-fledged
154 professional package.
155
156 @cindex Traditional VPNs
157 @cindex scalability
158 tinc also allows more than two sites to connect to eachother and form a single VPN.
159 Traditionally VPNs are created by making tunnels, which only have two endpoints.
160 Larger VPNs with more sites are created by adding more tunnels.
161 tinc takes another approach: only endpoints are specified,
162 the software itself will take care of creating the tunnels.
163 This allows for easier configuration and improved scalability.
164
165 A lot can---and will be---changed. We have a number of things that we would like to
166 see in the future releases of tinc.  Not everything will be available in
167 the near future.  Our first objective is to make tinc work perfectly as
168 it stands, and then add more advanced features.
169
170 Meanwhile, we're always open-minded towards new ideas.  And we're
171 available too.
172
173
174 @c ==================================================================
175 @node    Supported platforms,  , tinc, Introduction
176 @section Supported platforms
177
178 @cindex platforms
179 tinc has been verified to work under Linux, FreeBSD and Solaris, with
180 various hardware architectures.  These are the three platforms
181 that are supported by the universial TUN/TAP device driver, so if
182 support for other operating systems is added to this driver, perhaps
183 tinc will run on them as well.  Without this driver, tinc will most
184 likely compile and run, but it will not be able to send or receive data
185 packets.
186
187 @cindex release
188 The official release only truly supports Linux.
189 For an up to date list of supported platforms, please check the list on
190 our website:
191 @uref{http://tinc.nl.linux.org/platforms.html}.
192
193
194 @c ==================================================================
195 @subsection Linux
196
197 @cindex Linux
198 tinc was first written for Linux running on an intel x86 processor, so
199 this is the best supported platform.  The protocol however, and actually
200 anything about tinc, has been rewritten to support random byte ordering
201 and arbitrary word length.  So in theory it should run on other
202 processors that Linux runs on.  It has already been verified to run on
203 alpha and sparc processors as well.
204
205 tinc uses the ethertap device or the universal TUN/TAP driver. The former is provided in the standard kernel
206 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.
207
208
209 @c ==================================================================
210 @subsection FreeBSD
211
212 @cindex FreeBSD
213 tinc on FreeBSD relies on the universial TUN/TAP driver for its data
214 acquisition from the kernel.  Therefore, tinc will work on the same platforms
215 as this driver.  These are: FreeBSD 3.x, 4.x, 5.x.
216
217
218 @c ==================================================================
219 @subsection Solaris
220
221 @cindex Solaris
222 tinc on Solaris relies on the universial TUN/TAP driver for its data
223 acquisition from the kernel.  Therefore, tinc will work on the same platforms
224 as this driver.  These are: Solaris, 2.1.x.
225
226
227 @c
228 @c
229 @c
230 @c
231 @c
232 @c
233 @c       Preparing your system
234 @c
235 @c
236 @c
237 @c
238 @c
239
240 @c ==================================================================
241 @node    Preparations, Installation, Introduction, Top
242 @chapter Preparations
243
244 This chapter contains information on how to prepare your system to
245 support tinc.
246
247 @menu
248 * Configuring the kernel::
249 * Libraries::
250 @end menu
251
252
253 @c ==================================================================
254 @node    Configuring the kernel, Libraries, Preparations, Preparations
255 @section Configuring the kernel
256
257 @cindex RedHat
258 @cindex Debian
259 @cindex netlink_dev
260 @cindex tun
261 @cindex ethertap
262 If you are running Linux, chances are good that your kernel already supports
263 all the devices that tinc needs for proper operation.  For example, the
264 standard kernel from Redhat Linux already has support for ethertap and netlink
265 compiled in.  Debian users can use the modconf utility to select the modules.
266 If your Linux distribution supports this method of selecting devices, look out
267 for something called `ethertap', and `netlink_dev' if it is using a kernel
268 version prior to 2.4.0. In that case you will need both these devices.  If you
269 are using kernel 2.4.0 or later, you need to select `tun'.
270
271 @cindex Kernel-HOWTO
272 If you can install these devices in a similar manner, you may skip this section.
273 Otherwise, you will have to recompile the kernel in order to turn on the required features.
274 If you are unfamiliar with the process of configuring and compiling a new kernel,
275 you should read the @uref{http://howto.linuxberg.com/LDP/HOWTO/Kernel-HOWTO.html, Kernel HOWTO} first.
276
277 @menu
278 * Configuration of Linux kernels 2.1.60 up to 2.4.0::
279 * Configuration of Linux kernels 2.4.0 and higher::
280 * Configuration of FreeBSD kernels::
281 * Configuration of Solaris kernels::
282 @end menu
283
284
285 @c ==================================================================
286 @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
287 @subsection Configuration of Linux kernels 2.1.60 up to 2.4.0
288
289 Here are the options you have to turn on when configuring a new kernel:
290
291 @example
292 Code maturity level options
293 [*] Prompt for development and/or incomplete code/drivers
294 Networking options
295 [*] Kernel/User netlink socket
296 <M> Netlink device emulation
297 Network device support
298 <M> Ethertap network tap
299 @end example
300
301 If you want to run more than one instance of tinc or other programs that use
302 the ethertap, you have to compile the ethertap driver as a module, otherwise
303 you can also choose to compile it directly into the kernel.
304
305 If you decide to build any of these as dynamic kernel modules, it's a good idea
306 to add these lines to @file{/etc/modules.conf}:
307
308 @example
309 alias char-major-36 netlink_dev
310 alias tap0 ethertap
311 options tap0 -o tap0 unit=0
312 alias tap1 ethertap
313 options tap1 -o tap1 unit=1
314 ...
315 alias tap@emph{N} ethertap
316 options tap@emph{N} -o tap@emph{N} unit=@emph{N}
317 @end example
318
319 Add as much alias/options lines as necessary.
320
321
322 @c ==================================================================
323 @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
324 @subsection Configuration of Linux kernels 2.4.0 and higher
325
326 Here are the options you have to turn on when configuring a new kernel:
327
328 @example
329 Code maturity level options
330 [*] Prompt for development and/or incomplete code/drivers
331 Network device support
332 <M> Universal TUN/TAP device driver support
333 @end example
334
335 It's not necessary to compile this driver as a module, even if you are going to
336 run more than one instance of tinc.
337
338 If you have an early 2.4 kernel, you can choose both the TUN/TAP driver and the
339 `Ethertap network tap' device.  This latter is marked obsolete, and chances are
340 that it won't even function correctly anymore.  Make sure you select the
341 universal TUN/TAP driver.
342
343 If you decide to build the TUN/TAP driver as a kernel module, add these lines
344 to @file{/etc/modules.conf}:
345
346 @example
347 alias char-major-10-200 tun
348 @end example
349
350
351 @c ==================================================================
352 @node       Configuration of FreeBSD kernels, Configuration of Solaris kernels, Configuration of Linux kernels 2.4.0 and higher, Configuring the kernel
353 @subsection Configuration of FreeBSD kernels
354
355 This section will contain information on how to configure your FreeBSD
356 kernel to support the universal TUN/TAP device.  For 5.0 and 4.1
357 systems, this is included in the kernel configuration, for earlier
358 systems (4.0 and 3.x), you need to install the universal TUN/TAP driver
359 yourself.
360
361 Unfortunately somebody still has to write the text.
362
363
364 @c ==================================================================
365 @node       Configuration of Solaris kernels,  , Configuration of FreeBSD kernels, Configuring the kernel
366 @subsection Configuration of Solaris kernels
367
368 This section will contain information on how to configure your Solaris
369 kernel to support the universal TUN/TAP device.  You need to install
370 this driver yourself.
371
372 Unfortunately somebody still has to write the text.
373
374
375 @c ==================================================================
376 @node    Libraries,  , Configuring the kernel, Preparations
377 @section Libraries
378
379 @cindex requirements
380 @cindex libraries
381 Before you can configure or build tinc, you need to have the OpenSSL
382 library installed on your system.  If you try to configure tinc without
383 having installed it, configure will give you an error message, and stop.
384
385 @menu
386 * OpenSSL::
387 @end menu
388
389
390 @c ==================================================================
391 @node       OpenSSL,  , Libraries, Libraries
392 @subsection OpenSSL
393
394 @cindex OpenSSL
395 For all cryptography-related functions, tinc uses the functions provided
396 by the OpenSSL library.
397
398 If this library is not installed, you wil get an error when configuring
399 tinc for build.  Support for running tinc without having OpenSSL
400 installed @emph{may} be added in the future.
401
402 You can use your operating system's package manager to install this if
403 available.  Make sure you install the development AND runtime versions
404 of this package.
405
406 If you have to install OpenSSL manually, you can get the source code
407 from @url{http://www.openssl.org/}.  Instructions on how to configure,
408 build and install this package are included within the package.  Please
409 make sure you build development and runtime libraries (which is the
410 default).
411
412 If you installed the OpenSSL libraries from source, it may be necessary
413 to let configure know where they are, by passing configure one of the
414 --with-openssl-* parameters.
415
416 @example
417 --with-openssl=DIR      OpenSSL library and headers prefix
418 --with-openssl-include=DIR OpenSSL headers directory
419                         (Default is OPENSSL_DIR/include)
420 --with-openssl-lib=DIR  OpenSSL library directory
421                         (Default is OPENSSL_DIR/lib)
422 @end example
423
424
425 @subsubheading License
426
427 @cindex license
428 Since the license under which OpenSSL is distributed is not directly
429 compatible with the terms of the GNU GPL
430 @uref{http://www.openssl.org/support/faq.html#LEGAL2}, therefore we
431 include an addition to the GPL (see also the file COPYING.README):
432
433 @quotation
434 This program is released under the GPL with the additional exemption
435 that compiling, linking, and/or using OpenSSL is allowed.  You may
436 provide binary packages linked to the OpenSSL libraries, provided that
437 all other requirements of the GPL are met.
438 @end quotation
439
440
441 @c
442 @c
443 @c
444 @c      Installing tinc
445 @c
446 @c
447 @c
448 @c
449
450 @c ==================================================================
451 @node    Installation, Configuration, Preparations, Top
452 @chapter Installation
453
454 If you use Redhat or Debian, you may want to install one of the
455 precompiled packages for your system.  These packages are equipped with
456 system startup scripts and sample configurations.
457
458 If you don't run either of these systems, or you want to compile tinc
459 for yourself, you can use the source.  The source is distributed under
460 the GNU General Public License (GPL).  Download the source from the
461 @uref{http://tinc.nl.linux.org/download.html, download page}, which has
462 the checksums of these files listed; you may wish to check these with
463 md5sum before continuing.
464
465 tinc comes in a convenient autoconf/automake package, which you can just
466 treat the same as any other package.  Which is just untar it, type
467 `configure' and then `make'.
468 More detailed instructions are in the file @file{INSTALL}, which is
469 included in the source distribution.
470
471 @menu
472 * Building and installing tinc::
473 * System files::
474 @end menu
475
476
477 @c ==================================================================
478 @node    Building and installing tinc, System files, Installation, Installation
479 @section Building and installing tinc
480
481 Detailed instructions on configuring the source, building tinc and installing tinc
482 can be found in the file called @file{INSTALL}.
483
484 @cindex binary package
485 If you happen to have a binary package for tinc for your distribution,
486 you can use the package management tools of that distribution to install tinc.
487 The documentation that comes along with your distribution will tell you how to do that.
488
489
490 @c ==================================================================
491 @node    System files,  , Building and installing tinc, Installation
492 @section System files
493
494 Before you can run tinc, you must make sure you have all the needed
495 files on your system.
496
497 @menu
498 * Device files::
499 * Other files::
500 @end menu
501
502
503 @c ==================================================================
504 @node       Device files, Other files, System files, System files
505 @subsection Device files
506
507 @cindex device files
508 First, you'll need the special device file(s) that form the interface
509 between the kernel and the daemon.
510
511 The permissions for these files have to be such that only the super user
512 may read/write to this file.  You'd want this, because otherwise
513 eavesdropping would become a bit too easy.  This does, however, imply
514 that you'd have to run tincd as root.
515
516 If you use Linux and have a kernel version prior to 2.4.0, you have to make the
517 ethertap devices:
518
519 @example
520 mknod -m 600 /dev/tap0 c 36 16
521 chown 0.0 /dev/tap0
522 @end example
523
524 Any further ethertap devices have minor device number 16 through 31.
525
526 If you use the universal TUN/TAP driver, you have to create the
527 following device files (unless they already exist):
528
529 @example
530 mknod -m 600 /dev/tun c 10 200
531 chown 0.0 /dev/tun
532 @end example
533
534 If you use Linux, and you run the new 2.4 kernel using the devfs filesystem,
535 then the TUN/TAP device will probably be automatically generated as
536 @file{/dev/net/tun}.
537
538
539 @c ==================================================================
540 @node       Other files,  , Device files, System files
541 @subsection Other files
542
543 @subsubheading @file{/etc/networks}
544
545 You may add a line to @file{/etc/networks} so that your VPN will get a
546 symbolic name.  For example:
547
548 @example
549 myvpn 10.0.0.0
550 @end example
551
552 @subsubheading @file{/etc/services}
553
554 @cindex port numbers
555 You may add this line to @file{/etc/services}.  The effect is that you
556 may supply a @samp{tinc} as a valid port number to some programs.  The
557 number 655 is registered with the IANA.
558
559 @example
560 tinc            655/tcp    TINC
561 tinc            655/udp    TINC
562 #                          Ivo Timmermans <itimmermans@@bigfoot.com>
563 @end example
564
565
566 @c
567 @c
568 @c
569 @c
570 @c         Configuring tinc
571 @c
572 @c
573 @c
574 @c
575
576
577 @c ==================================================================
578 @node    Configuration, Running tinc, Installation, Top
579 @chapter Configuration
580
581 @menu
582 * Configuration introduction::
583 * Multiple networks::
584 * How connections work::
585 * Configuration files::
586 * Generating keypairs::
587 * Network interfaces::
588 * Example configuration::
589 @end menu
590
591 @c ==================================================================
592 @node    Configuration introduction, Multiple networks, Configuration, Configuration
593 @section Configuration introduction
594
595 @cindex Network Administrators Guide
596 Before actually starting to configure tinc and editing files,
597 make sure you have read this entire section so you know what to expect.
598 Then, make it clear to yourself how you want to organize your VPN:
599 What are the nodes (computers running tinc)?
600 What IP addresses/subnets do they have?
601 What is the network mask of the entire VPN?
602 Do you need special firewall rules?
603 Do you have to set up masquerading or forwarding rules?
604 These questions can only be answered by yourself,
605 you will not find the answers in this documentation.
606 Make sure you have an adequate understanding of networks in general.
607 A good resource on networking is the
608 @uref{http://www.linuxdoc.org/LDP/nag2/, Linux Network Administrators Guide}.
609
610 If you have everything clearly pictured in your mind,
611 proceed in the following order:
612 First, generate the configuration files (tinc.conf, your host configuration file, tinc-up and perhaps tinc-down).
613 Then generate the keypairs.
614 Finally, distribute the host configuration files.
615 These steps are described in the subsections below.
616
617
618 @c ==================================================================
619 @node    Multiple networks, How connections work, Configuration introduction, Configuration
620 @section Multiple networks
621
622 @cindex multiple networks
623 @cindex netname
624 In order to allow you to run more than one tinc daemon on one computer,
625 for instance if your computer is part of more than one VPN,
626 you can assign a ``netname'' to your VPN.
627 It is not required if you only run one tinc daemon,
628 it doesn't even have to be the same on all the sites of your VPN,
629 but it is recommended that you choose one anyway.
630
631 We will asume you use a netname throughout this document.
632 This means that you call tincd with the -n argument,
633 which will assign a netname to this daemon.
634
635 The effect of this is that the daemon will set its configuration
636 ``root'' to /etc/tinc/netname/, where netname is your argument to the -n
637 option.  You'll notice that it appears in syslog as ``tinc.netname''.
638
639 However, it is not strictly necessary that you call tinc with the -n
640 option.  In this case, the network name would just be empty, and it will
641 be used as such.  tinc now looks for files in /etc/tinc/, instead of
642 /etc/tinc/netname/; the configuration file should be /etc/tinc/tinc.conf,
643 and the host configuration files are now expected to be in /etc/tinc/hosts/.
644
645 But it is highly recommended that you use this feature of tinc, because
646 it will be so much clearer whom your daemon talks to.  Hence, we will
647 assume that you use it.
648
649
650 @c ==================================================================
651 @node    How connections work, Configuration files, Multiple networks, Configuration
652 @section How connections work
653
654 When tinc starts up, it parses the command-line options and then
655 reads in the configuration file.
656 If it sees a `ConnectTo' value pointing to another tinc daemon in the file,
657 it will try to connect to that other one.
658 Whether this succeeds or not and whether `ConnectTo' is specified or not,
659 tinc will listen for incoming connection from other deamons.
660 If you did specify a `ConnectTo' value and the other side is not responding,
661 tinc will keep retrying.
662 This means that once started, tinc will stay running until you tell it to stop,
663 and failures to connect to other tinc daemons will not stop your tinc daemon
664 for trying again later.
665 This means you don't have to intervene if there are any network problems.
666
667 @cindex client
668 @cindex server
669 There is no real distinction between a server and a client in tinc.
670 If you wish, you can view a tinc daemon without a `ConnectTo' value as a server,
671 and one which does specify such a value as a client.
672 It does not matter if two tinc daemons have a `ConnectTo' value pointing to eachother however.
673
674
675 @c ==================================================================
676 @node    Configuration files, Generating keypairs, How connections work, Configuration
677 @section Configuration files
678
679 The actual configuration of the daemon is done in the file
680 @file{/etc/tinc/netname/tinc.conf} and at least one other file in the directory
681 @file{/etc/tinc/netname/hosts/}.
682
683 These file consists of comments (lines started with a #) or assignments
684 in the form of
685
686 @example
687 Variable = Value.
688 @end example
689
690 The variable names are case insensitive, and any spaces, tabs, newlines
691 and carriage returns are ignored.  Note: it is not required that you put
692 in the `=' sign, but doing so improves readability.  If you leave it
693 out, remember to replace it with at least one space character.
694
695 In this section all valid variables are listed in alphabetical order.
696 The default value is given between parentheses; required directives are
697 given in @strong{bold}.
698
699 @menu
700 * Main configuration variables::
701 * Host configuration variables::
702 * How to configure::
703 @end menu
704
705
706 @c ==================================================================
707 @node    Main configuration variables, Host configuration variables, Configuration files, Configuration files
708 @subsection Main configuration variables
709
710 @table @asis
711 @item @strong{ConnectTo = <name>}
712 @cindex ConnectTo
713 Specifies which host to connect to on startup.  Multiple ConnectTo
714 variables may be specified, if connecting to the first one fails then
715 tinc will try the next one, and so on.  It is possible to specify
716 hostnames for dynamic IP addresses (like those given on dyndns.org),
717 tinc will not cache the resolved IP address.
718
719 If you don't specify a host with ConnectTo, regardless of whether a
720 value for ConnectPort is given, tinc won't connect at all, and will
721 instead just listen for incoming connections.
722
723 @item Hostnames = <yes|no> (no)
724 @cindex Hostnames
725 This option selects whether IP addresses (both real and on the VPN)
726 should be resolved.  Since DNS lookups are blocking, it might affect
727 tinc's efficiency, even stopping the daemon for a few seconds everytime
728 it does a lookup if your DNS server is not responding.
729
730 This does not affect resolving hostnames to IP addresses from the
731 configuration file.
732
733 @item Interface = <device>
734 @cindex Interface
735 If you have more than one network interface in your computer, tinc will
736 by default listen on all of them for incoming connections.  It is
737 possible to bind tinc to a single interface like eth0 or ppp0 with this
738 variable.
739
740 @item InterfaceIP = <local address>
741 @cindex InterfaceIP
742 If your computer has more than one IP address on a single interface (for
743 example if you are running virtual hosts), tinc will by default listen
744 on all of them for incoming connections.  It is possible to bind tinc to
745 a single IP address with this variable.  It is still possible to listen
746 on several interfaces at the same time though, if they share the same IP
747 address.
748
749 @item KeyExpire = <seconds> (3600)
750 @cindex KeyExpire
751 This option controls the time the encryption keys used to encrypt the data
752 are valid.  It is common practice to change keys at regular intervals to
753 make it even harder for crackers, even though it is thought to be nearly
754 impossible to crack a single key.
755
756 @item ListenPort = <port> (655)
757 @cindex ListenPort
758 Listen on local port port.  The computer connecting to this daemon should
759 use this number as the argument for his ConnectPort.
760
761 @item @strong{Name = <name>}
762 @cindex Name
763 This is a symbolic name for this connection.  It can be anything
764
765 @item PingTimeout = <seconds> (5)
766 @cindex PingTimeout
767 The number of seconds of inactivity that tinc will wait before sending a
768 probe to the other end.  If that other end doesn't answer within that
769 same amount of seconds, the connection is terminated, and the others
770 will be notified of this.
771
772 @item PrivateKey = <key> (obsolete)
773 @cindex PrivateKey
774 This is the RSA private key for tinc. However, for safety reasons it is
775 advised to store private keys of any kind in separate files. This prevents
776 accidental eavesdropping if you are editting the configuration file.
777
778 @item @strong{PrivateKeyFile = <path>} (recommended)
779 @cindex PrivateKeyFile
780 This is the full path name of the RSA private key file that was
781 generated by ``tincd --generate-keys''.  It must be a full path, not a
782 relative directory.
783
784 @item @strong{TapDevice = <device>} (/dev/tap0)
785 @cindex TapDevice
786 The ethertap device to use.  Note that you can only use one device per
787 daemon.  The info pages of the tinc package contain more information
788 about configuring an ethertap device for Linux.
789
790 @item TCPonly = <yes|no> (no, experimental)
791 @cindex TCPonly
792 If this variable is set to yes, then the packets are tunnelled over a TCP
793 connection instead of a UDP connection.  This is especially useful for those
794 who want to run a tinc daemon from behind a masquerading firewall, or if
795 UDP packet routing is disabled somehow.  This is experimental code,
796 try this at your own risk.
797 @end table
798
799
800 @c ==================================================================
801 @node    Host configuration variables, How to configure, Main configuration variables, Configuration files
802 @subsection Host configuration variables
803
804 @table @asis
805 @item @strong{Address = <IP address|hostname>}
806 @cindex Address
807 This variable is only required if you want to connect to this host.  It
808 must resolve to the external IP address where the host can be reached,
809 not the one that is internal to the VPN.
810
811 @item IndirectData = <yes|no> (no, experimental)
812 @cindex IndirectData
813 This option specifies whether other tinc daemons besides the one you
814 specified with ConnectTo can make a direct connection to you.  This is
815 especially useful if you are behind a firewall and it is impossible to
816 make a connection from the outside to your tinc daemon.  Otherwise, it
817 is best to leave this option out or set it to no.
818
819 @item Port = <port> (655)
820 @cindex Port
821 Connect to the upstream host (given with the ConnectTo directive) on
822 port port.  port may be given in decimal (default), octal (when preceded
823 by a single zero) o hexadecimal (prefixed with 0x).  port is the port
824 number for both the UDP and the TCP (meta) connections.
825
826 @item PublicKey = <key> (obsolete)
827 @cindex PublicKey
828 This is the RSA public key for this host.
829
830 @item PublicKeyFile = <path> (obsolete)
831 @cindex PublicKeyFile
832 This is the full path name of the RSA public key file that was generated
833 by ``tincd --generate-keys''.  It must be a full path, not a relative
834 directory.
835
836 @cindex PEM format
837 From version 1.0pre4 on tinc will store the public key directly into the
838 host configuration file in PEM format, the above two options then are not
839 necessary. Either the PEM format is used, or exactly
840 @strong{one of the above two options} must be specified
841 in each host configuration file, if you want to be able to establish a
842 connection with that host.
843
844 @item Subnet = <IP address/maskbits>
845 @cindex Subnet
846 This is the subnet range of all IP addresses that will be accepted by
847 the host that defines it.
848
849 The range must be contained in the IP address range of the tap device,
850 not the real IP address of the host running tincd.
851
852 @cindex CIDR notation
853 maskbits is the number of bits set to 1 in the netmask part; for
854 example: netmask 255.255.255.0 would become /24, 255.255.252.0 becomes
855 /22. This conforms to standard CIDR notation as described in
856 @uref{ftp://ftp.isi.edu/in-notes/rfc1519.txt, RFC1519}
857
858 @item TCPonly = <yes|no> (no, experimental)
859 @cindex TCPonly
860 If this variable is set to yes, then the packets are tunnelled over a
861 TCP connection instead of a UDP connection.  This is especially useful
862 for those who want to run a tinc daemon from behind a masquerading
863 firewall, or if UDP packet routing is disabled somehow. This is
864 experimental code, try this at your own risk. It may not work at all.
865 @end table
866
867
868 @c ==================================================================
869 @node    How to configure,  , Host configuration variables, Configuration files
870 @subsection How to configure
871
872 @subsubheading Step 1.  Creating the main configuration file
873
874 The main configuration file will be called @file{/etc/tinc/netname/tinc.conf}.
875 Adapt the following example to create a basic configuration file:
876
877 @example
878 Name = @emph{yourname}
879 TapDevice = @emph{/dev/tap0}
880 PrivateKeyFile = /etc/tinc/@emph{netname}/rsa_key.priv
881 @end example
882
883 Then, if you know to which other tinc daemon(s) yours is going to connect,
884 add `ConnectTo' values.
885
886 @subsubheading Step 2.  Creating your host configuration file
887
888 If you added a line containing `Name = yourname' in the main configuarion file,
889 you will need to create a host configuration file @file{/etc/tinc/netname/hosts/yourname}.
890 Adapt the following example to create a host configuration file:
891
892 @example
893 Address = @emph{your.real.hostname.org}
894 Subnet = @emph{192.168.1.0/24}
895 @end example
896
897 You can also use an IP address instead of a hostname.
898 The `Subnet' specifies the address range that is local for @emph{your part of the VPN only}.
899 If you have multiple address ranges you can specify more than one `Subnet'.
900 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).
901
902
903 @c ==================================================================
904 @node    Generating keypairs, Network interfaces, Configuration files, Configuration
905 @section Generating keypairs
906
907 @cindex key generation
908 Now that you have already created the main configuration file and your host configuration file,
909 you can easily create a public/private keypair by entering the following command:
910
911 @example
912 tincd -n @emph{netname} -K
913 @end example
914
915 tinc will generate a public and a private key and ask you where to put them.
916 Just press enter to accept the defaults.
917
918
919 @c ==================================================================
920 @node    Network interfaces, Example configuration, Generating keypairs, Configuration
921 @section Network interfaces
922
923 Before tinc can start transmitting data over the tunnel, it must
924 set up the ethertap network devices.
925
926 First, decide which IP addresses you want to have associated with these
927 devices, and what network mask they must have.
928
929 tinc will open an ethertap device or TUN/TAP device, which will also
930 create a network interface called `tap0', or `tap1', and so on if you are using
931 the ethertap driver, or a network interface with the same name as netname
932 if you are using the universal TUN/TAP driver.
933
934 @cindex tinc-up
935 You can configure that device by putting ordinary ifconfig, route, and other commands
936 to a script named @file{/etc/tinc/netname/tinc-up}. When tinc starts, this script
937 will be executed. When tinc exits, it will execute the script named
938 @file{/etc/tinc/netname/tinc-down}, but normally you don't need to create that script.
939
940 An example @file{tinc-up} script when using the TUN/TAP driver:
941
942 @example
943 #!/bin/sh
944 ifconfig $NETNAME hw ether fe:fd:00:00:00:00
945 ifconfig $NETNAME @emph{xx}.@emph{xx}.@emph{xx}.@emph{xx} netmask @emph{mask}
946 ifconfig $NETNAME -arp
947 @end example
948
949 @cindex MAC address
950 @cindex hardware address
951 The first line sets up the MAC address of the network interface.
952 Due to the nature of how Ethernet and tinc work, it has to be set to fe:fd:00:00:00:00.
953 (tinc versions prior to 1.0pre3 required that the MAC address matched the IP address.)
954 You can use the environment variable $NETNAME to get the name of the interface.
955 If you are using the ethertap driver however, you need to replace it with tap@emph{N},
956 corresponding to the device file name.
957
958 @cindex ifconfig
959 The next line gives the interface an IP address and a netmask.
960 The kernel will also automatically add a route to this interface, so normally you don't need
961 to add route commands to the @file{tinc-up} script.
962 The kernel will also bring the interface up after this command.
963 @cindex netmask
964 The netmask is the mask of the @emph{entire} VPN network, not just your
965 own subnet.
966
967 @cindex arp
968 The last line tells the kernel not to use ARP on that interface.
969 Again this has to do with how Ethernet and tinc work. Don't forget to add this line.
970
971
972 @c ==================================================================
973 @node    Example configuration,  , Network interfaces, Configuration
974 @section Example configuration
975
976
977 @cindex example
978 Imagine the following situation.  Branch A of our example `company' wants to connect
979 three branch offices in B, C and D using the Internet.  All four offices
980 have a 24/7 connection to the Internet.
981
982 A is going to serve as the center of the network.  B and C will connect
983 to A, and D will connect to C.  Each office will be assigned their own IP
984 network, 10.x.0.0.
985
986 @example
987 A: net 10.1.0.0 mask 255.255.0.0 gateway 10.1.54.1 internet IP 1.2.3.4
988 B: net 10.2.0.0 mask 255.255.0.0 gateway 10.2.1.12 internet IP 2.3.4.5
989 C: net 10.3.0.0 mask 255.255.0.0 gateway 10.3.69.254 internet IP 3.4.5.6
990 D: net 10.4.0.0 mask 255.255.0.0 gateway 10.4.3.32 internet IP 4.5.6.7
991 @end example
992
993 ``gateway'' is the VPN IP address of the machine that is running the
994 tincd.  ``internet IP'' is the IP address of the firewall, which does not
995 need to run tincd, but it must do a port forwarding of TCP&UDP on port
996 655 (unless otherwise configured).
997
998 In this example, it is assumed that eth0 is the interface that points to
999 the inner (physical) LAN of the office, although this could also be the
1000 same as the interface that leads to the Internet.  The configuration of
1001 the real interface is also shown as a comment, to give you an idea of
1002 how these example host is set up. All branches use the netname `company'
1003 for this particular VPN.
1004
1005 @subsubheading For Branch A
1006
1007 @emph{BranchA} would be configured like this:
1008
1009 In @file{/etc/tinc/company/tinc-up}:
1010
1011 @example
1012 # Real interface of internal network:
1013 # ifconfig eth0 10.1.54.1 netmask 255.255.0.0 broadcast 10.1.255.255
1014
1015 ifconfig tap0 hw ether fe:fd:00:00:00:00
1016 ifconfig tap0 10.1.54.1 netmask 255.0.0.0
1017 ifconfig tap0 -arp
1018 @end example
1019
1020 and in @file{/etc/tinc/company/tinc.conf}:
1021
1022 @example
1023 Name = BranchA
1024 PrivateKey = /etc/tinc/company/rsa_key.priv
1025 TapDevice = /dev/tap0
1026 @end example
1027
1028 On all hosts, /etc/tinc/company/hosts/BranchA contains:
1029
1030 @example
1031 Subnet = 10.1.0.0/16
1032 Address = 1.2.3.4
1033
1034 Note that the IP addresses of eth0 and tap0 are the same.
1035 This is quite possible, if you make sure that the netmasks of the interfaces are different.
1036 It is in fact recommended to give give both real internal network interfaces and tap interfaces the same IP address,
1037 since that will make things a lot easier to remember and set up.
1038
1039 -----BEGIN RSA PUBLIC KEY-----
1040 ...
1041 -----END RSA PUBLIC KEY-----
1042 @end example
1043
1044
1045 @subsubheading For Branch B
1046
1047 In @file{/etc/tinc/company/tinc-up}:
1048
1049 @example
1050 # Real interface of internal network:
1051 # ifconfig eth0 10.2.43.8 netmask 255.255.0.0 broadcast 10.2.255.255
1052
1053 ifconfig tap0 hw ether fe:fd:00:00:00:00
1054 ifconfig tap0 10.2.1.12 netmask 255.0.0.0
1055 ifconfig tap0 -arp
1056 @end example
1057
1058 and in @file{/etc/tinc/company/tinc.conf}:
1059
1060 @example
1061 Name = BranchB
1062 ConnectTo = BranchA
1063 PrivateKey = /etc/tinc/company/rsa_key.priv
1064 @end example
1065
1066 Note here that the internal address (on eth0) doesn't have to be the
1067 same as on the tap0 device.  Also, ConnectTo is given so that no-one can
1068 connect to this node.
1069
1070 On all hosts, in @file{/etc/tinc/company/hosts/BranchB}:
1071
1072 @example
1073 Subnet = 10.2.0.0/16
1074 Address = 2.3.4.5
1075
1076 -----BEGIN RSA PUBLIC KEY-----
1077 ...
1078 -----END RSA PUBLIC KEY-----
1079 @end example
1080
1081
1082 @subsubheading For Branch C
1083
1084 In @file{/etc/tinc/company/tinc-up}:
1085
1086 @example
1087 # Real interface of internal network:
1088 # ifconfig eth0 10.3.69.254 netmask 255.255.0.0 broadcast 10.3.255.255
1089
1090 ifconfig tap1 hw ether fe:fd:00:00:00:00
1091 ifconfig tap1 10.3.69.254 netmask 255.0.0.0
1092 ifconfig tap1 -arp
1093 @end example
1094
1095 and in @file{/etc/tinc/company/tinc.conf}:
1096
1097 @example
1098 Name = BranchC
1099 ConnectTo = BranchA
1100 TapDevice = /dev/tap1
1101 @end example
1102
1103 C already has another daemon that runs on port 655, so they have to
1104 reserve another port for tinc. It knows the portnumber it has to listen on
1105 from it's own host configuration file.
1106
1107 On all hosts, in @file{/etc/tinc/company/hosts/BranchC}:
1108
1109 @example
1110 Address = 3.4.5.6
1111 Subnet = 10.3.0.0/16
1112 Port = 2000
1113
1114 -----BEGIN RSA PUBLIC KEY-----
1115 ...
1116 -----END RSA PUBLIC KEY-----
1117 @end example
1118
1119
1120 @subsubheading For Branch D
1121
1122 In @file{/etc/tinc/company/tinc-up}:
1123
1124 @example
1125 # Real interface of internal network:
1126 # ifconfig eth0 10.4.3.32 netmask 255.255.0.0 broadcast 10.4.255.255
1127
1128 ifconfig company hw ether fe:fd:0a:04:03:20
1129 ifconfig company 10.4.3.32 netmask 255.0.0.0
1130 ifconfig company -arp
1131 @end example
1132
1133 and in @file{/etc/tinc/company/tinc.conf}:
1134
1135 @example
1136 Name = BranchD
1137 ConnectTo = BranchC
1138 TapDevice = /dev/net/tun
1139 PrivateKeyFile = /etc/tinc/company/rsa_key.priv
1140 @end example
1141
1142 D will be connecting to C, which has a tincd running for this network on
1143 port 2000. It knows the port number from the host configuration file.
1144 Also note that since D uses the TUN/TAP driver, the network interface
1145 will not be called `tun' or `tap0' or something like that, but will
1146 have the same name as netname.
1147
1148 On all hosts, in @file{/etc/tinc/company/hosts/BranchD}:
1149
1150 @example
1151 Subnet = 10.4.0.0/16
1152 Address = 4.5.6.7
1153
1154 -----BEGIN RSA PUBLIC KEY-----
1155 ...
1156 -----END RSA PUBLIC KEY-----
1157 @end example
1158
1159 @subsubheading Key files
1160
1161 A, B, C and D all have generated a public/private keypair with the following command:
1162
1163 @example
1164 tincd -n company -K
1165 @end example
1166
1167 The private key is stored in @file{/etc/tinc/company/rsa_key.priv},
1168 the public key is put into the host configuration file in the @file{/etc/tinc/company/hosts/} directory.
1169 During key generation, tinc automatically guesses the right filenames based on the -n option and
1170 the Name directive in the @file{tinc.conf} file (if it is available).
1171
1172 @subsubheading Starting
1173
1174 After each branch has finished configuration and they have distributed
1175 the host configuration files amongst them, they can start their tinc daemons.
1176 They don't necessarily have to wait for the other branches to have started
1177 their daemons, tinc will try connecting until they are available.
1178
1179
1180 @c ==================================================================
1181 @node    Running tinc, Technical information, Configuration, Top
1182 @chapter Running tinc
1183
1184 If everything else is done, you can start tinc by typing the following command:
1185
1186 @example
1187 tincd -n @emph{netname}
1188 @end example
1189
1190 @cindex daemon
1191 tinc will detach from the terminal and continue to run in the background like a good daemon.
1192 If there are any problems however you can try to increase the debug level
1193 and look in the syslog to find out what the problems are.
1194
1195 @menu
1196 * Runtime options::
1197 * Error messages::
1198 @end menu
1199
1200
1201 @c ==================================================================
1202 @node    Runtime options, Error messages,  , Running tinc
1203 @section Runtime options
1204
1205 Besides the settings in the configuration file, tinc also accepts some
1206 command line options.
1207
1208 This list is a longer version of that in the manpage.  The latter is
1209 generated automatically, so may be more up-to-date.
1210
1211 @cindex command line
1212 @cindex runtime options
1213 @cindex options
1214 @c from the manpage
1215 @table @samp
1216 @item -c, --config=PATH
1217 Read configuration options from the directory PATH.  The default is
1218 @file{/etc/tinc/netname/}.
1219
1220 @cindex debug level
1221 @item -d
1222 Increase debug level.  The higher it gets, the more gets
1223 logged.  Everything goes via syslog.
1224
1225 0 is the default, only some basic information connection attempts get
1226 logged.  Setting it to 1 will log a bit more, still not very
1227 disturbing.  With two -d's tincd will log protocol information, which can
1228 get pretty noisy.  Three or more -d's will output every single packet
1229 that goes out or comes in, which probably generates more data than the
1230 packets themselves.
1231
1232 @item -k, --kill
1233 Attempt to kill a running tincd and exit.  A TERM signal (15) gets sent
1234 to the daemon that his its PID in /var/run/tinc.pid.
1235
1236 Because it kills only one tinc daemon, you should use -n here if you
1237 started it that way.  It will then read the PID from
1238 @file{/var/run/tinc.NETNAME.pid}.
1239
1240 @item -n, --net=NETNAME
1241 Connect to net NETNAME.  @xref{Multiple networks}.
1242
1243 @item -K, --generate-keys[=BITS]
1244 Generate public/private keypair of BITS length. If BITS is not specified,
1245 1024 is the default. tinc will ask where you want to store the files,
1246 but will default to the configuration directory (you can use the -c or -n option
1247 in combination with -K). After that, tinc will quit.
1248
1249 @item --help
1250 Display a short reminder of these runtime options and terminate.
1251
1252 @item --version
1253 Output version information and exit.
1254
1255 @end table
1256
1257
1258 @c ==================================================================
1259 @node    Error messages,  , Runtime options, Running tinc
1260 @section Error messages
1261
1262 What follows is a list of the most common error messages you can see
1263 when configuring tinc.  Most of these messages are visible in the syslog
1264 only, so keep an eye on it!
1265
1266 @table @strong
1267 @item Could not open /dev/tap0: No such device
1268
1269 @itemize
1270 @item You forgot to `modprobe netlink_dev' or `modprobe ethertap'.
1271 @item You forgot to compile `Netlink device emulation' in the kernel.
1272 @end itemize
1273
1274 @item Can't write to /dev/net/tun: No such device
1275
1276 @itemize
1277 @item You forgot to `modprobe tun'.
1278 @item You forgot to compile `Universal TUN/TAP driver' in the kernel.
1279 @end itemize
1280
1281 @item Packet with destination 1.2.3.4 is looping back to us!
1282
1283 @itemize
1284 @item Something is not configured right. Packets are being sent out to the
1285 tap device, but according to the Subnet directives in your host configuration
1286 file, those packets should go to your own host. Most common mistake is that
1287 you have a Subnet line in your host configuration file with a netmask which is
1288 just as large as the netmask of the tap device. The latter should in almost all
1289 cases be larger. Rethink your configuration.
1290 Note that you will only see this message if you specified a debug
1291 level of 5 or higher!
1292 @item Chances are that a `Subnet = ...' line in the host configuration file of this tinc daemon is wrong.
1293 Change it to a subnet that is accepted locally by another interface,
1294 or if that is not the case, try changing the prefix length into /32. 
1295 @end itemize
1296
1297 @item Network doesn't work, syslog shows only packets of length 46
1298
1299 @cindex arp
1300 @example
1301 Jan 1 12:00:00 host tinc.net[1234]: Read packet of length 46 from tap device
1302 Jan 1 12:00:00 host tinc.net[1234]: Trying to look up 0.0.192.168 in connection list failed!
1303 @end example
1304 @itemize
1305 @item Add the `ifconfig $NETNAME -arp' to tinc-up.
1306 @end itemize
1307
1308 @item Network address and subnet mask do not match!
1309
1310 @itemize
1311 @item The Subnet field must contain a @emph{network} address.
1312 @item If you only want to use one IP address, set the netmask to /32.
1313 @end itemize
1314
1315 @item This is a bug: net.c:253: 24: Some error
1316
1317 @itemize
1318 @item This is something that should not have happened.
1319 Please report this, and tell us exactly what went wrong before you got
1320 this message.  In normal operation, these errors should not occur.
1321 @end itemize
1322
1323 @item Error reading RSA key file `rsa_key.priv': No such file or directory
1324
1325 @itemize
1326 @item You must specify the complete pathname.
1327 Specifying a relative path does not make sense here.  tinc changes its
1328 directory to / when starting (to avoid keeping a mount point busy); and
1329 even if we built in a default directory to look for these files, the key
1330 files are bound to be in a different directory.
1331 @end itemize
1332
1333 @end table
1334
1335 @c ==================================================================
1336 @node    Technical information, About us, Running tinc, Top
1337 @chapter Technical information
1338
1339
1340 @menu
1341 * The Connection::
1342 * Security::
1343 @end menu
1344
1345
1346 @c ==================================================================
1347 @node    The Connection, Security, Technical information, Technical information
1348 @section The basic philosophy of the way tinc works
1349 @cindex connection
1350
1351 tinc is a daemon that takes VPN data and transmit that to another host
1352 computer over the existing Internet infrastructure.
1353
1354 @menu
1355 * Protocol Preview::
1356 * The Meta-connection::
1357 @end menu
1358
1359
1360 @c ==================================================================
1361 @node    Protocol Preview, The Meta-connection, The Connection, The Connection
1362 @subsection A preview of the way the tinc works
1363
1364 @cindex ethertap
1365 @cindex frame type
1366 The data itself is read from a character device file, the so-called
1367 @emph{ethertap} device.  This device is associated with a network
1368 interface.  Any data sent to this interface can be read from the device,
1369 and any data written to the device gets sent from the interface.  Data to
1370 and from the device is formatted as if it were a normal Ethernet card,
1371 so a frame is preceded by two MAC addresses and a @emph{frame type}
1372 field.
1373
1374 So when tinc reads an Ethernet frame from the device, it determines its
1375 type.  Right now, tinc can only handle Internet Protocol version 4 (IPv4)
1376 frames, because it needs IP headers for routing.
1377 Plans to support other protocols and switching instead of routing are being made.
1378 (Some code for IPv6 routing and switching is already present but nonfunctional.)
1379 When tinc knows
1380 which type of frame it has read, it can also read the source and
1381 destination address from it.
1382
1383 Now it is time that the frame gets encrypted.  Currently the only
1384 encryption algorithm available is blowfish.
1385
1386 @cindex encapsulating
1387 @cindex UDP
1388 When the encryption is ready, time has come to actually transport the
1389 packet to the destination computer.  We do this by sending the packet
1390 over an UDP connection to the destination host.  This is called
1391 @emph{encapsulating}, the VPN packet (though now encrypted) is
1392 encapsulated in another IP datagram.
1393
1394 When the destination receives this packet, the same thing happens, only
1395 in reverse.  So it does a decrypt on the contents of the UDP datagram,
1396 and it writes the decrypted information to its own ethertap device.
1397
1398 To let the kernel on the receiving end accept the packet, the destination MAC
1399 address must match that of the tap interface. Because of the routing nature
1400 of tinc, ARP is not possible. tinc solves this by always overwriting the
1401 destination MAC address with fe:fd:0:0:0:0. That is also the reason why you must
1402 set the MAC address of your tap interface to that address.
1403
1404
1405 @c ==================================================================
1406 @node    The Meta-connection,  , Protocol Preview, The Connection
1407 @subsection The meta-connection
1408
1409 Having only an UDP connection available is not enough.  Though suitable
1410 for transmitting data, we want to be able to reliably send other
1411 information, such as routing and session key information to somebody.
1412
1413 @cindex TCP
1414 TCP is a better alternative, because it already contains protection
1415 against information being lost, unlike UDP.
1416
1417 So we establish two connections.  One for the encrypted VPN data, and one
1418 for other information, the meta-data.  Hence, we call the second
1419 connection the meta-connection.  We can now be sure that the
1420 meta-information doesn't get lost on the way to another computer.
1421
1422 @cindex data-protocol
1423 @cindex meta-protocol
1424 Like with any communication, we must have a protocol, so that everybody
1425 knows what everything stands for, and how she should react.  Because we
1426 have two connections, we also have two protocols.  The protocol used for
1427 the UDP data is the ``data-protocol,'' the other one is the
1428 ``meta-protocol.''
1429
1430 The reason we don't use TCP for both protocols is that UDP is much
1431 better for encapsulation, even while it is less reliable.  The real
1432 problem is that when TCP would be used to encapsulate a TCP stream
1433 that's on the private network, for every packet sent there would be
1434 three ACKs sent instead of just one.  Furthermore, if there would be
1435 a timeout, both TCP streams would sense the timeout, and both would
1436 start re-sending packets.
1437
1438 @c ==================================================================
1439 @node    Security,  , The Connection, Technical information
1440 @section About tinc's encryption and other security-related issues.
1441
1442 @cindex TINC
1443 @cindex Cabal
1444 tinc got its name from ``TINC,'' short for @emph{There Is No Cabal}; the
1445 alleged Cabal was/is an organisation that was said to keep an eye on the
1446 entire Internet.  As this is exactly what you @emph{don't} want, we named
1447 the tinc project after TINC.
1448
1449 @cindex SVPN
1450 But in order to be ``immune'' to eavesdropping, you'll have to encrypt
1451 your data.  Because tinc is a @emph{Secure} VPN (SVPN) daemon, it does
1452 exactly that: encrypt.
1453 tinc uses blowfish encryption in CBC mode and a small amount of salt
1454 at the beginning of each packet to make sure eavesdroppers cannot get
1455 any information at all from the packets they can intercept.
1456
1457 @cindex authentication
1458 Another important part is the authentication done prior to allowing other
1459 tinc daemons to connect. This is done by a challenge/response handshake
1460 involving RSA encryption.
1461 The details of the authentication can be found in a file called @file{doc/SECURITY2}
1462 in the source of tinc.
1463
1464
1465 @c ==================================================================
1466 @node    About us, Concept Index, Technical information, Top
1467 @chapter About us
1468
1469
1470 @menu
1471 * Contact Information::
1472 * Authors::
1473 @end menu
1474
1475
1476 @c ==================================================================
1477 @node    Contact Information, Authors, About us, About us
1478 @section Contact information
1479
1480 @cindex website
1481 tinc's website is at @url{http://tinc.nl.linux.org/},
1482 this server is located in the Netherlands.
1483
1484 @cindex IRC
1485 We have an IRC channel on the Open Projects IRC network.  Connect to
1486 @uref{http://openprojects.nu/services/irc.html, irc.openprojects.net},
1487 and join channel #tinc.
1488
1489
1490 @c ==================================================================
1491 @node    Authors,  , Contact Information, About us
1492 @section Authors
1493
1494 @table @asis
1495 @item Ivo Timmermans (zarq) (@email{itimmermans@@bigfoot.com})
1496 Main coder/hacker and maintainer of the package.
1497
1498 @item Guus Sliepen (guus) (@email{guus@@sliepen.warande.net})
1499 Originator of it all, co-author.
1500
1501 @item Wessel Dankers (Ubiq) (@email{wsl@@nl.linux.org})
1502 For the name `tinc' and various suggestions.
1503
1504 @end table
1505
1506 We have received a lot of valuable input from users.  With their help,
1507 tinc has become the flexible and robust tool that it is today.  We have
1508 composed a list of contributions, in the file called @file{THANKS} in
1509 the source distribution.
1510
1511
1512 @c ==================================================================
1513 @node    Concept Index,  , About us, Top
1514 @c        node-name,    next, previous,        up
1515 @unnumbered Concept Index
1516
1517 @c ==================================================================
1518 @printindex cp
1519
1520
1521 @c ==================================================================
1522 @contents
1523 @bye