Typo and another thing to think about.
[tinc] / doc / tinc.texi
index 298c24d..26b8dca 100644 (file)
@@ -1,5 +1,5 @@
 \input texinfo   @c -*-texinfo-*-
-@c $Id: tinc.texi,v 1.8.4.35 2003/05/17 22:12:52 guus Exp $
+@c $Id: tinc.texi,v 1.8.4.42 2003/08/02 22:01:50 guus Exp $
 @c %**start of header
 @setfilename tinc.info
 @settitle tinc Manual
 
 This is the info manual for tinc, a Virtual Private Network daemon.
 
-Copyright @copyright{} 1998-2002 Ivo Timmermans
+Copyright @copyright{} 1998-2003 Ivo Timmermans
 <ivo@@o2w.nl>, Guus Sliepen <guus@@sliepen.eu.org> and
 Wessel Dankers <wsl@@nl.linux.org>.
 
-$Id: tinc.texi,v 1.8.4.35 2003/05/17 22:12:52 guus Exp $
+$Id: tinc.texi,v 1.8.4.42 2003/08/02 22:01:50 guus Exp $
 
 Permission is granted to make and distribute verbatim copies of this
 manual provided the copyright notice and this permission notice are
@@ -39,11 +39,11 @@ permission notice identical to this one.
 @page
 @vskip 0pt plus 1filll
 @cindex copyright
-Copyright @copyright{} 1998-2002 Ivo Timmermans
+Copyright @copyright{} 1998-2003 Ivo Timmermans
 <ivo@@o2w.nl>, Guus Sliepen <guus@@sliepen.eu.org> and
 Wessel Dankers <wsl@@nl.linux.org>.
 
-$Id: tinc.texi,v 1.8.4.35 2003/05/17 22:12:52 guus Exp $
+$Id: tinc.texi,v 1.8.4.42 2003/08/02 22:01:50 guus Exp $
 
 Permission is granted to make and distribute verbatim copies of this
 manual provided the copyright notice and this permission notice are
@@ -177,8 +177,8 @@ available too.
 @section Supported platforms
 
 @cindex platforms
-tinc has been verified to work under Linux, FreeBSD, OpenBSD and Solaris, with
-various hardware architectures.  These are some of the platforms
+tinc has been verified to work under Linux, FreeBSD, OpenBSD, NetBSD, MacOS/X (Darwin), Solaris, and Windows (in a Cygwin environment),
+with various hardware architectures.  These are some of the platforms
 that are supported by the universal tun/tap device driver or other virtual network device drivers.
 Without such a driver, tinc will most
 likely compile and run, but it will not be able to send or receive data
