add (errnum) in front of windows error messages
[tinc] / doc / tinc.conf.5.in
1 .Dd 2010-01-16
2 .Dt TINC.CONF 5
3 .\" Manual page created by:
4 .\" Ivo Timmermans
5 .\" Guus Sliepen <guus@tinc-vpn.org>
6
7 .Sh NAME
8 .Nm tinc.conf
9 .Nd tinc daemon configuration
10
11 .Sh DESCRIPTION
12 The files in the
13 .Pa @sysconfdir@/tinc/
14 directory contain runtime and security information for the tinc daemon.
15
16 .Sh NETWORKS
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
20 .Fl c
21 option.
22
23 .Pp
24 We have thought of another way of dealing with this: network names.
25 This means that you call
26 .Nm
27 with the
28 .Fl n
29 option, which will assign a name to this daemon.
30
31 .Pp
32 The effect of this is that the daemon will set its configuration root to
33 .Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa / ,
34 where 
35 .Ar NETNAME
36 is your argument to the
37 .Fl n
38 option.
39 You'll notice that messages appear in syslog as coming from
40 .Nm tincd. Ns Ar NETNAME .
41
42 .Pp
43 However, it is not strictly necessary that you call tinc with the
44 .Fl n
45 option.
46 In this case, the network name would just be empty,
47 and it will be used as such.
48 .Nm tinc
49 now looks for files in
50 .Pa @sysconfdir@/tinc/ ,
51 instead of 
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/ .
57
58 .Pp
59 But it is highly recommended that you use this feature of
60 .Nm tinc ,
61 because it will be so much clearer whom your daemon talks to.
62 Hence, we will assume that you use it.
63
64 .Sh NAMES
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
69 file.
70
71 .Pp
72 To make things easy,
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.
75
76 .Sh PUBLIC/PRIVATE KEYS
77 You should use 
78 .Ic tincd -K
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
83 \-\- where 
84 .Ar NETNAME
85 stands for the network (see 
86 .Sx NETWORKS )
87 above.
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
90 \-\- where
91 .Va NAME
92 stands for the name of the local tinc daemon (see
93 .Sx NAMES ) .
94
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
99 .Li # )
100 or assignments in the form of:
101
102 .Pp
103 .Va Variable Li = Ar Value .
104
105 .Pp
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 
109 .Li =
110 sign, but doing so improves readability.
111 If you leave it out, remember to replace it with at least one space character.
112
113 .Pp
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.
119
120 .Pp
121 Here are all valid variables, listed in alphabetical order.
122 The default value is given between parentheses.
123 .Bl -tag -width indent
124
125 .It Va AddressFamily Li = ipv4 | ipv6 | any Pq any
126 This option affects the address family of listening and outgoing sockets.
127 If
128 .Qq any
129 is selected, then depending on the operating system both IPv4 and IPv6 or just
130 IPv6 listening sockets will be created.
131
132 .It Va BindToAddress Li = Ar address Oo Ar port Oc Bq experimental
133 If your computer has more than one IPv4 or IPv6 address,
134 .Nm tinc
135 will by default listen on all of them for incoming connections.
136 Multiple
137 .Va BindToAddress
138 variables may be specified,
139 in which case listening sockets for each specified address are made.
140 .Pp
141 If no
142 .Ar port
143 is specified, the socket will be bound to the port specified by the
144 .Va Port
145 option, or to port 655 if neither is given.
146 To only bind to a specific port but not to a specific address, use
147 .Li *
148 for the
149 .Ar address .
150 .Pp
151 This option may not work on all platforms.
152
153 .It Va BindToInterface Li = Ar interface Bq experimental
154 If your computer has more than one network interface,
155 .Nm tinc
156 will by default listen on all of them for incoming connections.
157 It is possible to bind only to a single interface with this variable.
158
159 .Pp
160 This option may not work on all platforms.
161
162 .It Va Broadcast Li = no | mst | direct Po mst Pc Bq experimental
163 This option selects the way broadcast packets are sent to other daemons.
164 NOTE: all nodes in a VPN must use the same
165 .Va Broadcast
166 mode, otherwise routing loops can form.
167
168 .Bl -tag -width indent
169 .It no
170 Broadcast packets are never sent to other nodes.
171
172 .It mst
173 Broadcast packets are sent and forwarded via the VPN's Minimum Spanning Tree.
174 This ensures broadcast packets reach all nodes.
175
176 .It direct
177 Broadcast packets are sent directly to all nodes that can be reached directly.
178 Broadcast packets received from other nodes are never forwarded.
179 If the IndirectData option is also set, broadcast packets will only be sent to nodes which we have a meta connection to.
180 .El
181
182 .It Va ConnectTo Li = Ar name
183 Specifies which other tinc daemon to connect to on startup.
184 Multiple
185 .Va ConnectTo
186 variables may be specified,
187 in which case outgoing connections to each specified tinc daemon are made.
188 The names should be known to this tinc daemon
189 (i.e., there should be a host configuration file for the name on the
190 .Va ConnectTo
191 line).
192
193 .Pp
194 If you don't specify a host with
195 .Va ConnectTo ,
196 .Nm tinc
197 won't try to connect to other daemons at all,
198 and will instead just listen for incoming connections.
199
200 .It Va DecrementTTL Li = yes | no Po no Pc Bq experimental
201 When enabled,
202 .Nm tinc
203 will decrement the Time To Live field in IPv4 packets, or the Hop Limit field in IPv6 packets,
204 before forwarding a received packet to the virtual network device or to another node,
205 and will drop packets that have a TTL value of zero,
206 in which case it will send an ICMP Time Exceeded packet back.
207 .Pp
208 Do not use this option if you use switch mode and want to use IPv6.
209
210 .It Va Device Li = Ar device Po Pa /dev/tap0 , Pa /dev/net/tun No or other depending on platform Pc
211 The virtual network device to use.
212 .Nm tinc
213 will automatically detect what kind of device it is.
214 Note that you can only use one device per daemon.
215 Under Windows, use
216 .Va Interface
217 instead of
218 .Va Device .
219 The info pages of the tinc package contain more information
220 about configuring the virtual network device.
221
222 .It Va DeviceType Li = Ar type Pq platform dependent
223 The type of the virtual network device.
224 Tinc will normally automatically select the right type of tun/tap interface, and this option should not be used.
225 However, this option can be used to select one of the special interface types, if support for them is compiled in.
226 .Bl -tag -width indent
227
228 .It dummy
229 Use a dummy interface.
230 No packets are ever read or written to a virtual network device.
231 Useful for testing, or when setting up a node that only forwards packets for other nodes.
232
233 .It raw_socket
234 Open a raw socket, and bind it to a pre-existing
235 .Va Interface
236 (eth0 by default).
237 All packets are read from this interface.
238 Packets received for the local node are written to the raw socket.
239 However, at least on Linux, the operating system does not process IP packets destined for the local host.
240
241 .It multicast
242 Open a multicast UDP socket and bind it to the address and port (separated by spaces) and optionally a TTL value specified using
243 .Va Device .
244 Packets are read from and written to this multicast socket.
245 This can be used to connect to UML, QEMU or KVM instances listening on the same multicast address.
246 Do NOT connect multiple
247 .Nm tinc 
248 daemons to the same multicast address, this will very likely cause routing loops.
249 Also note that this can cause decrypted VPN packets to be sent out on a real network if misconfigured.
250
251 .It uml Pq not compiled in by default
252 Create a UNIX socket with the filename specified by
253 .Va Device ,
254 or
255 .Pa @localstatedir@/run/ Ns Ar NETNAME Ns Pa .umlsocket
256 if not specified.
257 .Nm tinc
258 will wait for a User Mode Linux instance to connect to this socket.
259
260 .It vde Pq not compiled in by default
261 Uses the libvdeplug library to connect to a Virtual Distributed Ethernet switch,
262 using the UNIX socket specified by
263 .Va Device ,
264 or
265 .Pa @localstatedir@/run/vde.ctl
266 if not specified.
267 .El
268
269 Also, in case tinc does not seem to correctly interpret packets received from the virtual network device,
270 it can be used to change the way packets are interpreted:
271
272 .Bl -tag -width indent
273
274 .It tun Pq BSD and Linux
275 Set type to tun.
276 Depending on the platform, this can either be with or without an address family header (see below).
277
278 .It tunnohead Pq BSD
279 Set type to tun without an address family header.
280 Tinc will expect packets read from the virtual network device to start with an IP header.
281 On some platforms IPv6 packets cannot be read from or written to the device in this mode.
282
283 .It tunifhead Pq BSD
284 Set type to tun with an address family header.
285 Tinc will expect packets read from the virtual network device
286 to start with a four byte header containing the address family,
287 followed by an IP header.
288 This mode should support both IPv4 and IPv6 packets.
289
290 .It tap Pq BSD and Linux
291 Set type to tap.
292 Tinc will expect packets read from the virtual network device
293 to start with an Ethernet header.
294 .El
295
296 .It Va DirectOnly Li = yes | no Po no Pc Bq experimental
297 When this option is enabled, packets that cannot be sent directly to the destination node,
298 but which would have to be forwarded by an intermediate node, are dropped instead.
299 When combined with the IndirectData option,
300 packets for nodes for which we do not have a meta connection with are also dropped.
301
302 .It Va Forwarding Li = off | internal | kernel Po internal Pc Bq experimental
303 This option selects the way indirect packets are forwarded.
304 .Bl -tag -width indent
305
306 .It off
307 Incoming packets that are not meant for the local node,
308 but which should be forwarded to another node, are dropped.
309
310 .It internal
311 Incoming packets that are meant for another node are forwarded by tinc internally.
312
313 .Pp
314 This is the default mode, and unless you really know you need another forwarding mode, don't change it.
315
316 .It kernel
317 Incoming packets are always sent to the TUN/TAP device, even if the packets are not for the local node.
318 This is less efficient, but allows the kernel to apply its routing and firewall rules on them,
319 and can also help debugging.
320 .El
321
322 .It Va GraphDumpFile Li = Ar filename Bq experimental
323 If this option is present,
324 .Nm tinc
325 will dump the current network graph to the file
326 .Ar filename
327 every minute, unless there were no changes to the graph.
328 The file is in a format that can be read by graphviz tools.
329 If
330 .Ar filename
331 starts with a pipe symbol |,
332 then the rest of the filename is interpreted as a shell command
333 that is executed, the graph is then sent to stdin.
334
335 .It Va Hostnames Li = yes | no Pq no
336 This option selects whether IP addresses (both real and on the VPN) should
337 be resolved. Since DNS lookups are blocking, it might affect tinc's
338 efficiency, even stopping the daemon for a few seconds every time it does
339 a lookup if your DNS server is not responding.
340
341 .Pp
342 This does not affect resolving hostnames to IP addresses from the
343 host configuration files.
344
345 .It Va IffOneQueue Li = yes | no Po no Pc Bq experimental
346 (Linux only) Set IFF_ONE_QUEUE flag on TUN/TAP devices.
347
348 .It Va Interface Li = Ar interface
349 Defines the name of the interface corresponding to the virtual network device.
350 Depending on the operating system and the type of device this may or may not actually set the name of the interface.
351 Under Windows, this variable is used to select which network interface will be used.
352 If you specified a
353 .Va Device ,
354 this variable is almost always already correctly set.
355
356 .It Va KeyExpire Li = Ar seconds Pq 3600
357 This option controls the period the encryption keys used to encrypt the data are valid.
358 It is common practice to change keys at regular intervals to make it even harder for crackers,
359 even though it is thought to be nearly impossible to crack a single key.
360
361 .It Va LocalDiscovery Li = yes | no Po no Pc Bq experimental
362 When enabled,
363 .Nm tinc
364 will try to detect peers that are on the same local network.
365 This will allow direct communication using LAN addresses, even if both peers are behind a NAT
366 and they only ConnectTo a third node outside the NAT,
367 which normally would prevent the peers from learning each other's LAN address.
368
369 .Pp
370 Currently, local discovery is implemented by sending broadcast packets to the LAN during path MTU discovery.
371 This feature may not work in all possible situations.
372
373 .It Va MACExpire Li = Ar seconds Pq 600
374 This option controls the amount of time MAC addresses are kept before they are removed.
375 This only has effect when
376 .Va Mode
377 is set to
378 .Qq switch .
379
380 .It Va MaxTimeout Li = Ar seconds Pq 900
381 This is the maximum delay before trying to reconnect to other tinc daemons.
382
383 .It Va Mode Li = router | switch | hub Pq router
384 This option selects the way packets are routed to other daemons.
385 .Bl -tag -width indent
386
387 .It router
388 In this mode
389 .Va Subnet
390 variables in the host configuration files will be used to form a routing table.
391 Only unicast packets of routable protocols (IPv4 and IPv6) are supported in this mode.
392
393 .Pp
394 This is the default mode, and unless you really know you need another mode, don't change it.
395
396 .It switch
397 In this mode the MAC addresses of the packets on the VPN will be used to
398 dynamically create a routing table just like an Ethernet switch does.
399 Unicast, multicast and broadcast packets of every protocol that runs over Ethernet are supported in this mode
400 at the cost of frequent broadcast ARP requests and routing table updates.
401
402 .Pp
403 This mode is primarily useful if you want to bridge Ethernet segments.
404
405 .It hub
406 This mode is almost the same as the switch mode, but instead
407 every packet will be broadcast to the other daemons
408 while no routing table is managed.
409 .El
410
411 .It Va Name Li = Ar name Bq required
412 This is the name which identifies this tinc daemon.
413 It must be unique for the virtual private network this daemon will connect to.
414 The Name may only consist of alphanumeric and underscore characters.
415
416 If 
417 .Va Name
418 starts with a
419 .Li $ ,
420 then the contents of the environment variable that follows will be used.
421 In that case, invalid characters will be converted to underscores.
422 If
423 .Va Name
424 is
425 .Li $HOST ,
426 but no such environment variable exist, the hostname will be read using the gethostnname() system call.
427
428 .It Va PingInterval Li = Ar seconds Pq 60
429 The number of seconds of inactivity that
430 .Nm tinc
431 will wait before sending a probe to the other end.
432
433 .It Va PingTimeout Li = Ar seconds Pq 5
434 The number of seconds to wait for a response to pings or to allow meta
435 connections to block. If the other end doesn't respond within this time,
436 the connection is terminated,
437 and the others will be notified of this.
438
439 .It Va PriorityInheritance Li = yes | no Po no Pc Bq experimental
440 When this option is enabled the value of the TOS field of tunneled IPv4 packets
441 will be inherited by the UDP packets that are sent out.
442
443 .It Va PrivateKey Li = Ar key Bq obsolete
444 The private RSA key of this tinc daemon.
445 It will allow this tinc daemon to authenticate itself to other daemons.
446
447 .It Va PrivateKeyFile Li = Ar filename Po Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /rsa_key.priv Pc
448 The file in which the private RSA key of this tinc daemon resides.
449 Note that there must be exactly one of
450 .Va PrivateKey
451 or
452 .Va PrivateKeyFile
453 specified in the configuration file.
454
455 .It Va ProcessPriority Li = low | normal | high
456 When this option is used the priority of the tincd process will be adjusted.
457 Increasing the priority may help to reduce latency and packet loss on the VPN.
458
459 .It Va Proxy Li = socks4 | socks5 | http | exec Ar ... Bq experimental
460 Use a proxy when making outgoing connections.
461 The following proxy types are currently supported:
462 .Bl -tag -width indent
463 .It socks4 Ar address Ar port Op Ar username
464 Connects to the proxy using the SOCKS version 4 protocol.
465 Optionally, a
466 .Ar username
467 can be supplied which will be passed on to the proxy server.
468 Only IPv4 connections can be proxied using SOCKS 4.
469 .It socks5 Ar address Ar port Op Ar username Ar password
470 Connect to the proxy using the SOCKS version 5 protocol.
471 If a
472 .Ar username
473 and
474 .Ar password
475 are given, basic username/password authentication will be used,
476 otherwise no authentication will be used.
477 .It http Ar address Ar port
478 Connects to the proxy and sends a HTTP CONNECT request.
479 .It exec Ar command
480 Executes the given
481 .Ar command
482 which should set up the outgoing connection.
483 The environment variables
484 .Ev NAME ,
485 .Ev NODE ,
486 .Ev REMOTEADDRES
487 and
488 .Ev REMOTEPORT
489 are available.
490 .El
491
492 .It Va ReplayWindow Li = Ar bytes Pq 16
493 vhis is the size of the replay tracking window for each remote node, in bytes.
494 The window is a bitfield which tracks 1 packet per bit, so for example
495 the default setting of 16 will track up to 128 packets in the window.  In high
496 bandwidth scenarios, setting this to a higher value can reduce packet loss from
497 the interaction of replay tracking with underlying real packet loss and/or
498 reordering.  Setting this to zero will disable replay tracking completely and
499 pass all traffic, but leaves tinc vulnerable to replay-based attacks on your
500 traffic.
501
502 .It Va StrictSubnets Li = yes | no Po no Pc Bq experimental
503 When this option is enabled tinc will only use Subnet statements which are
504 present in the host config files in the local
505 .Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /hosts/
506 directory.
507
508 .It Va TunnelServer Li = yes | no Po no Pc Bq experimental
509 When this option is enabled tinc will no longer forward information between other tinc daemons,
510 and will only allow connections with nodes for which host config files are present in the local
511 .Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /hosts/
512 directory.
513 Setting this options also implicitly sets StrictSubnets.
514
515 .It Va UDPRcvBuf Li = Ar bytes Pq OS default
516 Sets the socket receive buffer size for the UDP socket, in bytes.
517 If unset, the default buffer size will be used by the operating system.
518
519 .It Va UDPSndBuf Li = Ar bytes Pq OS default
520 Sets the socket send buffer size for the UDP socket, in bytes.
521 If unset, the default buffer size will be used by the operating system.
522 .El
523
524 .Sh HOST CONFIGURATION FILES
525 The host configuration files contain all information needed
526 to establish a connection to those hosts.
527 A host configuration file is also required for the local tinc daemon,
528 it will use it to read in it's listen port, public key and subnets.
529
530 .Pp
531 The idea is that these files are portable.
532 You can safely mail your own host configuration file to someone else.
533 That other person can then copy it to his own hosts directory,
534 and now his tinc daemon will be able to connect to your tinc daemon.
535 Since host configuration files only contain public keys,
536 no secrets are revealed by sending out this information.
537 .Bl -tag -width indent
538
539 .It Va Address Li = Ar address Oo Ar port Oc Bq recommended
540 The IP address or hostname of this tinc daemon on the real network.
541 This will only be used when trying to make an outgoing connection to this tinc daemon.
542 Optionally, a port can be specified to use for this address.
543 Multiple
544 .Va Address
545 variables can be specified, in which case each address will be tried until a working
546 connection has been established.
547
548 .It Va Cipher Li = Ar cipher Pq blowfish
549 The symmetric cipher algorithm used to encrypt UDP packets.
550 Any cipher supported by OpenSSL is recognised.
551 Furthermore, specifying
552 .Qq none
553 will turn off packet encryption.
554 It is best to use only those ciphers which support CBC mode.
555
556 .It Va ClampMSS Li = yes | no Pq yes
557 This option specifies whether tinc should clamp the maximum segment size (MSS)
558 of TCP packets to the path MTU. This helps in situations where ICMP
559 Fragmentation Needed or Packet too Big messages are dropped by firewalls.
560
561 .It Va Compression Li = Ar level Pq 0
562 This option sets the level of compression used for UDP packets.
563 Possible values are 0 (off), 1 (fast zlib) and any integer up to 9 (best zlib),
564 10 (fast lzo) and 11 (best lzo).
565
566 .It Va Digest Li = Ar digest Pq sha1
567 The digest algorithm used to authenticate UDP packets.
568 Any digest supported by OpenSSL is recognised.
569 Furthermore, specifying
570 .Qq none
571 will turn off packet authentication.
572
573 .It Va IndirectData Li = yes | no Pq no
574 This option specifies whether other tinc daemons besides the one you specified with
575 .Va ConnectTo
576 can make a direct connection to you.
577 This is especially useful if you are behind a firewall
578 and it is impossible to make a connection from the outside to your tinc daemon.
579 Otherwise, it is best to leave this option out or set it to no.
580
581 .It Va MACLength Li = Ar length Pq 4
582 The length of the message authentication code used to authenticate UDP packets.
583 Can be anything from
584 .Qq 0
585 up to the length of the digest produced by the digest algorithm.
586
587 .It Va PMTU Li = Ar mtu Po 1514 Pc
588 This option controls the initial path MTU to this node.
589
590 .It Va PMTUDiscovery Li = yes | no Po yes Pc
591 When this option is enabled, tinc will try to discover the path MTU to this node.
592 After the path MTU has been discovered, it will be enforced on the VPN.
593
594 .It Va Port Li = Ar port Pq 655
595 The port number on which this tinc daemon is listening for incoming connections,
596 which is used if no port number is specified in an
597 .Va Address
598 statement.
599
600 .It Va PublicKey Li = Ar key Bq obsolete
601 The public RSA key of this tinc daemon.
602 It will be used to cryptographically verify it's identity and to set up a secure connection.
603
604 .It Va PublicKeyFile Li = Ar filename Bq obsolete
605 The file in which the public RSA key of this tinc daemon resides.
606
607 .Pp
608 From version 1.0pre4 on
609 .Nm tinc
610 will store the public key directly into the host configuration file in PEM format,
611 the above two options then are not necessary.
612 Either the PEM format is used, or exactly one of the above two options must be specified
613 in each host configuration file,
614 if you want to be able to establish a connection with that host.
615
616 .It Va Subnet Li = Ar address Ns Op Li / Ns Ar prefixlength Ns Op Li # Ns Ar weight
617 The subnet which this tinc daemon will serve.
618 .Nm tinc
619 tries to look up which other daemon it should send a packet to by searching the appropriate subnet.
620 If the packet matches a subnet,
621 it will be sent to the daemon who has this subnet in his host configuration file.
622 Multiple
623 .Va Subnet
624 variables can be specified.
625
626 .Pp
627 Subnets can either be single MAC, IPv4 or IPv6 addresses,
628 in which case a subnet consisting of only that single address is assumed,
629 or they can be a IPv4 or IPv6 network address with a prefixlength.
630 For example, IPv4 subnets must be in a form like 192.168.1.0/24,
631 where 192.168.1.0 is the network address and 24 is the number of bits set in the netmask.
632 Note that subnets like 192.168.1.1/24 are invalid!
633 Read a networking HOWTO/FAQ/guide if you don't understand this.
634 IPv6 subnets are notated like fec0:0:0:1::/64.
635 MAC addresses are notated like 0:1a:2b:3c:4d:5e.
636
637 .Pp
638 A Subnet can be given a weight to indicate its priority over identical Subnets
639 owned by different nodes.  The default weight is 10. Lower values indicate
640 higher priority. Packets will be sent to the node with the highest priority,
641 unless that node is not reachable, in which case the node with the next highest
642 priority will be tried, and so on.
643
644 .It Va TCPOnly Li = yes | no Pq no Bq obsolete
645 If this variable is set to yes,
646 then the packets are tunnelled over the TCP connection instead of a UDP connection.
647 This is especially useful for those who want to run a tinc daemon
648 from behind a masquerading firewall,
649 or if UDP packet routing is disabled somehow.
650 Setting this options also implicitly sets IndirectData.
651
652 .Pp
653 Since version 1.0.10, tinc will automatically detect whether communication via
654 UDP is possible or not.
655 .El
656
657 .Sh SCRIPTS
658 Apart from reading the server and host configuration files,
659 tinc can also run scripts at certain moments.
660 Under Windows (not Cygwin), the scripts should have the extension
661 .Pa .bat .
662 .Bl -tag -width indent
663
664 .It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /tinc-up
665 This is the most important script.
666 If it is present it will be executed right after the tinc daemon has been started and has connected to the virtual network device.
667 It should be used to set up the corresponding network interface,
668 but can also be used to start other things.
669 Under Windows you can use the Network Connections control panel instead of creating this script.
670
671 .It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /tinc-down
672 This script is started right before the tinc daemon quits.
673
674 .It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /hosts/ Ns Ar HOST Ns Pa -up
675 This script is started when the tinc daemon with name
676 .Ar HOST
677 becomes reachable.
678
679 .It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /hosts/ Ns Ar HOST Ns Pa -down
680 This script is started when the tinc daemon with name
681 .Ar HOST
682 becomes unreachable.
683
684 .It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /host-up
685 This script is started when any host becomes reachable.
686
687 .It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /host-down
688 This script is started when any host becomes unreachable.
689
690 .It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /subnet-up
691 This script is started when a Subnet becomes reachable.
692 The Subnet and the node it belongs to are passed in environment variables.
693
694 .It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /subnet-down
695 This script is started when a Subnet becomes unreachable.
696 .El
697
698 .Pp
699 The scripts are started without command line arguments, but can make use of certain environment variables.
700 Under UNIX like operating systems the names of environment variables must be preceded by a
701 .Li $ 
702 in scripts.
703 Under Windows, in
704 .Pa .bat
705 files, they have to be put between
706 .Li %
707 signs.
708 .Bl -tag -width indent
709
710 .It Ev NETNAME
711 If a netname was specified, this environment variable contains it.
712
713 .It Ev NAME
714 Contains the name of this tinc daemon.
715
716 .It Ev DEVICE
717 Contains the name of the virtual network device that tinc uses.
718
719 .It Ev INTERFACE
720 Contains the name of the virtual network interface that tinc uses.
721 This should be used for commands like
722 .Pa ifconfig .
723
724 .It Ev NODE
725 When a host becomes (un)reachable, this is set to its name.
726 If a subnet becomes (un)reachable, this is set to the owner of that subnet.
727
728 .It Ev REMOTEADDRESS
729 When a host becomes (un)reachable, this is set to its real address.
730
731 .It Ev REMOTEPORT
732 When a host becomes (un)reachable, this is set to the port number it uses for communication with other tinc daemons.
733
734 .It Ev SUBNET
735 When a subnet becomes (un)reachable, this is set to the subnet.
736
737 .It Ev WEIGHT
738 When a subnet becomes (un)reachable, this is set to the subnet weight.
739 .El
740
741 .Sh FILES
742 The most important files are:
743 .Bl -tag -width indent
744
745 .It Pa @sysconfdir@/tinc/
746 The top directory for configuration files.
747
748 .It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /tinc.conf
749 The default name of the server configuration file for net
750 .Ar NETNAME .
751
752 .It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /hosts/
753 Host configuration files are kept in this directory.
754
755 .It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /tinc-up
756 If an executable file with this name exists,
757 it will be executed right after the tinc daemon has connected to the virtual network device.
758 It can be used to set up the corresponding network interface.
759
760 .It Pa @sysconfdir@/tinc/ Ns Ar NETNAME Ns Pa /tinc-down
761 If an executable file with this name exists,
762 it will be executed right before the tinc daemon is going to close
763 its connection to the virtual network device.
764 .El
765
766 .Sh SEE ALSO
767 .Xr tincd 8 ,
768 .Pa http://www.tinc-vpn.org/ ,
769 .Pa http://www.linuxdoc.org/LDP/nag2/ .
770
771 .Pp
772 The full documentation for
773 .Nm tinc
774 is maintained as a Texinfo manual.
775 If the info and tinc programs are properly installed at your site, the command
776 .Ic info tinc
777 should give you access to the complete manual.
778
779 .Pp
780 .Nm tinc
781 comes with ABSOLUTELY NO WARRANTY.
782 This is free software, and you are welcome to redistribute it under certain conditions;
783 see the file COPYING for details.