ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/gvpe/README
Revision: 1.8
Committed: Fri Mar 18 01:53:05 2005 UTC (19 years, 1 month ago) by pcg
Branch: MAIN
CVS Tags: rel-1_9, rel-1_8, rel-2_01, rel-3_0, rel-2_2, rel-2_0, rel-2_21, rel-2_22, rel-2_25, HEAD
Changes since 1.7: +59 -45 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 pcg 1.1
2 pcg 1.2 ==== NAME ====
3    
4 pcg 1.6 GNU-VPE - Overview of the GNU Virtual Private Ethernet suite.
5 pcg 1.2
6    
7     ==== DESCRIPTION ====
8    
9 pcg 1.7 GVPE is a suite designed to provide a virtual private network for
10 pcg 1.8 multiple nodes over an untrusted network. This document first gives an
11     introduction to VPNs in general and then describes the specific
12     implementation of GVPE.
13 pcg 1.2
14 pcg 1.4
15 pcg 1.8 == WHAT IS A VPN? ==
16 pcg 1.4
17 pcg 1.8 VPN is an acronym, it stands for:
18 pcg 1.4
19 pcg 1.8 : Virtual means that no physical network is created (of course), but a
20     network is *emulated* by creating multiple tunnels between the
21     member nodes by encapsulating and sending data over another
22     transport network.
23 pcg 1.2
24 pcg 1.8 Usually the emulated network is a normal IP or Ethernet, and the
25     transport network is the Internet. However, using a VPN system like
26     GVPE to connect nodes over other untrusted networks such as Wireless
27     LAN is not uncommon.
28 pcg 1.2
29 pcg 1.8 : Private means that non-participating nodes cannot decode ("sniff)"
30     nor inject ("spoof") packets. This means that nodes can be connected
31     over untrusted networks such as the public Internet without fear of
32     being eavesdropped while at the same time being able to trust data
33     sent by other nodes.
34    
35     In the case of GVPE, even participating nodes cannot sniff packets
36     send to other nodes or spoof packets as if sent from other nodes, so
37     communications between any two nodes is private to those two nodes.
38    
39     : Network means that more than two parties can participate in the
40     network, so for instance it's possible to connect multiple branches
41     of a company into a single network. Many so-called "vpn" solutions
42     only create point-to-point tunnels, which in turn can be used to
43     build larger networks.
44    
45     GVPE provides a true multi-point network in wich any number of nodes
46     (at least a few dozen in practise, the theoretical limit is 4095
47     nodes) can participate.
48    
49    
50     == GVPE DESIGN GOALS ==
51 pcg 1.2
52     : SIMPLE DESIGN
53     Cipher, HMAC algorithms and other key parameters must be selected at
54     compile time - this makes it possible to only link in algorithms you
55     actually need. It also makes the crypto part of the source very
56 pcg 1.8 transparent and easy to inspect, and last not least this makes it
57     possible to hardcode the layout of all packets into the binary. GVPE
58     goes a step further and internally reserves blocks of the same
59     length for all packets, which virtually removes all possibilities of
60     buffer overflows, as there is only a single type of buffer and it's
61     always of fixed length.
62 pcg 1.2
63     : EASY TO SETUP
64     A few lines of config (the config file is shared unmodified between
65 pcg 1.7 all hosts) and a single run of ``gvpectrl'' to generate the keys
66 pcg 1.2 suffices to make it work.
67    
68     : MAC-BASED SECURITY
69     Since every host has it's own private key, other hosts cannot spoof
70 pcg 1.7 traffic from this host. That makes it possible to filter packet by
71 pcg 1.2 MAC address, e.g. to ensure that packets from a specific IP address
72 pcg 1.7 come, in fact, from a specific host that is associated with that IP
73     and not from another host.
74 pcg 1.2
75    
76     ==== PROGRAMS ====
77    
78 pcg 1.7 Vpe comes with two programs: one daemon (``gvpe'') and one control
79     program (``gvpectrl'').
80 pcg 1.2
81 pcg 1.7 : gvpectrl
82 pcg 1.3 Is used to generate the keys, check and give an overview of of the
83     configuration and contorl the daemon (restarting etc.).
84 pcg 1.2
85 pcg 1.7 : gvpe
86     Is the daemon used to establish and maintain connections to the
87 pcg 1.2 other network members. It should be run on the gateway machine.
88    
89    
90 pcg 1.3 ==== COMPILETIME CONFIGURATION ====
91 pcg 1.2
92 pcg 1.7 Please have a look at the ``gvpe.osdep(5)'' manpage for
93     platform-specific information.
94 pcg 1.6
95 pcg 1.8 Here are a few recipes for compiling your gvpe, showing the extremes
96     (fast, small, insecure OR slow, large, more secure), between you should
97     choose:
98 pcg 1.2
99    
100     == AS LOW PACKET OVERHEAD AS POSSIBLE ==
101    
102 pcg 1.3 ./configure --enable-hmac-length=4 --enable-rand-length=0
103 pcg 1.2
104 pcg 1.3 Minimize the header overhead of VPN packets (the above will result in
105 pcg 1.8 only 4 bytes of overhead over the raw ethernet frame). This is a
106     insecure configuration because a HMAC length of 4 makes collision
107     attacks based on the birthday paradox easy, though.
108 pcg 1.2
109    
110     == MINIMIZE CPU TIME REQUIRED ==
111    
112 pcg 1.3 ./configure --enable-cipher=bf --enable-digest=md4
113 pcg 1.2
114 pcg 1.7 Use the fastest cipher and digest algorithms currently available in
115 pcg 1.8 gvpe. MD4 has been broken and is quite insecure, though.
116 pcg 1.2
117    
118     == MAXIMIZE SECURITY ==
119    
120 pcg 1.3 ./configure --enable-hmac-length=16 --enable-rand-length=8 --enable-digest=sha1
121    
122     This uses a 16 byte HMAC checksum to authenticate packets (I guess 8-12
123     would also be pretty secure ;) and will additionally prefix each packet
124 pcg 1.8 with 8 bytes of random data. In the long run, people should move to
125     SHA-224 and beyond, but support in openssl is missing as of writing this
126     document.
127 pcg 1.2
128     In general, remember that AES-128 seems to be more secure and faster
129 pcg 1.3 than AES-192 or AES-256, more randomness helps against sniffing and a
130     longer HMAC helps against spoofing. MD4 is a fast digest, SHA1 or
131     RIPEMD160 are better, and Blowfish is a fast cipher (and also quite
132     secure).
133 pcg 1.2
134    
135     ==== HOW TO SET UP A SIMPLE VPN ====
136    
137     In this section I will describe how to get a simple VPN consisting of
138     three hosts up and running.
139    
140    
141     == STEP 1: configuration ==
142    
143     First you have to create a daemon configuation file and put it into the
144 pcg 1.7 configuration directory. This is usually ``/etc/gvpe'', depending on how
145     you configured gvpe, and can be overwritten using the ``-c'' commandline
146 pcg 1.2 switch.
147    
148 pcg 1.7 Put the following lines into ``/etc/gvpe/gvpe.conf'':
149 pcg 1.2
150 pcg 1.3 udp-port = 50000 # the external port to listen on (configure your firewall)
151     mtu = 1400 # minimum MTU of all outgoing interfaces on all hosts
152     ifname = vpn0 # the local network device name
153 pcg 1.2
154 pcg 1.3 node = first # just a nickname
155     hostname = first.example.net # the DNS name or IP address of the host
156 pcg 1.2
157 pcg 1.3 node = second
158     hostname = 133.55.82.9
159 pcg 1.2
160 pcg 1.3 node = third
161     hostname = third.example.net
162 pcg 1.2
163     The only other file neccessary if the ``if-up'' script that initializes
164     the local ethernet interface. Put the following lines into
165 pcg 1.7 ``/etc/gvpe/if-up'' and make it execute (``chmod 755 /etc/gvpe/if-up''):
166 pcg 1.2
167 pcg 1.3 #!/bin/sh
168     ip link set $IFNAME address $MAC mtu $MTU up
169     [ $NODENAME = first ] && ip addr add 10.0.1.1 dev $IFNAME
170     [ $NODENAME = second ] && ip addr add 10.0.2.1 dev $IFNAME
171     [ $NODENAME = third ] && ip addr add 10.0.3.1 dev $IFNAME
172     ip route add 10.0.0.0/16 dev $IFNAME
173 pcg 1.2
174     This script will give each node a different IP address in the
175     ``10.0/16'' network. The internal network (e.g. the ``eth0'' interface)
176     should then be set to a subset of that network, e.g. ``10.0.1.0/24'' on
177     node ``first'', ``10.0.2.0/24'' on node ``second'', and so on.
178    
179 pcg 1.7 By enabling routing on the gateway host that runs ``gvpe'' all nodes
180 pcg 1.2 will be able to reach the other nodes. You can, of course, also use
181     proxy arp or other means of pseudo-bridging (or even real briding), or
182     (best) full routing - the choice is yours.
183    
184    
185     == STEP 2: create the RSA key pairs for all hosts ==
186    
187     Run the following command to generate all key pairs (that might take a
188     while):
189    
190 pcg 1.7 gvpectrl -c /etc/gvpe -g
191 pcg 1.2
192     This command will put the public keys into
193 pcg 1.7 ``/etc/gvpe/pubkeys/*nodename*'' and the private keys into
194     ``/etc/gvpe/hostkeys/*nodename*''.
195 pcg 1.2
196    
197     == STEP 3: distribute the config files to all nodes ==
198    
199     Now distribute the config files to the other nodes. This should be done
200     in two steps, since the private keys should not be distributed. The
201     example uses rsync-over-ssh
202    
203     First all the config files without the hostkeys should be distributed:
204    
205 pcg 1.7 rsync -avzessh /etc/gvpe first.example.net:/etc/. --exclude hostkeys
206     rsync -avzessh /etc/gvpe 133.55.82.9:/etc/. --exclude hostkeys
207     rsync -avzessh /etc/gvpe third.example.net:/etc/. --exclude hostkeys
208 pcg 1.2
209     Then the hostkeys should be copied:
210    
211 pcg 1.7 rsync -avzessh /etc/gvpe/hostkeys/first first.example.net:/etc/hostkey
212     rsync -avzessh /etc/gvpe/hostkeys/second 133.55.82.9:/etc/hostkey
213     rsync -avzessh /etc/gvpe/hostkeys/third third.example.net:/etc/hostkey
214 pcg 1.2
215 pcg 1.7 You should now check the configration by issuing the command ``gvpectrl
216     -c /etc/gvpe -s'' on each node and verify it's output.
217 pcg 1.2
218    
219 pcg 1.7 == STEP 4: starting gvpe ==
220 pcg 1.2
221 pcg 1.7 You should then start gvpe on each node by issuing a command like:
222 pcg 1.2
223 pcg 1.7 gvpe -D -linfo first # first is the nodename
224 pcg 1.2
225 pcg 1.7 This will make the gvpe stay in foreground. You should then see
226 pcg 1.2 "connection established" messages. If you don't see them check your
227     firewall and routing (use tcpdump ;).
228    
229     If this works you should check your networking setup by pinging various
230     endpoints.
231    
232 pcg 1.7 To make gvpe run more permanently you can either run it as a daemon (by
233 pcg 1.2 starting it without the ``-D'' switch), or, much better, from your
234     inittab. I use a line like this on my systems:
235    
236 pcg 1.7 t1:2345:respawn:/opt/gvpe/sbin/gvpe -D -L first >/dev/null 2>&1
237 pcg 1.2
238    
239     == STEP 5: enjoy ==
240    
241 pcg 1.7 ... and play around. Sending a -HUP (``gvpectrl -kHUP'') to the daemon
242 pcg 1.2 will make it try to connect to all other nodes again. If you run it from
243 pcg 1.7 inittab, as is recommended, ``gvpectrl -k'' (or simply ``killall gvpe'')
244 pcg 1.2 will kill the daemon, start it again, making it read it's configuration
245     files again.
246    
247    
248     ==== SEE ALSO ====
249    
250 pcg 1.7 gvpe.osdep(5) for OS-depedendent information, gvpe.conf(5), gvpectrl(8),
251 pcg 1.8 and for a description of the transports, protocol, and routing
252     algorithm, gvpe.protocol(7).
253    
254     The GVPE mailinglist, at <http://lists.schmorp.de/>, or
255     ``gvpe@lists.schmorp.de''.
256 pcg 1.2
257    
258     ==== AUTHOR ====
259    
260 pcg 1.8 Marc Lehmann <gvpe@schmorp.de>
261 pcg 1.6
262    
263     ==== COPYRIGHTS AND LICENSES ====
264    
265 pcg 1.8 GVPE itself is distributed under the GENERAL PUBLIC LICENSE (see the
266     file COPYING that should be part of your distribution).
267 pcg 1.6
268     In some configurations it uses modified versions of the tinc vpn suite,
269     which is also available under the GENERAL PUBLIC LICENSE.
270