1 .\" Copyright (c) 2017 Andrey V. Elsukov <ae@FreeBSD.org>
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .Nd IPsec virtual tunneling interface
36 network interface is a part of the
39 To compile it into the kernel, place this line in the kernel
41 .Bd -ragged -offset indent
45 It can also be loaded as part of the
47 kernel module if the kernel was compiled with
48 .Bd -ragged -offset indent
49 .Cd "options IPSEC_SUPPORT"
54 network interface is targeted for creating route-based VPNs.
55 It can tunnel IPv4 and IPv6 traffic over either IPv4 or IPv6 and secure
59 interfaces are dynamically created and destroyed with the
65 The administrator must configure IPsec
68 These addresses will be used for the outer IP header of ESP packets.
69 The administrator can also configure the protocol and addresses for the inner
72 and modify the routing table to route the packets through the
78 interface is configured, it automatically creates special security policies.
79 These policies can be used to acquire security associations from the IKE daemon,
80 which are needed for establishing an IPsec tunnel.
81 It is also possible to create needed security associations manually with the
87 interface has an additional numeric configuration option
91 is used to distinguish traffic and security policies between several
96 can be specified on interface creation and changed later.
97 If not specified, it is automatically assigned.
100 will lead to generation of new security policies, and this
101 may require creating new security associations.
103 The example below shows manual configuration of an IPsec tunnel
104 between two FreeBSD hosts.
105 Host A has the IP address 192.168.0.3, and host B has the IP address
109 .Bd -literal -offset indent
110 ifconfig ipsec0 create reqid 100
111 ifconfig ipsec0 inet tunnel 192.168.0.3 192.168.0.5
112 ifconfig ipsec0 inet 172.16.0.3/16 172.16.0.5
114 add 192.168.0.3 192.168.0.5 esp 10000 -m tunnel -u 100 -E rijndael-cbc "VerySecureKey!!1";
115 add 192.168.0.5 192.168.0.3 esp 10001 -m tunnel -u 100 -E rijndael-cbc "VerySecureKey!!2";
120 .Bd -literal -offset indent
121 ifconfig ipsec0 create reqid 200
122 ifconfig ipsec0 inet tunnel 192.168.0.5 192.168.0.3
123 ifconfig ipsec0 inet 172.16.0.5/16 172.16.0.3
125 add 192.168.0.3 192.168.0.5 esp 10000 -m tunnel -u 200 -E rijndael-cbc "VerySecureKey!!1";
126 add 192.168.0.5 192.168.0.3 esp 10001 -m tunnel -u 200 -E rijndael-cbc "VerySecureKey!!2";
130 Note the value 100 on host A and value 200 on host B are used as reqid.
131 The same value must be used as identifier of the policy entry in the
141 .An Andrey V. Elsukov Aq Mt ae@FreeBSD.org