1 |
=head1 NAME |
2 |
|
3 |
gvpe.osdep - os dependent information |
4 |
|
5 |
=head1 DESCRIPTION |
6 |
|
7 |
This file tries to capture OS-dependent configuration or build issues, |
8 |
quirks and platform limitations, as known. |
9 |
|
10 |
=head2 TUN vs. TAP interface |
11 |
|
12 |
Most operating systems nowadays support something called a |
13 |
I<tunnel>-device, which makes it possible to divert IPv4 (and often other |
14 |
protocols, too) into a userspace daemon like C<gvpe>. This is being |
15 |
referred to as a TUN-device. |
16 |
|
17 |
This is fine for point-to-point tunnels, but for a virtual ethernet, an |
18 |
additional ethernet header is needed. This functionality (called a TAP |
19 |
device here) is only provided by a subset of the configurations. |
20 |
|
21 |
On platforms only supporting a TUN-device, gvpe will invoke it's magical |
22 |
ethernet emulation package, which currently only handles ARP requests for |
23 |
the IPv4 protocol (but more could be added, bu the tincd network drivers |
24 |
might need to be modified for this to work). This means that on those |
25 |
platforms, only IPv4 will be supported. |
26 |
|
27 |
Also, since there is no way (currently) to tell gvpe which IP subnets are |
28 |
found on a specific host, you will either need to hardwire the MAC address |
29 |
for TUN-style hosts on all networks (and avoid ARP altogether, which is |
30 |
possible), or you need to send a packet from these hosts into the vpn |
31 |
network to tell gvpe the local interface address. |
32 |
|
33 |
=head2 native/linux |
34 |
|
35 |
TAP-device; already part of the kernel (only 2.4+ supported, but see |
36 |
tincd/linux). This is the configuration tested best, as gvpe is being |
37 |
developed on this platform. |
38 |
|
39 |
To configure the interface, use either iproute2: |
40 |
|
41 |
ip set $IFNAME address $MAC mtu $MTU up |
42 |
ip addr add $IFNAME 10.11.12.13 |
43 |
ip route add $IFNAME 10.11.12.13/8 |
44 |
|
45 |
Or C<ifconfig>: |
46 |
|
47 |
ifconfig $IFNAME hw ether $MAC mtu $MTU |
48 |
ifconfig $IFNAME 10.11.12.13 netmask 255.0.0.0 |
49 |
|
50 |
To hardwire ARP addresses, use iproute2 (C<arp> can do it, too): |
51 |
|
52 |
MAC=fe:fd:80:00:00:$(printf "%02x" $NODEID) |
53 |
ip neighbour add 10.11.12.13 lladdr $MAC nud permanent dev $IFNAME |
54 |
|
55 |
=head2 tincd/linux |
56 |
|
57 |
TAP-device; already part of the kernel (2.2+ supported). See |
58 |
C<native/linux> for more info. |
59 |
|
60 |
=head2 native/cygwin |
61 |
|
62 |
TAP-device; The TAP device to be used must either be the CIPE driver |
63 |
(C<http://cipe-win32.sourceforge.net/>), or (highly recommended) the newer |
64 |
TAP-Win32 driver bundled with openvpn (http://openvpn.sf.net/). Just |
65 |
download and run the openvpn installer. The only option you need to select |
66 |
is the TAP driver. |
67 |
|
68 |
The MAC need not be set (and in fact I<cannot> be set). The MAC address |
69 |
is dynamically being patched into packets and ARP-requests, so only IPv4 |
70 |
works with ARP on this platform. |
71 |
|
72 |
=head2 tincd/freebsd |
73 |
|
74 |
TAP-device; part of the kernel (since 4.x, maybe earlier). To initialize |
75 |
the interface, use this command: |
76 |
|
77 |
ifconfig $IFNAME ether $MAC mtu $MTU up |
78 |
|
79 |
These commands might be helpful examples: |
80 |
|
81 |
ifconfig $IFNAME 10.0.0.$NODEID |
82 |
route add -net 10.0.0.0 -netmask 255.255.255.0 -interface $IFNAME 10.0.0.$NODEID |
83 |
|
84 |
=head2 tincd/netbsd |
85 |
|
86 |
TUN-device; The interface is a point to point-device. To initialize it, |
87 |
you currently need to configure it as such, giving it an address on your |
88 |
vpn (the exact address doesn't matter), like this: |
89 |
|
90 |
ifconfig $IFNAME mtu $MTU up |
91 |
ifconfig $IFNAME 10.11.12.13 10.55.66.77 |
92 |
route add -net 10.0.0.0 10.55.66.77 255.0.0.0 |
93 |
ping -c1 10.55.66.77 # ping once to tell gvpe your gw ip |
94 |
|
95 |
=head2 tincd/openbsd |
96 |
|
97 |
TUN-device; already part of the kernel. See C<tincd/netbsd> for more information. |
98 |
|
99 |
=head2 native/darwin |
100 |
|
101 |
TAP-device; |
102 |
|
103 |
The necessary kernel extension can be found here: |
104 |
|
105 |
http://www-user.rhrk.uni-kl.de/~nissler/tuntap/ |
106 |
|
107 |
There are two drivers, the one to use is the "tap" driver. It driver must |
108 |
be loaded before use, read the docs on how to install it as a startup |
109 |
item. |
110 |
|
111 |
To initialize the interface, use this command: |
112 |
|
113 |
ifconfig $IFNAME ether $MAC mtu $MTU up |
114 |
|
115 |
These commands might be helpful examples: |
116 |
|
117 |
ifconfig $IFNAME 10.0.0.$NODEID |
118 |
route add -net 10.0.0.0 -interface $IFNAME 255.255.255.0 |
119 |
|
120 |
=head2 tincd/darwin |
121 |
|
122 |
TUN-device; See C<tincd/netbsd> for more information. C<native/darwin> is |
123 |
preferable. |
124 |
|
125 |
The necessary kernel extension can be found here: |
126 |
|
127 |
http://chrisp.de/en/projects/tunnel.html |
128 |
|
129 |
The driver must be loaded before use: |
130 |
|
131 |
kmodload tunnel |
132 |
|
133 |
=head2 tincd/solaris |
134 |
|
135 |
TUN-device; already part of the kernel(?), or available here: |
136 |
|
137 |
http://vtun.sourceforge.net/tun/ |
138 |
|
139 |
Some precompiled tun drivers might be available here: |
140 |
|
141 |
http://www.monkey.org/~dugsong/fragroute/ |
142 |
|
143 |
See C<tincd/netbsd> for more information. |
144 |
|
145 |
Completely unstested so far. |
146 |
|
147 |
=head2 tincd/mingw |
148 |
|
149 |
TAP-device; see C<native/cygwin> for more information. |
150 |
|
151 |
Completely untested so far. |
152 |
|
153 |
=head2 tincd/raw_socket |
154 |
|
155 |
TAP-device; purpose unknown and untested, probably binds itself on an |
156 |
existing ethernet device (given by C<ifname>), which should probably not |
157 |
be configured in any way, except for setting it I<up>. |
158 |
|
159 |
=head2 tincd/uml_socket |
160 |
|
161 |
TAP-device; purpose unknown and untested, probably creates a unix datagram |
162 |
socket (path given by C<ifname>) and reads and writes raw packets, so |
163 |
might be useful in other than UML contexts. |
164 |
|
165 |
=head2 tincd/cygwin |
166 |
|
167 |
Known to be broken, use C<native/cygwin> instead. |
168 |
|
169 |
=head1 SEE ALSO |
170 |
|
171 |
gvpe(5). |
172 |
|
173 |
=head1 AUTHOR |
174 |
|
175 |
Marc Lehmann <gvpe@plan9.de> |
176 |
|