3 .\" Manual page created by:
5 .\" Guus Sliepen <guus@tinc-vpn.org>
9 .Nd tinc daemon configuration
13 .Pa @sysconfdir@/tinc/
14 directory contain runtime and security information for the tinc daemon.
17 It is perfectly ok for you to run more than one tinc daemon.
18 However, in its default form,
19 you will soon notice that you can't use two different configuration files without the
24 We have thought of another way of dealing with this: network names.
25 This means that you call
29 option, which will assign a name to this daemon.
32 The effect of this is that the daemon will set its configuration root to
33 .Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa / ,
36 is your argument to the
39 You'll notice that messages appear in syslog as coming from
40 .Nm tincd. Ns Ar NETNAME .
43 However, it is not strictly necessary that you call tinc with the
46 In this case, the network name would just be empty,
47 and it will be used as such.
49 now looks for files in
50 .Pa @sysconfdir@/tinc/ ,
52 .Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa / ;
53 the configuration file should be
54 .Pa @sysconfdir@/tinc/tinc.conf ,
55 and the host configuration files are now expected to be in
56 .Pa @sysconfdir@/tinc/hosts/ .
59 But it is highly recommended that you use this feature of
61 because it will be so much clearer whom your daemon talks to.
62 Hence, we will assume that you use it.
65 Each tinc daemon should have a name that is unique in the network which it will be part of.
66 The name will be used by other tinc daemons for identification.
67 The name has to be declared in the
68 .Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /tinc.conf
73 choose something that will give unique and easy to remember names to your tinc daemon(s).
74 You could try things like hostnames, owner surnames or location names.
76 .Sh PUBLIC/PRIVATE KEYS
79 to generate public/private keypairs.
80 It will generate two keys.
81 The private key should be stored in a separate file
82 .Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /rsa_key.priv
85 stands for the network (see
88 The public key should be stored in the host configuration file
89 .Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /hosts/ Ns Va NAME
92 stands for the name of the local tinc daemon (see
95 .Sh SERVER CONFIGURATION
96 The server configuration of the daemon is done in the file
97 .Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /tinc.conf .
98 This file consists of comments (lines started with a
100 or assignments in the form of:
103 .Va Variable Li = Ar Value .
106 The variable names are case insensitive, and any spaces, tabs,
107 newlines and carriage returns are ignored.
108 Note: it is not required that you put in the
110 sign, but doing so improves readability.
111 If you leave it out, remember to replace it with at least one space character.
114 The server configuration is complemented with host specific configuration (see the next section).
115 Although all configuration options for the local host listed in this document can also be put in
116 .Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /tinc.conf ,
117 it is recommended to put host specific configuration options in the host configuration file,
118 as this makes it easy to exchange with other nodes.
121 Here are all valid variables, listed in alphabetical order.
122 The default value is given between parentheses.
123 .Bl -tag -width indent
125 .It Va AddressFamily Li = ipv4 | ipv6 | any Pq any
126 This option affects the address family of listening and outgoing sockets.
129 is selected, then depending on the operating system both IPv4 and IPv6 or just
130 IPv6 listening sockets will be created.
132 .It Va BindToAddress Li = Ar address Bq experimental
133 If your computer has more than one IPv4 or IPv6 address,
135 will by default listen on all of them for incoming connections.
138 variables may be specified,
139 in which case listening sockets for each specified address are made.
142 This option may not work on all platforms.
144 .It Va BindToInterface Li = Ar interface Bq experimental
145 If your computer has more than one network interface,
147 will by default listen on all of them for incoming connections.
148 It is possible to bind only to a single interface with this variable.
151 This option may not work on all platforms.
153 .It Va ConnectTo Li = Ar name
154 Specifies which other tinc daemon to connect to on startup.
157 variables may be specified,
158 in which case outgoing connections to each specified tinc daemon are made.
159 The names should be known to this tinc daemon
160 (i.e., there should be a host configuration file for the name on the
165 If you don't specify a host with
168 won't try to connect to other daemons at all,
169 and will instead just listen for incoming connections.
171 .It Va Device Li = Ar device Po Pa /dev/tap0 , Pa /dev/net/tun No or other depending on platform Pc
172 The virtual network device to use.
174 will automatically detect what kind of device it is.
175 Note that you can only use one device per daemon.
180 The info pages of the tinc package contain more information
181 about configuring the virtual network device.
183 .It Va DeviceType Li = Ar type Pq platform dependent
184 The type of the virtual network device.
185 Tinc will normally automatically select the right type of tun/tap interface, and this option should not be used.
186 However, this option can be used to select one of the special interface types, if support for them is compiled in.
187 .Bl -tag -width indent
190 Use a dummy interface.
191 No packets are ever read or written to a virtual network device.
192 Useful for testing, or when setting up a node that only forwards packets for other nodes.
195 Open a raw socket, and bind it to a pre-existing
198 All packets are read from this interface.
199 Packets received for the local node are written to the raw socket.
200 However, at least on Linux, the operating system does not process IP packets destined for the local host.
202 .It uml Pq not compiled in by default
203 Create a UNIX socket with the filename specified by
206 .Pa @localstatedir@/run/ Ns Ar NETNAME Ns Pa .umlsocket
209 will wait for a User Mode Linux instance to connect to this socket.
211 .It vde Pq not compiled in by default
212 Uses the libvdeplug library to connect to a Virtual Distributed Ethernet switch,
213 using the UNIX socket specified by
216 .Pa @localstatedir@/run/vde.ctl
220 Also, in case tinc does not seem to correctly interpret packets received from the virtual network device,
221 it can be used to change the way packets are interpreted:
223 .Bl -tag -width indent
225 .It tun Pq BSD and Linux
227 Depending on the platform, this can either be with or without an address family header (see below).
230 Set type to tun without an address family header.
231 Tinc will expect packets read from the virtual network device to start with an IP header.
232 On some platforms IPv6 packets cannot be read from or written to the device in this mode.
235 Set type to tun with an address family header.
236 Tinc will expect packets read from the virtual network device
237 to start with a four byte header containing the address family,
238 followed by an IP header.
239 This mode should support both IPv4 and IPv6 packets.
241 .It tap Pq BSD and Linux
243 Tinc will expect packets read from the virtual network device
244 to start with an Ethernet header.
247 .It Va DirectOnly Li = yes | no Po no Pc Bq experimental
248 When this option is enabled, packets that cannot be sent directly to the destination node,
249 but which would have to be forwarded by an intermediate node, are dropped instead.
250 When combined with the IndirectData option,
251 packets for nodes for which we do not have a meta connection with are also dropped.
253 .It Va Forwarding Li = off | internal | kernel Po internal Pc Bq experimental
254 This option selects the way indirect packets are forwarded.
255 .Bl -tag -width indent
258 Incoming packets that are not meant for the local node,
259 but which should be forwarded to another node, are dropped.
262 Incoming packets that are meant for another node are forwarded by tinc internally.
265 This is the default mode, and unless you really know you need another forwarding mode, don't change it.
268 Incoming packets are always sent to the TUN/TAP device, even if the packets are not for the local node.
269 This is less efficient, but allows the kernel to apply its routing and firewall rules on them,
270 and can also help debugging.
273 .It Va GraphDumpFile Li = Ar filename Bq experimental
274 If this option is present,
276 will dump the current network graph to the file
278 every minute, unless there were no changes to the graph.
279 The file is in a format that can be read by graphviz tools.
282 starts with a pipe symbol |,
283 then the rest of the filename is interpreted as a shell command
284 that is executed, the graph is then sent to stdin.
286 .It Va Hostnames Li = yes | no Pq no
287 This option selects whether IP addresses (both real and on the VPN) should
288 be resolved. Since DNS lookups are blocking, it might affect tinc's
289 efficiency, even stopping the daemon for a few seconds every time it does
290 a lookup if your DNS server is not responding.
293 This does not affect resolving hostnames to IP addresses from the
294 host configuration files.
296 .It Va IffOneQueue Li = yes | no Po no Pc Bq experimental
297 (Linux only) Set IFF_ONE_QUEUE flag on TUN/TAP devices.
299 .It Va Interface Li = Ar interface
300 Defines the name of the interface corresponding to the virtual network device.
301 Depending on the operating system and the type of device this may or may not actually set the name of the interface.
302 Under Windows, this variable is used to select which network interface will be used.
305 this variable is almost always already correctly set.
307 .It Va KeyExpire Li = Ar seconds Pq 3600
308 This option controls the period the encryption keys used to encrypt the data are valid.
309 It is common practice to change keys at regular intervals to make it even harder for crackers,
310 even though it is thought to be nearly impossible to crack a single key.
312 .It Va MACExpire Li = Ar seconds Pq 600
313 This option controls the amount of time MAC addresses are kept before they are removed.
314 This only has effect when
319 .It Va MaxTimeout Li = Ar seconds Pq 900
320 This is the maximum delay before trying to reconnect to other tinc daemons.
322 .It Va Mode Li = router | switch | hub Pq router
323 This option selects the way packets are routed to other daemons.
324 .Bl -tag -width indent
329 variables in the host configuration files will be used to form a routing table.
330 Only unicast packets of routable protocols (IPv4 and IPv6) are supported in this mode.
333 This is the default mode, and unless you really know you need another mode, don't change it.
336 In this mode the MAC addresses of the packets on the VPN will be used to
337 dynamically create a routing table just like an Ethernet switch does.
338 Unicast, multicast and broadcast packets of every protocol that runs over Ethernet are supported in this mode
339 at the cost of frequent broadcast ARP requests and routing table updates.
342 This mode is primarily useful if you want to bridge Ethernet segments.
345 This mode is almost the same as the switch mode, but instead
346 every packet will be broadcast to the other daemons
347 while no routing table is managed.
350 .It Va Name Li = Ar name Bq required
351 This is the name which identifies this tinc daemon.
352 It must be unique for the virtual private network this daemon will connect to.
354 .It Va PingInterval Li = Ar seconds Pq 60
355 The number of seconds of inactivity that
357 will wait before sending a probe to the other end.
359 .It Va PingTimeout Li = Ar seconds Pq 5
360 The number of seconds to wait for a response to pings or to allow meta
361 connections to block. If the other end doesn't respond within this time,
362 the connection is terminated,
363 and the others will be notified of this.
365 .It Va PriorityInheritance Li = yes | no Po no Pc Bq experimental
366 When this option is enabled the value of the TOS field of tunneled IPv4 packets
367 will be inherited by the UDP packets that are sent out.
369 .It Va PrivateKey Li = Ar key Bq obsolete
370 The private RSA key of this tinc daemon.
371 It will allow this tinc daemon to authenticate itself to other daemons.
373 .It Va PrivateKeyFile Li = Ar filename Po Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /rsa_key.priv Pc
374 The file in which the private RSA key of this tinc daemon resides.
375 Note that there must be exactly one of
379 specified in the configuration file.
381 .It Va ProcessPriority Li = low | normal | high
382 When this option is used the priority of the tincd process will be adjusted.
383 Increasing the priority may help to reduce latency and packet loss on the VPN.
385 .It Va ReplayWindow Li = Ar bytes Pq 16
386 This is the size of the replay tracking window for each remote node, in bytes.
387 The window is a bitfield which tracks 1 packet per bit, so for example
388 the default setting of 16 will track up to 128 packets in the window. In high
389 bandwidth scenarios, setting this to a higher value can reduce packet loss from
390 the interaction of replay tracking with underlying real packet loss and/or
391 reordering. Setting this to zero will disable replay tracking completely and
392 pass all traffic, but leaves tinc vulnerable to replay-based attacks on your
395 .It Va StrictSubnets Li = yes | no Po no Pc Bq experimental
396 When this option is enabled tinc will only use Subnet statements which are
397 present in the host config files in the local
398 .Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /hosts/
401 .It Va TunnelServer Li = yes | no Po no Pc Bq experimental
402 When this option is enabled tinc will no longer forward information between other tinc daemons,
403 and will only allow connections with nodes for which host config files are present in the local
404 .Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /hosts/
406 Setting this options also implicitly sets StrictSubnets.
408 .It Va UDPRcvBuf Li = Ar bytes Pq OS default
409 Sets the socket receive buffer size for the UDP socket, in bytes.
410 If unset, the default buffer size will be used by the operating system.
412 .It Va UDPSndBuf Li = Ar bytes Pq OS default
413 Sets the socket send buffer size for the UDP socket, in bytes.
414 If unset, the default buffer size will be used by the operating system.
417 .Sh HOST CONFIGURATION FILES
418 The host configuration files contain all information needed
419 to establish a connection to those hosts.
420 A host configuration file is also required for the local tinc daemon,
421 it will use it to read in it's listen port, public key and subnets.
424 The idea is that these files are portable.
425 You can safely mail your own host configuration file to someone else.
426 That other person can then copy it to his own hosts directory,
427 and now his tinc daemon will be able to connect to your tinc daemon.
428 Since host configuration files only contain public keys,
429 no secrets are revealed by sending out this information.
430 .Bl -tag -width indent
432 .It Va Address Li = Ar address Oo port Oc Bq recommended
433 The IP address or hostname of this tinc daemon on the real network.
434 This will only be used when trying to make an outgoing connection to this tinc daemon.
435 Optionally, a port can be specified to use for this address.
438 variables can be specified, in which case each address will be tried until a working
439 connection has been established.
441 .It Va Cipher Li = Ar cipher Pq blowfish
442 The symmetric cipher algorithm used to encrypt UDP packets.
443 Any cipher supported by OpenSSL is recognised.
444 Furthermore, specifying
446 will turn off packet encryption.
447 It is best to use only those ciphers which support CBC mode.
449 .It Va ClampMSS Li = yes | no Pq yes
450 This option specifies whether tinc should clamp the maximum segment size (MSS)
451 of TCP packets to the path MTU. This helps in situations where ICMP
452 Fragmentation Needed or Packet too Big messages are dropped by firewalls.
454 .It Va Compression Li = Ar level Pq 0
455 This option sets the level of compression used for UDP packets.
456 Possible values are 0 (off), 1 (fast zlib) and any integer up to 9 (best zlib),
457 10 (fast lzo) and 11 (best lzo).
459 .It Va Digest Li = Ar digest Pq sha1
460 The digest algorithm used to authenticate UDP packets.
461 Any digest supported by OpenSSL is recognised.
462 Furthermore, specifying
464 will turn off packet authentication.
466 .It Va IndirectData Li = yes | no Pq no
467 This option specifies whether other tinc daemons besides the one you specified with
469 can make a direct connection to you.
470 This is especially useful if you are behind a firewall
471 and it is impossible to make a connection from the outside to your tinc daemon.
472 Otherwise, it is best to leave this option out or set it to no.
474 .It Va MACLength Li = Ar length Pq 4
475 The length of the message authentication code used to authenticate UDP packets.
478 up to the length of the digest produced by the digest algorithm.
480 .It Va PMTU Li = Ar mtu Po 1514 Pc
481 This option controls the initial path MTU to this node.
483 .It Va PMTUDiscovery Li = yes | no Po yes Pc
484 When this option is enabled, tinc will try to discover the path MTU to this node.
485 After the path MTU has been discovered, it will be enforced on the VPN.
487 .It Va Port Li = Ar port Pq 655
488 The port number on which this tinc daemon is listening for incoming connections,
489 which is used if no port number is specified in an
493 .It Va PublicKey Li = Ar key Bq obsolete
494 The public RSA key of this tinc daemon.
495 It will be used to cryptographically verify it's identity and to set up a secure connection.
497 .It Va PublicKeyFile Li = Ar filename Bq obsolete
498 The file in which the public RSA key of this tinc daemon resides.
501 From version 1.0pre4 on
503 will store the public key directly into the host configuration file in PEM format,
504 the above two options then are not necessary.
505 Either the PEM format is used, or exactly one of the above two options must be specified
506 in each host configuration file,
507 if you want to be able to establish a connection with that host.
509 .It Va Subnet Li = Ar address Ns Op Li / Ns Ar prefixlength Ns Op Li # Ns Ar weight
510 The subnet which this tinc daemon will serve.
512 tries to look up which other daemon it should send a packet to by searching the appropriate subnet.
513 If the packet matches a subnet,
514 it will be sent to the daemon who has this subnet in his host configuration file.
517 variables can be specified.
520 Subnets can either be single MAC, IPv4 or IPv6 addresses,
521 in which case a subnet consisting of only that single address is assumed,
522 or they can be a IPv4 or IPv6 network address with a prefixlength.
523 Shorthand notations are not supported.
524 For example, IPv4 subnets must be in a form like 192.168.1.0/24,
525 where 192.168.1.0 is the network address and 24 is the number of bits set in the netmask.
526 Note that subnets like 192.168.1.1/24 are invalid!
527 Read a networking HOWTO/FAQ/guide if you don't understand this.
528 IPv6 subnets are notated like fec0:0:0:1:0:0:0:0/64.
529 MAC addresses are notated like 0:1a:2b:3c:4d:5e.
532 A Subnet can be given a weight to indicate its priority over identical Subnets
533 owned by different nodes. The default weight is 10. Lower values indicate
534 higher priority. Packets will be sent to the node with the highest priority,
535 unless that node is not reachable, in which case the node with the next highest
536 priority will be tried, and so on.
538 .It Va TCPOnly Li = yes | no Pq no Bq obsolete
539 If this variable is set to yes,
540 then the packets are tunnelled over the TCP connection instead of a UDP connection.
541 This is especially useful for those who want to run a tinc daemon
542 from behind a masquerading firewall,
543 or if UDP packet routing is disabled somehow.
544 Setting this options also implicitly sets IndirectData.
547 Since version 1.0.10, tinc will automatically detect whether communication via
548 UDP is possible or not.
552 Apart from reading the server and host configuration files,
553 tinc can also run scripts at certain moments.
554 Under Windows (not Cygwin), the scripts should have the extension
556 .Bl -tag -width indent
558 .It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /tinc-up
559 This is the most important script.
560 If it is present it will be executed right after the tinc daemon has been started and has connected to the virtual network device.
561 It should be used to set up the corresponding network interface,
562 but can also be used to start other things.
563 Under Windows you can use the Network Connections control panel instead of creating this script.
565 .It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /tinc-down
566 This script is started right before the tinc daemon quits.
568 .It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /hosts/ Ns Ar HOST Ns Pa -up
569 This script is started when the tinc daemon with name
573 .It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /hosts/ Ns Ar HOST Ns Pa -down
574 This script is started when the tinc daemon with name
578 .It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /host-up
579 This script is started when any host becomes reachable.
581 .It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /host-down
582 This script is started when any host becomes unreachable.
584 .It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /subnet-up
585 This script is started when a Subnet becomes reachable.
586 The Subnet and the node it belongs to are passed in environment variables.
588 .It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /subnet-down
589 This script is started when a Subnet becomes unreachable.
593 The scripts are started without command line arguments, but can make use of certain environment variables.
594 Under UNIX like operating systems the names of environment variables must be preceded by a
599 files, they have to be put between
602 .Bl -tag -width indent
605 If a netname was specified, this environment variable contains it.
608 Contains the name of this tinc daemon.
611 Contains the name of the virtual network device that tinc uses.
614 Contains the name of the virtual network interface that tinc uses.
615 This should be used for commands like
619 When a host becomes (un)reachable, this is set to its name.
620 If a subnet becomes (un)reachable, this is set to the owner of that subnet.
623 When a host becomes (un)reachable, this is set to its real address.
626 When a host becomes (un)reachable, this is set to the port number it uses for communication with other tinc daemons.
629 When a subnet becomes (un)reachable, this is set to the subnet.
632 When a subnet becomes (un)reachable, this is set to the subnet weight.
636 The most important files are:
637 .Bl -tag -width indent
639 .It Pa @sysconfdir@/tinc/
640 The top directory for configuration files.
642 .It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /tinc.conf
643 The default name of the server configuration file for net
646 .It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /hosts/
647 Host configuration files are kept in this directory.
649 .It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /tinc-up
650 If an executable file with this name exists,
651 it will be executed right after the tinc daemon has connected to the virtual network device.
652 It can be used to set up the corresponding network interface.
654 .It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /tinc-down
655 If an executable file with this name exists,
656 it will be executed right before the tinc daemon is going to close
657 its connection to the virtual network device.
662 .Pa http://www.tinc-vpn.org/ ,
663 .Pa http://www.linuxdoc.org/LDP/nag2/ .
666 The full documentation for
668 is maintained as a Texinfo manual.
669 If the info and tinc programs are properly installed at your site, the command
671 should give you access to the complete manual.
675 comes with ABSOLUTELY NO WARRANTY.
676 This is free software, and you are welcome to redistribute it under certain conditions;
677 see the file COPYING for details.