Imported Upstream version 0.3.4
[anytun.git] / README
1 Dependencies
2 ============
3
4 Anytun can be built by using either libgcrypt or the openssl-crypto library. 
5 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 lib:
16   libssl-dev
17
18 common:
19   build-essential
20   libboost-serialization1.35-dev
21   libboost-thread1.35-dev
22   libboost-system1.35-dev
23   libboost-regex1.35-dev
24
25 if you want to rebuild the manpage:
26   asciidoc
27
28
29 Freebsd
30 -------
31
32 using libgcrypt:
33    security/libgcrypt
34
35 using ssl crypto lib:
36    <nothing here>
37
38 common:
39    devel/boost (boost-libs on newer versions of the ports tree)
40    devel/gmake
41
42 if you want to rebuild the manpage:
43  textproc/asciidoc
44  textproc/libxslt
45  textproc/docbook-xsl
46  sysutils/readlink
47  misc/getopt 
48
49
50
51 Windows
52 -------
53 OpenSSL
54  Developer: 
55         http://www.slproweb.com/download/Win32OpenSSL-0_9_8j.exe
56
57  Runtime Only: 
58         http://www.slproweb.com/download/Win32OpenSSL_Light-0_9_8j.exe
59   
60 Boost 1.35: 
61         http://www.boostpro.com/download/boost_1_35_0_setup.exe
62
63   As it can take some time to install everything from boost here is a 
64   complete list of libraries which have to be installed in order to build anytun:
65    
66    * Serialization
67    * Thread 
68    * date_time
69    * System
70    * regex
71
72 Microsoft Visual C++ 2008 Redistributable Package (x86):
73         http://www.microsoft.com/downloads/details.aspx?familyid=9B2DA534-3E03-4391-8A4D-074B9F2BC1BF
74
75
76
77 Installation
78 ============
79
80 Getting the source via subversion:
81 ----------------------------------
82 svn co http://svn.anytun.org/anytun/trunk anytun
83 cd anytun
84
85 Building from source
86 --------------------
87
88 using libgcrypt:
89
90  # cd src
91  # ./configure
92  # make
93
94 using ssl crypto library:
95
96  # cd src
97  # ./configure --use-ssl-crypto
98  # make
99
100
101 Notes: 
102   - try './configure --help' for further information
103   - if using openssl pre 0.9.8 you have to disable passphrase
104     because openssl had no SHA256 implementation prior to this
105     version
106   - on FreeBSD you have to use gmake instead of make
107   - the FreeBSD port has some issues concering daemonizing and signal handling
108
109 Installing
110 ----------
111
112 # sudo make install
113
114 This will install anytun under the --prefix defined with configure.
115
116 Uninstalling
117 ------------
118
119 # sudo make remove
120
121 This removes everything except for the config files
122
123 # sudo make purge
124
125 This also removes the config files
126
127
128
129 Usage:
130 ======
131
132 init.d script
133 -------------
134
135 The init.d script can be used to start anytun at boot time. It searches for 
136 configuration files which reside at $CONFIG_DIR. For each instance of anytun
137 which should be started there must be a directory containing at least a file
138 named config. This file must contain all command line parameter which should
139 be used when starting the daemon. One line for each parameter. Empty lines and
140 lines starting with # are ignored. Besides the config file there may be a script
141 named post-up.sh which will be called when the tun/tap device comes up. 
142 Furthermore there may be a directory called conf.d containing config files for 
143 anytun-config. The syntax of this files is quite the same as those for anytun. 
144 These files are used to configure a multi connection setup using anytun-config 
145 and anytun-controld
146 This is an example of how the script can be used to start anytun:
147
148 # /etc/init.d/anytun start client1 p2p-a
149
150 In this case the script will start 2 instances of anytun using the config files
151 $CONFIG_DIR/client1/config and $CONFIG_DIR/p2p-a/config. 
152 If no instance name is specified the script will use the file $CONFIG_DIR/autostart
153 to determine which instances to start or stop. This file must contain a list 
154 of instance names which should be used when no names are specified at the command 
155 line. One line for each name. Empty lines and lines starting with # are ignored.
156
157
158
159 Errors:
160 =======
161
162 Note: Cannot open TUN/TAP dev /dev/net/tun: No such file or directory (errno=2)
163 Cannot open TUN/TAP dev /dev/anytun0: No such file or directory (errno=2)
164
165 Solution: Enabling tun/tap device
166 ------------------------------------
167
168 modprobe tun
169 cd /dev
170 ./MAKEDEV tun
171
172 edit /etc/modules and add the line
173 tun
174 to load the module automatically