1cf43a054SHajimu UMEMOTO.\" $KAME: setkey.8,v 1.89 2003/09/07 22:17:41 itojun Exp $ 23c62e87aSJun-ichiro itojun Hagino.\" 39a4365d0SYoshinobu Inoue.\" Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project. 49a4365d0SYoshinobu Inoue.\" All rights reserved. 59a4365d0SYoshinobu Inoue.\" 69a4365d0SYoshinobu Inoue.\" Redistribution and use in source and binary forms, with or without 79a4365d0SYoshinobu Inoue.\" modification, are permitted provided that the following conditions 89a4365d0SYoshinobu Inoue.\" are met: 99a4365d0SYoshinobu Inoue.\" 1. Redistributions of source code must retain the above copyright 109a4365d0SYoshinobu Inoue.\" notice, this list of conditions and the following disclaimer. 119a4365d0SYoshinobu Inoue.\" 2. Redistributions in binary form must reproduce the above copyright 129a4365d0SYoshinobu Inoue.\" notice, this list of conditions and the following disclaimer in the 139a4365d0SYoshinobu Inoue.\" documentation and/or other materials provided with the distribution. 149a4365d0SYoshinobu Inoue.\" 3. Neither the name of the project nor the names of its contributors 159a4365d0SYoshinobu Inoue.\" may be used to endorse or promote products derived from this software 169a4365d0SYoshinobu Inoue.\" without specific prior written permission. 179a4365d0SYoshinobu Inoue.\" 189a4365d0SYoshinobu Inoue.\" THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND 199a4365d0SYoshinobu Inoue.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 209a4365d0SYoshinobu Inoue.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 219a4365d0SYoshinobu Inoue.\" ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE 229a4365d0SYoshinobu Inoue.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 239a4365d0SYoshinobu Inoue.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 249a4365d0SYoshinobu Inoue.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 259a4365d0SYoshinobu Inoue.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 269a4365d0SYoshinobu Inoue.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 279a4365d0SYoshinobu Inoue.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 289a4365d0SYoshinobu Inoue.\" SUCH DAMAGE. 299a4365d0SYoshinobu Inoue.\" 30*4f39ff1eSKonstantin Belousov.Dd August 25, 2024 319a4365d0SYoshinobu Inoue.Dt SETKEY 8 3233841545SHajimu UMEMOTO.Os 333c62e87aSJun-ichiro itojun Hagino.\" 349a4365d0SYoshinobu Inoue.Sh NAME 359a4365d0SYoshinobu Inoue.Nm setkey 366992e2a5SRuslan Ermilov.Nd "manually manipulate the IPsec SA/SP database" 373c62e87aSJun-ichiro itojun Hagino.\" 389a4365d0SYoshinobu Inoue.Sh SYNOPSIS 39e97407b4SRuslan Ermilov.Nm 40cf43a054SHajimu UMEMOTO.Op Fl v 419a4365d0SYoshinobu Inoue.Fl c 42e97407b4SRuslan Ermilov.Nm 43cf43a054SHajimu UMEMOTO.Op Fl v 449a4365d0SYoshinobu Inoue.Fl f Ar filename 45e97407b4SRuslan Ermilov.Nm 463cb80822SKonstantin Belousov.Op Fl v 473cb80822SKonstantin Belousov.Fl e Ar script 483cb80822SKonstantin Belousov.Nm 4922986c67SAndrey V. Elsukov.Op Fl Pgltv 509a4365d0SYoshinobu Inoue.Fl D 51e97407b4SRuslan Ermilov.Nm 52cf43a054SHajimu UMEMOTO.Op Fl Pv 539a4365d0SYoshinobu Inoue.Fl F 54e97407b4SRuslan Ermilov.Nm 559a4365d0SYoshinobu Inoue.Op Fl h 569a4365d0SYoshinobu Inoue.Fl x 579a4365d0SYoshinobu Inoue.\" 589a4365d0SYoshinobu Inoue.Sh DESCRIPTION 59490d5836SPhilippe CharnierThe 609a4365d0SYoshinobu Inoue.Nm 616992e2a5SRuslan Ermilovutility adds, updates, dumps, or flushes 623c62e87aSJun-ichiro itojun HaginoSecurity Association Database (SAD) entries 633c62e87aSJun-ichiro itojun Haginoas well as Security Policy Database (SPD) entries in the kernel. 649a4365d0SYoshinobu Inoue.Pp 65490d5836SPhilippe CharnierThe 669a4365d0SYoshinobu Inoue.Nm 676992e2a5SRuslan Ermilovutility takes a series of operations from the standard input 686992e2a5SRuslan Ermilov(if invoked with 693cb80822SKonstantin Belousov.Fl c ) , 703cb80822SKonstantin Belousovfrom the file named 719a4365d0SYoshinobu Inoue.Ar filename 726992e2a5SRuslan Ermilov(if invoked with 733cb80822SKonstantin Belousov.Fl f Ar filename ) , 743cb80822SKonstantin Belousovor from the command line argument following the option 753cb80822SKonstantin Belousov(if invoked with 763cb80822SKonstantin Belousov.Fl e Ar script ) . 776992e2a5SRuslan Ermilov.Bl -tag -width indent 789a4365d0SYoshinobu Inoue.It Fl D 799a4365d0SYoshinobu InoueDump the SAD entries. 809a4365d0SYoshinobu InoueIf with 819a4365d0SYoshinobu Inoue.Fl P , 829a4365d0SYoshinobu Inouethe SPD entries are dumped. 839a4365d0SYoshinobu Inoue.It Fl F 843c62e87aSJun-ichiro itojun HaginoFlush the SAD entries. 859a4365d0SYoshinobu InoueIf with 869a4365d0SYoshinobu Inoue.Fl P , 873c62e87aSJun-ichiro itojun Haginothe SPD entries are flushed. 8822986c67SAndrey V. Elsukov.It Fl g 8922986c67SAndrey V. ElsukovOnly SPD entries with global scope are dumped with 9022986c67SAndrey V. Elsukov.Fl D 9122986c67SAndrey V. Elsukovand 9222986c67SAndrey V. Elsukov.Fl P 9322986c67SAndrey V. Elsukovflags. 9422986c67SAndrey V. Elsukov.It Fl t 9522986c67SAndrey V. ElsukovOnly SPD entries with ifnet scope are dumped with 9622986c67SAndrey V. Elsukov.Fl D 9722986c67SAndrey V. Elsukovand 9822986c67SAndrey V. Elsukov.Fl P 9922986c67SAndrey V. Elsukovflags. 10022986c67SAndrey V. ElsukovSuch SPD entries are linked to the corresponding 10122986c67SAndrey V. Elsukov.Xr if_ipsec 4 10222986c67SAndrey V. Elsukovvirtual tunneling interface. 1039a4365d0SYoshinobu Inoue.It Fl h 1049a4365d0SYoshinobu InoueAdd hexadecimal dump on 1059a4365d0SYoshinobu Inoue.Fl x 106f2e366a1SSheldon Hearnmode. 1079a4365d0SYoshinobu Inoue.It Fl l 1089a4365d0SYoshinobu InoueLoop forever with short output on 1099a4365d0SYoshinobu Inoue.Fl D . 1109a4365d0SYoshinobu Inoue.It Fl v 1119a4365d0SYoshinobu InoueBe verbose. 11233841545SHajimu UMEMOTOThe program will dump messages exchanged on 1139a4365d0SYoshinobu Inoue.Dv PF_KEY 11433841545SHajimu UMEMOTOsocket, including messages sent from other processes to the kernel. 115cf43a054SHajimu UMEMOTO.It Fl x 116cf43a054SHajimu UMEMOTOLoop forever and dump all the messages transmitted to 117cf43a054SHajimu UMEMOTO.Dv PF_KEY 118cf43a054SHajimu UMEMOTOsocket. 119cf43a054SHajimu UMEMOTO.Fl xx 1207cb0189dSEitan Adlermakes each timestamp unformatted. 1219a4365d0SYoshinobu Inoue.El 122cf43a054SHajimu UMEMOTO.Ss Configuration syntax 123cf43a054SHajimu UMEMOTOWith 124cf43a054SHajimu UMEMOTO.Fl c 125cf43a054SHajimu UMEMOTOor 126cf43a054SHajimu UMEMOTO.Fl f 127cf43a054SHajimu UMEMOTOon the command line, 128cf43a054SHajimu UMEMOTO.Nm 129cf43a054SHajimu UMEMOTOaccepts the following configuration syntax. 1306992e2a5SRuslan ErmilovLines starting with hash signs 1316992e2a5SRuslan Ermilov.Pq Ql # 1326992e2a5SRuslan Ermilovare treated as comment lines. 1336992e2a5SRuslan Ermilov.Bl -tag -width indent 1349a4365d0SYoshinobu Inoue.It Xo 1359a4365d0SYoshinobu Inoue.Li add 136cf43a054SHajimu UMEMOTO.Op Fl 46n 1379a4365d0SYoshinobu Inoue.Ar src Ar dst Ar protocol Ar spi 1389a4365d0SYoshinobu Inoue.Op Ar extensions 1399a4365d0SYoshinobu Inoue.Ar algorithm ... 14035471bf8SJoel Dahl.Li \&; 1419a4365d0SYoshinobu Inoue.Xc 1423c62e87aSJun-ichiro itojun HaginoAdd an SAD entry. 143cf43a054SHajimu UMEMOTO.Li add 144cf43a054SHajimu UMEMOTOcan fail with multiple reasons, 145cf43a054SHajimu UMEMOTOincluding when the key length does not match the specified algorithm. 1469a4365d0SYoshinobu Inoue.\" 1479a4365d0SYoshinobu Inoue.It Xo 1489a4365d0SYoshinobu Inoue.Li get 149cf43a054SHajimu UMEMOTO.Op Fl 46n 1509a4365d0SYoshinobu Inoue.Ar src Ar dst Ar protocol Ar spi 15135471bf8SJoel Dahl.Li \&; 1529a4365d0SYoshinobu Inoue.Xc 1533c62e87aSJun-ichiro itojun HaginoShow an SAD entry. 1549a4365d0SYoshinobu Inoue.\" 1559a4365d0SYoshinobu Inoue.It Xo 1569a4365d0SYoshinobu Inoue.Li delete 157cf43a054SHajimu UMEMOTO.Op Fl 46n 1589a4365d0SYoshinobu Inoue.Ar src Ar dst Ar protocol Ar spi 15935471bf8SJoel Dahl.Li \&; 1609a4365d0SYoshinobu Inoue.Xc 1613c62e87aSJun-ichiro itojun HaginoRemove an SAD entry. 1629a4365d0SYoshinobu Inoue.\" 1639a4365d0SYoshinobu Inoue.It Xo 16433841545SHajimu UMEMOTO.Li deleteall 165cf43a054SHajimu UMEMOTO.Op Fl 46n 16633841545SHajimu UMEMOTO.Ar src Ar dst Ar protocol 16735471bf8SJoel Dahl.Li \&; 16833841545SHajimu UMEMOTO.Xc 16933841545SHajimu UMEMOTORemove all SAD entries that match the specification. 17033841545SHajimu UMEMOTO.\" 17133841545SHajimu UMEMOTO.It Xo 1729a4365d0SYoshinobu Inoue.Li flush 1739a4365d0SYoshinobu Inoue.Op Ar protocol 17435471bf8SJoel Dahl.Li \&; 1759a4365d0SYoshinobu Inoue.Xc 1763c62e87aSJun-ichiro itojun HaginoClear all SAD entries matched by the options. 177cf43a054SHajimu UMEMOTO.Fl F 178cf43a054SHajimu UMEMOTOon the command line achieves the same functionality. 1799a4365d0SYoshinobu Inoue.\" 1809a4365d0SYoshinobu Inoue.It Xo 1819a4365d0SYoshinobu Inoue.Li dump 1829a4365d0SYoshinobu Inoue.Op Ar protocol 18335471bf8SJoel Dahl.Li \&; 1849a4365d0SYoshinobu Inoue.Xc 1853c62e87aSJun-ichiro itojun HaginoDumps all SAD entries matched by the options. 186cf43a054SHajimu UMEMOTO.Fl D 187cf43a054SHajimu UMEMOTOon the command line achieves the same functionality. 1889a4365d0SYoshinobu Inoue.\" 1899a4365d0SYoshinobu Inoue.It Xo 1909a4365d0SYoshinobu Inoue.Li spdadd 191cf43a054SHajimu UMEMOTO.Op Fl 46n 1929a4365d0SYoshinobu Inoue.Ar src_range Ar dst_range Ar upperspec Ar policy 19335471bf8SJoel Dahl.Li \&; 1949a4365d0SYoshinobu Inoue.Xc 1953c62e87aSJun-ichiro itojun HaginoAdd an SPD entry. 1969a4365d0SYoshinobu Inoue.\" 1979a4365d0SYoshinobu Inoue.It Xo 1989a4365d0SYoshinobu Inoue.Li spddelete 199cf43a054SHajimu UMEMOTO.Op Fl 46n 2003c62e87aSJun-ichiro itojun Hagino.Ar src_range Ar dst_range Ar upperspec Fl P Ar direction 20135471bf8SJoel Dahl.Li \&; 2029a4365d0SYoshinobu Inoue.Xc 2033c62e87aSJun-ichiro itojun HaginoDelete an SPD entry. 2049a4365d0SYoshinobu Inoue.\" 2059a4365d0SYoshinobu Inoue.It Xo 2069a4365d0SYoshinobu Inoue.Li spdflush 20735471bf8SJoel Dahl.Li \&; 2089a4365d0SYoshinobu Inoue.Xc 2099a4365d0SYoshinobu InoueClear all SPD entries. 210cf43a054SHajimu UMEMOTO.Fl FP 211cf43a054SHajimu UMEMOTOon the command line achieves the same functionality. 2129a4365d0SYoshinobu Inoue.\" 2139a4365d0SYoshinobu Inoue.It Xo 2149a4365d0SYoshinobu Inoue.Li spddump 21535471bf8SJoel Dahl.Li \&; 2169a4365d0SYoshinobu Inoue.Xc 21717deb182SYoshinobu InoueDumps all SPD entries. 218cf43a054SHajimu UMEMOTO.Fl DP 219cf43a054SHajimu UMEMOTOon the command line achieves the same functionality. 2209a4365d0SYoshinobu Inoue.El 2219a4365d0SYoshinobu Inoue.\" 2229a4365d0SYoshinobu Inoue.Pp 2239a4365d0SYoshinobu InoueMeta-arguments are as follows: 224059b1593SBen Smithurst.Pp 2256992e2a5SRuslan Ermilov.Bl -tag -compact -width indent 2269a4365d0SYoshinobu Inoue.It Ar src 2279a4365d0SYoshinobu Inoue.It Ar dst 2289a4365d0SYoshinobu InoueSource/destination of the secure communication is specified as 2299a4365d0SYoshinobu InoueIPv4/v6 address. 2306992e2a5SRuslan ErmilovThe 2319a4365d0SYoshinobu Inoue.Nm 2326992e2a5SRuslan Ermilovutility 233b287f26cSYi-Chen Lican resolve an FQDN into numeric addresses. 234cf43a054SHajimu UMEMOTOIf the FQDN resolves into multiple addresses, 235cf43a054SHajimu UMEMOTO.Nm 236cf43a054SHajimu UMEMOTOwill install multiple SAD/SPD entries into the kernel 237cf43a054SHajimu UMEMOTOby trying all possible combinations. 238cf43a054SHajimu UMEMOTO.Fl 4 , 239cf43a054SHajimu UMEMOTO.Fl 6 2409a4365d0SYoshinobu Inoueand 241cf43a054SHajimu UMEMOTO.Fl n 242cf43a054SHajimu UMEMOTOrestricts the address resolution of FQDN in certain ways. 243cf43a054SHajimu UMEMOTO.Fl 4 244cf43a054SHajimu UMEMOTOand 245cf43a054SHajimu UMEMOTO.Fl 6 246cf43a054SHajimu UMEMOTOrestrict results into IPv4/v6 addresses only, respectively. 247cf43a054SHajimu UMEMOTO.Fl n 248cf43a054SHajimu UMEMOTOavoids FQDN resolution and requires addresses to be numeric addresses. 2499a4365d0SYoshinobu Inoue.\" 2509a4365d0SYoshinobu Inoue.Pp 2519a4365d0SYoshinobu Inoue.It Ar protocol 2529a4365d0SYoshinobu Inoue.Ar protocol 2539a4365d0SYoshinobu Inoueis one of following: 2549a4365d0SYoshinobu Inoue.Bl -tag -width Fl -compact 2559a4365d0SYoshinobu Inoue.It Li esp 256cf43a054SHajimu UMEMOTOESP based on rfc2406 2579a4365d0SYoshinobu Inoue.It Li esp-old 2589a4365d0SYoshinobu InoueESP based on rfc1827 2599a4365d0SYoshinobu Inoue.It Li ah 2609a4365d0SYoshinobu InoueAH based on rfc2402 2619a4365d0SYoshinobu Inoue.It Li ah-old 2629a4365d0SYoshinobu InoueAH based on rfc1826 2639a4365d0SYoshinobu Inoue.It Li ipcomp 264cf43a054SHajimu UMEMOTOIPComp 2651922fd12SBruce M Simpson.It Li tcp 2661922fd12SBruce M SimpsonTCP-MD5 based on rfc2385 2679a4365d0SYoshinobu Inoue.El 2689a4365d0SYoshinobu Inoue.\" 2699a4365d0SYoshinobu Inoue.Pp 2709a4365d0SYoshinobu Inoue.It Ar spi 271cf43a054SHajimu UMEMOTOSecurity Parameter Index 2726992e2a5SRuslan Ermilov(SPI) 273cf43a054SHajimu UMEMOTOfor the SAD and the SPD. 274cf43a054SHajimu UMEMOTO.Ar spi 275cf43a054SHajimu UMEMOTOmust be a decimal number, or a hexadecimal number with 2766992e2a5SRuslan Ermilov.Ql 0x 277cf43a054SHajimu UMEMOTOprefix. 278cf43a054SHajimu UMEMOTOSPI values between 0 and 255 are reserved for future use by IANA 279cf43a054SHajimu UMEMOTOand they cannot be used. 2809a4365d0SYoshinobu Inoue.\" 2819a4365d0SYoshinobu Inoue.Pp 2829a4365d0SYoshinobu Inoue.It Ar extensions 283cf43a054SHajimu UMEMOTOtake some of the following: 284cf85818eSKonstantin Belousov.Bl -tag -width Fl natt_mtu -compact 2853c62e87aSJun-ichiro itojun Hagino.\" 2869a4365d0SYoshinobu Inoue.It Fl m Ar mode 2873c62e87aSJun-ichiro itojun HaginoSpecify a security protocol mode for use. 2889a4365d0SYoshinobu Inoue.Ar mode 2899a4365d0SYoshinobu Inoueis one of following: 2909a4365d0SYoshinobu Inoue.Li transport , tunnel 2919a4365d0SYoshinobu Inoueor 2929a4365d0SYoshinobu Inoue.Li any . 2933c62e87aSJun-ichiro itojun HaginoThe default value is 2943c62e87aSJun-ichiro itojun Hagino.Li any . 2953c62e87aSJun-ichiro itojun Hagino.\" 2969a4365d0SYoshinobu Inoue.It Fl r Ar size 29723852d5cSBenedict ReuschlingSpecify the bitmap size in octets of the anti-replay window. 2989a4365d0SYoshinobu Inoue.Ar size 29923852d5cSBenedict Reuschlingis a 32-bit unsigned integer, and its value is one eighth of the 30023852d5cSBenedict Reuschlinganti-replay window size in packets. 30133841545SHajimu UMEMOTOIf 3029a4365d0SYoshinobu Inoue.Ar size 30323852d5cSBenedict Reuschlingis zero or not specified, an anti-replay check does not take place. 3043c62e87aSJun-ichiro itojun Hagino.\" 3053c62e87aSJun-ichiro itojun Hagino.It Fl u Ar id 30633841545SHajimu UMEMOTOSpecify the identifier of the policy entry in SPD. 30733841545SHajimu UMEMOTOSee 30833841545SHajimu UMEMOTO.Ar policy . 3093c62e87aSJun-ichiro itojun Hagino.\" 3109a4365d0SYoshinobu Inoue.It Fl f Ar pad_option 31133841545SHajimu UMEMOTOdefines the content of the ESP padding. 3129a4365d0SYoshinobu Inoue.Ar pad_option 3139a4365d0SYoshinobu Inoueis one of following: 31433841545SHajimu UMEMOTO.Bl -tag -width random-pad -compact 31533841545SHajimu UMEMOTO.It Li zero-pad 31633841545SHajimu UMEMOTOAll of the padding are zero. 31733841545SHajimu UMEMOTO.It Li random-pad 31833841545SHajimu UMEMOTOA series of randomized values are set. 31933841545SHajimu UMEMOTO.It Li seq-pad 32033841545SHajimu UMEMOTOA series of sequential increasing numbers started from 1 are set. 32133841545SHajimu UMEMOTO.El 3223c62e87aSJun-ichiro itojun Hagino.\" 3233c62e87aSJun-ichiro itojun Hagino.It Fl f Li nocyclic-seq 3246992e2a5SRuslan ErmilovDo not allow cyclic sequence number. 3253c62e87aSJun-ichiro itojun Hagino.\" 3269a4365d0SYoshinobu Inoue.It Fl lh Ar time 3279a4365d0SYoshinobu Inoue.It Fl ls Ar time 32833841545SHajimu UMEMOTOSpecify hard/soft life time duration of the SA. 329cf85818eSKonstantin Belousov.It Fl natt Ar oai \([ Ar sport \(] Ar oar \([ Ar dport \(] 330cf85818eSKonstantin BelousovManually configure NAT-T for the SA, by specifying initiator 331cf85818eSKonstantin Belousov.Ar oai 332cf85818eSKonstantin Belousovand 333cf85818eSKonstantin Belousovrequestor 334cf85818eSKonstantin Belousov.Ar oar 335cf85818eSKonstantin Belousovip addresses and ports. 336cf85818eSKonstantin BelousovNote that the 337cf85818eSKonstantin Belousov.Sq \([ 338cf85818eSKonstantin Belousovand 339cf85818eSKonstantin Belousov.Sq \(] 340cf85818eSKonstantin Belousovsymbols are part of the syntax for the ports specification, 341cf85818eSKonstantin Belousovnot indication of the optional components. 342cf85818eSKonstantin Belousov.It Fl natt_mtu Ar fragsize 343cf85818eSKonstantin BelousovConfigure NAT-T fragment size. 3449b93b2d8SKonstantin Belousov.It Fl esn 3459b93b2d8SKonstantin BelousovEnable Extended Sequence Number extension for this SA. 346*4f39ff1eSKonstantin Belousov.It Fl hwif Ar ifname 347*4f39ff1eSKonstantin BelousovRequest hardware offload to the specified interface 348*4f39ff1eSKonstantin Belousov.Ar ifname 349*4f39ff1eSKonstantin Belousov(only). 350*4f39ff1eSKonstantin BelousovBy default offload occurs to all capable interfaces. 3519a4365d0SYoshinobu Inoue.El 3529a4365d0SYoshinobu Inoue.\" 3539a4365d0SYoshinobu Inoue.Pp 3549a4365d0SYoshinobu Inoue.It Ar algorithm 3559a4365d0SYoshinobu Inoue.Bl -tag -width Fl -compact 3569a4365d0SYoshinobu Inoue.It Fl E Ar ealgo Ar key 357e6dede14SJohn BaldwinSpecify an encryption or Authenticated Encryption with Associated Data 358e6dede14SJohn Baldwin(AEAD) algorithm 359cf43a054SHajimu UMEMOTO.Ar ealgo 360cf43a054SHajimu UMEMOTOfor ESP. 361cf43a054SHajimu UMEMOTO.It Xo 362cf43a054SHajimu UMEMOTO.Fl E Ar ealgo Ar key 363cf43a054SHajimu UMEMOTO.Fl A Ar aalgo Ar key 364cf43a054SHajimu UMEMOTO.Xc 365cf43a054SHajimu UMEMOTOSpecify a encryption algorithm 366cf43a054SHajimu UMEMOTO.Ar ealgo , 367cf43a054SHajimu UMEMOTOas well as a payload authentication algorithm 368cf43a054SHajimu UMEMOTO.Ar aalgo , 369cf43a054SHajimu UMEMOTOfor ESP. 370ec2f949eSTim Vanderhoek.It Fl A Ar aalgo Ar key 371cf43a054SHajimu UMEMOTOSpecify an authentication algorithm for AH. 3729a4365d0SYoshinobu Inoue.It Fl C Ar calgo Op Fl R 373cf43a054SHajimu UMEMOTOSpecify a compression algorithm for IPComp. 3749a4365d0SYoshinobu InoueIf 3759a4365d0SYoshinobu Inoue.Fl R 376fb170c44SGeorge V. Neville-Neilis specified, the 3779a4365d0SYoshinobu Inoue.Ar spi 378cf43a054SHajimu UMEMOTOfield value will be used as the IPComp CPI 3796992e2a5SRuslan Ermilov(compression parameter index) 380cf43a054SHajimu UMEMOTOon wire as is. 3819a4365d0SYoshinobu InoueIf 3829a4365d0SYoshinobu Inoue.Fl R 383cf43a054SHajimu UMEMOTOis not specified, 384cf43a054SHajimu UMEMOTOthe kernel will use well-known CPI on wire, and 3859a4365d0SYoshinobu Inoue.Ar spi 386cf43a054SHajimu UMEMOTOfield will be used only as an index for kernel internal usage. 3879a4365d0SYoshinobu Inoue.El 3889a4365d0SYoshinobu Inoue.Pp 3899a4365d0SYoshinobu Inoue.Ar key 390cf43a054SHajimu UMEMOTOmust be double-quoted character string, or a series of hexadecimal digits 391cf43a054SHajimu UMEMOTOpreceded by 3926992e2a5SRuslan Ermilov.Ql 0x . 3939a4365d0SYoshinobu Inoue.Pp 3949a4365d0SYoshinobu InouePossible values for 3959a4365d0SYoshinobu Inoue.Ar ealgo , 3969a4365d0SYoshinobu Inoue.Ar aalgo 3979a4365d0SYoshinobu Inoueand 3989a4365d0SYoshinobu Inoue.Ar calgo 3999a4365d0SYoshinobu Inoueare specified in separate section. 4009a4365d0SYoshinobu Inoue.\" 401059b1593SBen Smithurst.Pp 4029a4365d0SYoshinobu Inoue.It Ar src_range 4039a4365d0SYoshinobu Inoue.It Ar dst_range 4043c62e87aSJun-ichiro itojun HaginoThese are selections of the secure communication specified as 4059a4365d0SYoshinobu InoueIPv4/v6 address or IPv4/v6 address range, and it may accompany 4069a4365d0SYoshinobu InoueTCP/UDP port specification. 4079a4365d0SYoshinobu InoueThis takes the following form: 40862890a39SRuslan Ermilov.Bd -unfilled 4099a4365d0SYoshinobu Inoue.Ar address 4109a4365d0SYoshinobu Inoue.Ar address/prefixlen 4119a4365d0SYoshinobu Inoue.Ar address[port] 4129a4365d0SYoshinobu Inoue.Ar address/prefixlen[port] 4139a4365d0SYoshinobu Inoue.Ed 4149a4365d0SYoshinobu Inoue.Pp 4159a4365d0SYoshinobu Inoue.Ar prefixlen 4169a4365d0SYoshinobu Inoueand 4179a4365d0SYoshinobu Inoue.Ar port 418fb170c44SGeorge V. Neville-Neilmust be a decimal number. 419fb170c44SGeorge V. Neville-NeilThe square brackets around 4209a4365d0SYoshinobu Inoue.Ar port 421fb170c44SGeorge V. Neville-Neilare necessary and are not manpage metacharacters. 422cf43a054SHajimu UMEMOTOFor FQDN resolution, the rules applicable to 4239a4365d0SYoshinobu Inoue.Ar src 4249a4365d0SYoshinobu Inoueand 425cf43a054SHajimu UMEMOTO.Ar dst 426cf43a054SHajimu UMEMOTOapply here as well. 4279a4365d0SYoshinobu Inoue.\" 428059b1593SBen Smithurst.Pp 4299a4365d0SYoshinobu Inoue.It Ar upperspec 430fb170c44SGeorge V. Neville-NeilThe upper layer protocol to be used. 431fb170c44SGeorge V. Neville-NeilYou can use one of the words in 43233841545SHajimu UMEMOTO.Pa /etc/protocols 43333841545SHajimu UMEMOTOas 434fb170c44SGeorge V. Neville-Neil.Ar upperspec , 435fb170c44SGeorge V. Neville-Neilas well as 436f1b1c5daSBrian Somers.Li icmp6 , 437f1b1c5daSBrian Somers.Li ip4 , 438fb170c44SGeorge V. Neville-Neilor 439fb170c44SGeorge V. Neville-Neil.Li any . 4408266d476SRuslan ErmilovThe word 4418266d476SRuslan Ermilov.Li any 4429a4365d0SYoshinobu Inouestands for 4439a4365d0SYoshinobu Inoue.Dq any protocol . 444fb170c44SGeorge V. Neville-NeilThe protocol number may also be used to specify the 445fb170c44SGeorge V. Neville-Neil.Ar upperspec . 446fb170c44SGeorge V. Neville-NeilA type and code related to ICMPv6 may also be specified as an 447fb170c44SGeorge V. Neville-Neil.Ar upperspec . 448fb170c44SGeorge V. Neville-NeilThe type is specified first, followed by a comma and then the relevant 449fb170c44SGeorge V. Neville-Neilcode. 450fb170c44SGeorge V. Neville-NeilThe specification must be placed after 451cf43a054SHajimu UMEMOTO.Li icmp6 . 452fb170c44SGeorge V. Neville-NeilThe kernel considers a zero to be a wildcard but 453fb170c44SGeorge V. Neville-Neilcannot distinguish between a wildcard and an ICMPv6 454fb170c44SGeorge V. Neville-Neiltype which is zero. 455fb170c44SGeorge V. Neville-NeilThe following example shows a policy where IPSec is not required for 456fb170c44SGeorge V. Neville-Neilinbound Neighbor Solicitations: 4576992e2a5SRuslan Ermilov.Pp 4586992e2a5SRuslan Ermilov.Dl "spdadd ::/0 ::/0 icmp6 135,0 -P in none;" 4599a4365d0SYoshinobu Inoue.Pp 4609a4365d0SYoshinobu InoueNOTE: 4619a4365d0SYoshinobu Inoue.Ar upperspec 462fb170c44SGeorge V. Neville-Neildoes not work in the forwarding case at this moment, 463fb170c44SGeorge V. Neville-Neilas it requires extra reassembly at forwarding node, 464fb170c44SGeorge V. Neville-Neilwhich is not implemented at this moment. 465fb170c44SGeorge V. Neville-NeilAlthough there are many protocols in 46633841545SHajimu UMEMOTO.Pa /etc/protocols , 467fb170c44SGeorge V. Neville-Neilprotocols other than TCP, UDP and ICMP may not be suitable to use with IPsec. 4689a4365d0SYoshinobu Inoue.\" 469059b1593SBen Smithurst.Pp 4709a4365d0SYoshinobu Inoue.It Ar policy 4719a4365d0SYoshinobu Inoue.Ar policy 472fb170c44SGeorge V. Neville-Neilis expressed in one of the following three formats: 473b2e52cedSUlrich Spörlein.Pp 47429e758c2SJoel Dahl.Bl -tag -width 2n -compact 475cf43a054SHajimu UMEMOTO.It Fl P Ar direction Li discard 476cf43a054SHajimu UMEMOTO.It Fl P Ar direction Li none 477cf43a054SHajimu UMEMOTO.It Xo Fl P Ar direction Li ipsec 478cf43a054SHajimu UMEMOTO.Ar protocol/mode/src-dst/level Op ... 47933841545SHajimu UMEMOTO.Xc 480b2e52cedSUlrich Spörlein.El 4819a4365d0SYoshinobu Inoue.Pp 482224fc33fSKonstantin Belousov.Bl -tag -compact -width "policy level" 483224fc33fSKonstantin Belousov.It Ar direction 484224fc33fSKonstantin BelousovThe 485224fc33fSKonstantin Belousov.Ar direction 486224fc33fSKonstantin Belousovof a policy must be specified as one of: 48706bfd0b9SBram Ton.Li out 48806bfd0b9SBram Tonor 48906bfd0b9SBram Ton.Li in . 490224fc33fSKonstantin Belousov.It Ar policy level 49106bfd0b9SBram TonThe direction is followed by one of the following policy levels: 4928266d476SRuslan Ermilov.Li discard , 493fb170c44SGeorge V. Neville-Neil.Li none , 494fb170c44SGeorge V. Neville-Neilor 495fb170c44SGeorge V. Neville-Neil.Li ipsec . 496224fc33fSKonstantin Belousov.Bl -compact -bullet 497224fc33fSKonstantin Belousov.It 4988266d476SRuslan ErmilovThe 4998266d476SRuslan Ermilov.Li discard 50006bfd0b9SBram Tonpolicy level means that packets matching the supplied indices will 501224fc33fSKonstantin Belousovbe discarded. 502224fc33fSKonstantin Belousov.It 503224fc33fSKonstantin BelousovThe 5049a4365d0SYoshinobu Inoue.Li none 505224fc33fSKonstantin Belousovpolicy level means that IPsec operations will not take place on 506224fc33fSKonstantin Belousovthe packet. 507224fc33fSKonstantin Belousov.It 508224fc33fSKonstantin BelousovThe 5099a4365d0SYoshinobu Inoue.Li ipsec 510224fc33fSKonstantin Belousovpolicy level means that IPsec operation will take place onto 511224fc33fSKonstantin Belousovthe packet. 512224fc33fSKonstantin Belousov.El 513224fc33fSKonstantin Belousov.It Ar protocol/mode/src-dst/level 514fb170c44SGeorge V. Neville-NeilThe 515cf43a054SHajimu UMEMOTO.Ar protocol/mode/src-dst/level 516fb170c44SGeorge V. Neville-Neilstatement gives the rule for how to process the packet. 517224fc33fSKonstantin Belousov.Bl -compact -bullet 518224fc33fSKonstantin Belousov.It 5198266d476SRuslan ErmilovThe 5208266d476SRuslan Ermilov.Ar protocol 5218266d476SRuslan Ermilovis specified as 5229a4365d0SYoshinobu Inoue.Li ah , 5239a4365d0SYoshinobu Inoue.Li esp 5249a4365d0SYoshinobu Inoueor 52519d35886SMaxim Konovalov.Li ipcomp . 526224fc33fSKonstantin Belousov.It 527fb170c44SGeorge V. Neville-NeilThe 5289a4365d0SYoshinobu Inoue.Ar mode 5299a4365d0SYoshinobu Inoueis either 5309a4365d0SYoshinobu Inoue.Li transport 5319a4365d0SYoshinobu Inoueor 5329a4365d0SYoshinobu Inoue.Li tunnel . 533224fc33fSKonstantin Belousov.El 534224fc33fSKonstantin Belousov.Pp 53533841545SHajimu UMEMOTOIf 53633841545SHajimu UMEMOTO.Ar mode 53733841545SHajimu UMEMOTOis 53833841545SHajimu UMEMOTO.Li tunnel , 539fb170c44SGeorge V. Neville-Neilyou must specify the end-point addresses of the SA as 5409a4365d0SYoshinobu Inoue.Ar src 5419a4365d0SYoshinobu Inoueand 5429a4365d0SYoshinobu Inoue.Ar dst 543fb170c44SGeorge V. Neville-Neilwith a dash, 544fb170c44SGeorge V. Neville-Neil.Sq - , 545fb170c44SGeorge V. Neville-Neilbetween the addresses. 546224fc33fSKonstantin Belousov.Pp 54733841545SHajimu UMEMOTOIf 54833841545SHajimu UMEMOTO.Ar mode 54933841545SHajimu UMEMOTOis 55033841545SHajimu UMEMOTO.Li transport , 55133841545SHajimu UMEMOTOboth 55233841545SHajimu UMEMOTO.Ar src 55333841545SHajimu UMEMOTOand 55433841545SHajimu UMEMOTO.Ar dst 55557bd0fc6SJens Schweikhardtcan be omitted. 556224fc33fSKonstantin Belousov.Pp 557fb170c44SGeorge V. Neville-NeilThe 5589a4365d0SYoshinobu Inoue.Ar level 559fb170c44SGeorge V. Neville-Neilis one of the following: 56033841545SHajimu UMEMOTO.Li default , use , require 5619a4365d0SYoshinobu Inoueor 56233841545SHajimu UMEMOTO.Li unique . 56333841545SHajimu UMEMOTOIf the SA is not available in every level, the kernel will request 564fb170c44SGeorge V. Neville-Neilthe SA from the key exchange daemon. 565224fc33fSKonstantin Belousov.Pp 566224fc33fSKonstantin Belousov.Bl -compact -bullet 567224fc33fSKonstantin Belousov.It 568fb170c44SGeorge V. Neville-NeilA value of 5699a4365d0SYoshinobu Inoue.Li default 570fb170c44SGeorge V. Neville-Neiltells the kernel to use the system wide default protocol 571c14beb68SWarren Blocke.g.,\& the one from the 5729a4365d0SYoshinobu Inoue.Li esp_trans_deflev 5733c62e87aSJun-ichiro itojun Haginosysctl variable, when the kernel processes the packet. 574224fc33fSKonstantin Belousov.It 5758266d476SRuslan ErmilovA value of 5768266d476SRuslan Ermilov.Li use 577fb170c44SGeorge V. Neville-Neilmeans that the kernel will use an SA if it is available, 578fb170c44SGeorge V. Neville-Neilotherwise the kernel will pass the packet as it would normally. 579224fc33fSKonstantin Belousov.It 5808266d476SRuslan ErmilovA value of 5818266d476SRuslan Ermilov.Li require 582fb170c44SGeorge V. Neville-Neilmeans that an SA is required whenever the kernel sends a packet matched 583fb170c44SGeorge V. Neville-Neilthat matches the policy. 584224fc33fSKonstantin Belousov.It 585fb170c44SGeorge V. Neville-NeilThe 58633841545SHajimu UMEMOTO.Li unique 587fb170c44SGeorge V. Neville-Neillevel is the same as 588fb170c44SGeorge V. Neville-Neil.Li require 589fb170c44SGeorge V. Neville-Neilbut, in addition, it allows the policy to bind with the unique out-bound SA. 590224fc33fSKonstantin Belousov.Pp 591fb170c44SGeorge V. Neville-NeilFor example, if you specify the policy level 592cf43a054SHajimu UMEMOTO.Li unique , 5938b55a471SJens Schweikhardt.Xr racoon 8 Pq Pa ports/security/ipsec-tools 594cf43a054SHajimu UMEMOTOwill configure the SA for the policy. 595cf43a054SHajimu UMEMOTOIf you configure the SA by manual keying for that policy, 59633841545SHajimu UMEMOTOyou can put the decimal number as the policy identifier after 59733841545SHajimu UMEMOTO.Li unique 59833841545SHajimu UMEMOTOseparated by colon 5996992e2a5SRuslan Ermilov.Ql :\& 600fb170c44SGeorge V. Neville-Neilas in the following example: 60133841545SHajimu UMEMOTO.Li unique:number . 6026992e2a5SRuslan ErmilovIn order to bind this policy to the SA, 60333841545SHajimu UMEMOTO.Li number 604fb170c44SGeorge V. Neville-Neilmust be between 1 and 32767, 605fb170c44SGeorge V. Neville-Neilwhich corresponds to 606cf43a054SHajimu UMEMOTO.Ar extensions Fl u 607fb170c44SGeorge V. Neville-Neilof manual SA configuration. 608224fc33fSKonstantin Belousov.El 609224fc33fSKonstantin Belousov.El 610fb170c44SGeorge V. Neville-Neil.Pp 6118266d476SRuslan ErmilovWhen you want to use an SA bundle, you can define multiple rules. 6128266d476SRuslan ErmilovFor 613fb170c44SGeorge V. Neville-Neilexample, if an IP header was followed by an AH header followed by an 614fb170c44SGeorge V. Neville-NeilESP header followed by an upper layer protocol header, the rule would 615fb170c44SGeorge V. Neville-Neilbe: 61629e758c2SJoel Dahl.Pp 617cf43a054SHajimu UMEMOTO.Dl esp/transport//require ah/transport//require ; 61829e758c2SJoel Dahl.Pp 619cf43a054SHajimu UMEMOTOThe rule order is very important. 62033841545SHajimu UMEMOTO.Pp 6219a4365d0SYoshinobu InoueNote that 6229a4365d0SYoshinobu Inoue.Dq Li discard 6239a4365d0SYoshinobu Inoueand 6249a4365d0SYoshinobu Inoue.Dq Li none 6259a4365d0SYoshinobu Inoueare not in the syntax described in 6269a4365d0SYoshinobu Inoue.Xr ipsec_set_policy 3 . 627fb170c44SGeorge V. Neville-NeilThere are small, but important, differences in the syntax. 6289a4365d0SYoshinobu InoueSee 6299a4365d0SYoshinobu Inoue.Xr ipsec_set_policy 3 630fb170c44SGeorge V. Neville-Neilfor details. 6319a4365d0SYoshinobu Inoue.El 6329a4365d0SYoshinobu Inoue.\" 6339a4365d0SYoshinobu Inoue.Sh ALGORITHMS 634e6dede14SJohn BaldwinThe following lists show the supported algorithms. 635e6dede14SJohn Baldwin.Ss Authentication Algorithms 636e6dede14SJohn BaldwinThe following authentication algorithms can be used as 6379a4365d0SYoshinobu Inoue.Ar aalgo 638fb170c44SGeorge V. Neville-Neilin the 6399a4365d0SYoshinobu Inoue.Fl A Ar aalgo 640fb170c44SGeorge V. Neville-Neilof the 6419a4365d0SYoshinobu Inoue.Ar protocol 6429a4365d0SYoshinobu Inoueparameter: 6439a4365d0SYoshinobu Inoue.Bd -literal -offset indent 6449a4365d0SYoshinobu Inouealgorithm keylen (bits) comment 645e6dede14SJohn Baldwinhmac-sha1 160 ah/esp: rfc2404 646e6dede14SJohn Baldwin 160 ah-old/esp-old: 128bit ICV (no document) 6479a4365d0SYoshinobu Inouenull 0 to 2048 for debugging 648e6dede14SJohn Baldwinhmac-sha2-256 256 ah/esp: 128bit ICV (RFC4868) 649e6dede14SJohn Baldwin 256 ah-old/esp-old: 128bit ICV (no document) 650e6dede14SJohn Baldwinhmac-sha2-384 384 ah/esp: 192bit ICV (RFC4868) 651e6dede14SJohn Baldwin 384 ah-old/esp-old: 128bit ICV (no document) 652e6dede14SJohn Baldwinhmac-sha2-512 512 ah/esp: 256bit ICV (RFC4868) 653e6dede14SJohn Baldwin 512 ah-old/esp-old: 128bit ICV (no document) 654e6dede14SJohn Baldwinaes-xcbc-mac 128 ah/esp: 96bit ICV (RFC3566) 655e6dede14SJohn Baldwin 128 ah-old/esp-old: 128bit ICV (no document) 6561922fd12SBruce M Simpsontcp-md5 8 to 640 tcp: rfc2385 6579f8f3a8eSKristof Provostchacha20-poly1305 256 ah/esp: 128bit ICV (RFC7634) 6589a4365d0SYoshinobu Inoue.Ed 659e6dede14SJohn Baldwin.Ss Encryption Algorithms 660e6dede14SJohn BaldwinThe following encryption algorithms can be used as the 6619a4365d0SYoshinobu Inoue.Ar ealgo 662fb170c44SGeorge V. Neville-Neilin the 6639a4365d0SYoshinobu Inoue.Fl E Ar ealgo 664fb170c44SGeorge V. Neville-Neilof the 6659a4365d0SYoshinobu Inoue.Ar protocol 6669a4365d0SYoshinobu Inoueparameter: 6679a4365d0SYoshinobu Inoue.Bd -literal -offset indent 6689a4365d0SYoshinobu Inouealgorithm keylen (bits) comment 669cf43a054SHajimu UMEMOTOnull 0 to 2048 rfc2410 67000a4311aSJohn Baldwinaes-cbc 128/192/256 rfc3602 671af5b6f81SJohn Baldwinaes-ctr 160/224/288 rfc3686 672e6dede14SJohn Baldwinaes-gcm-16 160/224/288 AEAD; rfc4106 6739f8f3a8eSKristof Provostchacha20-poly1305 256 rfc7634 6749a4365d0SYoshinobu Inoue.Ed 6759a4365d0SYoshinobu Inoue.Pp 6764c4090f5SPawel Jakub DawidekNote that the first 128/192/256 bits of a key for 677e6dede14SJohn Baldwin.Li aes-ctr 678e6dede14SJohn Baldwinor 679e6dede14SJohn Baldwin.Li aes-gcm-16 680e6dede14SJohn Baldwinwill be used as the AES key, 681e6dede14SJohn Baldwinand the remaining 32 bits will be used as the nonce. 682b42ac57fSHajimu UMEMOTO.Pp 683e6dede14SJohn BaldwinAEAD encryption algorithms such as 684e6dede14SJohn Baldwin.Li aes-gcm-16 685e6dede14SJohn Baldwininclude authentication and should not be 686e6dede14SJohn Baldwinpaired with a separate authentication algorithm via 687e6dede14SJohn Baldwin.Fl A . 688e6dede14SJohn Baldwin.Ss Compression Algorithms 689e6dede14SJohn BaldwinThe following compression algorithms can be used 690fb170c44SGeorge V. Neville-Neilas the 6919a4365d0SYoshinobu Inoue.Ar calgo 692fb170c44SGeorge V. Neville-Neilin the 6939a4365d0SYoshinobu Inoue.Fl C Ar calgo 694fb170c44SGeorge V. Neville-Neilof the 6959a4365d0SYoshinobu Inoue.Ar protocol 6969a4365d0SYoshinobu Inoueparameter: 6979a4365d0SYoshinobu Inoue.Bd -literal -offset indent 6989a4365d0SYoshinobu Inouealgorithm comment 6999a4365d0SYoshinobu Inouedeflate rfc2394 7009a4365d0SYoshinobu Inoue.Ed 7019a4365d0SYoshinobu Inoue.\" 702a866e170SRuslan Ermilov.Sh EXIT STATUS 7036992e2a5SRuslan Ermilov.Ex -std 704cf43a054SHajimu UMEMOTO.\" 7059a4365d0SYoshinobu Inoue.Sh EXAMPLES 706fb170c44SGeorge V. Neville-NeilAdd an ESP SA between two IPv6 addresses using the 707e6dede14SJohn BaldwinAES-GCM AEAD algorithm. 70846355096SJoel Dahl.Bd -literal -offset indent 7099a4365d0SYoshinobu Inoueadd 3ffe:501:4819::1 3ffe:501:481d::1 esp 123457 71016aabb76SJohn Baldwin -E aes-gcm-16 0x3ffe050148193ffe050148193ffe050148193ffe ; 711c14beb68SWarren Block.Pp 712fb170c44SGeorge V. Neville-Neil.Ed 713fb170c44SGeorge V. Neville-Neil.\" 714fb170c44SGeorge V. Neville-NeilAdd an authentication SA between two FQDN specified hosts: 71546355096SJoel Dahl.Bd -literal -offset indent 716cf43a054SHajimu UMEMOTOadd -6 myhost.example.com yourhost.example.com ah 123456 71716aabb76SJohn Baldwin -A hmac-sha2-256 "AH SA configuration!" ; 718c14beb68SWarren Block.Pp 719fb170c44SGeorge V. Neville-Neil.Ed 72016d1ba4fSMaxim KonovalovGet the SA information associated with first example above: 72146355096SJoel Dahl.Bd -literal -offset indent 7229a4365d0SYoshinobu Inoueget 3ffe:501:4819::1 3ffe:501:481d::1 ah 123456 ; 723c14beb68SWarren Block.Pp 724fb170c44SGeorge V. Neville-Neil.Ed 725fb170c44SGeorge V. Neville-NeilFlush all entries from the database: 72646355096SJoel Dahl.Bd -literal -offset indent 7279a4365d0SYoshinobu Inoueflush ; 728c14beb68SWarren Block.Pp 729fb170c44SGeorge V. Neville-Neil.Ed 730fb170c44SGeorge V. Neville-NeilDump the ESP entries from the database: 73146355096SJoel Dahl.Bd -literal -offset indent 7329a4365d0SYoshinobu Inouedump esp ; 733c14beb68SWarren Block.Pp 734fb170c44SGeorge V. Neville-Neil.Ed 735fb170c44SGeorge V. Neville-NeilAdd a security policy between two networks that uses ESP in tunnel mode: 73646355096SJoel Dahl.Bd -literal -offset indent 7379a4365d0SYoshinobu Inouespdadd 10.0.11.41/32[21] 10.0.11.33/32[any] any 7389a4365d0SYoshinobu Inoue -P out ipsec esp/tunnel/192.168.0.1-192.168.1.2/require ; 739c14beb68SWarren Block.Pp 740fb170c44SGeorge V. Neville-Neil.Ed 741fb170c44SGeorge V. Neville-NeilUse TCP MD5 between two numerically specified hosts: 74246355096SJoel Dahl.Bd -literal -offset indent 7431922fd12SBruce M Simpsonadd 10.1.10.34 10.1.10.36 tcp 0x1000 -A tcp-md5 "TCP-MD5 BGP secret" ; 7441bbe19e6SAndrey V. Elsukovadd 10.1.10.36 10.1.10.34 tcp 0x1001 -A tcp-md5 "TCP-MD5 BGP secret" ; 7459a4365d0SYoshinobu Inoue.Ed 7469a4365d0SYoshinobu Inoue.\" 7479a4365d0SYoshinobu Inoue.Sh SEE ALSO 7489a4365d0SYoshinobu Inoue.Xr ipsec_set_policy 3 , 74922986c67SAndrey V. Elsukov.Xr if_ipsec 4 , 7508b55a471SJens Schweikhardt.Xr racoon 8 Pq Pa ports/security/ipsec-tools , 7515521ff5aSRuslan Ermilov.Xr sysctl 8 752cf43a054SHajimu UMEMOTO.Rs 753cf43a054SHajimu UMEMOTO.%T "Changed manual key configuration for IPsec" 754179a53bbSWolfram Schneider.%U https://www.kame.net/newsletter/19991007/ 755cf43a054SHajimu UMEMOTO.%D "October 1999" 756cf43a054SHajimu UMEMOTO.Re 7579a4365d0SYoshinobu Inoue.\" 7589a4365d0SYoshinobu Inoue.Sh HISTORY 7599a4365d0SYoshinobu InoueThe 7609a4365d0SYoshinobu Inoue.Nm 7616992e2a5SRuslan Ermilovutility first appeared in WIDE Hydrangea IPv6 protocol stack kit. 7626992e2a5SRuslan ErmilovThe utility was completely re-designed in June 1998. 763032a05d5SSevan JaniyanIt first appeared in 764032a05d5SSevan Janiyan.Fx 4.0 . 7653c62e87aSJun-ichiro itojun Hagino.\" 766cf43a054SHajimu UMEMOTO.Sh BUGS 7676992e2a5SRuslan ErmilovThe 768cf43a054SHajimu UMEMOTO.Nm 7696992e2a5SRuslan Ermilovutility 770cf43a054SHajimu UMEMOTOshould report and handle syntax errors better. 771cf43a054SHajimu UMEMOTO.Pp 772cf43a054SHajimu UMEMOTOFor IPsec gateway configuration, 773cf43a054SHajimu UMEMOTO.Ar src_range 774cf43a054SHajimu UMEMOTOand 775cf43a054SHajimu UMEMOTO.Ar dst_range 776cf43a054SHajimu UMEMOTOwith TCP/UDP port number do not work, as the gateway does not reassemble 777cf43a054SHajimu UMEMOTOpackets 7786992e2a5SRuslan Ermilov(cannot inspect upper-layer headers). 779