1ed21cabcb1e2cc3f770f746140091c543ebfd89
[debian/uanytun.git] / doc / uanytun.8.txt
1 uanytun(8)
2 ==========
3
4 NAME
5 ----
6
7 uanytun - micro anycast tunneling daemon
8
9
10 SYNOPSIS
11 --------
12
13 ....
14 uanytun
15   [ -h|--help ]
16   [ -D|--nodaemonize ]
17   [ -u|--username <username> ]
18   [ -g|--groupname <groupname> ]
19   [ -C|--chroot <path> ]
20   [ -P|--write-pid <filename> ]
21   [ -L|--log <target>:<level>[,<param1>[,<param2>[..]]] ]
22   [ -i|--interface <ip-address> ]
23   [ -p|--port <port> ]
24   [ -r|--remote-host <hostname|ip> ]
25   [ -o|--remote-port <port> ]
26   [ -4|--ipv4-only ]
27   [ -6|--ipv6-only ]
28   [ -d|--dev <name> ]
29   [ -t|--type <tun|tap> ]
30   [ -n|--ifconfig <local>/<prefix> ]
31   [ -x|--post-up-script <script> ]
32   [ -m|--mux <mux-id> ]
33   [ -s|--sender-id <sender id> ]
34   [ -w|--window-size <window size> ]
35   [ -k|--kd-prf <kd-prf type> ]
36   [ -e|--role <role> ]
37   [ -E|--passphrase <pass phrase> ]
38   [ -K|--key <master key> ]
39   [ -A|--salt <master salt> ]
40   [ -c|--cipher <cipher type> ]
41   [ -a|--auth-algo <algo type> ]
42   [ -b|--auth-tag-length <length> ]
43 ....
44
45
46 DESCRIPTION
47 -----------
48
49 *uAnytun* is a tiny implementation of the Secure Anycast Tunneling Protocol
50 (SATP). It provides a complete VPN solution similar to OpenVPN or
51 IPsec in tunnel mode. The main difference is that anycast enables the
52 setup of tunnels between an arbitrary combination of anycast, unicast
53 and multicast hosts. Unlike Anytun which is a full featured implementation 
54 uAnytun has no support for multiple connections or synchronisation. It is a 
55 small single threaded implementation intended to act as a client on small 
56 platforms.
57
58
59 OPTIONS
60 -------
61
62 *uAnytun* has been designed as a peer to peer application, so there is
63 no difference between client and server. The following options can be
64 passed to the daemon:
65
66 *-D, --nodaemonize*::
67    This option instructs *uAnytun* to run in foreground
68    instead of becoming a daemon which is the default.
69
70 *-u, --username <username>*::
71    run as this user. If no group is specified (*-g*) the default group of 
72    the user is used. The default is to not drop privileges.
73
74 *-g, --groupname <groupname>*::
75    run as this group. If no username is specified (*-u*) this gets ignored.
76    The default is to not drop privileges.
77
78 *-C, --chroot <path>*::
79    Instruct *uAnytun* to run in a chroot jail. The default is 
80    to not run in chroot.
81
82 *-P, --write-pid <filename>*::
83    Instruct *uAnytun* to write it's pid to this file. The default is 
84    to not create a pid file.
85
86 *-L, --log <target>:<level>[,<param1>[,<param2>[..]]]*::
87    add log target to logging system. This can be invoked several times
88    in order to log to different targets at the same time. Every target 
89    hast its own log level which is a number between 0 and 5. Where 0 means
90    disabling log and 5 means debug messages are enabled. +
91    The file target can be used more the once with different levels.
92    If no target is provided at the command line a single target with the 
93    config *syslog:3,uanytun,daemon* is added. +
94    The following targets are supported:
95
96    *syslog*;; log to syslog daemon, parameters <level>[,<logname>[,<facility>]]
97    *file*;; log to file, parameters <level>[,<path>]
98    *stdout*;; log to standard output, parameters <level>
99    *stderr*;; log to standard error, parameters <level> 
100
101 *-i, --interface <ip address>*::
102    This IP address is used as the sender address for outgoing
103    packets. The default is to not use a special inteface and just
104    bind on all interfaces.
105
106 *-p, --port <port>*::
107    The local UDP port that is used to send and receive the
108    payload data. The two tunnel endpoints can use different
109    ports. default: 4444
110
111 *-r, --remote-host <hostname|ip>*::
112    This option can be used to specify the remote tunnel
113    endpoint. In case of anycast tunnel endpoints, the
114    anycast IP address has to be used. If you do not specify
115    an address, it is automatically determined after receiving
116    the first data packet.
117
118 *-o, --remote-port <port>*::
119    The UDP port used for payload data by the remote host
120    (specified with -p on the remote host). If you do not specify
121    a port, it is automatically determined after receiving
122    the first data packet.
123
124 *-4, --ipv4-only*::
125    Resolv to IPv4 addresses only. The default is to resolv both
126    IPv4 and IPv6 addresses.
127
128 *-6, --ipv6-only*::
129    Resolv to IPv6 addresses only. The default is to resolv both
130    IPv4 and IPv6 addresses.
131
132 *-d, --dev <name>*::
133    device name +
134    By default, tapN is used for Ethernet tunnel interfaces,
135    and tunN for IP tunnels, respectively. This option can
136    be used to manually override these defaults.
137
138 *-t, --type <tun|tap>*::
139    device type +
140    Type of the tunnels to create. Use tap for Ethernet
141    tunnels, tun for IP tunnels.
142
143 *-n, --ifconfig <local>/<prefix>*::
144    The local IP address and prefix length. The remote tunnel endpoint
145    has to use a different IP address in the same subnet.
146
147    *<local>*;; the local IP address for the tun/tap device
148    *<prefix>*;; the prefix length of the network
149
150 *-x, --post-up-script <script>*::
151    This option instructs *uAnytun* to run this script after the interface 
152    is created. By default no script will be executed.
153
154 *-m, --mux <mux-id>*::
155    the multiplex id to use. default: 0
156
157 *-s, --sender-id  <sender id>*::
158    Each anycast tunnel endpoint needs a unique sender id
159    (1, 2, 3, ...). It is needed to distinguish the senders
160    in case of replay attacks. As *uAnytun* does not support 
161    synchronisation it can't be used as an anycast endpoint therefore 
162    this option is quite useless but implemented for compability 
163    reasons. default: 0
164
165 *-w, --window-size <window size>*::
166    seqence window size +
167    Sometimes, packets arrive out of order on the receiver
168    side. This option defines the size of a list of received
169    packets' sequence numbers. If, according to this list,
170    a received packet has been previously received or has
171    been transmitted in the past, and is therefore not in
172    the list anymore, this is interpreted as a replay attack
173    and the packet is dropped. A value of 0 deactivates this
174    list and, as a consequence, the replay protection employed
175    by filtering packets according to their secuence number.
176    By default the sequence window is disabled and therefore a
177    window size of 0 is used.
178
179 *-k, --kd--prf <kd-prf type>*::
180    key derivation pseudo random function +
181    The pseudo random function which is used for calculating the 
182    session keys and session salt. +
183    Possible values:
184
185    *null*;; no random function, keys and salt are set to 0..00
186    *aes-ctr*;; AES in counter mode with 128 Bits, default value
187    *aes-ctr-128*;; AES in counter mode with 128 Bits
188    *aes-ctr-192*;; AES in counter mode with 192 Bits
189    *aes-ctr-256*;; AES in counter mode with 256 Bits
190
191 *-e, --role <role>*::
192    SATP uses different session keys for inbound and outbound traffic. The
193    role parameter is used to determine which keys to use for outbound or
194    inbound packets. On both sides of a vpn connection different roles have 
195    to be used. Possible values are *left* and *right*. You may also use 
196    *alice* or *server* as a replacement for *left* and *bob* or *client* as 
197    a replacement for *right*. By default *left* is used.
198
199 *-E, --passphrase <pass phrase>*::
200    This passphrase is used to generate the master key and master salt.
201    For the master key the last n bits of the SHA256 digest of the 
202    passphrase (where n is the length of the master key in bits) is used. 
203    The master salt gets generated with the SHA1 digest. 
204    You may force a specific key and or salt by using *--key* and *--salt*.
205
206 *-K, --key <master key>*::
207    master key to use for key derivation +
208    Master key in hexadecimal notation, e.g.
209    01a2b3c4d5e6f708a9b0cadbecfd0fa1, with a mandatory length
210    of 32, 48 or 64 characters (128, 192 or 256 bits).
211
212 *-A, --salt <master salt>*::
213    master salt to use for key derivation +
214    Master salt in hexadecimal notation, e.g.
215    01a2b3c4d5e6f708a9b0cadbecfd, with a mandatory length
216    of 28 characters (14 bytes).
217
218 *-c, --cipher <cipher type>*::
219    payload encryption algorithm +
220    Encryption algorithm used for encrypting the payload +
221    Possible values:
222
223    *null*;; no encryption
224    *aes-ctr*;; AES in counter mode with 128 Bits, default value
225    *aes-ctr-128*;; AES in counter mode with 128 Bits
226    *aes-ctr-192*;; AES in counter mode with 192 Bits
227    *aes-ctr-256*;; AES in counter mode with 256 Bits
228
229 *-a, --auth-algo <algo type>*::
230    message authentication algorithm +
231    This option sets the message authentication algorithm. +
232    If HMAC-SHA1 is used, the packet length is increased. The additional bytes 
233    contain the authentication data. see *--auth-tag-length* for more info. +
234    Possible values:
235
236    *null*;; no message authentication
237    *sha1*;; HMAC-SHA1, default value
238
239 *-b, --auth-tag-length <length>*::
240    The number of bytes to use for the auth tag. This value defaults to 10 bytes 
241    unless the *null* auth algo is used in which case it defaults to 0. 
242
243
244 EXAMPLES
245 --------
246
247 P2P Setup between two unicast enpoints:
248 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
249
250 Host A:
251 ^^^^^^^
252
253 uanytun -r hostb.example.com -t tun -n 192.168.123.1/30 -c aes-ctr-256 -k aes-ctr-256 \
254         -E have_a_very_safe_and_productive_day -e left
255
256 Host B:
257 ^^^^^^^
258 uanytun -r hosta.example.com -t tun -n 192.168.123.2/30 -c aes-ctr-256 -k aes-ctr-256 \
259         -E have_a_very_safe_and_productive_day -e right
260
261 One unicast and one anycast tunnel endpoint:
262 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
263  
264 Unicast tunnel endpoint:
265 ^^^^^^^^^^^^^^^^^^^^^^^^
266
267 uanytun -r anycast.anytun.org -d anytun0 -t tun -n 192.0.2.2/30 -a null -c null -w 0 -e client
268
269 Anycast tunnel endpoints:
270 ^^^^^^^^^^^^^^^^^^^^^^^^^
271 As *uAnytun* can't work as an anycast endpoint it can't be used for this purpose. You
272 have to use *Anytun* for that job.
273
274
275 BUGS
276 ----
277 Most likely there are some bugs in *uAnytun*. If you find a bug, please let
278 the developers know at uanytun@anytun.org. Of course, patches are preferred.
279
280
281 AUTHORS
282 -------
283
284 Christian Pointner <equinox@anytun.org>
285
286
287 RESOURCES
288 ---------
289
290 Main web site: http://www.anytun.org/
291
292
293 COPYING
294 -------
295
296 Copyright \(C) 2008-2009 Christian Pointner. This  program is  free 
297 software: you can redistribute it and/or modify it under the terms 
298 of the GNU General Public License as published by the Free Software 
299 Foundation, either version 3 of the License, or any later version.