ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/gvpe/doc/gvpe.5
Revision: 1.12
Committed: Sat Jul 13 04:10:29 2013 UTC (10 years, 11 months ago) by root
Branch: MAIN
CVS Tags: rel-2_25
Changes since 1.11: +17 -26 lines
Log Message:
*** empty log message ***

File Contents

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