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