Check for fchmod().
[tinc] / doc / tinc.texi
index 2214d49..555017a 100644 (file)
@@ -1,24 +1,26 @@
 \input texinfo   @c -*-texinfo-*-
-@c $Id: tinc.texi,v 1.8.4.36 2003/06/11 20:18:48 guus Exp $
+@c $Id: tinc.texi,v 1.8.4.43 2003/08/08 14:07:12 guus Exp $
 @c %**start of header
 @setfilename tinc.info
 @settitle tinc Manual
 @setchapternewpage odd
 @c %**end of header
 
+@include tincinclude.texi
+
 @ifinfo
 @dircategory Networking tools
 @direntry
 * tinc: (tinc).              The tinc Manual.
 @end direntry
 
-This is the info manual for tinc, a Virtual Private Network daemon.
+This is the info manual for @value{PACKAGE} version @value{VERSION}, 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.36 2003/06/11 20:18:48 guus Exp $
+$Id: tinc.texi,v 1.8.4.43 2003/08/08 14:07:12 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 +41,13 @@ permission notice identical to this one.
 @page
 @vskip 0pt plus 1filll
 @cindex copyright
-Copyright @copyright{} 1998-2002 Ivo Timmermans
+This is the info manual for @value{PACKAGE} version @value{VERSION}, a Virtual Private Network daemon.
+
+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.36 2003/06/11 20:18:48 guus Exp $
+$Id: tinc.texi,v 1.8.4.43 2003/08/08 14:07:12 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 +181,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 +262,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 +339,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 +414,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,6 +460,24 @@ 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
@@ -612,11 +641,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
@@ -626,6 +657,31 @@ 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, 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 ==================================================================
 @node    System files,  , Building and installing tinc, Installation
@@ -745,6 +801,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.
@@ -777,14 +834,14 @@ This means that you call tincd with the -n argument,
 which will assign a netname to this daemon.
 
 The effect of this is that the daemon will set its configuration
-``root'' to /etc/tinc/netname/, where netname is your argument to the -n
-option.  You'll notice that it appears in syslog as ``tinc.netname''.
+``root'' to @value{sysconfdir}/tinc/@emph{netname}/, where @emph{netname} is your argument to the -n
+option.  You'll notice that it appears in syslog as ``tinc.@emph{netname}''.
 
 However, it is not strictly necessary that you call tinc with the -n
 option.  In this case, the network name would just be empty, and it will
-be used as such.  tinc now looks for files in /etc/tinc/, instead of
-/etc/tinc/netname/; the configuration file should be /etc/tinc/tinc.conf,
-and the host configuration files are now expected to be in /etc/tinc/hosts/.
+be used as such.  tinc now looks for files in @value{sysconfdir}/tinc/, instead of
+@value{sysconfdir}/tinc/@emph{netname}/; the configuration file should be @value{sysconfdir}/tinc/tinc.conf,
+and the host configuration files are now expected to be in @value{sysconfdir}/tinc/hosts/.
 
 But it is highly recommended that you use this feature of tinc, because
 it will be so much clearer whom your daemon talks to.  Hence, we will
