ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/gvpe/doc/gvpe.5
Revision: 1.8
Committed: Wed Mar 23 21:55:39 2005 UTC (19 years, 2 months ago) by pcg
Branch: MAIN
Changes since 1.7: +1 -1 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 pcg 1.1 .\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
2     .\"
3     .\" Standard preamble:
4     .\" ========================================================================
5     .de Sh \" Subsection heading
6     .br
7     .if t .Sp
8     .ne 5
9     .PP
10     \fB\\$1\fR
11     .PP
12     ..
13     .de Sp \" Vertical space (when we can't use .PP)
14     .if t .sp .5v
15     .if n .sp
16     ..
17     .de Vb \" Begin verbatim text
18     .ft CW
19     .nf
20     .ne \\$1
21     ..
22     .de Ve \" End verbatim text
23     .ft R
24     .fi
25     ..
26     .\" Set up some character translations and predefined strings. \*(-- will
27     .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
28     .\" double quote, and \*(R" will give a right double quote. | will give a
29     .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
30     .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
31     .\" expand to `' in nroff, nothing in troff, for use with C<>.
32     .tr \(*W-|\(bv\*(Tr
33     .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
34     .ie n \{\
35     . ds -- \(*W-
36     . ds PI pi
37     . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
38     . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
39     . ds L" ""
40     . ds R" ""
41     . ds C`
42     . ds C'
43     'br\}
44     .el\{\
45     . ds -- \|\(em\|
46     . ds PI \(*p
47     . ds L" ``
48     . ds R" ''
49     'br\}
50     .\"
51     .\" If the F register is turned on, we'll generate index entries on stderr for
52     .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
53     .\" entries marked with X<> in POD. Of course, you'll have to process the
54     .\" output yourself in some meaningful fashion.
55     .if \nF \{\
56     . de IX
57     . tm Index:\\$1\t\\n%\t"\\$2"
58     ..
59     . nr % 0
60     . rr F
61     .\}
62     .\"
63     .\" For nroff, turn off justification. Always turn off hyphenation; it makes
64     .\" way too many mistakes in technical documents.
65     .hy 0
66     .if n .na
67     .\"
68     .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69     .\" Fear. Run. Save yourself. No user-serviceable parts.
70     . \" fudge factors for nroff and troff
71     .if n \{\
72     . ds #H 0
73     . ds #V .8m
74     . ds #F .3m
75     . ds #[ \f1
76     . ds #] \fP
77     .\}
78     .if t \{\
79     . ds #H ((1u-(\\\\n(.fu%2u))*.13m)
80     . ds #V .6m
81     . ds #F 0
82     . ds #[ \&
83     . ds #] \&
84     .\}
85     . \" simple accents for nroff and troff
86     .if n \{\
87     . ds ' \&
88     . ds ` \&
89     . ds ^ \&
90     . ds , \&
91     . ds ~ ~
92     . ds /
93     .\}
94     .if t \{\
95     . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
96     . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
97     . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
98     . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
99     . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
100     . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
101     .\}
102     . \" troff and (daisy-wheel) nroff accents
103     .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
104     .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
105     .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
106     .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
107     .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
108     .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
109     .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
110     .ds ae a\h'-(\w'a'u*4/10)'e
111     .ds Ae A\h'-(\w'A'u*4/10)'E
112     . \" corrections for vroff
113     .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
114     .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
115     . \" for low resolution devices (crt and lpr)
116     .if \n(.H>23 .if \n(.V>19 \
117     \{\
118     . ds : e
119     . ds 8 ss
120     . ds o a
121     . ds d- d\h'-1'\(ga
122     . ds D- D\h'-1'\(hy
123     . ds th \o'bp'
124     . ds Th \o'LP'
125     . ds ae ae
126     . ds Ae AE
127     .\}
128     .rm #[ #] #H #V #F C
129     .\" ========================================================================
130     .\"
131     .IX Title "GVPE 5"
132 pcg 1.8 .TH GVPE 5 "2005-03-23" "1.9" "GNU Virtual Private Ethernet"
133 pcg 1.1 .SH "NAME"
134     GNU\-VPE \- Overview of the GNU Virtual Private Ethernet suite.
135     .SH "DESCRIPTION"
136     .IX Header "DESCRIPTION"
137     \&\s-1GVPE\s0 is a suite designed to provide a virtual private network for multiple
138 pcg 1.5 nodes over an untrusted network. This document first gives an introduction
139     to VPNs in general and then describes the specific implementation of \s-1GVPE\s0.
140     .Sh "\s-1WHAT\s0 \s-1IS\s0 A \s-1VPN\s0?"
141     .IX Subsection "WHAT IS A VPN?"
142     \&\s-1VPN\s0 is an acronym, it stands for:
143 pcg 1.3 .IP "\(bu" 4
144     .IX Xref "Virtual"
145 pcg 1.5 Virtual means that no physical network is created (of course), but a
146     network is \fIemulated\fR by creating multiple tunnels between the member
147     nodes by encapsulating and sending data over another transport network.
148     .Sp
149     Usually the emulated network is a normal \s-1IP\s0 or Ethernet, and the transport
150     network is the Internet. However, using a \s-1VPN\s0 system like \s-1GVPE\s0 to connect
151     nodes over other untrusted networks such as Wireless \s-1LAN\s0 is not uncommon.
152 pcg 1.3 .IP "\(bu" 4
153     .IX Xref "Private"
154     Private means that non-participating nodes cannot decode (\*(L"sniff)\*(R" nor
155 pcg 1.5 inject (\*(L"spoof\*(R") packets. This means that nodes can be connected over
156     untrusted networks such as the public Internet without fear of being
157     eavesdropped while at the same time being able to trust data sent by other
158     nodes.
159 pcg 1.3 .Sp
160 pcg 1.5 In the case of \s-1GVPE\s0, even participating nodes cannot sniff packets
161     send to other nodes or spoof packets as if sent from other nodes, so
162     communications between any two nodes is private to those two nodes.
163 pcg 1.3 .IP "\(bu" 4
164     .IX Xref "Network"
165     Network means that more than two parties can participate in the network,
166     so for instance it's possible to connect multiple branches of a company
167     into a single network. Many so-called \*(L"vpn\*(R" solutions only create
168 pcg 1.5 point-to-point tunnels, which in turn can be used to build larger
169     networks.
170     .Sp
171     \&\s-1GVPE\s0 provides a true multi-point network in wich any number of nodes (at
172     least a few dozen in practise, the theoretical limit is 4095 nodes) can
173     participate.
174     .Sh "\s-1GVPE\s0 \s-1DESIGN\s0 \s-1GOALS\s0"
175     .IX Subsection "GVPE DESIGN GOALS"
176 pcg 1.1 .IP "\s-1SIMPLE\s0 \s-1DESIGN\s0" 4
177     .IX Item "SIMPLE DESIGN"
178     Cipher, \s-1HMAC\s0 algorithms and other key parameters must be selected
179     at compile time \- this makes it possible to only link in algorithms
180     you actually need. It also makes the crypto part of the source very
181 pcg 1.5 transparent and easy to inspect, and last not least this makes it possible
182     to hardcode the layout of all packets into the binary. \s-1GVPE\s0 goes a step
183     further and internally reserves blocks of the same length for all packets,
184     which virtually removes all possibilities of buffer overflows, as there is
185     only a single type of buffer and it's always of fixed length.
186 pcg 1.1 .IP "\s-1EASY\s0 \s-1TO\s0 \s-1SETUP\s0" 4
187     .IX Item "EASY TO SETUP"
188     A few lines of config (the config file is shared unmodified between all
189     hosts) and a single run of \f(CW\*(C`gvpectrl\*(C'\fR to generate the keys suffices to
190     make it work.
191     .IP "MAC-BASED \s-1SECURITY\s0" 4
192     .IX Item "MAC-BASED SECURITY"
193     Since every host has it's own private key, other hosts cannot spoof
194     traffic from this host. That makes it possible to filter packet by \s-1MAC\s0
195     address, e.g. to ensure that packets from a specific \s-1IP\s0 address come, in
196     fact, from a specific host that is associated with that \s-1IP\s0 and not from
197     another host.
198     .SH "PROGRAMS"
199     .IX Header "PROGRAMS"
200     Vpe comes with two programs: one daemon (\f(CW\*(C`gvpe\*(C'\fR) and one control program
201     (\f(CW\*(C`gvpectrl\*(C'\fR).
202     .IP "gvpectrl" 4
203     .IX Item "gvpectrl"
204     Is used to generate the keys, check and give an overview of of the
205     configuration and contorl the daemon (restarting etc.).
206     .IP "gvpe" 4
207     .IX Item "gvpe"
208     Is the daemon used to establish and maintain connections to the other
209     network members. It should be run on the gateway machine.
210     .SH "COMPILETIME CONFIGURATION"
211     .IX Header "COMPILETIME CONFIGURATION"
212     Please have a look at the \f(CW\*(C`gvpe.osdep(5)\*(C'\fR manpage for platform-specific
213     information.
214     .PP
215 pcg 1.4 Here are a few recipes for compiling your gvpe, showing the extremes
216     (fast, small, insecure \s-1OR\s0 slow, large, more secure), between you should
217     choose:
218 pcg 1.1 .Sh "\s-1AS\s0 \s-1LOW\s0 \s-1PACKET\s0 \s-1OVERHEAD\s0 \s-1AS\s0 \s-1POSSIBLE\s0"
219     .IX Subsection "AS LOW PACKET OVERHEAD AS POSSIBLE"
220     .Vb 1
221     \& ./configure --enable-hmac-length=4 --enable-rand-length=0
222     .Ve
223     .PP
224 pcg 1.4 Minimize the header overhead of \s-1VPN\s0 packets (the above will result in
225     only 4 bytes of overhead over the raw ethernet frame). This is a insecure
226     configuration because a \s-1HMAC\s0 length of 4 makes collision attacks based on
227     the birthday paradox easy, though.
228 pcg 1.1 .Sh "\s-1MINIMIZE\s0 \s-1CPU\s0 \s-1TIME\s0 \s-1REQUIRED\s0"
229     .IX Subsection "MINIMIZE CPU TIME REQUIRED"
230     .Vb 1
231     \& ./configure --enable-cipher=bf --enable-digest=md4
232     .Ve
233     .PP
234 pcg 1.4 Use the fastest cipher and digest algorithms currently available in
235     gvpe. \s-1MD4\s0 has been broken and is quite insecure, though.
236 pcg 1.1 .Sh "\s-1MAXIMIZE\s0 \s-1SECURITY\s0"
237     .IX Subsection "MAXIMIZE SECURITY"
238     .Vb 1
239     \& ./configure --enable-hmac-length=16 --enable-rand-length=8 --enable-digest=sha1
240     .Ve
241     .PP
242     This uses a 16 byte \s-1HMAC\s0 checksum to authenticate packets (I guess 8\-12
243     would also be pretty secure ;) and will additionally prefix each packet
244 pcg 1.2 with 8 bytes of random data. In the long run, people should move to
245     \&\s-1SHA\-224\s0 and beyond, but support in openssl is missing as of writing this
246     document.
247 pcg 1.1 .PP
248     In general, remember that \s-1AES\-128\s0 seems to be more secure and faster than
249     \&\s-1AES\-192\s0 or \s-1AES\-256\s0, more randomness helps against sniffing and a longer
250     \&\s-1HMAC\s0 helps against spoofing. \s-1MD4\s0 is a fast digest, \s-1SHA1\s0 or \s-1RIPEMD160\s0 are
251     better, and Blowfish is a fast cipher (and also quite secure).
252     .SH "HOW TO SET UP A SIMPLE VPN"
253     .IX Header "HOW TO SET UP A SIMPLE VPN"
254     In this section I will describe how to get a simple \s-1VPN\s0 consisting of
255     three hosts up and running.
256     .Sh "\s-1STEP\s0 1: configuration"
257     .IX Subsection "STEP 1: configuration"
258     First you have to create a daemon configuation file and put it into the
259     configuration directory. This is usually \f(CW\*(C`/etc/gvpe\*(C'\fR, depending on how you
260     configured gvpe, and can be overwritten using the \f(CW\*(C`\-c\*(C'\fR commandline switch.
261     .PP
262     Put the following lines into \f(CW\*(C`/etc/gvpe/gvpe.conf\*(C'\fR:
263     .PP
264     .Vb 3
265     \& udp-port = 50000 # the external port to listen on (configure your firewall)
266     \& mtu = 1400 # minimum MTU of all outgoing interfaces on all hosts
267     \& ifname = vpn0 # the local network device name
268     .Ve
269     .PP
270     .Vb 2
271     \& node = first # just a nickname
272     \& hostname = first.example.net # the DNS name or IP address of the host
273     .Ve
274     .PP
275     .Vb 2
276     \& node = second
277     \& hostname = 133.55.82.9
278     .Ve
279     .PP
280     .Vb 2
281     \& node = third
282     \& hostname = third.example.net
283     .Ve
284     .PP
285     The only other file neccessary if the \f(CW\*(C`if\-up\*(C'\fR script that initializes the
286     local ethernet interface. Put the following lines into \f(CW\*(C`/etc/gvpe/if\-up\*(C'\fR
287     and make it execute (\f(CW\*(C`chmod 755 /etc/gvpe/if\-up\*(C'\fR):
288     .PP
289     .Vb 6
290     \& #!/bin/sh
291     \& ip link set $IFNAME address $MAC mtu $MTU up
292     \& [ $NODENAME = first ] && ip addr add 10.0.1.1 dev $IFNAME
293     \& [ $NODENAME = second ] && ip addr add 10.0.2.1 dev $IFNAME
294     \& [ $NODENAME = third ] && ip addr add 10.0.3.1 dev $IFNAME
295     \& ip route add 10.0.0.0/16 dev $IFNAME
296     .Ve
297     .PP
298     This script will give each node a different \s-1IP\s0 address in the \f(CW\*(C`10.0/16\*(C'\fR
299     network. The internal network (e.g. the \f(CW\*(C`eth0\*(C'\fR interface) should then be
300     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,
301     \&\f(CW\*(C`10.0.2.0/24\*(C'\fR on node \f(CW\*(C`second\*(C'\fR, and so on.
302     .PP
303     By enabling routing on the gateway host that runs \f(CW\*(C`gvpe\*(C'\fR all nodes will
304     be able to reach the other nodes. You can, of course, also use proxy arp
305     or other means of pseudo-bridging (or even real briding), or (best) full
306     routing \- the choice is yours.
307     .Sh "\s-1STEP\s0 2: create the \s-1RSA\s0 key pairs for all hosts"
308     .IX Subsection "STEP 2: create the RSA key pairs for all hosts"
309     Run the following command to generate all key pairs (that might take a
310     while):
311     .PP
312     .Vb 1
313     \& gvpectrl -c /etc/gvpe -g
314     .Ve
315     .PP
316     This command will put the public keys into \f(CW\*(C`/etc/gvpe/pubkeys/\f(CInodename\f(CW\*(C'\fR and the private keys into \f(CW\*(C`/etc/gvpe/hostkeys/\f(CInodename\f(CW\*(C'\fR.
317     .Sh "\s-1STEP\s0 3: distribute the config files to all nodes"
318     .IX Subsection "STEP 3: distribute the config files to all nodes"
319     Now distribute the config files to the other nodes. This should be done in two steps, since the
320     private keys should not be distributed. The example uses rsync-over-ssh
321     .PP
322     First all the config files without the hostkeys should be distributed:
323     .PP
324     .Vb 3
325     \& rsync -avzessh /etc/gvpe first.example.net:/etc/. --exclude hostkeys
326     \& rsync -avzessh /etc/gvpe 133.55.82.9:/etc/. --exclude hostkeys
327     \& rsync -avzessh /etc/gvpe third.example.net:/etc/. --exclude hostkeys
328     .Ve
329     .PP
330     Then the hostkeys should be copied:
331     .PP
332     .Vb 3
333     \& rsync -avzessh /etc/gvpe/hostkeys/first first.example.net:/etc/hostkey
334     \& rsync -avzessh /etc/gvpe/hostkeys/second 133.55.82.9:/etc/hostkey
335     \& rsync -avzessh /etc/gvpe/hostkeys/third third.example.net:/etc/hostkey
336     .Ve
337     .PP
338     You should now check the configration by issuing the command \f(CW\*(C`gvpectrl \-c
339     /etc/gvpe \-s\*(C'\fR on each node and verify it's output.
340     .Sh "\s-1STEP\s0 4: starting gvpe"
341     .IX Subsection "STEP 4: starting gvpe"
342     You should then start gvpe on each node by issuing a command like:
343     .PP
344     .Vb 1
345     \& gvpe -D -linfo first # first is the nodename
346     .Ve
347     .PP
348     This will make the gvpe stay in foreground. You should then see
349     \&\*(L"connection established\*(R" messages. If you don't see them check your
350     firewall and routing (use tcpdump ;).
351     .PP
352     If this works you should check your networking setup by pinging various
353     endpoints.
354     .PP
355     To make gvpe run more permanently you can either run it as a daemon
356     (by starting it without the \f(CW\*(C`\-D\*(C'\fR switch), or, much better, from your
357     inittab. I use a line like this on my systems:
358     .PP
359     .Vb 1
360     \& t1:2345:respawn:/opt/gvpe/sbin/gvpe -D -L first >/dev/null 2>&1
361     .Ve
362     .Sh "\s-1STEP\s0 5: enjoy"
363     .IX Subsection "STEP 5: enjoy"
364     \&... and play around. Sending a \-HUP (\f(CW\*(C`gvpectrl \-kHUP\*(C'\fR) to the daemon
365     will make it try to connect to all other nodes again. If you run it from
366     inittab, as is recommended, \f(CW\*(C`gvpectrl \-k\*(C'\fR (or simply \f(CW\*(C`killall gvpe\*(C'\fR) will
367     kill the daemon, start it again, making it read it's configuration files
368     again.
369     .SH "SEE ALSO"
370     .IX Header "SEE ALSO"
371 pcg 1.6 \&\fIgvpe.osdep\fR\|(5) for OS-depedendent information, \fIgvpe.conf\fR\|(5), \fIgvpectrl\fR\|(8),
372     and for a description of the transports, protocol, and routing algorithm,
373     \&\fIgvpe.protocol\fR\|(7).
374 pcg 1.7 .PP
375     The \s-1GVPE\s0 mailinglist, at <http://lists.schmorp.de/>, or
376     \&\f(CW\*(C`gvpe@lists.schmorp.de\*(C'\fR.
377 pcg 1.1 .SH "AUTHOR"
378     .IX Header "AUTHOR"
379 pcg 1.7 Marc Lehmann <gvpe@schmorp.de>
380 pcg 1.1 .SH "COPYRIGHTS AND LICENSES"
381     .IX Header "COPYRIGHTS AND LICENSES"
382     \&\s-1GVPE\s0 itself is distributed under the \s-1GENERAL\s0 \s-1PUBLIC\s0 \s-1LICENSE\s0 (see the file
383     \&\s-1COPYING\s0 that should be part of your distribution).
384     .PP
385     In some configurations it uses modified versions of the tinc vpn suite,
386     which is also available under the \s-1GENERAL\s0 \s-1PUBLIC\s0 \s-1LICENSE\s0.