Allow configuration variables to be added/removed using tincctl.
[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 start
72 Start
73 .Xr tincd 8 .
74 .It stop
75 Stop
76 .Xr tincd 8 .
77 .It restart
78 Restart
79 .Xr tincd 8 .
80 .It reload
81 Partially rereads configuration files. Connections to hosts whose host
82 config files are removed are closed. New outgoing connections specified
83 in
84 .Xr tinc.conf 5
85 will be made.
86 .It pid
87 Shows the PID of the currently running
88 .Xr tincd 8 .
89 .It generate-keys Op bits
90 Generate both RSA and ECDSA keypairs (see below) and exit.
91 .It generate-ecdsa-keys
92 Generate public/private ECDSA keypair and exit.
93 .It generate-rsa-keys Op bits
94 Generate public/private RSA keypair and exit.
95 If
96 .Ar bits
97 is omitted, the default length will be 2048 bits.
98 When saving keys to existing files, tinc will not delete the old keys;
99 you have to remove them manually.
100 .It dump nodes
101 Dump a list of all known nodes in the VPN.
102 .It dump edges
103 Dump a list of all known connections in the VPN.
104 .It dump subnets
105 Dump a list of all known subnets in the VPN.
106 .It dump connections
107 Dump a list of all meta connections with ourself.
108 .It dump graph
109 Dump a graph of the VPN in
110 .Xr dotty 1
111 format.
112 .It purge
113 Purges all information remembered about unreachable nodes.
114 .It debug Ar N
115 Sets debug level to
116 .Ar N .
117 .It log Op Ar N
118 Capture log messages from a running tinc daemon.
119 An optional debug level can be given that will be applied only for log messages sent to
120 .Nm tincctl .
121 .It retry
122 Forces
123 .Xr tincd 8
124 to try to connect to all uplinks immediately.
125 Usually
126 .Xr tincd 8
127 attempts to do this itself,
128 but increases the time it waits between the attempts each time it failed,
129 and if
130 .Xr tincd 8
131 didn't succeed to connect to an uplink the first time after it started,
132 it defaults to the maximum time of 15 minutes.
133 .It disconnect Ar NODE
134 Closes the meta connection with the given
135 .Ar NODE .
136 .It top
137 If
138 .Nm
139 is compiled with libcurses support, this will display live traffic statistics
140 for all the known nodes, similar to the UNIX
141 .Xr top 1
142 command.
143 See below for more information.
144 .It pcap
145 Dump VPN traffic going through the local tinc node in
146 .Xr pcap-savefile 5
147 format to standard output,
148 from where it can be redirected to a file or piped through a program that can parse it directly,
149 such as
150 .Xr tcpdump 8 .
151 .El
152 .Sh EXAMPLES
153 Examples of some commands:
154 .Bd -literal -offset indent
155 tincctl -n vpn dump graph | circo -Txlib
156 tincctl -n vpn pcap | tcpdump -r -
157 tincctl -n vpn top
158 .Pp
159 .Ed
160 Example of configuring tinc using
161 .Nm :
162 .Bd -literal -offset indent
163 tincctl -n vpn init foo
164 tincctl -n vpn config Subnet 192.168.1.0/24
165 tincctl -n vpn config bar.Address bar.example.com
166 tincctl -n vpn config ConnectTo bar
167 .Sh TOP
168 The top command connects to a running tinc daemon and repeatedly queries its per-node traffic counters.
169 It displays a list of all the known nodes in the left-most column,
170 and the amount of bytes and packets read from and sent to each node in the other columns.
171 By default, the information is updated every second.
172 The behaviour of the top command can be changed using the following keys:
173 .Bl -tag
174 .It Ic s
175 Change the interval between updates.
176 After pressing the
177 .Ic s
178 key, enter the desired interval in seconds, followed by enter.
179 Fractional seconds are honored.
180 Intervals lower than 0.1 seconds are not allowed.
181 .It Ic c
182 Toggle between displaying current traffic rates (in packets and bytes per second)
183 and cummulative traffic (total packets and bytes since the tinc daemon started).
184 .It Ic n
185 Sort the list of nodes by name.
186 .It Ic i
187 Sort the list of nodes by incoming amount of bytes.
188 .It Ic I
189 Sort the list of nodes by incoming amount of packets.
190 .It Ic o
191 Sort the list of nodes by outgoing amount of bytes.
192 .It Ic O
193 Sort the list of nodes by outgoing amount of packets.
194 .It Ic t
195 Sort the list of nodes by sum of incoming and outgoing amount of bytes.
196 .It Ic T
197 Sort the list of nodes by sum of incoming and outgoing amount of packets.
198 .It Ic b
199 Show amount of traffic in bytes.
200 .It Ic k
201 Show amount of traffic in kilobytes.
202 .It Ic M
203 Show amount of traffic in megabytes.
204 .It Ic G
205 Show amount of traffic in gigabytes.
206 .It Ic q
207 Quit.
208 .El
209 .Sh BUGS
210 If you find any bugs, report them to tinc@tinc-vpn.org.
211 .Sh SEE ALSO
212 .Xr tincd 8 ,
213 .Xr tinc.conf 5 ,
214 .Xr dotty 1 ,
215 .Xr pcap-savefile 7 ,
216 .Xr tcpdump 8 ,
217 .Xr top 1 ,
218 .Pa http://www.tinc-vpn.org/ ,
219 .Pa http://www.cabal.org/ .
220 .Pp
221 The full documentation for tinc is maintained as a Texinfo manual.
222 If the info and tinc programs are properly installed at your site,
223 the command
224 .Ic info tinc
225 should give you access to the complete manual.
226 .Pp
227 tinc comes with ABSOLUTELY NO WARRANTY.
228 This is free software, and you are welcome to redistribute it under certain conditions;
229 see the file COPYING for details.
230 .Sh AUTHORS
231 .An "Ivo Timmermans"
232 .An "Guus Sliepen" Aq guus@tinc-vpn.org
233 .Pp
234 And thanks to many others for their contributions to tinc!