chiark / gitweb /
Disassociate public key tags from peer names.
[tripe] / svc / connect.8.in
CommitLineData
a62f8e8a
MW
1.\" -*-nroff-*-
2.\".
3.\" Manual for the connect service
4.\"
5.\" (c) 2008 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 ../defs.man.in \"@@@PRE@@@
28.
29.\"--------------------------------------------------------------------------
30.TH connect 8 "8 January 2007" "Straylight/Edgeware" "TrIPE: Trivial IP Encryption"
31.
32.\"--------------------------------------------------------------------------
33.SH "NAME"
34.
35connect \- tripe service to make connections to peers
36.
37.\"--------------------------------------------------------------------------
38.SH "SYNOPSIS"
39.
40.B connect
41.RB [ \-a
42.IR socket ]
43.RB [ \-d
44.IR dir ]
45.RB [ \-p
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 connect
58service registers new peers with the
59.BR tripe (8)
60server.
61.PP
62A peer may participate
63.I actively
64or
65.I passively
66in a connection. A peer participating actively (an
67.IR "active peer" )
68must already know its peer's connection details \(en its server's IP
69address and port. Active connection is suitable when the peer is a
70well-known server with stable details.
71.PP
72A server participating passively (a
73.IR "passive peer" )
74waits to be contacted by its peer, and discovers the peer's IP address
75and port as a result of a simple protocol described below. Passive
76connection is suitable when the peer's IP address or port can vary over
77time \(en e.g., if its IP address is assigned dynamically by DHCP or
78PPP, or if it is hidden behind a NAT firewall.
79.PP
80If both peers are active, we say that they establish an
81.IR "static connection" ;
82if one is passive, we say that they establish a
83.IR "dynamic connection" .
84At least one of the peers must be active; it is not possible to
85establish a connection if both peers are passive.
86.SS "Command line"
87In addition to the standard options described in
88.BR tripe-service (7),
89the following command-line options are recognized.
90.TP
91.BI "\-p, \-\-peerdb=" file
92Use
93.I file
94as the (CDB format) peer database. In the absence of this option, the
95file named by the
96.B TRIPEPEERDB
97environment variable is used; if that's not set either, then the default
98default of
99.B peers.cdb
100in the current working directory is used instead.
101.SS "Dynamic connection protocol"
102Dynamic connections are used when the peer's address or port are
103unknown, e.g., when it is hidden behind a NAT firewall.
104.PP
105The protocol for passive connection works as follows.
106.hP 1.
107The active peer
108.BR ADD s
109its partner, typically using the
110.B \-cork
111option to suppress the key-exchange message which the server usually
112sends immediately, since otherwise the passive peer will warn about it.
113.hP 2.
114The active peer somehow issues the command
115.RS
116.IP
117.B SVCSUBMIT connect passive
118.I user
119.PP
120to the passive peer's server. (Here,
121.I user
122is a name identifying the active peer; see below.) This may be handled
123by the
124.BR watch (8)
125service.
126.RE
127.hP 3.
128The
129.B connect
130service on the passive peer responds with a
131.I challenge
132\(en a short Base64-encoded string. Somehow this challenge is sent back
133to the passive peer without being intercepted.
134.hP 4.
135The active peer sends a
136.BR GREET ing
137containing the challenge to its passive partner. The passive server
138announces the arrival of this message, and the originating address and
139port.
140.hP 5.
141The
142.B connect
143service running on the passive host receives the notification, matches
144it up with the
145.I user
146from the initial connection request, and
147.BR ADD s
148the appropriate peer, with the address from the
149.BR GREET ing.
150.PP
151The
152.BR watch (8)
153service is capable of performing the active-peer part of this protocol,
154sending the correct
155.B GREET
156command once the challenge has been obtained. The remaining difficulty
157is in collecting the challenge from the passive peer.
158.
159.\"--------------------------------------------------------------------------
160.SH "SERVICE COMMAND REFERENCE"
161.
162.\"* 10 Service commands
163The commands provided by the service are as follows.
164.SP
165.BI "active " peer
166Make an active connection to the named
167.IR peer .
168The service will submit the command
169.RS
170.IP
171.B ADD
172.RB [ \-cork ]
173.RB [ \-keepalive
174.IR time ]
48b84569
MW
175.RB [ \-key
176.IR tag ]
a62f8e8a
MW
177.RB [ \-tunnel
178.IR driver ]
179.I address
180.PP
181Specifically:
182.hP \*o
183The option
184.B \-cork
185is provided if the peer's database record assigns the
186.B cork
187key one of the values
188.BR t ,
189.BR true ,
190.BR y ,
191.BR yes,
192or
193.BR on .
194.hP \*o
195The option
196.B \-keepalive
197.I time
198is provided if the database record assigns a value
199.I time
200to the
201.B keepalive
202key.
203.hP \*o
204The option
48b84569
MW
205.B \-key
206.I tag
207is provided if the database record assigns a value
208.I tag
209to the
210.B key
211key.
212.hP \*o
213The option
a62f8e8a
MW
214.B \-tunnel
215.I driver
216is provided if the database record assigns a value
217.I driver
218to the
219.B tunnel
220key.
221.hP \*o
222The
223.I address
224is the value assigned to the
225.B peer
226key in the database record.
227.RE
228.SP
229.BI "info " peer
230Lists the database record for the named
231.IR peer .
232For each key/value pair, a line
233.RS
234.IP
235.B INFO
236.IB key = value
237.PP
238is output. The key/value pairs are output in an arbitrary order.
239.RE
240.TP
241.B "list"
242Output a list of peers in the database. For each peer name
243.IR peer ,
244a line
245.RS
246.IP
247.B INFO
248.I peer
249.PP
250is output.
251.RE
252.SP
253.BI "passive \fR[" options "\fR]\fP " user
254If the database contains a user record mapping
255.I user
256to some
257.I peer
258then an
259.B INFO
260line is written containing a freshly chosen challenge string. If the
261server receives a
262.BR GREET ing
263message quoting this challenge within 30 seconds, the
264.B connect
265service will issue an
266.B ADD
267request for the peer, as for the
268.B active
269command, except that the origin of the
270.BR GREET ing
271packet is used as the peer's address.
272.RS
273.\"+opts
274.PP
275The following option is recognized.
276.TP
277.BI "\-timeout " time
278Wait for
279.I time
280instead of 30 seconds. The
281.I time
282is expressed as a non-negative integer followed by
283.BR d ,
284.BR h ,
285.BR m ,
286or
287.B s
288for days, hours, minutes or seconds respectively; if no suffix is given,
289seconds are assumed.
290.\"-opts
291.RE
292.
293.\"--------------------------------------------------------------------------
294.SH "ERROR MESSAGES"
295.
296.\"* 20 Error messages (FAIL codes)
297The following error codes may be reported.
298.SP
299.B "connect-timeout"
300(For
301.BR passive .)
302No
303.BR GREET ing
304was received within the timeout period (default 30 seconds).
305.SP
306.BI "malformed-peer " peer " missing-key " key
307The database record for
308.I peer
309has no value for the
310.I key
311but one was expected.
312.SP
313.BI "passive-peer " peer
314(For
315.BR active .)
316An active connection to
317.I peer
318was requested, but the database record indicates that it is passive,
319i.e., its
320.B peer
321key has the value
322.BR PASSIVE .
323.SP
324.BI "unknown-peer " peer
325The
326.I peer
327has no record in the database.
328.SP
329.BI "unknown-user " user
330(For
331.BR passive .)
332There is no record of
333.I user
334in the database.
335.
336.\"--------------------------------------------------------------------------
337.SH "WARNINGS"
338.
339.\"* 40 Warning broadcasts (WARN codes)
340All warnings issued by
341.B connect
342begin with the tokens
343.BR "USER connect" .
344.SP
345.BI "USER connect auto-add-failed " name " " error\fR...
346The attempt to add the peer
347.I name
348automatically failed: the
349.B ADD
350command reported
351.B FAIL
352.IR error ...
353.
354.\"--------------------------------------------------------------------------
355.SH "SUMMARY"
356.
357.\"= summary
358.
359.\"--------------------------------------------------------------------------
360.SH "SEE ALSO"
361.
362.BR tripe-service (7),
363.BR peers.in (5),
364.BR watch (8),
365.BR tripe (8).
366.
367.\"--------------------------------------------------------------------------
368.SH "AUTHOR"
369.
370Mark Wooding, <mdw@distorted.org.uk>
371.
372.\"----- That's all, folks --------------------------------------------------