X-Git-Url: https://www.tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=doc%2Ftinc.texi;h=100042343d7d29a3add177843783fd1d47bcf00c;hp=afcaa6a334eb5fd6f95c8e27c7a45a885c90ac19;hb=e821a22876d15c921a4c1fbc0f792d83e90916f6;hpb=7c665712d69d5a502d4c2f098ad85df3b17bfb92 diff --git a/doc/tinc.texi b/doc/tinc.texi index afcaa6a3..10004234 100644 --- a/doc/tinc.texi +++ b/doc/tinc.texi @@ -6,10 +6,13 @@ @c %**end of header @ifinfo +@direntry +* tinc: (tinc). The tinc Manual. +@end direntry This is the info manual for tinc, a Virtual Private Network daemon. -Copyright 1998 Ivo Timmermans +Copyright 1998,199,2000 Ivo Timmermans Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and @@ -31,7 +34,7 @@ Copyright 1998 Ivo Timmermans @page @vskip 0pt plus 1filll -Copyright @copyright{} 1998 Ivo Timmermans +Copyright @copyright{} 1998,1999,2000 Ivo Timmermans Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and @@ -94,11 +97,27 @@ by a few elected computers that participate. This goal is achievable in more than just one way. @cindex private -For instance, a VPN can consist of a single stand-alone ethernet LAN. Or -even two computers hooked up using a null-modem cable@footnote{Though -discussable, I think it qualifies as a VPN.}. In these cases, it is -obvious that the network is @emph{private}. But there is another type -of VPN, the type tinc was made for. +Private networks can consist of a single stand-alone ethernet LAN. Or +even two computers hooked up using a null-modem cable. In these cases, +it is +obvious that the network is @emph{private}, noone can access it from the +outside. But if your computers are linked to the internet, the network +is not private anymore, unless one uses firewalls to block all private +traffic. But then, there is no way to send private data to trusted +computers on the other end of the internet. + +@cindex virtual +This problem can be solved by using @emph{virtual} networks. Virtual +networks can live on top of other networks, but do not interfere with +each other. Mostly, virtual networks appear like a singe LAN, even though +they can span the entire world. But virtual networks can't be secured +by using firewalls, because the traffic that flows through it has to go +through the internet, where other people can look at it. + +When one introduces encryption, we can form a true VPN. Other people may +see encrypted traffic, but if they don't know how to decipher it (they +need to know the key for that), they cannot read the information that flows +through the VPN. This is what tinc was made for. @cindex virtual tinc uses normal IP datagrams to encapsulate data that goes over the VPN @@ -209,7 +228,7 @@ chown 0.0 /dev/tap0 The permissions now will be such that only the super user may read/write to this file. You'd want this, because otherwise eavesdropping would -become a tad too easy. This does, however, imply that you'd have to run +become a bit too easy. This does, however, imply that you'd have to run tincd as root. If you want to, you may also create more device files, which would be @@ -219,7 +238,7 @@ owned by root and have permission 600. @subsubheading @file{/etc/networks} -You may add a line to @file{/etc/networks} so that your vpn will get a +You may add a line to @file{/etc/networks} so that your VPN will get a symbolic name. For example: @example @@ -230,7 +249,7 @@ myvpn 10.0.0.0 @subsubheading @file{/etc/services} You may add this line to @file{/etc/services}. The effect is that you -may supply a @samp{vpn} as a valid port number to some programs. The +may supply a @samp{tinc} as a valid port number to some programs. The number 655 is registered with the IANA. @example @@ -325,12 +344,12 @@ to this daemon. The effect of this is that the daemon will set its configuration ``root'' to /etc/tinc/nn/, where nn is your argument to the -n -option. You'll notice that it appears in syslog as ``tincd.nn''. +option. You'll notice that it appears in syslog as ``tinc.nn''. 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/nn/; the configuration file should be /etc/tinc/tincd.conf, +/etc/tinc/nn/; the configuration file should be /etc/tinc/tinc.conf, and the passphrases are now expected to be in /etc/tinc/passphrases/. But it is highly recommended that you use this feature of tinc, because @@ -354,7 +373,7 @@ will try to connect to it, on the given port. If this fails, tinc exits. @section Configuration file The actual configuration of the daemon is done in the file -@file{/etc/tinc/nn/tincd.conf}. +@file{/etc/tinc/nn/tinc.conf}. This file consists of comments (lines started with a #) or assignments in the form of @@ -380,11 +399,6 @@ Here are all valid variables, listed in alphabetical order: @c straight from the manpage @table @asis -@item AllowConnect = (yes|no) -If set to yes, anyone may try to connect to you. If you set this to no, -no incoming connections will be accepted. This does not affect the -outgoing connections. - @item ConnectPort = port Connect to the upstream host (given with the ConnectTo directive) on port port. port may be given in decimal (default), octal (when preceded @@ -437,6 +451,10 @@ The ethertap device to use. Note that you can only use one device per daemon. The info pages of the tinc package contain more information about configuring an ethertap device for Linux. +@item VpnMask = mask +The mask that defines the scope of the entire VPN. This option is not used +by the tinc daemon itself, but can be used by startup scripts to configure +the ethertap devices correctly. @end table @@ -478,11 +496,12 @@ ifconfig tap0 10.1.54.1 netmask 255.0.0.0 ifconfig eth0 10.1.54.1 netmask 255.255.0.0 broadcast 10.1.255.255 @end example -and in /etc/tinc/tincd.conf: +and in /etc/tinc/tinc.conf: @example TapDevice = /dev/tap0 MyVirtualIP = 10.1.54.1/16 +VpnMask = 255.0.0.0 @end example @subsubheading For B @@ -493,13 +512,13 @@ ifconfig tap0 10.2.1.12 netmask 255.0.0.0 ifconfig eth0 10.2.43.8 netmask 255.255.0.0 broadcast 10.2.255.255 @end example -and in /etc/tinc/tincd.conf: +and in /etc/tinc/tinc.conf: @example TapDevice = /dev/tap0 MyVirtualIP = 10.2.1.12/16 ConnectTo = 1.2.3.4 -AllowConnect = no +VpnMask = 255.0.0.0 @end example Note here that the internal address (on eth0) doesn't have to be the @@ -514,12 +533,13 @@ ifconfig tap0 10.3.69.254 netmask 255.0.0.0 ifconfig eth0 10.3.69.254 netmask 255.255.0.0 broadcast 10.3.255.255 @end example -and in /etc/tinc/A/tincd.conf: +and in /etc/tinc/A/tinc.conf: @example MyVirtualIP = 10.3.69.254/16 ConnectTo = 1.2.3.4 ListenPort = 2000 +VpnMask = 255.0.0.0 @end example C already has another daemon that runs on port 655, so they have to @@ -534,13 +554,13 @@ ifconfig tap0 10.4.3.32 netmask 255.0.0.0 ifconfig tap0 10.4.3.32 netmask 255.255.0.0 broadcast 10.4.255.255 @end example -and in /etc/tinc/tincd.conf: +and in /etc/tinc/tinc.conf: @example MyVirtualIP = 10.4.3.32/16 ConnectTo = 3.4.5.6 ConnectPort = 2000 -AllowConnect = no +VpnMask=255.0.0.0 @end example D will be connecting to C, which has a tincd running for this network on @@ -642,7 +662,7 @@ generated automatically, so may be more up-to-date. @table @asis @item -c, --config=FILE Read configuration options from FILE. The default is -@file{/etc/tinc/nn/tincd.conf}. +@file{/etc/tinc/nn/tinc.conf}. @item -d Increase debug level. The higher it gets, the more gets @@ -657,7 +677,7 @@ packets themselves. @item -k, --kill Attempt to kill a running tincd and exit. A TERM signal (15) gets sent -to the daemon that his its PID in /var/run/tincd.nn.pid. +to the daemon that his its PID in /var/run/tinc.nn.pid. Because it kills only one tincd, you should use -n here if you use it normally. @@ -688,7 +708,6 @@ Output version information and exit. @menu * The Connection:: * Security:: -* The Protocol:: @end menu @node The Connection, Security, Technical information, Technical information @@ -743,7 +762,7 @@ and it writes the decrypted information to its own ethertap device. @node The Meta-connection, , Protocol Preview, The Connection @subsection The meta-connection -Having only a UDP connection available is not enough. Though suitable +Having only an UDP connection available is not enough. Though suitable for transmitting data, we want to be able to reliably send other information, such as routing and encryption information to somebody. @@ -763,9 +782,16 @@ have two connections, we also have two protocols. The protocol used for the UDP data is the ``data-protocol,'' the other one is the ``meta-protocol.'' +The reason we don't use TCP for both protocols is that UDP is much +better for encapsulation, even while it is less reliable. The real +problem is that when TCP would be used to encapsulate a TCP stream +that's on the private network, for every packet sent there would be +three ACK's sent instead of just one. Furthermore, if there would be +a timeout, both TCP streams would sense the timeout, and both would +start resending packets. @c ================================================================== -@node Security, The Protocol, The Connection, Technical information +@node Security, , The Connection, Technical information @section About tinc's encryption and other security-related issues. @cindex tinc @@ -859,266 +885,6 @@ Now we have securely hidden our data. But a malicious cracker may still bother you by randomly altering the encrypted data he intercepts. -@c ================================================================== -@node The Protocol, , Security, Technical information -@section Detailed protocol specifications - - - -@menu -* Data protocol:: -* Meta protocol:: -@end menu - -@c ================================================================== -@node Data protocol, Meta protocol, The Protocol, The Protocol -@subsection The data protocol - -The data that is sent through the UDP connection is formatted as follows: - -@example - - bytes | Contents ----------------------- - 0-1 | The length of this packet, including all leading fields - 2-5 | The destination IP address - 6-... | The encrypted data - -@end example - -The method that was used to encrypt the data should be made known via -the meta-protocol, during early identification stages. - - -@c ================================================================== -@node Meta protocol, , Data protocol, The Protocol -@subsection The Meta protocol - -This protocol consists of separate packets of information, that are -generally formatted thusly: - -@example - - bytes | Contents ----------------------- - 0 | The request ID - 1-... | (Optional: arguments) - -@end example - -What follows is a listing of possible request IDs. - -@table @samp -@item ACK -Acknowledge. This generally means that the authentication has been -accepted by the remote computer. Takes no arguments. - -@example - - bytes | Contents ----------------------- - 0 | `1' - -@end example - -@item AUTH_S_INIT -@itemx AUTH_C_INIT -Obsolete. Use @samp{BASIC_INFO}. - -@item AUTH_S_SPP -@itemx AUTH_C_SPP -Obsolete. Use @samp{PASSPHRASE}. - -@item AUTH_S_SKEY -@itemx AUTH_C_SKEY -Obsolete. Use @samp{PUBLIC_KEY}, @samp{REQ_KEY} and @samp{ANS_KEY}. - -@item AUTH_S_SACK -@itemx AUTH_C_RACK -Obsolete. Use @samp{ACK}. - -@item TERMREQ -A request to terminate this connection, for whatever reason. - -@example - - bytes | Contents ----------------------- - 0 | `30' - 1-4 | The VPN IP address of the host that has exited - -@end example - - -@item PINGTIMEOUT -Terminate connection, but the reason must be a ping timeout. - -@example - - bytes | Contents ----------------------- - 0 | `31' - 1-4 | The VPN IP address of the host that has exited - -@end example - - -@item PING -Send probe to the other end, if he hasn't returned a @samp{PONG} within -10 seconds, the connection is considered to be dead and will be -terminated, we should try to notify the other by sending a -@samp{PINGTIMEOUT} packet. - -@example - - bytes | Contents ----------------------- - 0 | `40' - -@end example - - -@item PONG -See explanation for @samp{PING} - -@example - - bytes | Contents ----------------------- - 0 | `41' - -@end example - - -@item ADD_HOST -Send an @samp{ADD_HOST} packet if you want to propagate all your current -connections to a new computer on a network. If we get this request, we -must forward it to everyone that hasn't got it yet. - -@example - - bytes | Contents ----------------------- - 0 | `60' - 1-4 | The real IP address of the new host - 5-8 | The VPN IP address of the new host - 9-12 | The VPN netmask - 13-14 | The port number that the new host listens on - -@end example - - -@item BASIC_INFO -This packet will contain all necessary basic information about -ourselves, such as the port we listen on and our desired VPN IP address. - -@example - - bytes | Contents ----------------------- - 0 | `61' - 1 | The protocol version. - | This chapter describes version 4. - 2-3 | The port number that the new host listens on - 4-7 | The VPN IP address of the new host - 8-11 | The VPN netmask - -@end example - - -@item PASSPHRASE -Send an encrypted passphrase. Should be encrypted with our -@strong{public} key, and it must reach us before a @samp{PUBLIC_KEY} -request. - -@example - - bytes | Contents ----------------------- - 0 | `62' - 1-2 | The length of the encrypted passphrase - 3-... | The encrypted passphrase - -@end example - - -@item PUBLIC_KEY -This is only used during authentication of a new connection, later on we -may use @samp{REQ_KEY} and @samp{ANS_KEY}. - -@example - - bytes | Contents ----------------------- - 0 | `63' - 1-2 | The length of the key - 3-... | The public key, given in base-36 - -@end example - - -@item HOLD -@itemx RESUME -Unused. - -@item CALCULATE -@itemx CALC_RES -@itemx ALMOST_KEY -Never been in use. - -@item REQ_KEY -Request a public key from someone and return it to the sender of this -request using a @samp{ANS_KEY} packet. If we get such request, we must -forward it to the connection that leads to the destination. - -@example - - bytes | Contents ----------------------- - 0 | `160' - 1-4 | The source VPN IP address - 5-8 | The destination VPN IP address - 9-14 | `0' - -@end example - - -@item ANS_KEY -Answer to a @samp{REQ_KEY} request, forward it to the destination if it -is not meant for us. - -@example - - bytes | Contents ----------------------- - 0 | `161' - 1-4 | The source VPN IP address - 5-8 | The destination VPN IP address - 9-12 | The expiration date/time in seconds - 13-14 | The key length - 15-... | The public key in base-36 - -@end example - - -@item KEY_CHANGED -The source computer wants to tell that it has regenerated its private -and public keys, so anything going there must be encrypted with a new -shared key. - -@example - - bytes | Contents ----------------------- - 0 | `162' - 1-4 | The source VPN IP address - -@end example - - -@end table - - @c ================================================================== @node About us, Concept Index, Technical information, Top @chapter About us @@ -1154,7 +920,7 @@ Main coder/hacker and maintainer of the package. Originator of it all, co-author. @item Wessel Dankers (Ubiq) -General obfuscator of the code. +General obfuscater of the code. @end table