.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 .\" .\" Standard preamble: .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. | will give a .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' .\" expand to `' in nroff, nothing in troff, for use with C<>. .tr \(*W-|\(bv\*(Tr .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` . ds C' 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .\" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "VPE 5" .TH VPE 5 "2004-06-07" "1.7" "Virtual Private Ethernet" .SH "NAME" GNU\-VPE \- Overview of the GNU Virtual Private Ethernet suite. .SH "DESCRIPTION" .IX Header "DESCRIPTION" Vpe is a suite designed to provide a virtual private network for multiple nodes over an untrusted network. .PP \&\*(L"Virtual\*(R" means that no physical network is created (of course), but an ethernet is emulated by creating multiple tunnels between the member nodes. .PP \&\*(L"Private\*(R" means that non-participating nodes cannot decode (\*(L"sniff)\*(R" nor inject (\*(L"spoof\*(R") packets. .PP In the case of vpe, even participating nodes cannot sniff packets send to other nodes or spoof packets as if sent from other nodes. .PP \&\*(L"Network\*(R" means that more than two parties can participate in the network, so for instance it's possible to connect multiple branches of a company into a single network. Many so-called \*(L"vpn\*(R" solutions only create point-to-point tunnels. .Sh "\s-1DESIGN\s0 \s-1GOALS\s0" .IX Subsection "DESIGN GOALS" .IP "\s-1SIMPLE\s0 \s-1DESIGN\s0" 4 .IX Item "SIMPLE DESIGN" Cipher, \s-1HMAC\s0 algorithms and other key parameters must be selected at compile time \- this makes it possible to only link in algorithms you actually need. It also makes the crypto part of the source very transparent and easy to inspect. .IP "\s-1EASY\s0 \s-1TO\s0 \s-1SETUP\s0" 4 .IX Item "EASY TO SETUP" A few lines of config (the config file is shared unmodified between all hosts) and a single run of \f(CW\*(C`vpectrl\*(C'\fR to generate the keys suffices to make it work. .IP "MAC-BASED \s-1SECURITY\s0" 4 .IX Item "MAC-BASED SECURITY" Since every host has it's own private key, other hosts cannot spoof traffic from this host. That makes it possible to filter packest by \s-1MAC\s0 address, e.g. to ensure that packets from a specific \s-1IP\s0 address come, in fact, from a specific host. .SH "PROGRAMS" .IX Header "PROGRAMS" Vpe comes with two programs: one daemon (\f(CW\*(C`vped\*(C'\fR) and one control program (\f(CW\*(C`vpectrl\*(C'\fR). .IP "vpectrl" 4 .IX Item "vpectrl" Is used to generate the keys, check and give an overview of of the configuration and contorl the daemon (restarting etc.). .IP "vped" 4 .IX Item "vped" Is the daemon used to establish and maintain conenctions to the other network members. It should be run on the gateway machine. .SH "COMPILETIME CONFIGURATION" .IX Header "COMPILETIME CONFIGURATION" Please have a look at the \f(CW\*(C`vpe.osdep(5)\*(C'\fR manpage for platform-specific information. .PP Here are a few recipes for compiling your vpe: .Sh "\s-1AS\s0 \s-1LOW\s0 \s-1PACKET\s0 \s-1OVERHEAD\s0 \s-1AS\s0 \s-1POSSIBLE\s0" .IX Subsection "AS LOW PACKET OVERHEAD AS POSSIBLE" .Vb 1 \& ./configure --enable-hmac-length=4 --enable-rand-length=0 .Ve .PP Minimize the header overhead of \s-1VPN\s0 packets (the above will result in only 4 bytes of overhead over the raw ethernet frame). .Sh "\s-1MINIMIZE\s0 \s-1CPU\s0 \s-1TIME\s0 \s-1REQUIRED\s0" .IX Subsection "MINIMIZE CPU TIME REQUIRED" .Vb 1 \& ./configure --enable-cipher=bf --enable-digest=md4 .Ve .PP Use the fastest cipher and digest algorithms currently available in vpe. .Sh "\s-1MAXIMIZE\s0 \s-1SECURITY\s0" .IX Subsection "MAXIMIZE SECURITY" .Vb 1 \& ./configure --enable-hmac-length=16 --enable-rand-length=8 --enable-digest=sha1 .Ve .PP This uses a 16 byte \s-1HMAC\s0 checksum to authenticate packets (I guess 8\-12 would also be pretty secure ;) and will additionally prefix each packet with 8 bytes of random data. .PP In general, remember that \s-1AES\-128\s0 seems to be more secure and faster than \&\s-1AES\-192\s0 or \s-1AES\-256\s0, more randomness helps against sniffing and a longer \&\s-1HMAC\s0 helps against spoofing. \s-1MD4\s0 is a fast digest, \s-1SHA1\s0 or \s-1RIPEMD160\s0 are better, and Blowfish is a fast cipher (and also quite secure). .SH "HOW TO SET UP A SIMPLE VPN" .IX Header "HOW TO SET UP A SIMPLE VPN" In this section I will describe how to get a simple \s-1VPN\s0 consisting of three hosts up and running. .Sh "\s-1STEP\s0 1: configuration" .IX Subsection "STEP 1: configuration" First you have to create a daemon configuation file and put it into the configuration directory. This is usually \f(CW\*(C`/etc/vpe\*(C'\fR, depending on how you configured vpe, and can be overwritten using the \f(CW\*(C`\-c\*(C'\fR commandline switch. .PP Put the following lines into \f(CW\*(C`/etc/vpe/vped.conf\*(C'\fR: .PP .Vb 3 \& udp-port = 50000 # the external port to listen on (configure your firewall) \& mtu = 1400 # minimum MTU of all outgoing interfaces on all hosts \& ifname = vpn0 # the local network device name .Ve .PP .Vb 2 \& node = first # just a nickname \& hostname = first.example.net # the DNS name or IP address of the host .Ve .PP .Vb 2 \& node = second \& hostname = 133.55.82.9 .Ve .PP .Vb 2 \& node = third \& hostname = third.example.net .Ve .PP The only other file neccessary if the \f(CW\*(C`if\-up\*(C'\fR script that initializes the local ethernet interface. Put the following lines into \f(CW\*(C`/etc/vpe/if\-up\*(C'\fR and make it execute (\f(CW\*(C`chmod 755 /etc/vpe/if\-up\*(C'\fR): .PP .Vb 6 \& #!/bin/sh \& ip link set $IFNAME address $MAC mtu $MTU up \& [ $NODENAME = first ] && ip addr add 10.0.1.1 dev $IFNAME \& [ $NODENAME = second ] && ip addr add 10.0.2.1 dev $IFNAME \& [ $NODENAME = third ] && ip addr add 10.0.3.1 dev $IFNAME \& ip route add 10.0.0.0/16 dev $IFNAME .Ve .PP This script will give each node a different \s-1IP\s0 address in the \f(CW\*(C`10.0/16\*(C'\fR network. The internal network (e.g. the \f(CW\*(C`eth0\*(C'\fR interface) should then be set to a subset of that network, e.g. \f(CW\*(C`10.0.1.0/24\*(C'\fR on node \f(CW\*(C`first\*(C'\fR, \&\f(CW\*(C`10.0.2.0/24\*(C'\fR on node \f(CW\*(C`second\*(C'\fR, and so on. .PP By enabling routing on the gateway host that runs \f(CW\*(C`vped\*(C'\fR all nodes will be able to reach the other nodes. You can, of course, also use proxy arp or other means of pseudo-bridging (or even real briding), or (best) full routing \- the choice is yours. .Sh "\s-1STEP\s0 2: create the \s-1RSA\s0 key pairs for all hosts" .IX Subsection "STEP 2: create the RSA key pairs for all hosts" Run the following command to generate all key pairs (that might take a while): .PP .Vb 1 \& vpectrl -c /etc/vpe -g .Ve .PP This command will put the public keys into \f(CW\*(C`/etc/vpe/pubkeys/\f(CInodename\f(CW\*(C'\fR and the private keys into \f(CW\*(C`/etc/vpe/hostkeys/\f(CInodename\f(CW\*(C'\fR. .Sh "\s-1STEP\s0 3: distribute the config files to all nodes" .IX Subsection "STEP 3: distribute the config files to all nodes" Now distribute the config files to the other nodes. This should be done in two steps, since the private keys should not be distributed. The example uses rsync-over-ssh .PP First all the config files without the hostkeys should be distributed: .PP .Vb 3 \& rsync -avzessh /etc/vpe first.example.net:/etc/. --exclude hostkeys \& rsync -avzessh /etc/vpe 133.55.82.9:/etc/. --exclude hostkeys \& rsync -avzessh /etc/vpe third.example.net:/etc/. --exclude hostkeys .Ve .PP Then the hostkeys should be copied: .PP .Vb 3 \& rsync -avzessh /etc/vpe/hostkeys/first first.example.net:/etc/hostkey \& rsync -avzessh /etc/vpe/hostkeys/second 133.55.82.9:/etc/hostkey \& rsync -avzessh /etc/vpe/hostkeys/third third.example.net:/etc/hostkey .Ve .PP You should now check the configration by issuing the command \f(CW\*(C`vpectrl \-c /etc/vpe \-s\*(C'\fR on each node and verify it's output. .Sh "\s-1STEP\s0 4: starting vped" .IX Subsection "STEP 4: starting vped" You should then start vped on each node by issuing a command like: .PP .Vb 1 \& vped -D -linfo first # first is the nodename .Ve .PP This will make the vped stay in foreground. You should then see \&\*(L"connection established\*(R" messages. If you don't see them check your firewall and routing (use tcpdump ;). .PP If this works you should check your networking setup by pinging various endpoints. .PP To make vped run more permanently you can either run it as a daemon (by starting it without the \f(CW\*(C`\-D\*(C'\fR switch), or, much better, from your inittab. I use a line like this on my systems: .PP .Vb 1 \& t1:2345:respawn:/opt/vpe/sbin/vped -D -L first >/dev/null 2>&1 .Ve .Sh "\s-1STEP\s0 5: enjoy" .IX Subsection "STEP 5: enjoy" \&... and play around. Sending a \-HUP (\f(CW\*(C`vpectrl \-kHUP\*(C'\fR) to the daemon will make it try to connect to all other nodes again. If you run it from inittab, as is recommended, \f(CW\*(C`vpectrl \-k\*(C'\fR (or simply \f(CW\*(C`killall vped\*(C'\fR) will kill the daemon, start it again, making it read it's configuration files again. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fIvpe.osdep\fR\|(5) for OS-depedendent information, \fIvped.conf\fR\|(5), \fIvpectrl\fR\|(8), and for a description of the protocol and routing algorithms, \fIvpe.protocol\fR\|(7). .SH "AUTHOR" .IX Header "AUTHOR" Marc Lehmann .SH "COPYRIGHTS AND LICENSES" .IX Header "COPYRIGHTS AND LICENSES" Vpe itself is distributed under the \s-1GENERAL\s0 \s-1PUBLIC\s0 \s-1LICENSE\s0 (see the file \&\s-1COPYING\s0 that should be part of your distribution). .PP In some configurations it uses modified versions of the tinc vpn suite, which is also available under the \s-1GENERAL\s0 \s-1PUBLIC\s0 \s-1LICENSE\s0. .PP In some configurations (notably darwin), it uses a poll emulation library that comes with the following license notice: .PP .Vb 2 \& Copyright (c) 1995-2002 Brian M. Clapper \& All rights reserved. .Ve .PP .Vb 11 \& Redistribution and use in source and binary forms are permitted \& provided that: (1) source distributions retain this entire \& copyright notice and comment; (2) modifications made to the \& software are prominently mentioned, and a copy of the original \& software (or a pointer to its location) are included; and (3) \& distributions including binaries display the following \& acknowledgement: "This product includes software developed by Brian \& M. Clapper " in the documentation or other \& materials provided with the distribution. The name of the author \& may not be used to endorse or promote products derived from this \& software without specific prior written permission. .Ve .PP .Vb 3 \& THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR \& IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED \& WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. .Ve