summaryrefslogtreecommitdiff
path: root/README
blob: 60ef964bac83b159606b119fd9f51700307c72a9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
Dependencies
============

Anytun can be built by using either libgcrypt or the openssl-crypto library. 
The latter is more performant in most cases but there are some license 
issues when using this library.

Linux
-----
(this includes Debian with FreeBSD Kernel)

using libgcrypt:
  libgcrypt11-dev

using ssl crypto lib:
  libssl-dev

common:
  build-essential
  libboost-serialization1.35-dev
  libboost-thread1.35-dev
  libboost-system1.35-dev
  libboost-regex1.35-dev

if you want to rebuild the manpage:
  asciidoc


Freebsd
-------

using libgcrypt:
   security/libgcrypt

using ssl crypto lib:
   <nothing here>

common:
   devel/boost (boost-libs on newer versions of the ports tree)
   devel/gmake

if you want to rebuild the manpage:
 textproc/asciidoc
 textproc/libxslt
 textproc/docbook-xsl
 sysutils/readlink
 misc/getopt 



Windows
-------
OpenSSL
 Developer: 
 	http://www.slproweb.com/download/Win32OpenSSL-0_9_8j.exe

 Runtime Only: 
 	http://www.slproweb.com/download/Win32OpenSSL_Light-0_9_8j.exe
  
Boost 1.35: 
	http://www.boostpro.com/download/boost_1_35_0_setup.exe

  As it can take some time to install everything from boost here is a 
  complete list of libraries which have to be installed in order to build anytun:
   
   * Serialization
   * Thread 
   * date_time
   * System
   * regex

Microsoft Visual C++ 2008 Redistributable Package (x86):
	http://www.microsoft.com/downloads/details.aspx?familyid=9B2DA534-3E03-4391-8A4D-074B9F2BC1BF



Installation
============

Getting the source via subversion:
----------------------------------
svn co http://svn.anytun.org/anytun/trunk anytun
cd anytun

Building from source
--------------------

using libgcrypt:

 # cd src
 # ./configure
 # make

using ssl crypto library:

 # cd src
 # ./configure --use-ssl-crypto
 # make


Notes: 
  - try './configure --help' for further information
  - if using openssl pre 0.9.8 you have to disable passphrase
    because openssl had no SHA256 implementation prior to this
    version
  - on FreeBSD you have to use gmake instead of make

Installing
----------

# sudo make install

This will install anytun under the --prefix defined with configure.

Uninstalling
------------

# sudo make remove

This removes everytthing except for the config files

# sudo make purge

This also removes the config files



Usage:
======

init.d script
-------------

The init.d script can be used to start anytun at boot time. It searches for 
configuration files which reside at $CONFIG_DIR. For each instance of anytun
which should be started there must be a directory containing at least a file
named config. This file must contain all command line parameter which should
be used when starting the daemon. One line for each parameter. Empty lines and
lines starting with # are ignored. Besides the config file there may be a script
named post-up.sh which will be called when the tun/tap device comes up. 
Furthermore there may be a directory called conf.d containing config files for 
anytun-config. The syntax of this files is quite the same as those for anytun. 
These files are used to configure a multi connection setup using anytun-config 
and anytun-controld
This is an example of how the script can be used to start anytun:

# /etc/init.d/anytun start client1 p2p-a

In this case the script will start 2 instances of anytun using the config files
$CONFIG_DIR/client1/config and $CONFIG_DIR/p2p-a/config. 
If no instance name is specified the script will use the file $CONFIG_DIR/autostart
to determine which instances to start or stop. This file must contain a list 
of instance names which should be used when no names are specified at the command 
line. One line for each name. Empty lines and lines starting with # are ignored.



Errors:
=======

Note: Cannot open TUN/TAP dev /dev/net/tun: No such file or directory (errno=2)
Cannot open TUN/TAP dev /dev/anytun0: No such file or directory (errno=2)

Solution: Enabling tun/tap device
------------------------------------

modprobe tun
cd /dev
./MAKEDEV tun

edit /etc/modules and add the line
tun
to load the module automatically