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