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 Here are all valid variables, listed in alphabetical order.
115 The default value is given between parentheses.
116 .Bl -tag -width indent
118 .It Va AddressFamily Li = ipv4 | ipv6 | any Pq any
119 This option affects the address family of listening and outgoing sockets.
122 is selected, then depending on the operating system both IPv4 and IPv6 or just
123 IPv6 listening sockets will be created.
125 .It Va BindToAddress Li = Ar address Bq experimental
126 If your computer has more than one IPv4 or IPv6 address,
128 will by default listen on all of them for incoming connections.
129 It is possible to bind only to a single address with this variable.
132 This option may not work on all platforms.
134 .It Va BindToInterface Li = Ar interface Bq experimental
135 If your computer has more than one network interface,
137 will by default listen on all of them for incoming connections.
138 It is possible to bind only to a single interface with this variable.
141 This option may not work on all platforms.
143 .It Va ConnectTo Li = Ar name
144 Specifies which other tinc daemon to connect to on startup.
147 variables may be specified,
148 in which case outgoing connections to each specified tinc daemon are made.
149 The names should be known to this tinc daemon
150 (i.e., there should be a host configuration file for the name on the
155 If you don't specify a host with
158 won't try to connect to other daemons at all,
159 and will instead just listen for incoming connections.
161 .It Va Device Li = Ar device Po Pa /dev/tap0 , Pa /dev/net/tun No or other depending on platform Pc
162 The virtual network device to use.
164 will automatically detect what kind of device it is.
165 Note that you can only use one device per daemon.
170 The info pages of the tinc package contain more information
171 about configuring the virtual network device.
173 .It Va DeviceType Li = tun | tunnohead | tunifhead | tap Po only supported on BSD platforms Pc
174 The type of the virtual network device.
175 Tinc will normally automatically select the right type, and this option should not be used.
176 However, in case tinc does not seem to correctly interpret packets received from the virtual network device,
177 using this option might help.
178 .Bl -tag -width indent
182 Depending on the platform, this can either be with or without an address family header (see below).
185 Set type to tun without an address family header.
186 Tinc will expect packets read from the virtual network device to start with an IP header.
187 On some platforms IPv6 packets cannot be read from or written to the device in this mode.
190 Set type to tun with an address family header.
191 Tinc will expect packets read from the virtual network device
192 to start with a four byte header containing the address family,
193 followed by an IP header.
194 This mode should support both IPv4 and IPv6 packets.
198 Tinc will expect packets read from the virtual network device
199 to start with an Ethernet header.
202 .It Va GraphDumpFile Li = Ar filename Bq experimental
203 If this option is present,
205 will dump the current network graph to the file
207 every minute, unless there were no changes to the graph.
208 The file is in a format that can be read by graphviz tools.
211 starts with a pipe symbol |,
212 then the rest of the filename is interpreted as a shell command
213 that is executed, the graph is then sent to stdin.
215 .It Va Hostnames Li = yes | no Pq no
216 This option selects whether IP addresses (both real and on the VPN) should
217 be resolved. Since DNS lookups are blocking, it might affect tinc's
218 efficiency, even stopping the daemon for a few seconds every time it does
219 a lookup if your DNS server is not responding.
222 This does not affect resolving hostnames to IP addresses from the
223 host configuration files.
225 .It Va Interface Li = Ar interface
226 Defines the name of the interface corresponding to the virtual network device.
227 Depending on the operating system and the type of device this may or may not actually set the name of the interface.
228 Under Windows, this variable is used to select which network interface will be used.
231 this variable is almost always already correctly set.
233 .It Va KeyExpire Li = Ar seconds Pq 3600
234 This option controls the period the encryption keys used to encrypt the data are valid.
235 It is common practice to change keys at regular intervals to make it even harder for crackers,
236 even though it is thought to be nearly impossible to crack a single key.
238 .It Va MACExpire Li = Ar seconds Pq 600
239 This option controls the amount of time MAC addresses are kept before they are removed.
240 This only has effect when
245 .It Va MaxTimeout Li = Ar seconds Pq 900
246 This is the maximum delay before trying to reconnect to other tinc daemons.
248 .It Va Mode Li = router | switch | hub Pq router
249 This option selects the way packets are routed to other daemons.
250 .Bl -tag -width indent
255 variables in the host configuration files will be used to form a routing table.
256 Only unicast packets of routable protocols (IPv4 and IPv6) are supported in this mode.
259 This is the default mode, and unless you really know you need another mode, don't change it.
262 In this mode the MAC addresses of the packets on the VPN will be used to
263 dynamically create a routing table just like an Ethernet switch does.
264 Unicast, multicast and broadcast packets of every protocol that runs over Ethernet are supported in this mode
265 at the cost of frequent broadcast ARP requests and routing table updates.
268 This mode is primarily useful if you want to bridge Ethernet segments.
271 This mode is almost the same as the switch mode, but instead
272 every packet will be broadcast to the other daemons
273 while no routing table is managed.
276 .It Va Name Li = Ar name Bq required
277 This is the name which identifies this tinc daemon.
278 It must be unique for the virtual private network this daemon will connect to.
280 .It Va PingInterval Li = Ar seconds Pq 60
281 The number of seconds of inactivity that
283 will wait before sending a probe to the other end.
285 .It Va PingTimeout Li = Ar seconds Pq 5
286 The number of seconds to wait for a response to pings or to allow meta
287 connections to block. If the other end doesn't respond within this time,
288 the connection is terminated,
289 and the others will be notified of this.
291 .It Va PriorityInheritance Li = yes | no Po no Pc Bq experimental
292 When this option is enabled the value of the TOS field of tunneled IPv4 packets
293 will be inherited by the UDP packets that are sent out.
295 .It Va PrivateKey Li = Ar key Bq obsolete
296 The private RSA key of this tinc daemon.
297 It will allow this tinc daemon to authenticate itself to other daemons.
299 .It Va PrivateKeyFile Li = Ar filename Po Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /rsa_key.priv Pc
300 The file in which the private RSA key of this tinc daemon resides.
301 Note that there must be exactly one of
305 specified in the configuration file.
307 .It Va ProcessPriority Li = low | normal | high
308 When this option is used the priority of the tincd process will be adjusted.
309 Increasing the priority may help to reduce latency and packet loss on the VPN.
311 .It Va TunnelServer Li = yes | no Po no Pc Bq experimental
312 When this option is enabled tinc will no longer forward information between other tinc daemons,
313 and will only allow nodes and subnets on the VPN which are present in the
314 .Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /hosts/
318 .Sh HOST CONFIGURATION FILES
319 The host configuration files contain all information needed
320 to establish a connection to those hosts.
321 A host configuration file is also required for the local tinc daemon,
322 it will use it to read in it's listen port, public key and subnets.
325 The idea is that these files are portable.
326 You can safely mail your own host configuration file to someone else.
327 That other person can then copy it to his own hosts directory,
328 and now his tinc daemon will be able to connect to your tinc daemon.
329 Since host configuration files only contain public keys,
330 no secrets are revealed by sending out this information.
331 .Bl -tag -width indent
333 .It Va Address Li = Ar address Bq recommended
334 The IP address or hostname of this tinc daemon on the real network.
335 This will only be used when trying to make an outgoing connection to this tinc daemon.
338 variables can be specified, in which case each address will be tried until a working
339 connection has been established.
341 .It Va Cipher Li = Ar cipher Pq blowfish
342 The symmetric cipher algorithm used to encrypt UDP packets.
343 Any cipher supported by OpenSSL is recognised.
344 Furthermore, specifying
346 will turn off packet encryption.
347 It is best to use only those ciphers which support CBC mode.
349 .It Va Compression Li = Ar level Pq 0
350 This option sets the level of compression used for UDP packets.
351 Possible values are 0 (off), 1 (fast zlib) and any integer up to 9 (best zlib),
352 10 (fast lzo) and 11 (best lzo).
354 .It Va Digest Li = Ar digest Pq sha1
355 The digest algorithm used to authenticate UDP packets.
356 Any digest supported by OpenSSL is recognised.
357 Furthermore, specifying
359 will turn off packet authentication.
361 .It Va IndirectData Li = yes | no Pq no
362 This option specifies whether other tinc daemons besides the one you specified with
364 can make a direct connection to you.
365 This is especially useful if you are behind a firewall
366 and it is impossible to make a connection from the outside to your tinc daemon.
367 Otherwise, it is best to leave this option out or set it to no.
369 .It Va MACLength Li = Ar length Pq 4
370 The length of the message authentication code used to authenticate UDP packets.
373 up to the length of the digest produced by the digest algorithm.
375 .It Va PMTU Li = Ar mtu Po 1514 Pc
376 This option controls the initial path MTU to this node.
378 .It Va PMTUDiscovery Li = yes | no Po yes Pc
379 When this option is enabled, tinc will try to discover the path MTU to this node.
380 After the path MTU has been discovered, it will be enforced on the VPN.
382 .It Va Port Li = Ar port Pq 655
383 The port number on which this tinc daemon is listening for incoming connections.
385 .It Va PublicKey Li = Ar key Bq obsolete
386 The public RSA key of this tinc daemon.
387 It will be used to cryptographically verify it's identity and to set up a secure connection.
389 .It Va PublicKeyFile Li = Ar filename Bq obsolete
390 The file in which the public RSA key of this tinc daemon resides.
393 From version 1.0pre4 on
395 will store the public key directly into the host configuration file in PEM format,
396 the above two options then are not necessary.
397 Either the PEM format is used, or exactly one of the above two options must be specified
398 in each host configuration file,
399 if you want to be able to establish a connection with that host.
401 .It Va Subnet Li = Ar address Ns Op Li / Ns Ar prefixlength Ns Op Li # Ns Ar weight
402 The subnet which this tinc daemon will serve.
404 tries to look up which other daemon it should send a packet to by searching the appropriate subnet.
405 If the packet matches a subnet,
406 it will be sent to the daemon who has this subnet in his host configuration file.
409 variables can be specified.
412 Subnets can either be single MAC, IPv4 or IPv6 addresses,
413 in which case a subnet consisting of only that single address is assumed,
414 or they can be a IPv4 or IPv6 network address with a prefixlength.
415 Shorthand notations are not supported.
416 For example, IPv4 subnets must be in a form like 192.168.1.0/24,
417 where 192.168.1.0 is the network address and 24 is the number of bits set in the netmask.
418 Note that subnets like 192.168.1.1/24 are invalid!
419 Read a networking HOWTO/FAQ/guide if you don't understand this.
420 IPv6 subnets are notated like fec0:0:0:1:0:0:0:0/64.
421 MAC addresses are notated like 0:1a:2b:3c:4d:5e.
424 A Subnet can be given a weight to indicate its priority over identical Subnets
425 owned by different nodes. The default weight is 10. Lower values indicate
426 higher priority. Packets will be sent to the node with the highest priority,
427 unless that node is not reachable, in which case the node with the next highest
428 priority will be tried, and so on.
430 .It Va TCPOnly Li = yes | no Pq no Bq obsolete
431 If this variable is set to yes,
432 then the packets are tunnelled over the TCP connection instead of a UDP connection.
433 This is especially useful for those who want to run a tinc daemon
434 from behind a masquerading firewall,
435 or if UDP packet routing is disabled somehow.
436 Setting this options also implicitly sets IndirectData.
439 Since version 1.0.10, tinc will automatically detect whether communication via
440 UDP is possible or not.
444 Apart from reading the server and host configuration files,
445 tinc can also run scripts at certain moments.
446 Under Windows (not Cygwin), the scripts should have the extension
448 .Bl -tag -width indent
450 .It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /tinc-up
451 This is the most important script.
452 If it is present it will be executed right after the tinc daemon has been started and has connected to the virtual network device.
453 It should be used to set up the corresponding network interface,
454 but can also be used to start other things.
455 Under Windows you can use the Network Connections control panel instead of creating this script.
457 .It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /tinc-down
458 This script is started right before the tinc daemon quits.
460 .It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /hosts/ Ns Ar HOST Ns Pa -up
461 This script is started when the tinc daemon with name
465 .It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /hosts/ Ns Ar HOST Ns Pa -down
466 This script is started when the tinc daemon with name
470 .It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /host-up
471 This script is started when any host becomes reachable.
473 .It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /host-down
474 This script is started when any host becomes unreachable.
476 .It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /subnet-up
477 This script is started when a Subnet becomes reachable.
478 The Subnet and the node it belongs to are passed in environment variables.
480 .It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /subnet-down
481 This script is started when a Subnet becomes unreachable.
485 The scripts are started without command line arguments, but can make use of certain environment variables.
486 Under UNIX like operating systems the names of environment variables must be preceded by a
491 files, they have to be put between
494 .Bl -tag -width indent
497 If a netname was specified, this environment variable contains it.
500 Contains the name of this tinc daemon.
503 Contains the name of the virtual network device that tinc uses.
506 Contains the name of the virtual network interface that tinc uses.
507 This should be used for commands like
511 When a host becomes (un)reachable, this is set to its name.
512 If a subnet becomes (un)reachable, this is set to the owner of that subnet.
515 When a host becomes (un)reachable, this is set to its real address.
518 When a host becomes (un)reachable, this is set to the port number it uses for communication with other tinc daemons.
521 When a subnet becomes (un)reachable, this is set to the subnet.
524 When a subnet becomes (un)reachable, this is set to the subnet weight.
528 The most important files are:
529 .Bl -tag -width indent
531 .It Pa @sysconfdir@/tinc/
532 The top directory for configuration files.
534 .It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /tinc.conf
535 The default name of the server configuration file for net
538 .It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /hosts/
539 Host configuration files are kept in this directory.
541 .It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /tinc-up
542 If an executable file with this name exists,
543 it will be executed right after the tinc daemon has connected to the virtual network device.
544 It can be used to set up the corresponding network interface.
546 .It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /tinc-down
547 If an executable file with this name exists,
548 it will be executed right before the tinc daemon is going to close
549 its connection to the virtual network device.
554 .Pa http://www.tinc-vpn.org/ ,
555 .Pa http://www.linuxdoc.org/LDP/nag2/ .
558 The full documentation for
560 is maintained as a Texinfo manual.
561 If the info and tinc programs are properly installed at your site, the command
563 should give you access to the complete manual.
567 comes with ABSOLUTELY NO WARRANTY.
568 This is free software, and you are welcome to redistribute it under certain conditions;
569 see the file COPYING for details.