chiark / gitweb /
@@ -1,3 +1,9 @@
[userv-utils] / ipif / INSTALL
CommitLineData
0fe65164 1NB that this is a very bare set of installation instructions ! It
2describes a `default' configuration; you can do more esoteric things
3if you wish.
4
5
6In any case, on each tunnel endpoint system (not the eventual
7end-system, but the point where the packets are `detunnelled'):
8
7ec512d9 9* Install userv, 1.0.1 or later. This should be in Debian. Get this
10* package, userv-utils from the location above, unpack it, cd to the
11 `ipif' subdirectory, and say `make' then as root `make install'.
0fe65164 12
13
7ec512d9 14The tunnel is always set up by one of its endpoints, using ssh (we
15recommend you use OpenSSH). So the active endpoint must have ssh
16installed; the passive endpoint must have sshd accessible to the
17active endpoint, and be willing to allow the active endpoint to run
18the appropriate command.
0fe65164 19
20So: create an account for the active endpoint on the passive. You
21probably want to use RSAAuthentication, so configure the relevant key
22into the passive account's authorized_keys file.
23
24Each account must have the ability to run the `userv ipif' service
25with appropriate parameters. This is achieved by editing
26/etc/userv/ipif-networks, each line of which is in the format:
27
28<gid>,[=]<network-prefix>/<prefix-length>, <groupname>, <comment>
29
30Both the local and remote endpoint addresses, and the remote network
31address(es), need to be recorded in this file. The `=' restricts the
32address to be used, by that group, as the local tunnel endpoint
33address; without `=' the address ranges specified may refer to remote
34endpoints and networks. Every address involved with the tunnel must
35be covered by an appropriate line in ipif-networks.
36
37For example, a configuration to talk to Relativity, the author's home
38site, would include:
39<gid>,172.31.80.6/32, <group>, Relativity tunnel endpoint
40<gid>,172.18.45.0/24, <group>, Relativity house ethernet
41as well as the local tunnel endpoint address, for example:
42<gid>,=192.168.160.124/32, <group>, Local tunnel endpoint
43
44There is no NAT (address translation) in the tunnelling software, so
45all the addresses must be RFC1918-allocated and distinct (except that
46a single tunnel endpoint address can be used for all the tunnels
47terminating on a particular endpoint system).
48
49You are strongly advised to choose your private network ranges
50randomly, as recommended in BCP5 (currently RFC1918). Users in
51Cambridge may like to use the Cambridge G-RIN at
52http://www.ucam.org/cam-grin/ to choose and register their networks.
53
54
55When these things are all thought to be set up, you can test the
56tunnel by running `udptunnel' in the active account. It is invoked
57something like this:
58
59authbind udptunnel \
60 -m \
61 -e nonce -e timestamp/10/30 -e pkcs5/8 \
62 -e blowfish-cbcmac/128 -e blowfish-cbc/128 \
63 davenant-external,410 \
64 chiark-public,Command \
65 172.31.80.6,172.31.80.9,1000,cslip \
66 30,120,1800 \
67 - 172.18.45.0/24 \
68 ssh -o 'ForwardAgent no' -o 'ForwardX11 no' \
69 -o 'BatchMode yes' \
70 -i ~ian/.ssh/identity -l ian \
71 -v chiark.greenend.org.uk \
72 udptunnel
73
74This example is the tunnel between chiark and Relativity. I'll quote
75it and explain the details, below. See also the comment at the top of
76udptunnel.
77
78
79Because at Relativity the tunnel endpoint has to not be our firewall,
80because the firewall is a 386SX/16 and so not powerful enough,
81Relativity practically has to be the active partner in any tunnels it
82is involved in. This also necessitates the use of the `-m' option and
83various other things.
84
85
86Exposition of an example udptunnel invocation:
87
88> authbind udptunnel \
89
90`authbind' is used because at Relativity the tunnel endpoint address
91has to be on a fixed port because our tunnel endpoint is not on the
92firewall system (if it's not on a fixed port we can't write a firewall
93rule to let it through).
94
95The port is port 410, so root privilege or authbind is needed.
96authbind is in Debian GNU/Linux.
97
98> -m \
99
100-m tells this invocation of udptunnel that its endpoint address and
101port (for encapsulated packets) are going to be NATted before the far
102end sees them. The effect is that instead of supplying this
103information to the far end, the far end is told to `wait and see'.
104
105This should not usually be used in other circumstances. (For full
106details see the comment at the top of udptunnel.)
107
108> -e nonce -e timestamp/10/30 -e pkcs5/8 \
109> -e blowfish-cbcmac/128 -e blowfish-cbc/128 \
110
111This is the crypto configuration. I wouldn't mess with it too much if
112I were you. If you have serious (>10s) clock skew then the -e
113timestamp option may not work properly; I'd recommend having your
114systems NTP-synchronised. Here 10 is the maximum number of seconds
115into the future the timestamp on an incoming packet might be, and 30
116the maximum age of an incoming packet. You can tweak these numbers if
117you really want. If you really can't get any kind of good clock
118synch, then it's probably OK to replace
119 -e nonce -e timestamp/10/30
120with
121 -e sequence
122(NB that we don't use -e sequence so it has not been well tested.)
123
124> davenant-external,410 \
125
126This is the local address and port for sending/receiving encapsulated
127packets. davenant is the tunnel endpoint, and davenant-external is
128its globally-reachable address (we run two networks on the wire at
129Relativity, an internal one and a globally-reachable one).
130
131> chiark-public,Command \
132
133This is the remote address and port for encapsulated packets.
134`Command' means find out the remote address or port to send
135encapsulated packets to by having udptunnel at the far end print its
136address and port when they have been allocated.
137
138Another possibility here is to use a fixed remote port number.
139
140The DNS at GR has just `chiark' meaning chiark via the tunnel, so we
141have to use chiark-public which means its public IP address.
142
143> 172.31.80.6,172.31.80.9,1000,cslip \
144
145172.31.80.6 is davenant's tunnel endpoint address.
146172.31.80.9 is the address of chiark's Relativity tunnel endpoint.
147
148> 30,120,1800 \
149
150These are timing parameters. 30 is the `keep alive' timeout; if
151nothing is sent for this many seconds, an empty packet is sent. 120
152is the `broken' timeout; if nothing valid is received for this many
153seconds, the tunnel is declared dead and dies (hopefully to be
154restarted); 1800 is the time in seconds between messages of the form
155 udptunnel-forwarder: chiark: tunnel still open: received 746
156 packets, 103257 bytes
157These serve as a useful diagnostic, and also prevent the controlling
158ssh connection from timing out from NAT tables.
159
160> - 172.18.45.0/24 \
161
162`-' here is the remote networks which are reachable. None are
163reachable via chiark. 172.18.45.0/24 is the Relativity house
164ethernet.
165
166> ssh -o 'ForwardAgent no' -o 'ForwardX11 no' \
167> -o 'BatchMode yes' \
168> -i ~ian/.ssh/identity -l ian \
169> -v chiark.greenend.org.uk \
170> udptunnel
171
172This is the ssh invocation to run udptunnel at the far end.
173
174When you have this invocation working in a shell window you need to
175make it run automatically. Since the tunnel will die whenever your
176IP address changes, or when other troublesome events happen, you must
177arrange for it to be restarted. At Relativity we put the udptunnel
178invocation in a file and run it out of inittab, like this:
179
180t0:235:respawn:/usr/local/sbin/really -u ian /usr/local/sbin/udptunnel-invoke 2>&1 | logger -p local2.info -t tunnel-chiark
181
182
183Troubleshooting:
184
185Look at the error messages, they will hopefully be informative.
186
187If you see a message from `slattach' about being unable to open /dev/2
188or some such, then you need to upgrade your `slattach'. In Debian
189GNU/Linux it's in the `netbase' package, and the fix is in 3.16-3 and
7ec512d9 190later; however the bug has regressed, and is known to be in 3.18-4 and
191earlier. The relevant Debian bug reports are #45515 (now closed) and
192#45944. A patch to correct 3.18-4 is in this directory as
193`slattach.diff'.
0fe65164 194
195
7ec512d9 196$Id: INSTALL,v 1.2 2000/08/10 00:18:31 ian Exp $