@@ -821,8 +878,8 @@ It does not matter if two tinc daemons have a `ConnectTo' value pointing to each
 @section Configuration files
 
 The actual configuration of the daemon is done in the file
-@file{/etc/tinc/netname/tinc.conf} and at least one other file in the directory
-@file{/etc/tinc/netname/hosts/}.
+@file{@value{sysconfdir}/tinc/@emph{netname}/tinc.conf} and at least one other file in the directory
+@file{@value{sysconfdir}/tinc/@emph{netname}/hosts/}.
 
 These file consists of comments (lines started with a #) or assignments
 in the form of
@@ -906,8 +963,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)
@@ -920,6 +977,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
@@ -927,6 +986,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
@@ -1001,7 +1062,7 @@ Any cipher supported by OpenSSL is recognized.
 @item Compression = <level> (0)
 This option sets the level of compression used for UDP packets.
 Possible values are 0 (off), 1 (fast zlib) and any integer up to 9 (best zlib),
-and 10 (lzo).
+10 (fast lzo) and 11 (best lzo).
 
 @cindex Digest
 @item Digest = <digest> (sha1)
@@ -1087,13 +1148,13 @@ Setting this options also implicitly sets IndirectData.
 
 @subsubheading Step 1.  Creating the main configuration file
 
-The main configuration file will be called @file{/etc/tinc/netname/tinc.conf}.
+The main configuration file will be called @file{@value{sysconfdir}/tinc/@emph{netname}/tinc.conf}.
 Adapt the following example to create a basic configuration file:
 
 @example
 Name = @emph{yourname}
 Device = @emph{/dev/tap0}
-PrivateKeyFile = /etc/tinc/@emph{netname}/rsa_key.priv
+PrivateKeyFile = @value{sysconfdir}/tinc/@emph{netname}/rsa_key.priv
 @end example
 
 Then, if you know to which other tinc daemon(s) yours is going to connect,
@@ -1102,7 +1163,7 @@ add `ConnectTo' values.
 @subsubheading Step 2.  Creating your host configuration file
 
 If you added a line containing `Name = yourname' in the main configuarion file,
-you will need to create a host configuration file @file{/etc/tinc/netname/hosts/yourname}.
+you will need to create a host configuration file @file{@value{sysconfdir}/tinc/@emph{netname}/hosts/yourname}.
 Adapt the following example to create a host configuration file:
 
 @example
@@ -1148,9 +1209,9 @@ if you are using the Linux tun/tap driver, the network interface will by default
 
 @cindex tinc-up
 You can configure the network interface by putting ordinary ifconfig, route, and other commands
-to a script named @file{/etc/tinc/netname/tinc-up}. When tinc starts, this script
+to a script named @file{@value{sysconfdir}/tinc/@emph{netname}/tinc-up}. When tinc starts, this script
 will be executed. When tinc exits, it will execute the script named
-@file{/etc/tinc/netname/tinc-down}, but normally you don't need to create that script.
+@file{@value{sysconfdir}/tinc/@emph{netname}/tinc-down}, but normally you don't need to create that script.
 
 An example @file{tinc-up} script:
 
@@ -1205,7 +1266,7 @@ for this particular VPN.
 
 @emph{BranchA} would be configured like this:
 
-In @file{/etc/tinc/company/tinc-up}:
+In @file{@value{sysconfdir}/tinc/company/tinc-up}:
 
 @example
 # Real interface of internal network:
@@ -1214,15 +1275,15 @@ In @file{/etc/tinc/company/tinc-up}:
 ifconfig $INTERFACE 10.1.54.1 netmask 255.0.0.0
 @end example
 
-and in @file{/etc/tinc/company/tinc.conf}:
+and in @file{@value{sysconfdir}/tinc/company/tinc.conf}:
 
 @example
 Name = BranchA
-PrivateKeyFile = /etc/tinc/company/rsa_key.priv
+PrivateKeyFile = @value{sysconfdir}/tinc/company/rsa_key.priv
 Device = /dev/tap0
 @end example
 
-On all hosts, /etc/tinc/company/hosts/BranchA contains:
+On all hosts, @value{sysconfdir}/tinc/company/hosts/BranchA contains:
 
 @example
 Subnet = 10.1.0.0/16
@@ -1241,7 +1302,7 @@ since that will make things a lot easier to remember and set up.
 
 @subsubheading For Branch B
 
-In @file{/etc/tinc/company/tinc-up}:
+In @file{@value{sysconfdir}/tinc/company/tinc-up}:
 
 @example
 # Real interface of internal network:
@@ -1250,19 +1311,19 @@ In @file{/etc/tinc/company/tinc-up}:
 ifconfig $INTERFACE 10.2.1.12 netmask 255.0.0.0
 @end example
 
-and in @file{/etc/tinc/company/tinc.conf}:
+and in @file{@value{sysconfdir}/tinc/company/tinc.conf}:
 
 @example
 Name = BranchB
 ConnectTo = BranchA
-PrivateKeyFile = /etc/tinc/company/rsa_key.priv
+PrivateKeyFile = @value{sysconfdir}/tinc/company/rsa_key.priv
 @end example
 
 Note here that the internal address (on eth0) doesn't have to be the
 same as on the tap0 device.  Also, ConnectTo is given so that no-one can
 connect to this node.
 
-On all hosts, in @file{/etc/tinc/company/hosts/BranchB}:
+On all hosts, in @file{@value{sysconfdir}/tinc/company/hosts/BranchB}:
 
 @example
 Subnet = 10.2.0.0/16
@@ -1276,7 +1337,7 @@ Address = 2.3.4.5
 
 @subsubheading For Branch C
 
-In @file{/etc/tinc/company/tinc-up}:
+In @file{@value{sysconfdir}/tinc/company/tinc-up}:
 
 @example
 # Real interface of internal network:
@@ -1285,7 +1346,7 @@ In @file{/etc/tinc/company/tinc-up}:
 ifconfig $INTERFACE 10.3.69.254 netmask 255.0.0.0
 @end example
 
-and in @file{/etc/tinc/company/tinc.conf}:
+and in @file{@value{sysconfdir}/tinc/company/tinc.conf}:
 
 @example
 Name = BranchC
@@ -1297,7 +1358,7 @@ C already has another daemon that runs on port 655, so they have to
 reserve another port for tinc. It knows the portnumber it has to listen on
 from it's own host configuration file.
 
-On all hosts, in @file{/etc/tinc/company/hosts/BranchC}:
+On all hosts, in @file{@value{sysconfdir}/tinc/company/hosts/BranchC}:
 
 @example
 Address = 3.4.5.6
@@ -1312,7 +1373,7 @@ Port = 2000
 
 @subsubheading For Branch D
 
-In @file{/etc/tinc/company/tinc-up}:
+In @file{@value{sysconfdir}/tinc/company/tinc-up}:
 
 @example
 # Real interface of internal network:
@@ -1321,13 +1382,13 @@ In @file{/etc/tinc/company/tinc-up}:
 ifconfig $INTERFACE 10.4.3.32 netmask 255.0.0.0
 @end example
 
-and in @file{/etc/tinc/company/tinc.conf}:
+and in @file{@value{sysconfdir}/tinc/company/tinc.conf}:
 
 @example
 Name = BranchD
 ConnectTo = BranchC
 Device = /dev/net/tun
-PrivateKeyFile = /etc/tinc/company/rsa_key.priv
+PrivateKeyFile = @value{sysconfdir}/tinc/company/rsa_key.priv
 @end example
 
 D will be connecting to C, which has a tincd running for this network on
@@ -1336,7 +1397,7 @@ Also note that since D uses the tun/tap driver, the network interface
 will not be called `tun' or `tap0' or something like that, but will
 have the same name as netname.
 
-On all hosts, in @file{/etc/tinc/company/hosts/BranchD}:
+On all hosts, in @file{@value{sysconfdir}/tinc/company/hosts/BranchD}:
 
 @example
 Subnet = 10.4.0.0/16
@@ -1355,8 +1416,8 @@ A, B, C and D all have generated a public/private keypair with the following com
 tincd -n company -K
 @end example
 
-The private key is stored in @file{/etc/tinc/company/rsa_key.priv},
-the public key is put into the host configuration file in the @file{/etc/tinc/company/hosts/} directory.
+The private key is stored in @file{@value{sysconfdir}/tinc/company/rsa_key.priv},
+the public key is put into the host configuration file in the @file{@value{sysconfdir}/tinc/company/hosts/} directory.
 During key generation, tinc automatically guesses the right filenames based on the -n option and
 the Name directive in the @file{tinc.conf} file (if it is available).
 
@@ -1401,43 +1462,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/}.
+@file{@value{sysconfdir}/tinc/@emph{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 @value{localstatedir}/log/tinc.NETNAME.log.
+
+@item --pidfile=FILE
+Write PID to FILE instead of @value{localstatedir}/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.
 
@@ -1888,7 +1958,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 +2012,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.