ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/gvpe/doc/vpe.pod
Revision: 1.2
Committed: Mon Mar 24 15:20:24 2003 UTC (21 years, 2 months ago) by pcg
Branch: MAIN
Changes since 1.1: +42 -36 lines
Log Message:
*** empty log message ***

File Contents

# Content
1 =head1 NAME
2
3 vpe - Overview of the virtual private ethernet suite.
4
5 =head1 DESCRIPTION
6
7 Vpe is a suite designed to provide a virtual private network for multiple
8 nodes over an untrusted network.
9
10 "Virtual" means that no physical network is created (of course), but an
11 ethernet is emulated by creating multiple tunnels between the member
12 nodes. "Private" means that non-participating nodes cannot decode
13 ("sniff)" nor inject ("spoof") packets. In the case of vpe, even
14 participating nodes cannot spoof packets from other nodes. And "network"
15 means that more than two parties - many so-called vpn solutions only
16 create point-to-point tunnels - can participate in the network, so it's
17 possible to connect multiple branches of a company into a single network.
18
19 =head2 DESIGN GOALS
20
21 =over 4
22
23 =item SIMPLE DESIGN
24
25 Cipher, HMAC algorithms and other key parameters must be selected
26 at compile time - this makes it possible to only link in algorithms
27 you actually need. It also makes the crypto part of the source very
28 transparent and easy to inspect.
29
30 =item EASY TO SETUP
31
32 A few lines of config (the config file is shared unmodified between all
33 hosts) and a single run of C<vpectrl> to generate the keys suffices to
34 make it work.
35
36 =item MAC-BASED SECURITY
37
38 Since every host has it's own private key, other hosts cannot spoof
39 traffic from this host. That makes it possible to filter packest by MAC
40 address, e.g. to ensure that packets from a specific IP address come, in
41 fact, from a specific host.
42
43 =back
44
45 =head1 PROGRAMS
46
47 Vpe comes with two programs: one daemon (C<vped>) and one control program
48 (C<vpectrl>).
49
50 =over 4
51
52 =item vpectrl
53
54 Is used to generate the keys, check and give an overview of of the
55 configuration and contorl the daemon (restarting etc.).
56
57 =item vped
58
59 Is the daemon used to establish and maintain conenctions to the other
60 network members. It should be run on the gateway machine.
61
62 =back
63
64 =head1 COMPILETIME CONFIGURATION
65
66 Here are a few recipes for compiling your vpe:
67
68 =head2 AS LOW PACKET OVERHEAD AS POSSIBLE
69
70 ./configure --enable-hmac-length=4 --enable-rand-length=0
71
72 Minimize the header overhead of VPN packets (the above will result in only
73 4 bytes of overhead over the raw ethernet frame).
74
75 =head2 MINIMIZE CPU TIME REQUIRED
76
77 ./configure --enable-cipher=bf --enable-digest=md4
78
79 Use the fastest cipher and digest algorithms currently available in vpe.
80
81 =head2 MAXIMIZE SECURITY
82
83 ./configure --enable-hmac-length=16 --enable-rand-length=8 --enable-digest=sha1
84
85 This uses a 16 byte HMAC checksum to authenticate packets (I guess 8-12
86 would also be pretty secure ;) and will additionally prefix each packet
87 with 8 bytes of random data.
88
89 In general, remember that AES-128 seems to be more secure and faster than
90 AES-192 or AES-256, more randomness helps against sniffing and a longer
91 HMAC helps against spoofing. MD4 is a fast digest, SHA1 or RIPEMD160 are
92 better, and Blowfish is a fast cipher (and also quite secure).
93
94 =head1 HOW TO SET UP A SIMPLE VPN
95
96 In this section I will describe how to get a simple VPN consisting of
97 three hosts up and running.
98
99 =head2 STEP 1: configuration
100
101 First you have to create a daemon configuation file and put it into the
102 configuration directory. This is usually C</etc/vpe>, depending on how you
103 configured vpe, and can be overwritten using the C<-c> commandline switch.
104
105 Put the following lines into C</etc/vpe/vped.conf>:
106
107 udp-port = 50000 # the external port to listen on (configure your firewall)
108 mtu = 1400 # minimum MTU of all outgoing interfaces on all hosts
109 ifname = vpn0 # the local network device name
110
111 node = first # just a nickname
112 hostname = first.example.net # the DNS name or IP address of the host
113
114 node = second
115 hostname = 133.55.82.9
116
117 node = third
118 hostname = third.example.net
119
120 The only other file neccessary if the C<if-up> script that initializes the
121 local ethernet interface. Put the following lines into C</etc/vpe/if-up>
122 and make it execute (C<chmod 755 /etc/vpe/if-up>):
123
124 #!/bin/sh
125 ip link set $IFNAME address $MAC mtu $MTU up
126 [ $NODENAME = first ] && ip addr add 10.0.1.1 dev $IFNAME
127 [ $NODENAME = second ] && ip addr add 10.0.2.1 dev $IFNAME
128 [ $NODENAME = third ] && ip addr add 10.0.3.1 dev $IFNAME
129 ip route add 10.0.0.0/16 dev $IFNAME
130
131 This script will give each node a different IP address in the C<10.0/16>
132 network. The internal network (e.g. the C<eth0> interface) should then be
133 set to a subset of that network, e.g. C<10.0.1.0/24> on node C<first>,
134 C<10.0.2.0/24> on node C<second>, and so on.
135
136 By enabling routing on the gateway host that runs C<vped> all nodes will
137 be able to reach the other nodes. You can, of course, also use proxy arp
138 or other means of pseudo-bridging (or even real briding), or (best) full
139 routing - the choice is yours.
140
141 =head2 STEP 2: create the RSA key pairs for all hosts
142
143 Run the following command to generate all key pairs (that might take a
144 while):
145
146 vpectrl -c /etc/vpe -g
147
148 This command will put the public keys into C<<
149 /etc/vpe/pubkeys/I<nodename> >> and the private keys into C<<
150 /etc/vpe/hostkeys/I<nodename> >>.
151
152 =head2 STEP 3: distribute the config files to all nodes
153
154 Now distribute the config files to the other nodes. This should be done in two steps, since the
155 private keys should not be distributed. The example uses rsync-over-ssh
156
157 First all the config files without the hostkeys should be distributed:
158
159 rsync -avzessh /etc/vpe first.example.net:/etc/. --exclude hostkeys
160 rsync -avzessh /etc/vpe 133.55.82.9:/etc/. --exclude hostkeys
161 rsync -avzessh /etc/vpe third.example.net:/etc/. --exclude hostkeys
162
163 Then the hostkeys should be copied:
164
165 rsync -avzessh /etc/vpe/hostkeys/first first.example.net:/etc/hostkey
166 rsync -avzessh /etc/vpe/hostkeys/second 133.55.82.9:/etc/hostkey
167 rsync -avzessh /etc/vpe/hostkeys/third third.example.net:/etc/hostkey
168
169 You should now check the configration by issuing the command C<vpectrl -c
170 /etc/vpe -s> on each node and verify it's output.
171
172 =head2 STEP 4: starting vped
173
174 You should then start vped on each node by issuing a command like:
175
176 vped -D -linfo first # first is the nodename
177
178 This will make the vped stay in foreground. You should then see
179 "connection established" messages. If you don't see them check your
180 firewall and routing (use tcpdump ;).
181
182 If this works you should check your networking setup by pinging various
183 endpoints.
184
185 To make vped run more permanently you can either run it as a daemon
186 (by starting it without the C<-D> switch), or, much better, from your
187 inittab. I use a line like this on my systems:
188
189 t1:2345:respawn:/opt/vpe/sbin/vped -D -L first >/dev/null 2>&1
190
191 =head2 STEP 5: enjoy
192
193 ... and play around. Sending a -HUP (C<vpectrl -kHUP>) to the daemon
194 will make it try to connect to all other nodes again. If you run it from
195 inittab, as is recommended, C<vpectrl -k> (or simply C<killall vped>) will
196 kill the daemon, start it again, making it read it's configuration files
197 again.
198
199 =head1 SEE ALSO
200
201 vpe(8), vpectrl(8), vped.conf(5).
202
203 =head1 AUTHOR
204
205 Marc Lehmann <vpe@plan9.de>
206