Add an easy way to export and import host configuration files.
[tinc] / doc / tincctl.8.in
1 .Dd 2011-06-25
2 .Dt TINCCTL 8
3 .\" Manual page created by:
4 .\" Scott Lamb
5 .Sh NAME
6 .Nm tincctl
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 -help
15 .Op Fl -version
16 .Ar COMMAND
17 .Sh DESCRIPTION
18 This is the control program of tinc, a secure virtual private network (VPN)
19 project.
20 .Nm
21 communicates with
22 .Xr tincd 8
23 to alter and inspect the running VPN's state.
24 .Sh OPTIONS
25 .Bl -tag -width indent
26 .It Fl n, -net Ns = Ns Ar NETNAME
27 Communicate with tincd(8) connected with
28 .Ar NETNAME .
29 .It Fl -pidfile Ns = Ns Ar FILENAME
30 Use the cookie from
31 .Ar FILENAME
32 to authenticate with a running tinc daemon.
33 If unspecified, the default is
34 .Pa @localstatedir@/run/tinc. Ns Ar NETNAME Ns Pa .pid.
35 .It Fl -help
36 Display short list of options.
37 .It Fl -version
38 Output version information and exit.
39 .El
40 .Sh ENVIRONMENT VARIABLES
41 .Bl -tag -width indent
42 .It Ev NETNAME
43 If no netname is specified on the command line with the
44 .Fl n
45 option, the value of this environment variable is used.
46 .El
47 .Sh COMMANDS
48 .zZ
49 .Bl -tag -width indent
50 .It init Op Ar name
51 Create initial configuration files and RSA and ECDSA keypairs with default length.
52 If no
53 .Ar name
54 for this node is given, it will be asked for.
55 .It config Oo set Oc Ar variable Ar value
56 Set configuration variable
57 .Ar variable
58 to the given
59 .Ar value .
60 All previously existing configuration variables with the same name are removed.
61 To set a variable for a specific host, use the notation
62 .Ar host Ns Li . Ns Ar variable .
63 .It config add Ar variable Ar value
64 As above, but without removing any previously existing configuration variables.
65 .It config del Ar variable Op Ar value
66 Remove configuration variables with the same name and
67 .Ar value .
68 If no
69 .Ar value
70 is given, all configuration variables with the same name will be removed.
71 .It edit Ar filename
72 Start an editor for the given configuration file.
73 You do not need to specify the full path to the file.
74 .It export
75 Export the host configuration file of the local node to standard output.
76 .It export-all
77 Export all host configuration files to standard output.
78 .It import Op Fl -force
79 Import host configuration file(s) from standard input.
80 Already existing host configuration files are not overwritten unless the option
81 .Fl -force
82 is used.
83 .It start Op tincd options
84 Start
85 .Xr tincd 8 ,
86 optionally with the given extra options.
87 .It stop
88 Stop
89 .Xr tincd 8 .
90 .It restart
91 Restart
92 .Xr tincd 8 .
93 .It reload
94 Partially rereads configuration files. Connections to hosts whose host
95 config files are removed are closed. New outgoing connections specified
96 in
97 .Xr tinc.conf 5
98 will be made.
99 .It pid
100 Shows the PID of the currently running
101 .Xr tincd 8 .
102 .It generate-keys Op bits
103 Generate both RSA and ECDSA keypairs (see below) and exit.
104 .It generate-ecdsa-keys
105 Generate public/private ECDSA keypair and exit.
106 .It generate-rsa-keys Op bits
107 Generate public/private RSA keypair and exit.
108 If
109 .Ar bits
110 is omitted, the default length will be 2048 bits.
111 When saving keys to existing files, tinc will not delete the old keys;
112 you have to remove them manually.
113
114 .It dump nodes
115 Dump a list of all known nodes in the VPN.
116 .It dump edges
117 Dump a list of all known connections in the VPN.
118 .It dump subnets
119 Dump a list of all known subnets in the VPN.
120 .It dump connections
121 Dump a list of all meta connections with ourself.
122 .It dump graph
123 Dump a graph of the VPN in
124 .Xr dotty 1
125 format.
126 .It info Ar node | subnet | address
127 Show information about a particular node, subnet or address.
128 If an address is given, any matching subnet will be shown.
129 .It purge
130 Purges all information remembered about unreachable nodes.
131 .It debug Ar N
132 Sets debug level to
133 .Ar N .
134 .It log Op Ar N
135 Capture log messages from a running tinc daemon.
136 An optional debug level can be given that will be applied only for log messages sent to
137 .Nm tincctl .
138 .It retry
139 Forces
140 .Xr tincd 8
141 to try to connect to all uplinks immediately.
142 Usually
143 .Xr tincd 8
144 attempts to do this itself,
145 but increases the time it waits between the attempts each time it failed,
146 and if
147 .Xr tincd 8
148 didn't succeed to connect to an uplink the first time after it started,
149 it defaults to the maximum time of 15 minutes.
150 .It disconnect Ar NODE
151 Closes the meta connection with the given
152 .Ar NODE .
153 .It top
154 If
155 .Nm
156 is compiled with libcurses support, this will display live traffic statistics
157 for all the known nodes, similar to the UNIX
158 .Xr top 1
159 command.
160 See below for more information.
161 .It pcap
162 Dump VPN traffic going through the local tinc node in
163 .Xr pcap-savefile 5
164 format to standard output,
165 from where it can be redirected to a file or piped through a program that can parse it directly,
166 such as
167 .Xr tcpdump 8 .
168 .El
169 .Sh EXAMPLES
170 Examples of some commands:
171 .Bd -literal -offset indent
172 tincctl -n vpn dump graph | circo -Txlib
173 tincctl -n vpn pcap | tcpdump -r -
174 tincctl -n vpn top
175 .Pp
176 .Ed
177 Example of configuring tinc using
178 .Nm :
179 .Bd -literal -offset indent
180 tincctl -n vpn init foo
181 tincctl -n vpn config Subnet 192.168.1.0/24
182 tincctl -n vpn config bar.Address bar.example.com
183 tincctl -n vpn config ConnectTo bar
184 tincctl -n vpn export | gpg --clearsign | mail -s "My config" vpnmaster@example.com
185 .Sh TOP
186 The top command connects to a running tinc daemon and repeatedly queries its per-node traffic counters.
187 It displays a list of all the known nodes in the left-most column,
188 and the amount of bytes and packets read from and sent to each node in the other columns.
189 By default, the information is updated every second.
190 The behaviour of the top command can be changed using the following keys:
191 .Bl -tag
192 .It Ic s
193 Change the interval between updates.
194 After pressing the
195 .Ic s
196 key, enter the desired interval in seconds, followed by enter.
197 Fractional seconds are honored.
198 Intervals lower than 0.1 seconds are not allowed.
199 .It Ic c
200 Toggle between displaying current traffic rates (in packets and bytes per second)
201 and cummulative traffic (total packets and bytes since the tinc daemon started).
202 .It Ic n
203 Sort the list of nodes by name.
204 .It Ic i
205 Sort the list of nodes by incoming amount of bytes.
206 .It Ic I
207 Sort the list of nodes by incoming amount of packets.
208 .It Ic o
209 Sort the list of nodes by outgoing amount of bytes.
210 .It Ic O
211 Sort the list of nodes by outgoing amount of packets.
212 .It Ic t
213 Sort the list of nodes by sum of incoming and outgoing amount of bytes.
214 .It Ic T
215 Sort the list of nodes by sum of incoming and outgoing amount of packets.
216 .It Ic b
217 Show amount of traffic in bytes.
218 .It Ic k
219 Show amount of traffic in kilobytes.
220 .It Ic M
221 Show amount of traffic in megabytes.
222 .It Ic G
223 Show amount of traffic in gigabytes.
224 .It Ic q
225 Quit.
226 .El
227 .Sh BUGS
228 If you find any bugs, report them to tinc@tinc-vpn.org.
229 .Sh SEE ALSO
230 .Xr tincd 8 ,
231 .Xr tinc.conf 5 ,
232 .Xr dotty 1 ,
233 .Xr pcap-savefile 7 ,
234 .Xr tcpdump 8 ,
235 .Xr top 1 ,
236 .Pa http://www.tinc-vpn.org/ ,
237 .Pa http://www.cabal.org/ .
238 .Pp
239 The full documentation for tinc is maintained as a Texinfo manual.
240 If the info and tinc programs are properly installed at your site,
241 the command
242 .Ic info tinc
243 should give you access to the complete manual.
244 .Pp
245 tinc comes with ABSOLUTELY NO WARRANTY.
246 This is free software, and you are welcome to redistribute it under certain conditions;
247 see the file COPYING for details.
248 .Sh AUTHORS
249 .An "Ivo Timmermans"
250 .An "Guus Sliepen" Aq guus@tinc-vpn.org
251 .Pp
252 And thanks to many others for their contributions to tinc!