3 .\" Manual for the conntrack service
5 .\" (c) 2010 Straylight/Edgeware
8 .\"----- Licensing notice ---------------------------------------------------
10 .\" This file is part of Trivial IP Encryption (TrIPE).
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.
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
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/>.
25 .\"--------------------------------------------------------------------------
26 .so ../common/defs.man \"@@@PRE@@@
28 .\"--------------------------------------------------------------------------
29 .TH conntrack 8tripe "8 January 2007" "Straylight/Edgeware" "TrIPE: Trivial IP Encryption"
31 .\"--------------------------------------------------------------------------
34 conntrack \- tripe service to start/stop peers depending on external connectivity
36 .\"--------------------------------------------------------------------------
52 .\"--------------------------------------------------------------------------
57 service watches D-Bus network management services like
58 .BR NetworkManager (8)
61 bringing peers up and down automatically. It's designed to be useful on
62 a mobile device, such as a laptop; I expect servers to stay where
63 they're put and be configured statically.
67 service reads a configuration file, by default
69 explaining which peers to bring up under which circumstances. The
70 configuration file is automatically re-read if it's changed.
73 configuration is split into sections, each describing a
75 A section begins with the peer group name in square brackets:
79 The group name is entirely arbitrary, and affects nothing else. This is
80 followed by peer definitions, each of which looks like this:
87 This means that the peer
89 should be selected if the host's current IP address is within the
91 .IB network / mask \fR.
94 is an IP address in dotted-quad form, and
96 is a netmask, either in dotted-quad form, or as a number of 1-bits.
97 Only one peer in each group may be connected at any given time; if a
98 change is needed, any existing peer in the group is killed before
99 connecting the new one. If no match is found in a particular group,
100 then no peers in the group are connected. Strange and unhelpful things
101 will happen if you put the same peer in several different groups.
107 are special and mean that no peer from the group should be active. This
108 is useful for detecting a `home' network, where a VPN is unnecessary
109 (or, worse, break routing completely).
111 The notion of `current IP address' is somewhat vague. The
113 service calculates it as the source address that the host would put on
114 an IP packet sent to an arbitrarily chosen remote address. The default
115 remote address is 1.2.3.4 (which is unlikely ever to be assigned); this
116 should determine an IP address on the network interface closest to the
117 default gateway. You can influence this process in two ways. Firstly,
118 you can change the default remote address used by adding a line
123 before the first peer group section. Secondly, you can specify a
126 to use when checking whether a particular peer is applicable.
128 The peer definitions can be in any order. They are checked
129 most-specific first, and searching stops as soon as a match is found.
130 Therefore a default definition can be added as
136 without fear of overriding any more specific definitions. For avoidance
137 of doubt, one peer definition is
139 than another if either the former has a specified
141 and the latter has not, or the former is wholly contained within the
142 latter. (Overlapping definitions are not recommended, and will be
143 processed in an arbitrary order.)
145 Peers are connected using the
149 .B SVCSUBMIT connect active
152 In addition to the standard options described in
153 .BR tripe-service (7),
154 the following command-line options are recognized.
156 .BI "\-f, \-\-config=" file
159 as the configuration file. In the absence of this option, the
162 in the current working directory is used instead.
164 .\"--------------------------------------------------------------------------
165 .SH "SERVICE COMMAND REFERENCE"
167 .\"* 10 Service commands
168 The commands provided by the service are as follows.
170 .BI "up " reason\fR...
171 Informs the service that the network connection has been established:
172 peer groups should be connected. The
174 is quoted in the status notification.
176 .BI "down " reason\fR...
177 Informs the service that the network connection has been lost:
178 peer groups should be disconnected. The
180 is quoted in the status notification.
182 .\"--------------------------------------------------------------------------
185 .\"* 30 Notification broadcasts (NOTE codes)
186 All notifications issued by
188 begin with the tokens
189 .BR "USER conntrack" .
191 .BI "USER conntrack dbus-connection " status
192 The service's connection to D-Bus has changed state. The
194 is one of the following.
198 Initially trying to connect.
201 Successfully established a connection to the bus.
204 A connection has been lost.
207 The service's internal state machine is confused.
210 .BI "USER conntrack " up \fR| down " " group = peer\fR... " " reason\fR...
211 The network connection has apparently gone up or down, and
213 is about to kill and/or connect peers accordingly: for each group, the
214 selected peer is listed; if a group is not listed, then either the group
215 is to be brought down, or no matching peer was found. The
217 is one of the following.
220 .B "nm initially-connected"
221 NetworkManager was detected on startup, and has an active network
224 .B "nm initially-disconnected"
225 NetworkManager was detected on startup, and has no active network
229 NetworkManager has acquired an active network connection.
232 NetworkManager has lost its active network connection.
234 .B "nm default-connection-change"
235 NetworkManager has changed its default route.
237 .BI "icd initially-connected " iap
238 Maemo ICd was detected on startup, and has an active network connection
242 .B "icd initially-disconnected"
243 Maemo ICd was detected on startup, and has no active network connection.
245 .BI "icd connected " iap
246 Maemo ICd has acquired an active network connection, identified by
250 Maemo ICd has lost its active network connection.
253 A change was detected during
255 periodic status check. This usually means that the network connection
256 was reconfigured manually without informing
259 .BI "manual " reason\fR...
260 The connection status was changed manually, using the
267 .\"--------------------------------------------------------------------------
270 .\"* 40 Warning broadcasts (WARN codes)
271 All warnings issued by
273 begin with the tokens
274 .BR "USER conntrack" .
276 .BI "USER conntrack config-file-error " exception " " error-text
277 The configuration file is invalid. The
279 token names a Python exception; the
281 describes the problem encountered, though it may not be very useful.
283 .BI "USER conntrack connect-failed " peer " " tokens\fR...
284 An attempt to connect the named
286 failed; the error message is given by the
289 .\"--------------------------------------------------------------------------
294 .\"--------------------------------------------------------------------------
297 .BR tripe-service (7),
302 .\"--------------------------------------------------------------------------
305 Mark Wooding, <mdw@distorted.org.uk>
307 .\"----- That's all, folks --------------------------------------------------