@@ -258,6 +258,24 @@ downloaded from @uref{http://chrisp.de/en/projects/tunnel.html}.
 
 IPv6 packets cannot be tunneled on Darwin.
 
+@c ==================================================================
+@subsection Cygwin (Windows)
+
+@cindex Cygwin
+@cindex Windows
+tinc on Windows, in a Cygwin environment, relies on the CIPE driver for its data
+acquisition from the kernel. This driver is not part of Windows but can be
+downloaded from @uref{http://cipe-win32.sourceforge.net/}.
+
+@c ==================================================================
+@subsection MinGW (Windows)
+
+@cindex MinGW
+@cindex Windows
+tinc on Windows (native), compiled using MinGW, relies on the CIPE driver for its data
+acquisition from the kernel. This driver is not part of Windows but can be
+downloaded from @uref{http://cipe-win32.sourceforge.net/}.
+
 
 @c
 @c
@@ -317,6 +335,8 @@ you should read the @uref{http://howto.linuxberg.com/LDP/HOWTO/Kernel-HOWTO.html
 * Configuration of NetBSD kernels::
 * Configuration of Solaris kernels::
 * Configuration of Darwin (MacOS/X) kernels::
+* Configuration of Cygwin (Windows)::
+* Configuration of MinGW (Windows)::
 @end menu
 
 
@@ -390,50 +410,37 @@ alias char-major-10-200 tun
 @node       Configuration of FreeBSD kernels, Configuration of OpenBSD kernels, Configuration of Linux kernels 2.4.0 and higher, Configuring the kernel
 @subsection Configuration of FreeBSD kernels
 
-This section will contain information on how to configure your FreeBSD
-kernel to support the universal tun/tap device.  For 4.1 and higher
-versions, this is included in the default kernel configuration, for earlier
+For FreeBSD version 4.1 and higher, the tap driver is included in the default kernel configuration, for earlier
 systems (4.0 and earlier), you need to install the universal tun/tap driver
 yourself.
 
-Unfortunately somebody still has to write the text.
-
 
 @c ==================================================================
 @node       Configuration of OpenBSD kernels, Configuration of NetBSD kernels, Configuration of FreeBSD kernels, Configuring the kernel
 @subsection Configuration of OpenBSD kernels
 
-This section will contain information on how to configure your OpenBSD
-kernel to support the tun device.  For 2.9 and 3.0 systems,
-this is included in the default kernel configuration.
-
-Unfortunately somebody still has to write the text.
+For OpenBSD version 2.9 and higher,
+the tun driver is included in the default kernel configuration.
 
 
 @c ==================================================================
 @node       Configuration of NetBSD kernels, Configuration of Solaris kernels, Configuration of OpenBSD kernels, Configuring the kernel
 @subsection Configuration of NetBSD kernels
 
-This section will contain information on how to configure your NetBSD
-kernel to support the tun device.  For 1.5.2 systems,
-this is included in the default kernel configuration.
-
-Unfortunately somebody still has to write the text.
+For NetBSD version 1.5.2 and higher,
+the tun driver is included in the default kernel configuration.
 
 
 @c ==================================================================
 @node       Configuration of Solaris kernels, Configuration of Darwin (MacOS/X) kernels, Configuration of NetBSD kernels, Configuring the kernel
 @subsection Configuration of Solaris kernels
 
-This section will contain information on how to configure your Solaris
-kernel to support the universal tun/tap device.  For Solaris 8 (SunOS 5.8),
-this is included in the default kernel configuration.
-
-Unfortunately somebody still has to write the text.
+For Solaris 8 (SunOS 5.8) and higher,
+the tun driver is included in the default kernel configuration.
 
 
 @c ==================================================================
-@node       Configuration of Darwin (MacOS/X) kernels, , Configuration of Solaris kernels, Configuring the kernel
+@node       Configuration of Darwin (MacOS/X) kernels, Configuration of Cygwin (Windows), Configuration of Solaris kernels, Configuring the kernel
 @subsection Configuration of Darwin (MacOS/X) kernels
 
 Darwin does not come with a tunnel driver. You must download it at
@@ -449,19 +456,38 @@ Once loaded, the tunnel driver will automatically create @file{/dev/tun0}..@file
 and the corresponding network interfaces.
 
 
+@c ==================================================================
+@node       Configuration of Cygwin (Windows), Configuration of MinGW (Windows), Configuration of Darwin (MacOS/X) kernels, Configuring the kernel
+@subsection Configuration of Cygwin (Windows)
+
+You will need to install the CIPE driver, you can download it from
+@uref{http://cipe-win32.sourceforge.net}.  Configure the CIPE network device in
+the same way as you would do from the tinc-up script.
+
+
+@c ==================================================================
+@node       Configuration of MinGW (Windows), , Configuration of Cygwin (Windows), Configuring the kernel
+@subsection Configuration of MinGW (Windows)
+
+You will need to install the CIPE driver, you can download it from
+@uref{http://cipe-win32.sourceforge.net}.  Configure the CIPE network device in
+the same way as you would do from the tinc-up script.
+
+
 @c ==================================================================
 @node    Libraries,  , Configuring the kernel, Preparations
 @section Libraries
 
 @cindex requirements
 @cindex libraries
-Before you can configure or build tinc, you need to have the OpenSSL
-and zlib libraries installed on your system.  If you try to configure tinc without
+Before you can configure or build tinc, you need to have the OpenSSL,
+zlib and lzo libraries installed on your system.  If you try to configure tinc without
 having them installed, configure will give you an error message, and stop.
 
 @menu
 * OpenSSL::
 * zlib::
+* lzo::
 @end menu
 
 
@@ -517,7 +543,7 @@ all other requirements of the GPL are met.
 
 
 @c ==================================================================
-@node       zlib,  , OpenSSL, Libraries
+@node       zlib, lzo, OpenSSL, Libraries
 @subsection zlib
 
 @cindex zlib
@@ -539,6 +565,28 @@ make sure you build development and runtime libraries (which is the
 default).
 
 
+@c ==================================================================
+@node       lzo,  , zlib, Libraries
+@subsection lzo
+
+@cindex lzo
+Another form of compression is offered using the lzo library.
+
+If this library is not installed, you wil get an error when configuring
+tinc for build.  Support for running tinc without having lzo
+installed @emph{may} be added in the future.
+
+You can use your operating system's package manager to install this if
+available.  Make sure you install the development AND runtime versions
+of this package.
+
+If you have to install lzo manually, you can get the source code
+from @url{http://www.oberhumer.com/opensource/lzo/}.  Instructions on how to configure,
+build and install this package are included within the package.  Please
+make sure you build development and runtime libraries (which is the
+default).
+
+
 @c
 @c
 @c
@@ -589,11 +637,13 @@ The documentation that comes along with your distribution will tell you how to d
 
 @menu
 * Darwin (MacOS/X) build environment::
+* Cygwin (Windows) build environment::
+* MinGW (Windows) build environment::
 @end menu
 
 
 @c ==================================================================
-@node       Darwin (MacOS/X) build environment,  ,  , Building and installing tinc
+@node       Darwin (MacOS/X) build environment, Cygwin (Windows) build environment,  , Building and installing tinc
 @subsection Darwin (MacOS/X) build environment
 
 In order to build tinc on Darwin, you need to install the MacOS/X Developer Tools
@@ -601,7 +651,32 @@ from @uref{http://developer.apple.com/tools/macosxtools.html} and
 a recent version of Fink from @uref{http://fink.sourceforge.net/}.
 
 After installation use fink to download and install the following packages:
-autoconf25, automake, dlcompat, m4, openssl and zlib.
+autoconf25, automake, dlcompat, m4, openssl, zlib and lzo.
+
+@c ==================================================================
+@node       Cygwin (Windows) build environment, MinGW (Windows) build environment, Darwin (MacOS/X) build environment, Building and installing tinc
+@subsection Cygwin (Windows) build environment
+
+If Cygwin hasn't already been installed, install it directly from
+@uref{http://www.cygwin.com/}.
+
+When tinc is compiled in a Cygwin environment, it can only be run in this environment,
+but all programs, including those started outside the Cygwin environment, will be able to use the VPN.
+It will also support all features.
+
+@c ==================================================================
+@node       MinGW (Windows) build environment, , Cygwin (Windows) build environment, Building and installing tinc
+@subsection MinGW (Windows) build environment
+
+You will need to install the MinGW environment from @uref{http://www.mingw.org}.
+
+When tinc is compiled using MinGW it runs natively under Windows,
+it is not necessary to keep MinGW installed.
+
+When running natively, tinc is not able to start scripts,
+nor is tinc able to receive signals.
+When detaching, tinc will install itself as a service,
+which will be restarted automatically after reboots.
 
 
 @c ==================================================================
@@ -722,6 +797,7 @@ What IP addresses/subnets do they have?
 What is the network mask of the entire VPN?
 Do you need special firewall rules?
 Do you have to set up masquerading or forwarding rules?
+Do you want to run tinc in router mode or switch mode?
 These questions can only be answered by yourself,
 you will not find the answers in this documentation.
 Make sure you have an adequate understanding of networks in general.
@@ -831,7 +907,7 @@ required directives are given in @strong{bold}.
 
 @table @asis
 @cindex AddressFamily
-@item AddressFamily = <ipv4|ipv6|any> (ipv4) [experimental]
+@item AddressFamily = <ipv4|ipv6|any> (any)
 This option affects the address family of listening and outgoing sockets.
 If "any" is selected, then depending on the operating system
 both IPv4 and IPv6 or just IPv6 listening sockets will be created.
@@ -883,8 +959,8 @@ configuration file.
 @cindex Interface
 @item Interface = <interface>
 Defines the name of the interface corresponding to the virtual network device.
-Depending on the operating system and the type of device this may or may not actually set the name.
-Currently this option only affects the Linux tun/tap device.
+Depending on the operating system and the type of device this may or may not actually set the name of the interface
+or choose the device corresponding to this interface.
 
 @cindex Mode
 @item Mode = <router|switch|hub> (router)
@@ -897,6 +973,8 @@ In this mode Subnet
 variables in the host configuration files will be used to form a routing table.
 Only unicast packets of routable protocols (IPv4 and IPv6) are supported in this mode.
 
+This is the default mode, and unless you really know you need another mode, don't change it.
+
 @cindex switch
 @item switch
 In this mode the MAC addresses of the packets on the VPN will be used to
@@ -904,6 +982,8 @@ dynamically create a routing table just like an Ethernet switch does.
 Unicast, multicast and broadcast packets of every protocol that runs over Ethernet are supported in this mode
 at the cost of frequent broadcast ARP requests and routing table updates.
 
+This mode is primarily useful if you want to bridge Ethernet segments.
+
 @cindex hub
 @item hub
 This mode is almost the same as the switch mode, but instead
@@ -977,7 +1057,8 @@ Any cipher supported by OpenSSL is recognized.
 @cindex Compression
 @item Compression = <level> (0)
 This option sets the level of compression used for UDP packets.
-Possible values are 0 (off), 1 (fast) and any integer up to 9 (best).
+Possible values are 0 (off), 1 (fast zlib) and any integer up to 9 (best zlib),
+10 (fast lzo) and 11 (best lzo).
 
 @cindex Digest
 @item Digest = <digest> (sha1)
@@ -1132,24 +1213,10 @@ An example @file{tinc-up} script:
 
 @example
 #!/bin/sh
-ifconfig $INTERFACE hw ether fe:fd:0:0:0:0
 ifconfig $INTERFACE 192.168.1.1 netmask 255.255.0.0
-ifconfig $INTERFACE -arp
 @end example
 
-@cindex MAC address
-@cindex hardware address
-The first line sets up the MAC address of the network interface.
-Due to the nature of how Ethernet and tinc work, it has to be set to fe:fd:0:0:0:0
-for tinc to work in it's normal mode.
-If you configured tinc to work in `switch' or `hub' mode, the hardware address should instead
-be set to a unique address instead of fe:fd:0:0:0:0.
-
-You can use the environment variable $INTERFACE to get the name of the interface.
-However, this might not be reliable. If in doubt, use the name of the interface explicitly.
-
-@cindex ifconfig
-The next line gives the interface an IP address and a netmask.
+This script gives the interface an IP address and a netmask.
 The kernel will also automatically add a route to this interface, so normally you don't need
 to add route commands to the @file{tinc-up} script.
 The kernel will also bring the interface up after this command.
@@ -1157,11 +1224,6 @@ The kernel will also bring the interface up after this command.
 The netmask is the mask of the @emph{entire} VPN network, not just your
 own subnet.
 
-@cindex arp
-The last line tells the kernel not to use ARP on that interface.
-Again this has to do with how Ethernet and tinc work.
-Use this option only if you are running tinc under Linux and are using tinc's normal routing mode.
-
 
 @c ==================================================================
 @node    Example configuration,  , Network interfaces, Configuration
@@ -1206,9 +1268,7 @@ In @file{/etc/tinc/company/tinc-up}:
 # Real interface of internal network:
 # ifconfig eth0 10.1.54.1 netmask 255.255.0.0 broadcast 10.1.255.255
 
-ifconfig tap0 hw ether fe:fd:0:0:0:0
-ifconfig tap0 10.1.54.1 netmask 255.0.0.0
-ifconfig tap0 -arp
+ifconfig $INTERFACE 10.1.54.1 netmask 255.0.0.0
 @end example
 
 and in @file{/etc/tinc/company/tinc.conf}:
@@ -1225,16 +1285,16 @@ On all hosts, /etc/tinc/company/hosts/BranchA contains:
 Subnet = 10.1.0.0/16
 Address = 1.2.3.4
 
-Note that the IP addresses of eth0 and tap0 are the same.
-This is quite possible, if you make sure that the netmasks of the interfaces are different.
-It is in fact recommended to give give both real internal network interfaces and tap interfaces the same IP address,
-since that will make things a lot easier to remember and set up.
-
 -----BEGIN RSA PUBLIC KEY-----
 ...
 -----END RSA PUBLIC KEY-----
 @end example
 
+Note that the IP addresses of eth0 and tap0 are the same.
+This is quite possible, if you make sure that the netmasks of the interfaces are different.
+It is in fact recommended to give give both real internal network interfaces and tap interfaces the same IP address,
+since that will make things a lot easier to remember and set up.
+
 
 @subsubheading For Branch B
 
@@ -1244,9 +1304,7 @@ In @file{/etc/tinc/company/tinc-up}:
 # Real interface of internal network:
 # ifconfig eth0 10.2.43.8 netmask 255.255.0.0 broadcast 10.2.255.255
 
-ifconfig tap0 hw ether fe:fd:0:0:0:0
-ifconfig tap0 10.2.1.12 netmask 255.0.0.0
-ifconfig tap0 -arp
+ifconfig $INTERFACE 10.2.1.12 netmask 255.0.0.0
 @end example
 
 and in @file{/etc/tinc/company/tinc.conf}:
@@ -1281,9 +1339,7 @@ In @file{/etc/tinc/company/tinc-up}:
 # Real interface of internal network:
 # ifconfig eth0 10.3.69.254 netmask 255.255.0.0 broadcast 10.3.255.255
 
-ifconfig tap1 hw ether fe:fd:0:0:0:0
-ifconfig tap1 10.3.69.254 netmask 255.0.0.0
-ifconfig tap1 -arp
+ifconfig $INTERFACE 10.3.69.254 netmask 255.0.0.0
 @end example
 
 and in @file{/etc/tinc/company/tinc.conf}:
@@ -1319,9 +1375,7 @@ In @file{/etc/tinc/company/tinc-up}:
 # Real interface of internal network:
 # ifconfig eth0 10.4.3.32 netmask 255.255.0.0 broadcast 10.4.255.255
 
-ifconfig company hw ether fe:fd:0:0:0:0
-ifconfig company 10.4.3.32 netmask 255.0.0.0
-ifconfig company -arp
+ifconfig $INTERFACE 10.4.3.32 netmask 255.0.0.0
 @end example
 
 and in @file{/etc/tinc/company/tinc.conf}:
@@ -1404,43 +1458,52 @@ command line options.
 @cindex options
 @c from the manpage
 @table @samp
-@item --bypass-security
-Disables encryption and authentication.
-Only useful for debugging.
-
 @item -c, --config=PATH
 Read configuration options from the directory PATH.  The default is
 @file{/etc/tinc/netname/}.
 
+@item -D, --no-detach
+Don't fork and detach.
+This will also disable the automatic restart mechanism for fatal errors.
+
 @cindex debug level
 @item -d, --debug=LEVEL
 Set debug level to LEVEL.  The higher the debug level, the more gets
 logged.  Everything goes via syslog.
 
-@item -K, --generate-keys[=BITS]
-Generate public/private keypair of BITS length. If BITS is not specified,
-1024 is the default. tinc will ask where you want to store the files,
-but will default to the configuration directory (you can use the -c or -n option
-in combination with -K). After that, tinc will quit.
-
-@item --help
-Display a short reminder of these runtime options and terminate.
-
 @item -k, --kill[=SIGNAL]
 Attempt to kill a running tincd (optionally with the specified SIGNAL instead of SIGTERM) and exit.
 Use it in conjunction with the -n option to make sure you kill the right tinc daemon.
+Under native Windows the optional argument is ignored,
+the service will always be stopped and removed.
 
 @item -n, --net=NETNAME
 Connect to net NETNAME.  @xref{Multiple networks}.
 
-@item -D, --no-detach
-Don't fork and detach.
-This will also disable the automatic restart mechanism for fatal errors.
+@item -K, --generate-keys[=BITS]
+Generate public/private keypair of BITS length. If BITS is not specified,
+1024 is the default. tinc will ask where you want to store the files,
+but will default to the configuration directory (you can use the -c or -n option
+in combination with -K). After that, tinc will quit.
 
 @item -L, --mlock
 Lock tinc into main memory.
 This will prevent sensitive data like shared private keys to be written to the system swap files/partitions.
 
+@item --logfile[=FILE]
+Write log entries to a file instead of to the system logging facility.
+If FILE is omitted, the default is /var/log/tinc.NETNAME.log.
+
+@item --pidfile=FILE
+Write PID to FILE instead of /var/run/tinc.NETNAME.pid.
+
+@item --bypass-security
+Disables encryption and authentication.
+Only useful for debugging.
+
+@item --help
+Display a short reminder of these runtime options and terminate.
+
 @item --version
 Output version information and exit.
 
@@ -1548,18 +1611,19 @@ computer over the existing Internet infrastructure.
 The data itself is read from a character device file, the so-called
 @emph{virtual network device}.  This device is associated with a network
 interface.  Any data sent to this interface can be read from the device,
-and any data written to the device gets sent from the interface.  Data to
-and from the device is formatted as if it were a normal Ethernet card,
-so a frame is preceded by two MAC addresses and a @emph{frame type}
-field.
+and any data written to the device gets sent from the interface.
+There are two possible types of virtual network devices:
+`tun' style, which are point-to-point devices which can only handle IPv4 and/or IPv6 packets,
+and `tap' style, which are Ethernet devices and handle complete Ethernet frames.
 
 So when tinc reads an Ethernet frame from the device, it determines its
 type. When tinc is in it's default routing mode, it can handle IPv4 and IPv6
-packets. Depending on the Subnet lines, it will send the packets off to their destination.
+packets. Depending on the Subnet lines, it will send the packets off to their destination IP address.
 In the `switch' and `hub' mode, tinc will use broadcasts and MAC address discovery
 to deduce the destination of the packets.
 Since the latter modes only depend on the link layer information,
 any protocol that runs over Ethernet is supported (for instance IPX and Appletalk).
+However, only `tap' style devices provide this information.
 
 After the destination has been determined,
 the packet will be compressed (optionally),
@@ -1580,18 +1644,20 @@ in reverse.  So it checks the message authentication code, decrypts the contents
 checks the sequence number
 and writes the decrypted information to its own virtual network device.
 
-To let the kernel on the receiving end accept the packet, the destination MAC
-address must match that of the virtual network interface.
-If tinc is in it's default routing mode, ARP does not work, so the correct destination MAC cannot be set
-by the sending daemons.
-tinc solves this by letting the receiving end detect the MAC address
+If the virtual network device is a `tun' device (a point-to-point tunnel),
+there is no problem for the kernel to accept a packet.
+However, if it is a `tap' device (this is the only available type on FreeBSD),
+the destination MAC address must match that of the virtual network interface.
+If tinc is in it's default routing mode, ARP does not work, so the correct destination MAC 
+can not be known by the sending host.
+tinc solves this by letting the receiving end detect the MAC address of its own virtual network interface
 and overwriting the destination MAC address of the received packet.
-However, the MAC address of the network interface at the receiver might not always be known to tinc.
-That is the reason why you should set the MAC address of your tap interface to that address
-when in routing mode.
 
 In switch or hub modes ARP does work so the sender already knows the correct destination MAC address.
 In those modes every interface should have a unique MAC address, so make sure they are not the same.
+Because switch and hub modes rely on MAC addresses to function correctly,
+these modes cannot be used on the following operating systems which don't have a `tap' style virtual network device:
+OpenBSD, NetBSD, Darwin and Solaris.
 
 
 @c ==================================================================
@@ -1888,7 +1954,7 @@ known, because a challenge reply can only be sent back if the challenge is
 decrypted correctly, and that can only be done with knowledge of the private
 key.
 
-Fourth: the first thing that is send via the symmetric cipher encrypted
+Fourth: the first thing that is sent via the symmetric cipher encrypted
 connection is a totally random string, so that there is no known plaintext (for
 an attacker) in the beginning of the encrypted stream.
 
@@ -1942,8 +2008,10 @@ tinc's website is at @url{http://tinc.nl.linux.org/},
 this server is located in the Netherlands.
 
 @cindex IRC
-We have an IRC channel on the FreeNode IRC network. Connect to
+We have an IRC channel on the FreeNode and OFTC IRC networks. Connect to
 @uref{http://www.freenode.net/, irc.freenode.net}
+or
+@uref{http://www.oftc.net/, irc.oftc.net}
 and join channel #tinc.