Don't assume sa.sa_family is a short int.
[tinc] / doc / tinc.8.in
1 .Dd 2014-01-16
2 .Dt TINCCTL 8
3 .\" Manual page created by:
4 .\" Scott Lamb
5 .Sh NAME
6 .Nm tinc
7 .Nd tinc VPN control
8 .Sh SYNOPSIS
9 .Nm
10 .Op Fl cn
11 .Op Fl -config Ns = Ns Ar DIR
12 .Op Fl -net Ns = Ns Ar NETNAME
13 .Op Fl -pidfile Ns = Ns Ar FILENAME
14 .Op Fl -force
15 .Op Fl -help
16 .Op Fl -version
17 .Op Ar COMMAND
18 .Sh DESCRIPTION
19 This is the control program of tinc, a secure virtual private network (VPN)
20 project.
21 .Nm
22 can start and stop
23 .Xr tincd 8 ,
24 and can to alter and inspect the state of a running VPN.
25 It can also be used to change the configuration,
26 or to import or export host configuration files from other nodes.
27
28 If
29 .Nm
30 is started with a
31 .Ar COMMAND ,
32 this command is immediately executed, after which
33 .Nm
34 exits.
35 If no
36 .Ar COMMAND
37 is given,
38 .Nm
39 will act as a shell;
40 it will display a prompt, and commands can be entered on the prompt.
41 If
42 .Nm
43 is compiled with libreadline, history and command completion are available on the prompt.
44 One can also pipe a script containing commands through
45 .Nm .
46 In that case, lines starting with a # symbol will be ignored.
47 .Sh OPTIONS
48 .Bl -tag -width indent
49 .It Fl n, -net Ns = Ns Ar NETNAME
50 Communicate with tincd(8) connected with
51 .Ar NETNAME .
52 .It Fl -pidfile Ns = Ns Ar FILENAME
53 Use the cookie from
54 .Ar FILENAME
55 to authenticate with a running tinc daemon.
56 If unspecified, the default is
57 .Pa @localstatedir@/run/tinc. Ns Ar NETNAME Ns Pa .pid.
58 .It Fl -force
59 Force some commands to work despite warnings.
60 .It Fl -help
61 Display short list of options.
62 .It Fl -version
63 Output version information and exit.
64 .El
65 .Sh ENVIRONMENT VARIABLES
66 .Bl -tag -width indent
67 .It Ev NETNAME
68 If no netname is specified on the command line with the
69 .Fl n
70 option, the value of this environment variable is used.
71 .El
72 .Sh COMMANDS
73 .Bl -tag -width indent
74 .It init Op Ar name
75 Create initial configuration files and RSA and Ed25519 keypairs with default length.
76 If no
77 .Ar name
78 for this node is given, it will be asked for.
79 .It get Ar variable
80 Print the current value of configuration variable
81 .Ar variable .
82 If more than one variable with the same name exists,
83 the value of each of them will be printed on a separate line.
84 .It set Ar variable Ar value
85 Set configuration variable
86 .Ar variable
87 to the given
88 .Ar value .
89 All previously existing configuration variables with the same name are removed.
90 To set a variable for a specific host, use the notation
91 .Ar host Ns Li . Ns Ar variable .
92 .It add Ar variable Ar value
93 As above, but without removing any previously existing configuration variables.
94 If the variable already exists with the given value, nothing happens.
95 .It del Ar variable Op Ar value
96 Remove configuration variables with the same name and
97 .Ar value .
98 If no
99 .Ar value
100 is given, all configuration variables with the same name will be removed.
101 .It edit Ar filename
102 Start an editor for the given configuration file.
103 You do not need to specify the full path to the file.
104 .It export
105 Export the host configuration file of the local node to standard output.
106 .It export-all
107 Export all host configuration files to standard output.
108 .It import
109 Import host configuration data generated by the
110 .Nm
111 export command from standard input.
112 Already existing host configuration files are not overwritten unless the option
113 .Fl -force
114 is used.
115 .It exchange
116 The same as export followed by import.
117 .It exchange-all
118 The same as export-all followed by import.
119 .It invite Ar name
120 Prepares an invitation for a new node with the given
121 .Ar name ,
122 and prints a short invitation URL that can be used with the join command.
123 .It join Op Ar URL
124 Join an existing VPN using an invitation URL created using the invite command.
125 If no
126 .Ar URL
127 is given, it will be read from standard input.
128 .It start Op tincd options
129 Start
130 .Xr tincd 8 ,
131 optionally with the given extra options.
132 .It stop
133 Stop
134 .Xr tincd 8 .
135 .It restart Op tincd options
136 Restart
137 .Xr tincd 8 ,
138 optionally with the given extra options.
139 .It reload
140 Partially rereads configuration files. Connections to hosts whose host
141 config files are removed are closed. New outgoing connections specified
142 in
143 .Xr tinc.conf 5
144 will be made.
145 .It pid
146 Shows the PID of the currently running
147 .Xr tincd 8 .
148 .It generate-keys Op bits
149 Generate both RSA and Ed25519 keypairs (see below) and exit.
150 .It generate-ed25519-keys
151 Generate public/private Ed25519 keypair and exit.
152 .It generate-rsa-keys Op bits
153 Generate public/private RSA keypair and exit.
154 If
155 .Ar bits
156 is omitted, the default length will be 2048 bits.
157 When saving keys to existing files, tinc will not delete the old keys;
158 you have to remove them manually.
159 .It dump [reachable] nodes
160 Dump a list of all known nodes in the VPN.
161 If the keyword reachable is used, only lists reachable nodes.
162 .It dump edges
163 Dump a list of all known connections in the VPN.
164 .It dump subnets
165 Dump a list of all known subnets in the VPN.
166 .It dump connections
167 Dump a list of all meta connections with ourself.
168 .It dump graph | digraph
169 Dump a graph of the VPN in
170 .Xr dotty 1
171 format.
172 Nodes are colored according to their reachability:
173 red nodes are unreachable, orange nodes are indirectly reachable, green nodes are directly reachable.
174 Black nodes are either directly or indirectly reachable, but direct reachability has not been tried yet.
175 .It dump invitations
176 Dump a list of outstanding invitations.
177 The filename of the invitation, as well as the name of the node that is being invited is shown for each invitation.
178 .It info Ar node | subnet | address
179 Show information about a particular node, subnet or address.
180 If an address is given, any matching subnet will be shown.
181 .It purge
182 Purges all information remembered about unreachable nodes.
183 .It debug Ar N
184 Sets debug level to
185 .Ar N .
186 .It log Op Ar N
187 Capture log messages from a running tinc daemon.
188 An optional debug level can be given that will be applied only for log messages sent to
189 .Nm tinc .
190 .It retry
191 Forces
192 .Xr tincd 8
193 to try to connect to all uplinks immediately.
194 Usually
195 .Xr tincd 8
196 attempts to do this itself,
197 but increases the time it waits between the attempts each time it failed,
198 and if
199 .Xr tincd 8
200 didn't succeed to connect to an uplink the first time after it started,
201 it defaults to the maximum time of 15 minutes.
202 .It disconnect Ar NODE
203 Closes the meta connection with the given
204 .Ar NODE .
205 .It top
206 If
207 .Nm
208 is compiled with libcurses support, this will display live traffic statistics
209 for all the known nodes, similar to the UNIX
210 .Xr top 1
211 command.
212 See below for more information.
213 .It pcap
214 Dump VPN traffic going through the local tinc node in
215 .Xr pcap-savefile 5
216 format to standard output,
217 from where it can be redirected to a file or piped through a program that can parse it directly,
218 such as
219 .Xr tcpdump 8 .
220 .It network Op Ar netname
221 If
222 .Ar netname
223 is given, switch to that network.
224 Otherwise, display a list of all networks for which configuration files exist.
225 .It fsck
226 This will check the configuration files for possible problems,
227 such as unsafe file permissions, missing executable bit on script,
228 unknown and obsolete configuration variables, wrong public and/or private keys, and so on.
229 .Pp
230 When problems are found, this will be printed on a line with WARNING or ERROR in front of it.
231 Most problems must be corrected by the user itself, however in some cases (like file permissions and missing public keys),
232 tinc will ask if it should fix the problem.
233 .It sign Op Ar filename
234 Sign a file with the local node's private key.
235 If no
236 .Ar filename
237 is given, the file is read from standard input.
238 The signed file is written to standard output.
239 .It verify Ar name Op Ar filename
240 Check the signature of a file against a node's public key.
241 The
242 .Ar name
243 of the node must be given,
244 or can be
245 .Li .
246 to check against the local node's public key, or
247 .Li *
248 to allow a signature from any node whose public key is known.
249 If no
250 .Ar filename
251 is given, the file is read from standard input.
252 If the verification is succesful,
253 a copy of the input with the signature removed is written to standard output,
254 and the exit code will be zero.
255 If the verification failed,
256 nothing will be written to standard output, and the exit code will be non-zero.
257 .El
258 .Sh EXAMPLES
259 Examples of some commands:
260 .Bd -literal -offset indent
261 tinc -n vpn dump graph | circo -Txlib
262 tinc -n vpn pcap | tcpdump -r -
263 tinc -n vpn top
264 .Pp
265 .Ed
266 Examples of changing the configuration using
267 .Nm :
268 .Bd -literal -offset indent
269 tinc -n vpn init foo
270 tinc -n vpn add Subnet 192.168.1.0/24
271 tinc -n vpn add bar.Address bar.example.com
272 tinc -n vpn add ConnectTo bar
273 tinc -n vpn export | gpg --clearsign | mail -s "My config" vpnmaster@example.com
274 .Ed
275 .Sh TOP
276 The top command connects to a running tinc daemon and repeatedly queries its per-node traffic counters.
277 It displays a list of all the known nodes in the left-most column,
278 and the amount of bytes and packets read from and sent to each node in the other columns.
279 By default, the information is updated every second.
280 The behaviour of the top command can be changed using the following keys:
281 .Bl -tag
282 .It Ic s
283 Change the interval between updates.
284 After pressing the
285 .Ic s
286 key, enter the desired interval in seconds, followed by enter.
287 Fractional seconds are honored.
288 Intervals lower than 0.1 seconds are not allowed.
289 .It Ic c
290 Toggle between displaying current traffic rates (in packets and bytes per second)
291 and cumulative traffic (total packets and bytes since the tinc daemon started).
292 .It Ic n
293 Sort the list of nodes by name.
294 .It Ic i
295 Sort the list of nodes by incoming amount of bytes.
296 .It Ic I
297 Sort the list of nodes by incoming amount of packets.
298 .It Ic o
299 Sort the list of nodes by outgoing amount of bytes.
300 .It Ic O
301 Sort the list of nodes by outgoing amount of packets.
302 .It Ic t
303 Sort the list of nodes by sum of incoming and outgoing amount of bytes.
304 .It Ic T
305 Sort the list of nodes by sum of incoming and outgoing amount of packets.
306 .It Ic b
307 Show amount of traffic in bytes.
308 .It Ic k
309 Show amount of traffic in kilobytes.
310 .It Ic M
311 Show amount of traffic in megabytes.
312 .It Ic G
313 Show amount of traffic in gigabytes.
314 .It Ic q
315 Quit.
316 .El
317 .Sh BUGS
318 If you find any bugs, report them to tinc@tinc-vpn.org.
319 .Sh SEE ALSO
320 .Xr tincd 8 ,
321 .Xr tinc.conf 5 ,
322 .Xr dotty 1 ,
323 .Xr pcap-savefile 5 ,
324 .Xr tcpdump 8 ,
325 .Xr top 1 ,
326 .Pa http://www.tinc-vpn.org/ ,
327 .Pa http://www.cabal.org/ .
328 .Pp
329 The full documentation for tinc is maintained as a Texinfo manual.
330 If the info and tinc programs are properly installed at your site,
331 the command
332 .Ic info tinc
333 should give you access to the complete manual.
334 .Pp
335 tinc comes with ABSOLUTELY NO WARRANTY.
336 This is free software, and you are welcome to redistribute it under certain conditions;
337 see the file COPYING for details.
338 .Sh AUTHORS
339 .An "Ivo Timmermans"
340 .An "Guus Sliepen" Aq guus@tinc-vpn.org
341 .Pp
342 And thanks to many others for their contributions to tinc!