1 | .\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 |
1 | .\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30) |
2 | .\" |
2 | .\" |
3 | .\" Standard preamble: |
3 | .\" Standard preamble: |
4 | .\" ======================================================================== |
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) |
5 | .de Sp \" Vertical space (when we can't use .PP) |
14 | .if t .sp .5v |
6 | .if t .sp .5v |
15 | .if n .sp |
7 | .if n .sp |
16 | .. |
8 | .. |
17 | .de Vb \" Begin verbatim text |
9 | .de Vb \" Begin verbatim text |
… | |
… | |
23 | .ft R |
15 | .ft R |
24 | .fi |
16 | .fi |
25 | .. |
17 | .. |
26 | .\" Set up some character translations and predefined strings. \*(-- will |
18 | .\" Set up some character translations and predefined strings. \*(-- will |
27 | .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left |
19 | .\" 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 |
20 | .\" double quote, and \*(R" will give a right double quote. \*(C+ will |
29 | .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to |
21 | .\" give a nicer C++. Capital omega is used to do unbreakable dashes and |
30 | .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' |
22 | .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, |
31 | .\" expand to `' in nroff, nothing in troff, for use with C<>. |
23 | .\" nothing in troff, for use with C<>. |
32 | .tr \(*W-|\(bv\*(Tr |
24 | .tr \(*W- |
33 | .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' |
25 | .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' |
34 | .ie n \{\ |
26 | .ie n \{\ |
35 | . ds -- \(*W- |
27 | . ds -- \(*W- |
36 | . ds PI pi |
28 | . ds PI pi |
37 | . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch |
29 | . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch |
… | |
… | |
44 | .el\{\ |
36 | .el\{\ |
45 | . ds -- \|\(em\| |
37 | . ds -- \|\(em\| |
46 | . ds PI \(*p |
38 | . ds PI \(*p |
47 | . ds L" `` |
39 | . ds L" `` |
48 | . ds R" '' |
40 | . ds R" '' |
|
|
41 | . ds C` |
|
|
42 | . ds C' |
49 | 'br\} |
43 | 'br\} |
50 | .\" |
44 | .\" |
|
|
45 | .\" Escape single quotes in literal strings from groff's Unicode transform. |
|
|
46 | .ie \n(.g .ds Aq \(aq |
|
|
47 | .el .ds Aq ' |
|
|
48 | .\" |
51 | .\" If the F register is turned on, we'll generate index entries on stderr for |
49 | .\" 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 |
50 | .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index |
53 | .\" entries marked with X<> in POD. Of course, you'll have to process the |
51 | .\" entries marked with X<> in POD. Of course, you'll have to process the |
54 | .\" output yourself in some meaningful fashion. |
52 | .\" output yourself in some meaningful fashion. |
55 | .if \nF \{\ |
53 | .\" |
|
|
54 | .\" Avoid warning from groff about undefined register 'F'. |
56 | . de IX |
55 | .de IX |
57 | . tm Index:\\$1\t\\n%\t"\\$2" |
|
|
58 | .. |
56 | .. |
59 | . nr % 0 |
57 | .nr rF 0 |
60 | . rr F |
58 | .if \n(.g .if rF .nr rF 1 |
|
|
59 | .if (\n(rF:(\n(.g==0)) \{ |
|
|
60 | . if \nF \{ |
|
|
61 | . de IX |
|
|
62 | . tm Index:\\$1\t\\n%\t"\\$2" |
|
|
63 | .. |
|
|
64 | . if !\nF==2 \{ |
|
|
65 | . nr % 0 |
|
|
66 | . nr F 2 |
|
|
67 | . \} |
|
|
68 | . \} |
61 | .\} |
69 | .\} |
62 | .\" |
70 | .rr rF |
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 | .\" |
71 | .\" |
68 | .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). |
72 | .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). |
69 | .\" Fear. Run. Save yourself. No user-serviceable parts. |
73 | .\" Fear. Run. Save yourself. No user-serviceable parts. |
70 | . \" fudge factors for nroff and troff |
74 | . \" fudge factors for nroff and troff |
71 | .if n \{\ |
75 | .if n \{\ |
… | |
… | |
127 | .\} |
131 | .\} |
128 | .rm #[ #] #H #V #F C |
132 | .rm #[ #] #H #V #F C |
129 | .\" ======================================================================== |
133 | .\" ======================================================================== |
130 | .\" |
134 | .\" |
131 | .IX Title "GVPE 5" |
135 | .IX Title "GVPE 5" |
132 | .TH GVPE 5 "2005-03-18" "1.8" "GNU Virtual Private Ethernet" |
136 | .TH GVPE 5 "2016-11-02" "2.25" "GNU Virtual Private Ethernet" |
|
|
137 | .\" For nroff, turn off justification. Always turn off hyphenation; it makes |
|
|
138 | .\" way too many mistakes in technical documents. |
|
|
139 | .if n .ad l |
|
|
140 | .nh |
133 | .SH "NAME" |
141 | .SH "NAME" |
134 | GNU\-VPE \- Overview of the GNU Virtual Private Ethernet suite. |
142 | GNU\-VPE \- Overview of the GNU Virtual Private Ethernet suite. |
135 | .SH "DESCRIPTION" |
143 | .SH "DESCRIPTION" |
136 | .IX Header "DESCRIPTION" |
144 | .IX Header "DESCRIPTION" |
137 | \&\s-1GVPE\s0 is a suite designed to provide a virtual private network for multiple |
145 | \&\s-1GVPE\s0 is a suite designed to provide a virtual private network for multiple |
138 | nodes over an untrusted network. This document first gives an introduction |
146 | 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. |
147 | 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?" |
148 | .SS "\s-1WHAT IS A VPN\s0?" |
141 | .IX Subsection "WHAT IS A VPN?" |
149 | .IX Subsection "WHAT IS A VPN?" |
142 | \&\s-1VPN\s0 is an acronym, it stands for: |
150 | \&\s-1VPN\s0 is an acronym, it stands for: |
143 | .IP "\(bu" 4 |
151 | .IP "Virtual" 4 |
144 | .IX Xref "Virtual" |
152 | .IX Item "Virtual" |
145 | Virtual means that no physical network is created (of course), but a |
153 | Virtual means that no physical network is created (of course), but a |
146 | network is \fIemulated\fR by creating multiple tunnels between the member |
154 | network is \fIemulated\fR by creating multiple tunnels between the member |
147 | nodes by encapsulating and sending data over another transport network. |
155 | nodes by encapsulating and sending data over another transport network. |
148 | .Sp |
156 | .Sp |
149 | Usually the emulated network is a normal \s-1IP\s0 or Ethernet, and the transport |
157 | 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 |
158 | 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. |
159 | nodes over other untrusted networks such as Wireless \s-1LAN\s0 is not uncommon. |
152 | .IP "\(bu" 4 |
160 | .IP "Private" 4 |
153 | .IX Xref "Private" |
161 | .IX Item "Private" |
154 | Private means that non-participating nodes cannot decode (\*(L"sniff)\*(R" nor |
162 | Private means that non-participating nodes cannot decode (\*(L"sniff)\*(R" nor |
155 | inject (\*(L"spoof\*(R") packets. This means that nodes can be connected over |
163 | 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 |
164 | 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 |
165 | eavesdropped while at the same time being able to trust data sent by other |
158 | nodes. |
166 | nodes. |
159 | .Sp |
167 | .Sp |
160 | In the case of \s-1GVPE\s0, even participating nodes cannot sniff packets |
168 | 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 |
169 | 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. |
170 | communications between any two nodes is private to those two nodes. |
163 | .IP "\(bu" 4 |
171 | .IP "Network" 4 |
164 | .IX Xref "Network" |
172 | .IX Item "Network" |
165 | Network means that more than two parties can participate in the network, |
173 | 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 |
174 | 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 |
175 | into a single network. Many so-called \*(L"\s-1VPN\*(R"\s0 solutions only create |
168 | point-to-point tunnels, which in turn can be used to build larger |
176 | point-to-point tunnels, which in turn can be used to build larger |
169 | networks. |
177 | networks. |
170 | .Sp |
178 | .Sp |
171 | \&\s-1GVPE\s0 provides a true multi-point network in wich any number of nodes (at |
179 | \&\s-1GVPE\s0 provides a true multi-point network in which any number of nodes (at |
172 | least a few dozen in practise, the theoretical limit is 4095 nodes) can |
180 | least a few dozen in practise, the theoretical limit is 4095 nodes) can |
173 | participate. |
181 | participate. |
174 | .Sh "\s-1GVPE\s0 \s-1DESIGN\s0 \s-1GOALS\s0" |
182 | .SS "\s-1GVPE DESIGN GOALS\s0" |
175 | .IX Subsection "GVPE DESIGN GOALS" |
183 | .IX Subsection "GVPE DESIGN GOALS" |
176 | .IP "\s-1SIMPLE\s0 \s-1DESIGN\s0" 4 |
184 | .IP "\s-1SIMPLE DESIGN\s0" 4 |
177 | .IX Item "SIMPLE DESIGN" |
185 | .IX Item "SIMPLE DESIGN" |
178 | Cipher, \s-1HMAC\s0 algorithms and other key parameters must be selected |
186 | 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 |
187 | 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 |
188 | you actually need. It also makes the crypto part of the source very |
181 | transparent and easy to inspect, and last not least this makes it possible |
189 | 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 |
190 | 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, |
191 | further and internally reserves blocks of the same length for all packets, |
184 | which virtually removes all possibilities of buffer overflows, as there is |
192 | 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. |
193 | only a single type of buffer and it's always of fixed length. |
186 | .IP "\s-1EASY\s0 \s-1TO\s0 \s-1SETUP\s0" 4 |
194 | .IP "\s-1EASY TO SETUP\s0" 4 |
187 | .IX Item "EASY TO SETUP" |
195 | .IX Item "EASY TO SETUP" |
188 | A few lines of config (the config file is shared unmodified between all |
196 | 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 |
197 | hosts) and generating an \s-1RSA\s0 key-pair on each node suffices to make it |
190 | make it work. |
198 | work. |
191 | .IP "MAC-BASED \s-1SECURITY\s0" 4 |
199 | .IP "MAC-BASED \s-1SECURITY\s0" 4 |
192 | .IX Item "MAC-BASED SECURITY" |
200 | .IX Item "MAC-BASED SECURITY" |
193 | Since every host has it's own private key, other hosts cannot spoof |
201 | 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 |
202 | 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 |
203 | 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 |
204 | fact, from a specific host that is associated with that \s-1IP\s0 and not from |
197 | another host. |
205 | another host. |
198 | .SH "PROGRAMS" |
206 | .SH "PROGRAMS" |
199 | .IX Header "PROGRAMS" |
207 | .IX Header "PROGRAMS" |
200 | Vpe comes with two programs: one daemon (\f(CW\*(C`gvpe\*(C'\fR) and one control program |
208 | Gvpe comes with two programs: one daemon (\f(CW\*(C`gvpe\*(C'\fR) and one control program |
201 | (\f(CW\*(C`gvpectrl\*(C'\fR). |
209 | (\f(CW\*(C`gvpectrl\*(C'\fR). |
202 | .IP "gvpectrl" 4 |
210 | .IP "gvpectrl" 4 |
203 | .IX Item "gvpectrl" |
211 | .IX Item "gvpectrl" |
204 | Is used to generate the keys, check and give an overview of of the |
212 | This program is used to generate the keys, check and give an overview of of the |
205 | configuration and contorl the daemon (restarting etc.). |
213 | configuration and to control the daemon (restarting etc.). |
206 | .IP "gvpe" 4 |
214 | .IP "gvpe" 4 |
207 | .IX Item "gvpe" |
215 | .IX Item "gvpe" |
208 | Is the daemon used to establish and maintain connections to the other |
216 | This is the daemon used to establish and maintain connections to the other |
209 | network members. It should be run on the gateway machine. |
217 | network nodes. It should be run on the gateway of each \s-1VPN\s0 subnet. |
210 | .SH "COMPILETIME CONFIGURATION" |
218 | .SH "COMPILETIME CONFIGURATION" |
211 | .IX Header "COMPILETIME CONFIGURATION" |
219 | .IX Header "COMPILETIME CONFIGURATION" |
212 | Please have a look at the \f(CW\*(C`gvpe.osdep(5)\*(C'\fR manpage for platform-specific |
220 | Please have a look at the \f(CW\*(C`gvpe.osdep(5)\*(C'\fR manpage for platform-specific |
213 | information. |
221 | information. |
214 | .PP |
222 | .PP |
|
|
223 | Gvpe hardcodes most encryption parameters. While this reduces flexibility, |
|
|
224 | it makes the program much simpler and helps making buffer overflows |
|
|
225 | impossible under most circumstances. |
|
|
226 | .PP |
215 | Here are a few recipes for compiling your gvpe, showing the extremes |
227 | 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 |
228 | (fast, small, insecure \s-1OR\s0 slow, large, more secure), between which you |
217 | choose: |
229 | should choose: |
218 | .Sh "\s-1AS\s0 \s-1LOW\s0 \s-1PACKET\s0 \s-1OVERHEAD\s0 \s-1AS\s0 \s-1POSSIBLE\s0" |
230 | .SS "\s-1AS LOW PACKET OVERHEAD AS POSSIBLE\s0" |
219 | .IX Subsection "AS LOW PACKET OVERHEAD AS POSSIBLE" |
231 | .IX Subsection "AS LOW PACKET OVERHEAD AS POSSIBLE" |
220 | .Vb 1 |
232 | .Vb 1 |
221 | \& ./configure --enable-hmac-length=4 --enable-rand-length=0 |
233 | \& ./configure \-\-enable\-hmac\-length=4 \-\-enable\-rand\-length=0 |
222 | .Ve |
234 | .Ve |
223 | .PP |
235 | .PP |
224 | Minimize the header overhead of \s-1VPN\s0 packets (the above will result in |
236 | 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 |
237 | 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 |
238 | configuration because a \s-1HMAC\s0 length of 4 makes collision attacks almost |
227 | the birthday paradox easy, though. |
239 | trivial. |
228 | .Sh "\s-1MINIMIZE\s0 \s-1CPU\s0 \s-1TIME\s0 \s-1REQUIRED\s0" |
240 | .SS "\s-1MINIMIZE CPU TIME REQUIRED\s0" |
229 | .IX Subsection "MINIMIZE CPU TIME REQUIRED" |
241 | .IX Subsection "MINIMIZE CPU TIME REQUIRED" |
230 | .Vb 1 |
242 | .Vb 1 |
231 | \& ./configure --enable-cipher=bf --enable-digest=md4 |
243 | \& ./configure \-\-enable\-cipher=bf \-\-enable\-digest=md4 |
232 | .Ve |
244 | .Ve |
233 | .PP |
245 | .PP |
234 | Use the fastest cipher and digest algorithms currently available in |
246 | Use the fastest cipher and digest algorithms currently available in |
235 | gvpe. \s-1MD4\s0 has been broken and is quite insecure, though. |
247 | gvpe. \s-1MD4\s0 has been broken and is quite insecure, though, so using another |
|
|
248 | digest algorithm is recommended. |
236 | .Sh "\s-1MAXIMIZE\s0 \s-1SECURITY\s0" |
249 | .SS "\s-1MAXIMIZE SECURITY\s0" |
237 | .IX Subsection "MAXIMIZE SECURITY" |
250 | .IX Subsection "MAXIMIZE SECURITY" |
238 | .Vb 1 |
251 | .Vb 1 |
239 | \& ./configure --enable-hmac-length=16 --enable-rand-length=8 --enable-digest=sha1 |
252 | \& ./configure \-\-enable\-hmac\-length=16 \-\-enable\-rand\-length=12 \-\-enable\-digest=ripemd610 |
240 | .Ve |
253 | .Ve |
241 | .PP |
254 | .PP |
242 | This uses a 16 byte \s-1HMAC\s0 checksum to authenticate packets (I guess 8\-12 |
255 | 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 |
256 | would also be pretty secure ;) and will additionally prefix each packet |
244 | with 8 bytes of random data. In the long run, people should move to |
257 | with 12 bytes of random data. |
245 | \&\s-1SHA\-224\s0 and beyond, but support in openssl is missing as of writing this |
|
|
246 | document. |
|
|
247 | .PP |
258 | .PP |
248 | In general, remember that \s-1AES\-128\s0 seems to be more secure and faster than |
259 | In general, remember that \s-1AES\-128\s0 seems to be as secure but faster than |
249 | \&\s-1AES\-192\s0 or \s-1AES\-256\s0, more randomness helps against sniffing and a longer |
260 | \&\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 |
261 | \&\s-1HMAC\s0 helps against spoofing. \s-1MD4\s0 is a fast digest, \s-1SHA1, RIPEMD160, SHA256\s0 |
251 | better, and Blowfish is a fast cipher (and also quite secure). |
262 | are consecutively better, and Blowfish is a fast cipher (and also quite |
|
|
263 | secure). |
252 | .SH "HOW TO SET UP A SIMPLE VPN" |
264 | .SH "HOW TO SET UP A SIMPLE VPN" |
253 | .IX Header "HOW TO SET UP A SIMPLE VPN" |
265 | .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 |
266 | In this section I will describe how to get a simple \s-1VPN\s0 consisting of |
255 | three hosts up and running. |
267 | three hosts up and running. |
256 | .Sh "\s-1STEP\s0 1: configuration" |
268 | .SS "\s-1STEP 1:\s0 configuration" |
257 | .IX Subsection "STEP 1: configuration" |
269 | .IX Subsection "STEP 1: configuration" |
258 | First you have to create a daemon configuation file and put it into the |
270 | First you have to create a daemon configuration file and put it into the |
259 | configuration directory. This is usually \f(CW\*(C`/etc/gvpe\*(C'\fR, depending on how you |
271 | 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. |
272 | configured gvpe, and can be overwritten using the \f(CW\*(C`\-c\*(C'\fR command line switch. |
261 | .PP |
273 | .PP |
262 | Put the following lines into \f(CW\*(C`/etc/gvpe/gvpe.conf\*(C'\fR: |
274 | Put the following lines into \f(CW\*(C`/etc/gvpe/gvpe.conf\*(C'\fR: |
263 | .PP |
275 | .PP |
264 | .Vb 3 |
276 | .Vb 3 |
265 | \& udp-port = 50000 # the external port to listen on (configure your firewall) |
277 | \& udp\-port = 50000 # the external port to listen on (configure your firewall) |
266 | \& mtu = 1400 # minimum MTU of all outgoing interfaces on all hosts |
278 | \& mtu = 1400 # minimum MTU of all outgoing interfaces on all hosts |
267 | \& ifname = vpn0 # the local network device name |
279 | \& ifname = vpn0 # the local network device name |
268 | .Ve |
280 | \& |
269 | .PP |
|
|
270 | .Vb 2 |
|
|
271 | \& node = first # just a nickname |
281 | \& node = first # just a nickname |
272 | \& hostname = first.example.net # the DNS name or IP address of the host |
282 | \& hostname = first.example.net # the DNS name or IP address of the host |
273 | .Ve |
283 | \& |
274 | .PP |
|
|
275 | .Vb 2 |
|
|
276 | \& node = second |
284 | \& node = second |
277 | \& hostname = 133.55.82.9 |
285 | \& hostname = 133.55.82.9 |
278 | .Ve |
286 | \& |
279 | .PP |
|
|
280 | .Vb 2 |
|
|
281 | \& node = third |
287 | \& node = third |
282 | \& hostname = third.example.net |
288 | \& hostname = third.example.net |
283 | .Ve |
289 | .Ve |
284 | .PP |
290 | .PP |
285 | The only other file neccessary if the \f(CW\*(C`if\-up\*(C'\fR script that initializes the |
291 | The only other file necessary is 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 |
292 | virtual ethernet interface on the local host. Put the following lines into |
287 | and make it execute (\f(CW\*(C`chmod 755 /etc/gvpe/if\-up\*(C'\fR): |
293 | \&\f(CW\*(C`/etc/gvpe/if\-up\*(C'\fR and make it executable (\f(CW\*(C`chmod 755 /etc/gvpe/if\-up\*(C'\fR): |
288 | .PP |
294 | .PP |
289 | .Vb 6 |
295 | .Vb 6 |
290 | \& #!/bin/sh |
296 | \& #!/bin/sh |
291 | \& ip link set $IFNAME address $MAC mtu $MTU up |
297 | \& ip link set $IFNAME address $MAC mtu $MTU up |
292 | \& [ $NODENAME = first ] && ip addr add 10.0.1.1 dev $IFNAME |
298 | \& [ $NODENAME = first ] && ip addr add 10.0.1.1 dev $IFNAME |
… | |
… | |
294 | \& [ $NODENAME = third ] && ip addr add 10.0.3.1 dev $IFNAME |
300 | \& [ $NODENAME = third ] && ip addr add 10.0.3.1 dev $IFNAME |
295 | \& ip route add 10.0.0.0/16 dev $IFNAME |
301 | \& ip route add 10.0.0.0/16 dev $IFNAME |
296 | .Ve |
302 | .Ve |
297 | .PP |
303 | .PP |
298 | This script will give each node a different \s-1IP\s0 address in the \f(CW\*(C`10.0/16\*(C'\fR |
304 | 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 |
305 | network. The internal network (if gvpe runs on a router) 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, |
306 | 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. |
307 | \&\f(CW\*(C`10.0.2.0/24\*(C'\fR on node \f(CW\*(C`second\*(C'\fR, and so on. |
302 | .PP |
308 | .PP |
303 | By enabling routing on the gateway host that runs \f(CW\*(C`gvpe\*(C'\fR all nodes will |
309 | 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 |
310 | be able to reach the other nodes. You can, of course, also use proxy \s-1ARP\s0 |
305 | or other means of pseudo-bridging (or even real briding), or (best) full |
311 | or other means of pseudo-bridging, or (best) full routing \- the choice is |
306 | routing \- the choice is yours. |
312 | yours. |
307 | .Sh "\s-1STEP\s0 2: create the \s-1RSA\s0 key pairs for all hosts" |
313 | .SS "\s-1STEP 2:\s0 create the \s-1RSA\s0 key pair for each node" |
308 | .IX Subsection "STEP 2: create the RSA key pairs for all hosts" |
314 | .IX Subsection "STEP 2: create the RSA key pair for each node" |
309 | Run the following command to generate all key pairs (that might take a |
315 | Next you have to generate the \s-1RSA\s0 keys for the nodes. While you can set |
310 | while): |
316 | up \s-1GVPE\s0 so you can generate all keys on a single host and centrally |
|
|
317 | distribute all keys, it is safer to generate the key for each node on the |
|
|
318 | node, so that the secret/private key does not have to be copied over the |
|
|
319 | network. |
311 | .PP |
320 | .PP |
|
|
321 | To do so, run the following command to generate a key pair: |
|
|
322 | .PP |
312 | .Vb 1 |
323 | .Vb 1 |
313 | \& gvpectrl -c /etc/gvpe -g |
324 | \& gvpectrl \-c /etc/gvpe \-g nodekey |
314 | .Ve |
325 | .Ve |
315 | .PP |
326 | .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. |
327 | This will create two files, \fInodekey\fR and \fInodekey.privkey\fR. The former |
|
|
328 | should be copied to \fI/etc/gvpe/pubkey/\fInodename\fI\fR on the host where |
|
|
329 | your config file is (you will have to create the \fIpubkey\fR directory |
|
|
330 | first): |
|
|
331 | .PP |
|
|
332 | .Vb 1 |
|
|
333 | \& scp nodekey confighost:/etc/gvpe/pubkey/nodename |
|
|
334 | .Ve |
|
|
335 | .PP |
|
|
336 | The private key \fInodekey.privkey\fR should be moved to \fI/etc/gvpe/hostkey\fR: |
|
|
337 | .PP |
|
|
338 | .Vb 2 |
|
|
339 | \& mkdir \-p /etc/gvpe |
|
|
340 | \& mv nodekey.privkey /etc/gvpe/hostkey |
|
|
341 | .Ve |
317 | .Sh "\s-1STEP\s0 3: distribute the config files to all nodes" |
342 | .SS "\s-1STEP 3:\s0 distribute the config files to all nodes" |
318 | .IX Subsection "STEP 3: distribute the config files to all nodes" |
343 | .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 |
344 | Now distribute the config files and public keys to the other nodes. |
320 | private keys should not be distributed. The example uses rsync-over-ssh |
|
|
321 | .PP |
345 | .PP |
322 | First all the config files without the hostkeys should be distributed: |
346 | The example uses rsync-over-ssh to copy the config file and all the public |
|
|
347 | keys: |
323 | .PP |
348 | .PP |
324 | .Vb 3 |
349 | .Vb 3 |
325 | \& rsync -avzessh /etc/gvpe first.example.net:/etc/. --exclude hostkeys |
350 | \& rsync \-avzessh /etc/gvpe first.example.net:/etc/. \-\-exclude hostkey |
326 | \& rsync -avzessh /etc/gvpe 133.55.82.9:/etc/. --exclude hostkeys |
351 | \& rsync \-avzessh /etc/gvpe 133.55.82.9:/etc/. \-\-exclude hostkey |
327 | \& rsync -avzessh /etc/gvpe third.example.net:/etc/. --exclude hostkeys |
352 | \& rsync \-avzessh /etc/gvpe third.example.net:/etc/. \-\-exclude hostkey |
328 | .Ve |
353 | .Ve |
329 | .PP |
354 | .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 |
355 | You should now check the configuration by issuing the command \f(CW\*(C`gvpectrl |
339 | /etc/gvpe \-s\*(C'\fR on each node and verify it's output. |
356 | \&\-c /etc/gvpe \-s\*(C'\fR on each node and verify it's output. |
340 | .Sh "\s-1STEP\s0 4: starting gvpe" |
357 | .SS "\s-1STEP 4:\s0 starting gvpe" |
341 | .IX Subsection "STEP 4: starting gvpe" |
358 | .IX Subsection "STEP 4: starting gvpe" |
342 | You should then start gvpe on each node by issuing a command like: |
359 | You should then start gvpe on each node by issuing a command like: |
343 | .PP |
360 | .PP |
344 | .Vb 1 |
361 | .Vb 1 |
345 | \& gvpe -D -linfo first # first is the nodename |
362 | \& gvpe \-D \-l info first # first is the nodename |
346 | .Ve |
363 | .Ve |
347 | .PP |
364 | .PP |
348 | This will make the gvpe stay in foreground. You should then see |
365 | This will make the gvpe daemon stay in foreground. You should then see |
349 | \&\*(L"connection established\*(R" messages. If you don't see them check your |
366 | \&\*(L"connection established\*(R" messages. If you don't see them check your |
350 | firewall and routing (use tcpdump ;). |
367 | firewall and routing (use tcpdump ;). |
351 | .PP |
368 | .PP |
352 | If this works you should check your networking setup by pinging various |
369 | If this works you should check your networking setup by pinging various |
353 | endpoints. |
370 | endpoints. |
354 | .PP |
371 | .PP |
355 | To make gvpe run more permanently you can either run it as a daemon |
372 | To make gvpe run more permanently you can either run it as a daemon (by |
356 | (by starting it without the \f(CW\*(C`\-D\*(C'\fR switch), or, much better, from your |
373 | starting it without the \f(CW\*(C`\-D\*(C'\fR switch), or, much better, from your inittab |
357 | inittab. I use a line like this on my systems: |
374 | or equivalent. I use a line like this on all my systems: |
358 | .PP |
375 | .PP |
359 | .Vb 1 |
376 | .Vb 1 |
360 | \& t1:2345:respawn:/opt/gvpe/sbin/gvpe -D -L first >/dev/null 2>&1 |
377 | \& t1:2345:respawn:/opt/gvpe/sbin/gvpe \-D \-L first >/dev/null 2>&1 |
361 | .Ve |
378 | .Ve |
362 | .Sh "\s-1STEP\s0 5: enjoy" |
379 | .SS "\s-1STEP 5:\s0 enjoy" |
363 | .IX Subsection "STEP 5: enjoy" |
380 | .IX Subsection "STEP 5: enjoy" |
364 | \&... and play around. Sending a \-HUP (\f(CW\*(C`gvpectrl \-kHUP\*(C'\fR) to the daemon |
381 | \&... 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 |
382 | 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 |
383 | inittab \f(CW\*(C`gvpectrl \-k\*(C'\fR (or simply \f(CW\*(C`killall gvpe\*(C'\fR) will kill the daemon, |
367 | kill the daemon, start it again, making it read it's configuration files |
384 | start it again, making it read it's configuration files again. |
368 | again. |
385 | .PP |
|
|
386 | To run the \s-1GVPE\s0 daemon permanently from your SysV init, you can add it to |
|
|
387 | your \fIinittab\fR, e.g.: |
|
|
388 | .PP |
|
|
389 | .Vb 1 |
|
|
390 | \& t1:2345:respawn:/bin/sh \-c "exec nice \-n\-20 /path/to/gvpe \-D node >/var/log/gvpe.log 2>&1" |
|
|
391 | .Ve |
|
|
392 | .PP |
|
|
393 | For systems using systemd, you can use a unit file similar to this one: |
|
|
394 | .PP |
|
|
395 | .Vb 4 |
|
|
396 | \& [Unit] |
|
|
397 | \& Description=gvpe |
|
|
398 | \& After=network.target |
|
|
399 | \& Before=remote\-fs.target |
|
|
400 | \& |
|
|
401 | \& [Service] |
|
|
402 | \& ExecStart=/path/to/gvpe \-D node |
|
|
403 | \& KillMode=process |
|
|
404 | \& Restart=always |
|
|
405 | \& |
|
|
406 | \& [Install] |
|
|
407 | \& WantedBy=multi\-user.target |
|
|
408 | .Ve |
369 | .SH "SEE ALSO" |
409 | .SH "SEE ALSO" |
370 | .IX Header "SEE ALSO" |
410 | .IX Header "SEE ALSO" |
371 | \&\fIgvpe.osdep\fR\|(5) for OS-depedendent information, \fIgvpe.conf\fR\|(5), \fIgvpectrl\fR\|(8), |
411 | \&\fIgvpe.osdep\fR\|(5) for OS-dependent information, \fIgvpe.conf\fR\|(5), \fIgvpectrl\fR\|(8), |
372 | and for a description of the transports, protocol, and routing algorithm, |
412 | and for a description of the transports, protocol, and routing algorithm, |
373 | \&\fIgvpe.protocol\fR\|(7). |
413 | \&\fIgvpe.protocol\fR\|(7). |
374 | .PP |
414 | .PP |
375 | The \s-1GVPE\s0 mailinglist, at <http://lists.schmorp.de/>, or |
415 | The \s-1GVPE\s0 mailing list, at <http://lists.schmorp.de/>, or |
376 | \&\f(CW\*(C`gvpe@lists.schmorp.de\*(C'\fR. |
416 | \&\f(CW\*(C`gvpe@lists.schmorp.de\*(C'\fR. |
377 | .SH "AUTHOR" |
417 | .SH "AUTHOR" |
378 | .IX Header "AUTHOR" |
418 | .IX Header "AUTHOR" |
379 | Marc Lehmann <gvpe@schmorp.de> |
419 | Marc Lehmann <gvpe@schmorp.de> |
380 | .SH "COPYRIGHTS AND LICENSES" |
420 | .SH "COPYRIGHTS AND LICENSES" |
381 | .IX Header "COPYRIGHTS AND LICENSES" |
421 | .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 |
422 | \&\s-1GVPE\s0 itself is distributed under the \s-1GENERAL PUBLIC LICENSE \s0(see the file |
383 | \&\s-1COPYING\s0 that should be part of your distribution). |
423 | \&\s-1COPYING\s0 that should be part of your distribution). |
384 | .PP |
424 | .PP |
385 | In some configurations it uses modified versions of the tinc vpn suite, |
425 | 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. |
426 | which is also available under the \s-1GENERAL PUBLIC LICENSE.\s0 |