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