chiark / gitweb /
Import release 0.06
[secnet.git] / INSTALL
1 INSTALLATION INSTRUCTIONS for SECNET
2
3 USE AT YOUR OWN RISK.  THIS IS ALPHA TEST SOFTWARE.  I DO NOT
4 GUARANTEE THAT THERE WILL BE PROTOCOL COMPATIBILITY BETWEEN DIFFERENT
5 VERSIONS.
6
7 * Preparation
8
9 ** System software support
10
11 Ensure that you have libgmp2-dev and adns installed (and bison and
12 flex, and for that matter gcc...).
13
14 If you intend to configure secnet to obtain packets from the kernel
15 through userv-ipif, install and configure userv-ipif.  It is part of
16 userv-utils, available from ftp.chiark.greenend.org.uk in
17 /users/ian/userv
18
19 If you intend to configure secnet to obtain packets from the kernel
20 using the universal TUN/TAP driver, make sure it's configured in your
21 kernel (it's under "network device support" in Linux-2.4) and that
22 you've created the appropriate device files; see
23 linux/Documentation/networking/tuntap.txt
24
25 If you're using TUN/TAP on a platform other than Linux-2.4, see
26 http://vtun.sourceforge.net/tun/
27
28 Note than TUN comes in two flavours, one (called 'tun' in the secnet
29 config file) which has only one device file (usually /dev/net/tun) and
30 the other (called 'tun-old') which has many device files (/dev/tun*).
31 Linux-2.4 has new-style TUN, Linux-2.2, BSD and Solaris have old-style
32 TUN.  Currently only new-style TUN has been tested with secnet.
33
34 ** System and network configuration
35
36 If you intend to start secnet as root, I suggest you create a userid
37 for it to run as once it's ready to drop its privileges.  Example (on
38 Debian):
39 # adduser --system --no-create-home secnet
40
41 You will need to allocate two IP addresses for use by secnet.  One
42 will be for the tunnel interface on your tunnel endpoint machine (i.e.
43 the address you see in 'ifconfig' when you look at the tunnel
44 interface).  The other will be for secnet itself.  These addresses
45 could possibly be allocated from the range used by your internal
46 network: if you do this, you should think about providing appropriate
47 proxy-ARP on the machine running secnet for the two addresses.
48 Alternatively the addresses could be from some other range - this
49 works well if the machine running secnet is the default route out of
50 your network.
51
52 http://www.ucam.org/cam-grin/ may be useful.
53
54 Advanced users: secnet's IP address does not _have_ to be in the range
55 of networks claimed by your end of the tunnel; it could be in the
56 range of networks claimed by the other end.  Doing this is confusing,
57 but works.
58
59 * Installation
60
61 To install secnet do
62
63 $ ./configure
64 $ make
65 # make install
66 # mkdir /etc/secnet
67 # cp example.conf /etc/secnet/secnet.conf
68 # cd /etc/secnet
69 # ssh-keygen -f key -N ""
70
71 (When upgrading, just install the new /usr/local/sbin/secnet; keep
72 your current configuration file.)
73
74 Generate a site file fragment for your site (see below), and submit it
75 for inclusion in the vpn-sites file.  Download the vpn-sites file to
76 /etc/secnet/sites - MAKE SURE YOU GET AN AUTHENTIC COPY because the
77 sites file contains public keys for all the sites in the VPN.
78
79 * Configuration
80
81 Should be reasonably obvious - edit /etc/secnet/secnet.conf as
82 prompted by the comments.  XXX Fuller documentation of the
83 configuration file format should be forthcoming in time.  Its syntax
84 is described in the README file at the moment.
85
86 * Constructing your site file fragment
87
88 You need the following information:
89
90 1. a short name for your site, eg.  "greenend".  This is used to
91 identify your site in the vpn-sites file.
92
93 2. the name your site will use in the key setup protocol,
94 eg. "greenend" (these two will usually be similar or the same).
95
96 3. the DNS name of the machine that will be the "front-end" for your
97 secnet installation.  This will typically be the name of the gateway
98 machine for your network, eg.  sinister.dynamic.greenend.org.uk
99
100 secnet does not actually have to run on this machine, as long as the
101 machine can be configured to forward UDP packets to the machine that
102 is running secnet.
103
104 4. the port number used to contact secnet at your site.  This is the
105 port number on the front-end machine, and does not necessarily have to
106 match the port number on the machine running secnet.
107
108 5. the list of networks accessible at your site over the VPN.
109
110 6. the public part of the RSA key you generated during installation
111 (in /etc/secnet/key.pub if you followed the installation
112 instructions).  This file contains three numbers and a comment on one
113 line.  The first number is the key length in bits, and can be ignored.
114 The second number (typically small) is the encryption key 'e', and the
115 third number (large) is the modulus 'n'.
116
117 If you are running secnet on a particularly slow machine, you may like
118 to specify a larger value for the key setup retry timeout than the
119 default, to prevent unnecessary retransmissions of key setup packets.
120 See the notes in the example configuration file for more on this.
121
122 The site file fragment should look something like this:
123
124 shortname {
125                 name "sitename";
126                 address "your.public.address.org.uk";
127                 port 5678;
128                 networks "172.18.45.0/24";
129                 key rsa-public("35","153279875126380522437827076871354104097683702803616313419670959273217685015951590424876274370401136371563604396779864283483623325238228723798087715987495590765759771552692972297669972616769731553560605291312242789575053620182470998166393580503400960149506261455420521811814445675652857085993458063584337404329");
130         };
131
132 See 'example-sites-file' for more examples.