Add patch to fix a lintian warning
[anytun.git] / README
1 Dependencies
2 ============
3
4 Anytun can be built by using either libgcrypt, libnettle or the openssl-crypto
5 library. The latter is more performant in most cases but there are some license
6 issues when using this library.
7
8 Linux
9 -----
10 (this includes Debian with FreeBSD Kernel)
11
12 using libgcrypt:
13   libgcrypt11-dev
14
15 using ssl crypto library:
16   libssl-dev
17
18 using nettle crypto library:
19   nettle-dev
20
21 common:
22   build-essential
23   libboost-serialization-dev
24   libboost-thread-dev
25   libboost-system-dev
26   libboost-regex-dev
27
28 if you want clang as compiler
29   clang
30
31 if you want to rebuild the manpage:
32   asciidoc
33
34
35 Freebsd
36 -------
37
38 using libgcrypt:
39    security/libgcrypt
40
41 using ssl crypto lib:
42    <nothing here>
43
44 common:
45    devel/boost (boost-libs on newer versions of the ports tree)
46    devel/gmake
47
48 if you want to rebuild the manpage:
49  textproc/asciidoc
50  textproc/libxslt
51  textproc/docbook-xsl
52  sysutils/readlink
53  misc/getopt
54
55
56
57 Windows
58 -------
59
60  Crosscompiling with MinGW under Debian/Ubuntu:
61  ----------------------------------------------
62
63   # sudo apt-get install mingw-w64
64   # cd contrib/
65   # ./build-boost-mingw-cross.sh
66   # ./build-openssl-mingw-cross.sh
67   # ./build-anytun-mingw-cross.sh
68
69   The compiled binaries can be found in anytun-w32 and anytun-w64 (32 and 64Bit).
70   You can create a ZIP archive containing all needed files by calling:
71
72   # ./make-mingw-release.sh
73
74
75  Using MS Visual C++:
76  --------------------
77   OpenSSL
78    Developer:
79     http://www.slproweb.com/download/Win32OpenSSL-1_0_1h.exe
80
81    Runtime Only:
82     http://www.slproweb.com/download/Win32OpenSSL_Light-1_0_1h.exe
83
84   Boost
85     http://sourceforge.net/projects/boost/files/boost-binaries/
86
87     As it can take some time to install everything from boost here is a
88     complete list of libraries which have to be installed in order to build anytun:
89
90      * Serialization
91      * Thread
92      * date_time
93      * System
94      * regex
95
96   Microsoft Visual C++ 2008 Redistributable Package (x86):
97     http://www.microsoft.com/downloads/details.aspx?familyid=9B2DA534-3E03-4391-8A4D-074B9F2BC1BF
98
99
100
101
102 Installation
103 ============
104
105 Getting the source via GIT:
106 ---------------------------
107
108 git clone https://git.spreadspace.org/anytun/anytun.git
109 cd anytun
110
111 Building from source
112 --------------------
113
114 using libgcrypt:
115
116  # cd src
117  # ./configure
118  # make
119
120 using ssl crypto library:
121
122  # cd src
123  # ./configure --use-ssl-crypto
124  # make
125
126
127 Notes:
128   - try './configure --help' for further information
129   - if using openssl pre 0.9.8 you have to disable passphrase
130     because openssl had no SHA256 implementation prior to this
131     version
132   - on FreeBSD you have to use gmake instead of make
133   - the FreeBSD port has some issues concering daemonizing and signal handling
134
135 Installing
136 ----------
137
138 # sudo make install
139
140 This will install anytun under the --prefix defined with configure.
141
142
143 Uninstalling
144 ------------
145
146 # sudo make remove
147
148 This removes everything except for the config files
149
150 # sudo make purge
151
152 This also removes the config files
153
154
155
156 Usage:
157 ======
158
159 init.d script
160 -------------
161
162 The init.d script can be used to start anytun at boot time. It searches for
163 configuration files which reside at $CONFIG_DIR. For each instance of anytun
164 which should be started there must be a directory containing at least a file
165 named config. This file must contain all command line parameter which should
166 be used when starting the daemon. One line for each parameter. Empty lines and
167 lines starting with # are ignored. Besides the config file there may be a script
168 named post-up.sh which will be called when the tun/tap device comes up.
169 Furthermore there may be a directory called conf.d containing config files for
170 anytun-config. The syntax of this files is quite the same as those for anytun.
171 These files are used to configure a multi connection setup using anytun-config
172 and anytun-controld
173 This is an example of how the script can be used to start anytun:
174
175 # /etc/init.d/anytun start client1 p2p-a
176
177 In this case the script will start 2 instances of anytun using the config files
178 $CONFIG_DIR/client1/config and $CONFIG_DIR/p2p-a/config.
179 If no instance name is specified the script will use the file $CONFIG_DIR/autostart
180 to determine which instances to start or stop. This file must contain a list
181 of instance names which should be used when no names are specified at the command
182 line. One line for each name. Empty lines and lines starting with # are ignored.
183
184
185 systemd usage
186 -------------
187
188 Using the provided service units, anytun can now be started and managed via Systemd.
189 As with the init.d script, each VPN or anytun instance, identified by it's $vpnname,
190  needs it's own configuration subdirectory. E.g.:  ${PREFIX}/etc/anytun/${vpnname}/.
191 For each such CLIENT instance, use the following command to enable it:
192
193 # systemctl enable anytun@${vpnname}.service
194
195 Manually start and stop instances by replacing enable with start or stop.
196
197
198 Errors:
199 =======
200
201 Note: Cannot open TUN/TAP dev /dev/net/tun: No such file or directory (errno=2)
202 Cannot open TUN/TAP dev /dev/anytun0: No such file or directory (errno=2)
203
204 Solution: Enabling tun/tap device
205 ------------------------------------
206
207 modprobe tun
208 cd /dev
209 ./MAKEDEV tun
210
211 edit /etc/modules and add the line
212 tun
213 to load the module automatically