1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
|
.\" $OpenBSD: isakmpd.8,v 1.19 2000/05/02 14:36:51 niklas Exp $
.\" $EOM: isakmpd.8,v 1.23 2000/05/02 00:30:23 niklas Exp $
.\"
.\" Copyright (c) 1998, 1999 Niklas Hallqvist. All rights reserved.
.\" Copyright (c) 1999 Angelos D. Keromytis. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\" must display the following acknowledgement:
.\" This product includes software developed by Ericsson Radio Systems.
.\" 4. The name of the author may not be used to endorse or promote products
.\" derived from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.\" This code was written under funding by Ericsson Radio Systems.
.\"
.\" Manual page, using -mandoc macros
.\"
.Dd July 31, 1998
.Dt ISAKMPD 8
.Os
.Sh NAME
.Nm isakmpd
.Nd ISAKMP/Oakley a.k.a. IKE key management daemon
.Sh SYNOPSIS
.Nm isakmpd
.Op Fl c Ar config-file
.Op Fl d
.Op Fl D Ar debug-class=level
.Op Fl f Ar fifo
.Op Fl i Ar pid-file
.Op Fl n
.Op Fl p Ar listen-port
.Op Fl P Ar local-port
.Op Fl r Ar seed
.Op Fl R Ar report-file
.Sh DESCRIPTION
The
.Nm
daemon establishes security associations for encrypted
and/or authenticated network traffic. At this moment,
and probably forever, this means
.Xr ipsec 4
traffic.
.Pp
The way
.Nm
goes about its work is by maintaining an internal configuration
as well as a policy database which describes what kinds of SAs to negotiate,
and by listening for different events that triggers these negotiations.
The events that control
.Nm
consists of negotiation initiations from a remote party, user input via
a FIFO or by signals, upcalls from the kernel via a
.Dv PF_KEY
socket, and lastly by scheduled events triggered by timers running out.
.Pp
Most uses of isakmpd will be to implement so called "virtual private
networks" or VPNs for short. The
.Xr vpn 8
manual page describes how to setup isakmpd for a simple VPN. For other
uses, some more knowledge of IKE as a protocol is required. One source
of information are the RFCs mentioned below.
.Pp
The options are as follows:
.Bl -tag -width Ds
.It Fl c Ar config-file
If given, the
.Fl c
option specifies an alternate configuration file instead of
.Pa /etc/isakmpd/isakmpd.conf .
As this file may contain sensitive information, it must be readable
only by the user running the daemon.
.It Fl d
The
.Fl d
option is used to make the daemon run in the foreground, logging to stderr.
.It Xo Fl D
.Ar debug-class Ns No = Ns Ar level
.Xc
This argument is possible to specify many times.
It takes a parameter of the form
.Ar class Ns No = Ns Ar level
where both
.Ar class
and
.Ar level
are numbers.
.Ar class
denotes a debugging class, and
.Ar level
the level you want that debugging class to
limit debug printouts at (i.e., all debug printouts above the level specified
will not output anything).
If
.Ar class
is set to 'A',
then all debugging classes are set to the specified level.
.It Fl f Ar fifo
The
.Fl f
option specifies the
.Tn FIFO
(a.k.a. named pipe) where the daemon listens for
user requests.
If the path given is a dash
.Pq Sq \&- ,
.Nm
will listen to stdin instead.
.It Fl i Ar pid-file
By default the PID of the daemon process will be written to
.Pa /var/run/isakmpd.pid .
This path can be overridden by specifying another one as the argument to the
.Fl i
option.
.It Fl n
When the
.Fl n
option is given, the kernel will not take part in the negotiations.
This is a non-destructive mode so to say, in that it won't alter any
SAs in the IPSEC stack.
.It Fl p Ar listen-port
The
.Fl p
option specifies the listen port the daemon will bind to.
.It Fl P Ar local-port
On the other hand, the port specified to capital
.Fl P
will be what the daemon binds its local end to when acting as initiator.
.It Fl r Ar seed
If given a deterministic random number sequence will be used internally.
This is useful for setting up regression tests.
.It Fl R Ar report-file
When you signal
.Nm
a
.Dv SIGUSR1
it will report its internal state to a report file, normally
.Pa /var/run/isakmpd.report ,
but this can be changed by feeding
the file name as an argument to the
.Fl R
flag.
.El
.Ss Setting up an IKE public key infrastructure (a.k.a. PKI)
In order to use public key based authentication, there has to be an
infrastructure managing the key signing. Either there is an already
existing PKI
.Nm
should take part in, or there will be a need to setup one. In the former
case, what is needed to be done varies depending on the actual Certificate
Authority used, and is therefore not covered here, more than
mentioning that
.Xr openssl 8
needs to be used to create a certificate signing request that the
CA understands. The latter case however is described here:
.Pp
.Bl -enum
.It
An RSA-enabled
.Pa libcrypto
(see
.Xr crypto 3 )
needs to be installed. This is described in
.Xr ssl 8 .
.It
Create your own CA as root.
.Pp
.Bd -literal
# openssl genrsa -out /etc/ssl/private/ca.key 1024
# openssl req -new -key /etc/ssl/private/ca.key \\
-out /etc/ssl/private/ca.csr
.Ed
.Pp
You are now being asked to enter information that will be incorporated
into your certificate request. What you are about to enter is what is
called a Distinguished Name or a DN. There are quite a few fields but
you can leave some blank. For some fields there will be a default
value, if you enter '.', the field will be left blank.
.Pp
.Bd -literal
# openssl x509 -req -days 365 -in /etc/ssl/private/ca.csr \\
-signkey /etc/ssl/private/ca.key \\
-out /etc/ssl/ca.crt
.Ed
.Pp
.It
Create keys and certificates for your IKE peers. This step as well
as the next one, needs to be done for every peer. Furthermore the
last step will need to be done once for each ID you want the peer
to have. The 10.0.0.1 below symbolizes that ID, and should be
changed for each invocation. You will be asked for a DN for each
run too. See to encode the ID in the common name too, so it gets
unique.
.Pp
.Bd -literal
# openssl genrsa -out /etc/isakmpd/private/local.key 1024
# openssl req -new -key /etc/isakmpd/private/local.key \\
-out /etc/isakmpd/private/10.0.0.1.csr
.Ed
.Pp
Now take these certificate signing requests to your CA and process
them like below. You have to add some extensions to the certificate
in order to make it usable for isakmpd, which is why you will need
to run
.Xr certpatch 8 .
Replace 10.0.0.1 with the IP-address which
.Nm
will be using for identity.
.Pp
.Bd -literal
# openssl x509 -req -days 365 -in 10.0.0.1.csr -CA /etc/ssl/ca.crt \\
-CAkey /etc/ssl/private/ca.key -CAcreateserial \\
-out 10.0.0.1.crt
# certpatch -i 10.0.0.1 -k /etc/ssl/private/ca.key \\
10.0.0.1.crt 10.0.0.1.crt
.Ed
.Pp
Put the certificate (the file ending in .crt) in
.Pa /etc/isakmpd/certs/
on your local system. Also carry over the CA cert
.Pa /etc/ssl/ca.crt
and put it in
.Pa /etc/isakmpd/ca/.
.El
.Sh BUGS
The
.Fl P
flag does not do what we document, rather it does nothing.
.Sh FILES
.Bl -tag -width /var/run/isakmpd.report
.It Pa /etc/isakmpd/ca/
The directory where CA certificates can be found.
.It Pa /etc/isakmpd/certs/
The directory where IKE certificates can be found, both the local
certificate(s) and those of the peers, if a choice to have them kept
permanently has been made.
.It Pa /etc/isakmpd/isakmpd.conf
The configuration file.
.It Pa /etc/isakmpd/isakmpd.policy
The keynote policy configuration file.
.It Pa /etc/isakmpd/private/local.key
A local private key for certificate based authentication. There has
to be a certificate for this key in the cerifcate directory mentioned
above.
.It Pa /var/run/isakmpd.fifo
The FIFO used to manually control
.Nm isakmpd .
.It Pa /var/run/isakmpd.report
The report file written when
.Dv SIGUSR1
is received.
.El
.Sh SEE ALSO
.Xr ipsec 4 ,
.Xr isakmpd.conf 5 ,
.Xr isakmpd.policy 5 ,
.Xr openssl 8 ,
.Xr photurisd 8 ,
.Xr ssl 8 ,
.Xr vpn 8
.Sh HISTORY
The ISAKMP/Oakley key management protocol is described in the RFCs
.%T RFC 2407 ,
.%T RFC 2408
and
.%T RFC 2409 .
This implementation was done 1998 by Niklas Hallqvist and Niels Provos,
sponsored by Ericsson Radio Systems.
|