chiark / gitweb /
server/admin.c: Remove spurious `ping' in usage message.
[tripe] / svc / conntrack.8.in
... / ...
CommitLineData
1.\" -*-nroff-*-
2.\".
3.\" Manual for the conntrack service
4.\"
5.\" (c) 2010 Straylight/Edgeware
6.\"
7.
8.\"----- Licensing notice ---------------------------------------------------
9.\"
10.\" This file is part of Trivial IP Encryption (TrIPE).
11.\"
12.\" TrIPE is free software: you can redistribute it and/or modify it under
13.\" the terms of the GNU General Public License as published by the Free
14.\" Software Foundation; either version 3 of the License, or (at your
15.\" option) any later version.
16.\"
17.\" TrIPE is distributed in the hope that it will be useful, but WITHOUT
18.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20.\" for more details.
21.\"
22.\" You should have received a copy of the GNU General Public License
23.\" along with TrIPE. If not, see <https://www.gnu.org/licenses/>.
24.
25.\"--------------------------------------------------------------------------
26.so ../common/defs.man \"@@@PRE@@@
27.
28.\"--------------------------------------------------------------------------
29.TH conntrack 8tripe "8 January 2007" "Straylight/Edgeware" "TrIPE: Trivial IP Encryption"
30.
31.\"--------------------------------------------------------------------------
32.SH "NAME"
33.
34conntrack \- tripe service to start/stop peers depending on external connectivity
35.
36.\"--------------------------------------------------------------------------
37.SH "SYNOPSIS"
38.
39.B conntrack
40.RB [ \-a
41.IR socket ]
42.RB [ \-d
43.IR dir ]
44.RB [ \-f
45.IR file ]
46.br
47\& \c
48.RB [ \-\-daemon ]
49.RB [ \-\-debug ]
50.RB [ \-\-startup ]
51.
52.\"--------------------------------------------------------------------------
53.SH "DESCRIPTION"
54.
55The
56.B conntrack
57service watches D-Bus network management services like
58.BR NetworkManager (8),
59.BR ConnMan
60.RB ( connmand (8)),
61and Nokia's
62.BR ICd ,
63bringing peers up and down automatically. It's designed to be useful on
64a mobile device, such as a laptop; I expect servers to stay where
65they're put and be configured statically.
66.SS "Configuration"
67The
68.B conntrack
69service reads a configuration file, by default
70.BR conntrack.conf ,
71explaining which peers to bring up under which circumstances. The
72configuration file is automatically re-read if it's changed.
73.PP
74The
75configuration is split into sections, each describing a
76.IR "peer group" .
77A section begins with the peer group name in square brackets:
78.IP
79.BI [ group ]
80.PP
81The group name is entirely arbitrary, and affects nothing else. This is
82followed by peer definitions, each of which looks like this:
83.IP
84.I tag
85.B =
86.RI [ remote-addr ]
87.IB network / mask
88\&...
89.PP
90This means that the peer
91.I tag
92should be selected if the host's current IP address is within one of the
93networks indicated by
94.IB network / mask \fR.
95Here, a
96.I network
97is an IPv4 or IPv6 address in dotted-quad form, and
98.I mask
99is a netmask, either in dotted-quad form (for IPv4), or as a prefix
100length (i.e., the number of initial 1-bits). Only one peer in each
101group may be connected at any given time; if a change is needed, any
102existing peer in the group is killed before connecting the new one. If
103no match is found in a particular group, then no peers in the group are
104connected. Strange and unhelpful things will happen if you put the same
105peer in several different groups.
106.PP
107The tags
108.B down
109and
110.BI down/ anything
111are special and mean that no peer from the group should be active. This
112is useful for detecting a `home' network, where a VPN is unnecessary
113(or, worse, break routing completely).
114.PP
115The notion of `current IP address' is somewhat vague. The
116.B conntrack
117service calculates it as the source address that the host would put on
118an IP packet sent to a particular remote address; note that this is
119entirely hypothetical, and no actual packets are transmitted. The
120default remote addresses are 1.2.3.4 (for IPv4, which is unlikely ever
121to be assigned), and 2001::1 (for IPv6); this should determine an IP
122address on the network interface closest to the default gateway. You
123can influence this process in two ways. Firstly, you can change the
124default remote address used by adding one or more lines
125.IP
126.B "test-addr ="
127.I remote-addr
128\&...
129.PP
130before the first peer group section. Secondly, you can specify a
131particular
132.I remote-addr
133to use when checking whether a particular peer is applicable.
134.PP
135The peer definitions in each group are checked in the order given, and
136searching stops as soon as a match is found. (In older versions of
137.BR conntrack ,
138definitions were processed according to a most-specific-first order, but
139that doesn't provide an ordering between IPv4 and IPv6 networks, which
140is important; so this has been changed.)
141.PP
142Peers are connected using the
143.BR connect (8)
144service:
145.IP
146.B SVCSUBMIT connect active
147.I peer
148.SS "Command line"
149In addition to the standard options described in
150.BR tripe-service (7),
151the following command-line options are recognized.
152.TP
153.BI "\-f, \-\-config=" file
154Use
155.I file
156as the configuration file. In the absence of this option, the
157file named
158.B conntrack.conf
159in the current working directory is used instead.
160.
161.\"--------------------------------------------------------------------------
162.SH "SERVICE COMMAND REFERENCE"
163.
164.\"* 10 Service commands
165The commands provided by the service are as follows.
166.SP
167.BI "up " reason\fR...
168Informs the service that the network connection has been established:
169peer groups should be connected. The
170.I reason
171is quoted in the status notification.
172.SP
173.BI "down " reason\fR...
174Informs the service that the network connection has been lost:
175peer groups should be disconnected. The
176.I reason
177is quoted in the status notification.
178.
179.\"--------------------------------------------------------------------------
180.SH "NOTIFICATIONS"
181.
182.\"* 30 Notification broadcasts (NOTE codes)
183All notifications issued by
184.B conntrack
185begin with the tokens
186.BR "USER conntrack" .
187.SP
188.BI "USER conntrack dbus-connection " status
189The service's connection to D-Bus has changed state. The
190.I status
191is one of the following.
192.RS
193.TP
194.B startup
195Initially trying to connect.
196.TP
197.B connected
198Successfully established a connection to the bus.
199.TP
200.B lost
201A connection has been lost.
202.TP
203.BI state= label
204The service's internal state machine is confused.
205.RE
206.SP
207.BI "USER conntrack " up \fR| down " " group = peer\fR... " " reason\fR...
208The network connection has apparently gone up or down, and
209.B conntrack
210is about to kill and/or connect peers accordingly: for each group, the
211selected peer is listed; if a group is not listed, then either the group
212is to be brought down, or no matching peer was found. The
213.I reason
214is one of the following.
215.RS
216.TP
217.BI "connman initially-" state
218ConnMan was detected on startup, and is in the given
219.I state
220\(en see below.
221.TP
222.BI "connman " state
223ConnMan has transitioned to
224.IR state .
225The possible states are:
226.B offline
227(the network is turned off by user request);
228.B idle
229(no network interfaces are active);
230.B ready
231(an interface is up but not fully configured); and
232.B online
233(an interface is up and configured).
234.TP
235.BI "icd connected " iap
236Maemo ICd has acquired an active network connection, identified by
237.IR iap .
238.TP
239.B "icd idle"
240Maemo ICd has lost its active network connection.
241.TP
242.BI "icd initially-connected " iap
243Maemo ICd was detected on startup, and has an active network connection
244identified by
245.IR iap .
246.TP
247.B "icd initially-disconnected"
248Maemo ICd was detected on startup, and has no active network connection.
249.TP
250.B interval-timer
251A change was detected during
252.BR conntrack 's
253periodic status check. This usually means that the network connection
254was reconfigured manually without informing
255.BR conntrack .
256.TP
257.BI "manual " reason\fR...
258The connection status was changed manually, using the
259.B up
260or
261.B down
262service command.
263.TP
264.B "nm connected"
265NetworkManager has acquired an active network connection.
266.TP
267.B "nm default-connection-change"
268NetworkManager has changed its default route.
269.TP
270.B "nm disconnected"
271NetworkManager has lost its active network connection.
272.TP
273.B "nm initially-connected"
274NetworkManager was detected on startup, and has an active network
275connection.
276.TP
277.B "nm initially-disconnected"
278NetworkManager was detected on startup, and has no active network
279connection.
280.RE
281.
282.\"--------------------------------------------------------------------------
283.SH "WARNINGS"
284.
285.\"* 40 Warning broadcasts (WARN codes)
286All warnings issued by
287.B conntrack
288begin with the tokens
289.BR "USER conntrack" .
290.SP
291.BI "USER conntrack config-file-error " exception " " error-text
292The configuration file is invalid. The
293.I exception
294token names a Python exception; the
295.I error-text
296describes the problem encountered, though it may not be very useful.
297.SP
298.BI "USER conntrack connect-failed " peer " " tokens\fR...
299An attempt to connect the named
300.I peer
301failed; the error message is given by the
302.IR tokens .
303.
304.\"--------------------------------------------------------------------------
305.SH "SUMMARY"
306.
307.\"= summary
308.
309.\"--------------------------------------------------------------------------
310.SH "SEE ALSO"
311.
312.BR tripe-service (7),
313.BR peers.in (5),
314.BR watch (8),
315.BR tripe (8).
316.
317.\"--------------------------------------------------------------------------
318.SH "AUTHOR"
319.
320Mark Wooding, <mdw@distorted.org.uk>
321.
322.\"----- That's all, folks --------------------------------------------------