OSDN Git Service

2013.10.24
[uclinux-h8/uClinux-dist.git] / freeswan / doc / manpage.d / ipsec_spi.8.html
1 Content-type: text/html
2
3 <HTML><HEAD><TITLE>Manpage of IPSEC_SPI</TITLE>
4 </HEAD><BODY>
5 <H1>IPSEC_SPI</H1>
6 Section: Maintenance Commands (8)<BR>Updated: 21 Jun 2000<BR><A HREF="#index">Index</A>
7 <A HREF="http://localhost/cgi-bin/man/man2html">Return to Main Contents</A><HR>
8
9
10
11
12 <A NAME="lbAB">&nbsp;</A>
13 <H2>NAME</H2>
14
15 ipsec spi - manage IPSEC Security Associations
16 <A NAME="lbAC">&nbsp;</A>
17 <H2>SYNOPSIS</H2>
18
19 <BR>
20
21 Note: In the following,
22 <B>&lt;SA&gt;</B>
23
24 means:
25 <B>--af</B>
26
27 (inet | inet6)
28 <B>--edst</B>
29
30 daddr
31 <B>--spi</B>
32
33 spi
34 <B>--proto</B>
35
36 proto OR 
37 <B>--said</B>
38
39 said
40 <P>
41
42 <B>ipsec</B>
43
44 <B>spi</B>
45
46 <P>
47
48 <B>ipsec</B>
49
50 <B>spi</B>
51
52 <B>&lt;SA&gt;</B>
53
54 <B>--src</B>
55
56 src
57 <B>--ah</B>
58
59 <B>hmac-md5-96</B>|<B>hmac-sha1-96</B>
60
61 [
62 <B>--replay_window</B>
63
64 replayw ]
65 <B>--authkey</B>
66
67 akey
68 <P>
69
70 <B>ipsec</B>
71
72 <B>spi</B>
73
74 <B>&lt;SA&gt;</B>
75
76 <B>--src</B>
77
78 src
79 <B>--esp</B>
80
81 <B>3des</B>
82
83 [
84 <B>--replay_window</B>
85
86 replayw ]
87 <B>--enckey</B>
88
89 ekey
90 <P>
91
92 <B>ipsec</B>
93
94 <B>spi</B>
95
96 <B>&lt;SA&gt;</B>
97
98 <B>--src</B>
99
100 src
101 <B>--esp</B>
102
103 <B>3des-md5-96</B>|<B>3des-sha1-96</B>
104
105 [
106 <B>--replay_window</B>
107
108 replayw ]
109 <B>--enckey</B>
110
111 ekey
112 <B>--authkey</B>
113
114 akey
115 <P>
116
117 <B>ipsec</B>
118
119 <B>spi</B>
120
121 <B>&lt;SA&gt;</B>
122
123 <B>--src</B>
124
125 src
126 <B>--comp</B>
127
128 <B>deflate</B>
129
130 <P>
131
132 <B>ipsec</B>
133
134 <B>spi</B>
135
136 <B>&lt;SA&gt;</B>
137
138 <B>--ip4</B>
139
140 <B>--src</B>
141
142 encap-src
143 <B>--dst</B>
144
145 encap-dst
146 <P>
147
148 <B>ipsec</B>
149
150 <B>spi</B>
151
152 <B>&lt;SA&gt;</B>
153
154 <B>--ip6</B>
155
156 <B>--src</B>
157
158 encap-src
159 <B>--dst</B>
160
161 encap-dst
162 <P>
163
164 <B>ipsec</B>
165
166 <B>spi</B>
167
168 <B>&lt;SA&gt;</B>
169
170 <B>--del</B>
171
172 <P>
173
174 <B>ipsec</B>
175
176 <B>spi</B>
177
178 <B>--help</B>
179
180 <P>
181
182 <B>ipsec</B>
183
184 <B>spi</B>
185
186 <B>--version</B>
187
188 <P>
189
190 <B>ipsec</B>
191
192 <B>spi</B>
193
194 <B>--clear</B>
195
196 <P>
197
198 <A NAME="lbAD">&nbsp;</A>
199 <H2>DESCRIPTION</H2>
200
201 <I>Spi</I>
202
203 creates and deletes IPSEC Security Associations.
204 A Security Association (SA) is a transform through which packet
205 contents are to be processed before being forwarded.
206 A transform can be an IPv4-in-IPv4 or an IPv6-in-IPv6 encapsulation,
207 an IPSEC Authentication Header (authentication with no encryption),
208 or an IPSEC Encapsulation Security Payload (encryption, possibly
209 including authentication).
210 <P>
211
212 When a packet is passed from a higher networking layer
213 through an IPSEC virtual interface,
214 a search in the extended routing table (see
215 <I><A HREF="ipsec_eroute.8.html">ipsec_eroute</A></I>(8))
216
217 yields an effective destination address, a
218 Security Parameters Index (SPI) and a IP protocol number.
219 When an IPSEC packet arrives from the network,
220 its ostensible destination, an SPI and an IP protocol
221 specified by its outermost IPSEC header are used.
222 The destination/SPI/protocol combination is used to select a relevant SA.
223 (See
224 <I><A HREF="ipsec_spigrp.8.html">ipsec_spigrp</A></I>(8)
225
226 for discussion of how multiple transforms are combined.)
227 <P>
228
229 The
230 <I>af</I>,
231
232 <I>daddr</I>,
233
234 <I>spi</I>
235
236 and
237 <I>proto</I>
238
239 arguments specify the SA to be created or deleted.
240 <I>af</I>
241
242 is the address family (inet for IPv4, inet6 for IPv6).
243 <I>Daddr</I>
244
245 is a destination address
246 in dotted-decimal notation for IPv4 
247 or in a coloned hex notation for IPv6.
248 <I>Spi</I>
249
250 is a number, preceded by '0x' for hexadecimal,
251 between
252 <B>0x100</B>
253
254 and
255 <B>0xffffffff</B>;
256
257 values from
258 <B>0x0</B>
259
260 to
261 <B>0xff</B>
262
263 are reserved.
264 <I>Proto</I>
265
266 is an ASCII string, &quot;ah&quot;, &quot;esp&quot;, &quot;comp&quot; or &quot;tun&quot;, specifying the IP protocol.
267 The protocol must agree with the algorithm selected.
268 <P>
269
270 Alternatively, the
271 <I>said</I>
272
273 argument can also specify an SA to be created or deleted.
274 <I>Said</I>
275
276 combines the three parameters above, such as: &quot;<A HREF="mailto:tun.101@1.2.3.4">tun.101@1.2.3.4</A>&quot; or &quot;tun:101@1:2::3:4&quot;,
277 where the address family is specified by &quot;.&quot; for IPv4 and &quot;:&quot; for IPv6. The address
278 family indicators substitute the &quot;0x&quot; for hexadecimal.
279 <P>
280
281 The source address,
282 <I>src</I>,
283
284 must also be provided for the inbound policy check to
285 function.  The source address does not need to be included if inbound
286 policy checking has been disabled.
287 <P>
288
289 Keys vectors must be entered as hexadecimal or base64 numbers.
290 They should be cryptographically strong random numbers.
291 <P>
292
293 All hexadecimal numbers are entered as strings of hexadecimal digits
294 (0-9 and a-f), without spaces, preceded by '0x', where each hexadecimal
295 digit represents 4 bits.
296 All base64 numbers are entered as strings of base64 digits
297 <BR>&nbsp;(0-9,&nbsp;A-Z,&nbsp;a-z,&nbsp;'+'&nbsp;and&nbsp;'/'),&nbsp;without&nbsp;spaces,&nbsp;preceded&nbsp;by&nbsp;'0s',
298 where each hexadecimal digit represents 6 bits and '=' is used for padding.
299 <P>
300
301 The deletion of an SA which has been grouped will result in the entire chain
302 being deleted.
303 <P>
304
305 The form with no additional arguments lists the contents of
306 /proc/net/ipsec_spi.  The format of /proc/net/ipsec_spi is discussed in
307 <A HREF="ipsec_spi.5.html">ipsec_spi</A>(5).
308 <A NAME="lbAE">&nbsp;</A>
309 <H2>OPTIONS</H2>
310
311 <DL COMPACT>
312 <DT><B>--af</B>
313
314 <DD>
315 specifies the address family (inet for IPv4, inet6 for IPv6)
316 <DT><B>--edst</B>
317
318 <DD>
319 specifies the effective destination
320 <I>daddr</I>
321
322 of the Security Association
323 <DT><B>--spi</B>
324
325 <DD>
326 specifies the Security Parameters Index
327 <I>spi</I>
328
329 of the Security Association
330 <DT><B>--proto</B>
331
332 <DD>
333 specifies the IP protocol
334 <I>proto</I>
335
336 of the Security Association
337 <DT><B>--said</B>
338
339 <DD>
340 specifies the Security Association in monolithic format
341 <DT><B>--ah</B>
342
343 <DD>
344 add an SA for an IPSEC Authentication Header,
345 specified by the following transform identifier
346 (<B>hmac-md5-96</B>
347
348 or
349 <B>hmac-sha1-96</B>)
350
351 (RFC2402, obsoletes RFC1826)
352 <DT><B>hmac-md5-96</B>
353
354 <DD>
355 transform following the HMAC and MD5 standards,
356 using a 128-bit
357 <I>key</I>
358
359 to produce a 96-bit authenticator (RFC2403)
360 <DT><B>hmac-sha1-96</B>
361
362 <DD>
363 transform following the HMAC and SHA1 standards,
364 using a 160-bit
365 <I>key</I>
366
367 to produce a 96-bit authenticator (RFC2404)
368 <DT><B>--esp</B>
369
370 <DD>
371 add an SA for an IPSEC Encapsulation Security Payload,
372 specified by the following
373 transform identifier (<B>3des</B>,
374
375 or
376 <B>3des-md5-96</B>)
377
378 (RFC2406, obsoletes RFC1827)
379 <DT><B>3des</B>
380
381 <DD>
382 encryption transform following the Triple-DES standard in
383 Cipher-Block-Chaining mode using a 64-bit
384 <I>iv</I>
385
386 (internally generated) and a 192-bit 3DES
387 <I>ekey</I>
388
389 (RFC2451)
390 <DT><B>3des-md5-96</B>
391
392 <DD>
393 encryption transform following the Triple-DES standard in
394 Cipher-Block-Chaining mode with authentication provided by
395 HMAC and MD5
396 (96-bit authenticator),
397 using a 64-bit
398 <I>iv</I>
399
400 (internally generated), a 192-bit 3DES
401 <I>ekey</I>
402
403 and a 128-bit HMAC-MD5
404 <I>akey</I>
405
406 (RFC2451, RFC2403)
407 <DT><B>3des-sha1-96</B>
408
409 <DD>
410 encryption transform following the Triple-DES standard in
411 Cipher-Block-Chaining mode with authentication provided by
412 HMAC and SHA1
413 (96-bit authenticator),
414 using a 64-bit
415 <I>iv</I>
416
417 (internally generated), a 192-bit 3DES
418 <I>ekey</I>
419
420 and a 160-bit HMAC-SHA1
421 <I>akey</I>
422
423 (RFC2451, RFC2404)
424 <DT><B>--replay_window</B> replayw
425
426 <DD>
427 sets the replay window size; valid values are decimal, 1 to 64
428 <DT><B>--comp</B>
429
430 <DD>
431 add an SA for IPSEC IP Compression,
432 specified by the following
433 transform identifier (<B>deflate</B>)
434
435 (RFC2393)
436 <DT><B>deflate</B>
437
438 <DD>
439 compression transform following the patent-free Deflate compression algorithm
440 (RFC2394)
441 <DT><B>--ip4</B>
442
443 <DD>
444 add an SA for an IPv4-in-IPv4
445 tunnel from
446 <I>encap-src</I>
447
448 to
449 <I>encap-dst</I>
450
451 <DT><B>--ip6</B>
452
453 <DD>
454 add an SA for an IPv6-in-IPv6
455 tunnel from
456 <I>encap-src</I>
457
458 to
459 <I>encap-dst</I>
460
461 <DT><B>--src</B>
462
463 <DD>
464 specify the source end of an IP-in-IP tunnel from
465 <I>encap-src</I>
466
467 to
468 <I>encap-dst</I>
469
470 and also specifies the source address of the Security Association to be
471 used in inbound policy checking and must be the same address
472 family as
473 <I>af</I>
474
475 and
476 <I>edst</I>
477
478 <DT><B>--dst</B>
479
480 <DD>
481 specify the destination end of an IP-in-IP tunnel from
482 <I>encap-src</I>
483
484 to
485 <I>encap-dst</I>
486
487 <DT><B>--del</B>
488
489 <DD>
490 delete the specified SA
491 <DT><B>--clear</B>
492
493 <DD>
494 clears the table of
495 <B>SA</B>s
496
497 <DT><B>--help</B>
498
499 <DD>
500 display synopsis
501 <DT><B>--version</B>
502
503 <DD>
504 display version information
505 </DL>
506 <A NAME="lbAF">&nbsp;</A>
507 <H2>EXAMPLES</H2>
508
509 To keep line lengths down and reduce clutter,
510 some of the long keys in these examples have been abbreviated
511 by replacing part of their text with
512 ``<I>...</I>''.
513
514 Keys used when the programs are actually run must,
515 of course, be the full length required for the particular algorithm.
516 <P>
517
518 <B>ipsec spi --af inet --edst gw2 --spi 0x125 --proto esp \</B>
519
520 <BR>
521
522 <B>   --src gw1 \</B>
523
524 <BR>
525
526 <B>   --esp 3des-md5-96 \</B>
527
528 <BR>
529
530 <B>&nbsp;&nbsp;&nbsp;--enckey&nbsp;0x6630</B><I>...</I><B>97ce&nbsp;\</B>
531
532 <BR>
533
534 <B>   --authkey 0x9941</B><I>...</I><B>71df</B>
535
536 <P>
537
538 sets up an SA from
539 <B>gw1</B>
540
541 to
542 <B>gw2</B>
543
544 with an SPI of 
545 <B>0x125</B>
546
547 and protocol
548 <B>ESP</B>
549
550 (50) using
551 <B>3DES</B>
552
553 encryption with integral
554 <B>MD5-96</B>
555
556 authentication transform, using an encryption key of
557 <B>0x6630</B><I>...</I><B>97ce</B>
558
559 and an authentication key of
560 <B>0x9941</B><I>...</I><B>71df</B>
561
562 (see note above about abbreviated keys).
563 <P>
564
565 <B>ipsec spi --af inet6 --edst 3049:9::9000:3100 --spi 0x150 --proto ah \</B>
566
567 <BR>
568
569 <B>   --src 3049:9::9000:3101 \</B>
570
571 <BR>
572
573 <B>   --ah hmac-md5-96 \</B>
574
575 <BR>
576
577 <B>&nbsp;&nbsp;&nbsp;--authkey&nbsp;0x1234</B><I>...</I><B>2eda&nbsp;\</B>
578
579 <P>
580
581 sets up an SA from
582 <B>3049:9::9000:3101</B>
583
584 to
585 <B>3049:9::9000:3100</B>
586
587 with an SPI of 
588 <B>0x150</B>
589
590 and protocol
591 <B>AH</B>
592
593 (50) using
594 <B>MD5-96</B>
595
596 authentication transform, using an authentication key of
597 <B>0x1234</B><I>...</I><B>2eda</B>
598
599 (see note above about abbreviated keys).
600 <P>
601
602 <B>ipsec spi --said <A HREF="mailto:tun.987@192.168.100.100">tun.987@192.168.100.100</A> --del </B>
603
604 <P>
605
606 deletes an SA to
607 <B>192.168.100.100</B>
608
609 with an SPI of 
610 <B>0x987</B>
611
612 and protocol
613 <B>IPv4-in-IPv4</B>
614
615 (4).
616 <P>
617
618 <B>ipsec spi --said tun:<A HREF="mailto:500@3049">500@3049</A>:9::1000:1 --del </B>
619
620 <P>
621
622 deletes an SA to
623 <B>3049:9::1000:1</B>
624
625 with an SPI of 
626 <B>0x500</B>
627
628 and protocol
629 <B>IPv6-in-IPv6</B>
630
631 (4).
632 <P>
633
634 <A NAME="lbAG">&nbsp;</A>
635 <H2>FILES</H2>
636
637 /proc/net/ipsec_spi, /usr/local/bin/ipsec
638 <A NAME="lbAH">&nbsp;</A>
639 <H2>SEE ALSO</H2>
640
641 <A HREF="ipsec.8.html">ipsec</A>(8), <A HREF="ipsec_manual.8.html">ipsec_manual</A>(8), <A HREF="ipsec_tncfg.8.html">ipsec_tncfg</A>(8), <A HREF="ipsec_eroute.8.html">ipsec_eroute</A>(8),
642 <A HREF="ipsec_spigrp.8.html">ipsec_spigrp</A>(8), <A HREF="ipsec_klipsdebug.8.html">ipsec_klipsdebug</A>(8), <A HREF="ipsec_spi.5.html">ipsec_spi</A>(5)
643 <A NAME="lbAI">&nbsp;</A>
644 <H2>HISTORY</H2>
645
646 Written for the Linux FreeS/WAN project
647 &lt;<A HREF="http://www.freeswan.org/">http://www.freeswan.org/</A>&gt;
648 by Richard Guy Briggs.
649 <A NAME="lbAJ">&nbsp;</A>
650 <H2>BUGS</H2>
651
652 The syntax is messy and the transform naming needs work.
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693 <P>
694
695 <HR>
696 <A NAME="index">&nbsp;</A><H2>Index</H2>
697 <DL>
698 <DT><A HREF="#lbAB">NAME</A><DD>
699 <DT><A HREF="#lbAC">SYNOPSIS</A><DD>
700 <DT><A HREF="#lbAD">DESCRIPTION</A><DD>
701 <DT><A HREF="#lbAE">OPTIONS</A><DD>
702 <DT><A HREF="#lbAF">EXAMPLES</A><DD>
703 <DT><A HREF="#lbAG">FILES</A><DD>
704 <DT><A HREF="#lbAH">SEE ALSO</A><DD>
705 <DT><A HREF="#lbAI">HISTORY</A><DD>
706 <DT><A HREF="#lbAJ">BUGS</A><DD>
707 </DL>
708 <HR>
709 This document was created by
710 <A HREF="http://localhost/cgi-bin/man/man2html">man2html</A>,
711 using the manual pages.<BR>
712 Time: 05:09:33 GMT, June 19, 2001
713 </BODY>
714 </HTML>