chiark / gitweb /
peerdb/peers.in.5.in: Fix formatting.
[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.\"
12.\" TrIPE is free software; you can redistribute it and/or modify
13.\" it under the terms of the GNU General Public License as published by
14.\" the Free Software Foundation; either version 2 of the License, or
15.\" (at your option) any later version.
16.\"
17.\" TrIPE is distributed in the hope that it will be useful,
18.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
19.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20.\" GNU General Public License for more details.
21.\"
22.\" You should have received a copy of the GNU General Public License
23.\" along with TrIPE; if not, write to the Free Software Foundation,
24.\" Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25.
26.\"--------------------------------------------------------------------------
27.so ../common/defs.man \"@@@PRE@@@
28.
29.\"--------------------------------------------------------------------------
30.TH connect 8 "8 January 2007" "Straylight/Edgeware" "TrIPE: Trivial IP Encryption"
31.
32.\"--------------------------------------------------------------------------
33.SH "NAME"
34.
35conntrack \- tripe service to start/stop peers depending on external connectivity
36.
37.\"--------------------------------------------------------------------------
38.SH "SYNOPSIS"
39.
40.B conntrack
41.RB [ \-a
42.IR socket ]
43.RB [ \-d
44.IR dir ]
45.RB [ \-f
46.IR file ]
47.br
48\& \c
49.RB [ \-\-daemon ]
50.RB [ \-\-debug ]
51.RB [ \-\-startup ]
52.
53.\"--------------------------------------------------------------------------
54.SH "DESCRIPTION"
55.
56The
57.B conntrack
58service watches D-Bus network management services like
59.BR NetworkManager (8)
60and Nokia's
61.BR ICd ,
62bringing peers up and down automatically. It's designed to be useful on
63a mobile device, such as a laptop; I expect servers to stay where
64they're put and be configured statically.
65.SS "Configuration"
66The
67.B conntrack
68service reads a configuration file, by default
69.BR conntrack.conf ,
70explaining which peers to bring up under which circumstances. The
71configuration file is automatically re-read if it's changed.
72.PP
73The
74configuration is split into sections, each describing a
75.IR "peer group" .
76A section begins with the peer group name in square brackets:
77.IP
78.BI [ group ]
79.PP
80The group name is entirely arbitrary, and affects nothing else. This is
81followed by peer definitions, each of which looks like this:
82.IP
83.I tag
84.B =
85.RI [ remote-addr ]
86.IB network / mask
87.PP
88This means that the peer
89.I tag
90should be selected if the host's current IP address is within the
91network indicated by
92.IB network / mask \fR.
93Here,
94.I network
95is an IP address in dotted-quad form, and
96.I mask
97is a netmask, either in dotted-quad form, or as a number of 1-bits.
98Only one peer in each group may be connected at any given time; if a
99change is needed, any existing peer in the group is killed before
100connecting the new one. If no match is found in a particular group,
101then no peers in the group are connected. Strange and unhelpful things
102will happen if you put the same peer in several different groups.
103.PP
104The notion of `current IP address' is somewhat vague. The
105.B conntrack
106service calculates it as the source address that the host would put on
107an IP packet sent to an arbitrarily chosen remote address. The default
108remote address is 1.2.3.4 (which is unlikely ever to be assigned); this
109should determine an IP address on the network interface closest to the
110default gateway. You can influence this process in two ways. Firstly,
111you can change the default remote address used by adding a line
112.IP
113.B "test-addr ="
114.I remote-addr
115.PP
116before the first peer group section. Secondly, you can specify a
117particular
118.I remote-addr
119to use when checking whether a particular peer is applicable.
120.PP
121The peer definitions can be in any order. They are checked
122most-specific first, and searching stops as soon as a match is found.
123Therefore a default definition can be added as
124.IP
125.I tag
126.B =
127.B 0/0
128.PP
129without fear of overriding any more specific definitions. For avoidance
130of doubt, one peer definition is
131.I more specific
132than another if either the former has a specified
133.I remote-addr
134and the latter has not, or the former is wholly contained within the
135latter. (Overlapping definitions are not recommended, and will be
136processed in an arbitrary order.)
137.PP
138Peers are connected using the
139.BR connect (8)
140service:
141.IP
142.B SVCSUBMIT connect active
143.I peer
144.SS "Command line"
145In addition to the standard options described in
146.BR tripe-service (7),
147the following command-line options are recognized.
148.TP
149.BI "\-f, \-\-config=" file
150Use
151.I file
152as the configuration file. In the absence of this option, the
153file named
154.B conntrack.conf
155in the current working directory is used instead.
156.
157.\"--------------------------------------------------------------------------
158.SH "SERVICE COMMAND REFERENCE"
159.
160.\"* 10 Service commands
161The commands provided by the service are as follows.
162.SP
163.BI "up " reason\fR...
164Informs the service that the network connection has been established:
165peer groups should be connected. The
166.I reason
167is quoted in the status notification.
168.SP
169.BI "down " reason\fR...
170Informs the service that the network connection has been lost:
171peer groups should be disconnected. The
172.I reason
173is quoted in the status notification.
174.
175.\"--------------------------------------------------------------------------
176.SH "NOTIFICATIONS"
177.
178.\"* 30 Notification broadcasts (NOTE codes)
179All notifications issued by
180.B conntrack
181begin with the tokens
182.BR "USER conntrack" .
183.SP
184.BI "USER conntrack " up \fR| down " " reason\fR...
185The network connection has apparently gone up or down, and
186.B conntrack
187is about to kill and/or connect peers accordingly. The
188.I reason
189is one of the following.
190.RS
191.TP
192.B "nm initially-connected"
193NetworkManager was detected on startup, and has an active network
194connection.
195.TP
196.B "nm initially-disconnected"
197NetworkManager was detected on startup, and has no active network
198connection.
199.TP
200.B "nm connected"
201NetworkManager has acquired an active network connection.
202.TP
203.B "nm disconnected"
204NetworkManager has lost its active network connection.
205.TP
206.B "nm default-connection-change"
207NetworkManager has changed its default route.
208.TP
209.BI "icd initially-connected " iap
210Maemo ICd was detected on startup, and has an active network connection
211identified by
212.IR iap .
213.TP
214.B "icd initially-disconnected"
215Maemo ICd was detected on startup, and has no active network connection.
216.TP
217.BI "icd connected " iap
218Maemo ICd has acquired an active network connection, identified by
219.IR iap .
220.TP
221.B "icd idle"
222Maemo ICd has lost its active network connection.
223.TP
224.B interval-timer
225A change was detected during
226.BR conntrack 's
227periodic status check. This usually means that the network connection
228was reconfigured manually without informing
229.BR conntrack .
230.TP
231.BI "manual " reason\fR...
232The connection status was changed manually, using the
233.B up
234or
235.B down
236service command.
237.RE
238.
239.\"--------------------------------------------------------------------------
240.SH "WARNINGS"
241.
242.\"* 40 Warning broadcasts (WARN codes)
243All warnings issued by
244.B conntrack
245begin with the tokens
246.BR "USER conntrack" .
247.SP
248.BI "USER conntrack config-file-error " exception " " error-text
249The configuration file is invalid. The
250.I exception
251token names a Python exception; the
252.I error-text
253describes the problem encountered, though it may not be very useful.
254.
255.\"--------------------------------------------------------------------------
256.SH "SUMMARY"
257.
258.\"= summary
259.
260.\"--------------------------------------------------------------------------
261.SH "SEE ALSO"
262.
263.BR tripe-service (7),
264.BR peers.in (5),
265.BR watch (8),
266.BR tripe (8).
267.
268.\"--------------------------------------------------------------------------
269.SH "AUTHOR"
270.
271Mark Wooding, <mdw@distorted.org.uk>
272.
273.\"----- That's all, folks --------------------------------------------------