svc/connect.in (Pinger.kill): Don't assume the peer exists.
[tripe] / svc / conntrack.8.in
CommitLineData
2ec90437
MW
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.\"
11ad66c2
MW
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.
2ec90437 16.\"
11ad66c2
MW
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.
2ec90437
MW
21.\"
22.\" You should have received a copy of the GNU General Public License
11ad66c2 23.\" along with TrIPE. If not, see <https://www.gnu.org/licenses/>.
2ec90437
MW
24.
25.\"--------------------------------------------------------------------------
26.so ../common/defs.man \"@@@PRE@@@
27.
28.\"--------------------------------------------------------------------------
0647ba7c 29.TH conntrack 8tripe "8 January 2007" "Straylight/Edgeware" "TrIPE: Trivial IP Encryption"
2ec90437
MW
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)
59and Nokia's
60.BR ICd ,
61bringing peers up and down automatically. It's designed to be useful on
62a mobile device, such as a laptop; I expect servers to stay where
63they're put and be configured statically.
64.SS "Configuration"
65The
66.B conntrack
67service reads a configuration file, by default
68.BR conntrack.conf ,
69explaining which peers to bring up under which circumstances. The
70configuration file is automatically re-read if it's changed.
71.PP
72The
73configuration is split into sections, each describing a
74.IR "peer group" .
75A section begins with the peer group name in square brackets:
76.IP
77.BI [ group ]
78.PP
79The group name is entirely arbitrary, and affects nothing else. This is
80followed by peer definitions, each of which looks like this:
81.IP
82.I tag
83.B =
84.RI [ remote-addr ]
85.IB network / mask
86.PP
87This means that the peer
88.I tag
89should be selected if the host's current IP address is within the
90network indicated by
91.IB network / mask \fR.
92Here,
93.I network
94is an IP address in dotted-quad form, and
95.I mask
96is a netmask, either in dotted-quad form, or as a number of 1-bits.
97Only one peer in each group may be connected at any given time; if a
98change is needed, any existing peer in the group is killed before
99connecting the new one. If no match is found in a particular group,
100then no peers in the group are connected. Strange and unhelpful things
101will happen if you put the same peer in several different groups.
102.PP
f2bdb96e
MW
103The tags
104.B down
105and
106.BI down/ anything
107are special and mean that no peer from the group should be active. This
108is useful for detecting a `home' network, where a VPN is unnecessary
109(or, worse, break routing completely).
110.PP
2ec90437
MW
111The notion of `current IP address' is somewhat vague. The
112.B conntrack
113service calculates it as the source address that the host would put on
114an IP packet sent to an arbitrarily chosen remote address. The default
115remote address is 1.2.3.4 (which is unlikely ever to be assigned); this
116should determine an IP address on the network interface closest to the
117default gateway. You can influence this process in two ways. Firstly,
118you can change the default remote address used by adding a line
119.IP
120.B "test-addr ="
121.I remote-addr
122.PP
123before the first peer group section. Secondly, you can specify a
124particular
125.I remote-addr
126to use when checking whether a particular peer is applicable.
127.PP
128The peer definitions can be in any order. They are checked
129most-specific first, and searching stops as soon as a match is found.
130Therefore a default definition can be added as
131.IP
132.I tag
133.B =
134.B 0/0
135.PP
136without fear of overriding any more specific definitions. For avoidance
137of doubt, one peer definition is
138.I more specific
139than another if either the former has a specified
140.I remote-addr
141and the latter has not, or the former is wholly contained within the
142latter. (Overlapping definitions are not recommended, and will be
143processed in an arbitrary order.)
144.PP
145Peers are connected using the
146.BR connect (8)
147service:
148.IP
149.B SVCSUBMIT connect active
150.I peer
151.SS "Command line"
152In addition to the standard options described in
153.BR tripe-service (7),
154the following command-line options are recognized.
155.TP
156.BI "\-f, \-\-config=" file
157Use
158.I file
159as the configuration file. In the absence of this option, the
160file named
161.B conntrack.conf
162in the current working directory is used instead.
163.
164.\"--------------------------------------------------------------------------
165.SH "SERVICE COMMAND REFERENCE"
166.
167.\"* 10 Service commands
168The commands provided by the service are as follows.
169.SP
170.BI "up " reason\fR...
171Informs the service that the network connection has been established:
172peer groups should be connected. The
173.I reason
174is quoted in the status notification.
175.SP
176.BI "down " reason\fR...
177Informs the service that the network connection has been lost:
178peer groups should be disconnected. The
179.I reason
180is quoted in the status notification.
181.
182.\"--------------------------------------------------------------------------
183.SH "NOTIFICATIONS"
184.
185.\"* 30 Notification broadcasts (NOTE codes)
186All notifications issued by
187.B conntrack
188begin with the tokens
189.BR "USER conntrack" .
190.SP
75d9c6fd
MW
191.BI "USER conntrack dbus-connection " status
192The service's connection to D-Bus has changed state. The
193.I status
194is one of the following.
195.RS
196.TP
197.B startup
198Initially trying to connect.
199.TP
200.B connected
201Successfully established a connection to the bus.
202.TP
203.B lost
204A connection has been lost.
205.TP
206.BI state= label
207The service's internal state machine is confused.
56d0fa7e 208.RE
75d9c6fd 209.SP
2d4998c4 210.BI "USER conntrack " up \fR| down " " group = peer\fR... " " reason\fR...
2ec90437
MW
211The network connection has apparently gone up or down, and
212.B conntrack
2d4998c4
MW
213is about to kill and/or connect peers accordingly: for each group, the
214selected peer is listed; if a group is not listed, then either the group
215is to be brought down, or no matching peer was found. The
2ec90437
MW
216.I reason
217is one of the following.
218.RS
219.TP
220.B "nm initially-connected"
221NetworkManager was detected on startup, and has an active network
222connection.
223.TP
224.B "nm initially-disconnected"
225NetworkManager was detected on startup, and has no active network
226connection.
227.TP
228.B "nm connected"
229NetworkManager has acquired an active network connection.
230.TP
231.B "nm disconnected"
232NetworkManager has lost its active network connection.
233.TP
234.B "nm default-connection-change"
235NetworkManager has changed its default route.
236.TP
237.BI "icd initially-connected " iap
238Maemo ICd was detected on startup, and has an active network connection
239identified by
240.IR iap .
241.TP
242.B "icd initially-disconnected"
243Maemo ICd was detected on startup, and has no active network connection.
244.TP
245.BI "icd connected " iap
246Maemo ICd has acquired an active network connection, identified by
247.IR iap .
248.TP
249.B "icd idle"
250Maemo ICd has lost its active network connection.
251.TP
252.B interval-timer
253A change was detected during
254.BR conntrack 's
255periodic status check. This usually means that the network connection
256was reconfigured manually without informing
257.BR conntrack .
258.TP
259.BI "manual " reason\fR...
260The connection status was changed manually, using the
261.B up
262or
263.B down
264service command.
265.RE
266.
267.\"--------------------------------------------------------------------------
268.SH "WARNINGS"
269.
270.\"* 40 Warning broadcasts (WARN codes)
271All warnings issued by
272.B conntrack
273begin with the tokens
274.BR "USER conntrack" .
275.SP
276.BI "USER conntrack config-file-error " exception " " error-text
277The configuration file is invalid. The
278.I exception
279token names a Python exception; the
280.I error-text
281describes the problem encountered, though it may not be very useful.
cf2e4ea6
MW
282.SP
283.BI "USER conntrack connect-failed " peer " " tokens\fR...
284An attempt to connect the named
285.I peer
286failed; the error message is given by the
287.IR tokens .
2ec90437
MW
288.
289.\"--------------------------------------------------------------------------
290.SH "SUMMARY"
291.
292.\"= summary
293.
294.\"--------------------------------------------------------------------------
295.SH "SEE ALSO"
296.
297.BR tripe-service (7),
298.BR peers.in (5),
299.BR watch (8),
300.BR tripe (8).
301.
302.\"--------------------------------------------------------------------------
303.SH "AUTHOR"
304.
305Mark Wooding, <mdw@distorted.org.uk>
306.
307.\"----- That's all, folks --------------------------------------------------