]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/man/man4/enc.4
disk(9): Fix a few mandoc related errors
[FreeBSD/FreeBSD.git] / share / man / man4 / enc.4
1 .\"     $OpenBSD: enc.4,v 1.22 2006/05/26 08:51:29 jmc Exp $
2 .\"
3 .\" Copyright (c) 1999 Angelos D. Keromytis
4 .\" All rights reserved.
5 .\"
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
8 .\" are met:
9 .\"
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\"    notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\"    notice, this list of conditions and the following disclaimer in the
14 .\"    documentation and/or other materials provided with the distribution.
15 .\" 3. All advertising materials mentioning features or use of this software
16 .\"    must display the following acknowledgement:
17 .\"     This product includes software developed by Angelos D. Keromytis.
18 .\" 4. The name of the author may not be used to endorse or promote products
19 .\"    derived from this software without specific prior written permission.
20 .\"
21 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 .\"
32 .\" $FreeBSD$
33 .\"
34 .Dd August 9, 2017
35 .Dt ENC 4
36 .Os
37 .Sh NAME
38 .Nm enc
39 .Nd Encapsulating Interface
40 .Sh SYNOPSIS
41 To compile this driver into the kernel,
42 place the following line in your
43 kernel configuration file:
44 .Bd -ragged -offset indent
45 .Cd "device enc"
46 .Ed
47 .Pp
48 Alternatively, to load the driver as a
49 module at boot time, place the following line in
50 .Xr loader.conf 5 :
51 .Bd -literal -offset indent
52 if_enc_load="YES"
53 .Ed
54 .Sh DESCRIPTION
55 The
56 .Nm
57 interface is a software loopback mechanism that allows hosts or
58 firewalls to filter
59 .Xr ipsec 4
60 traffic using any firewall package that hooks in via the
61 .Xr pfil 9
62 framework.
63 .Pp
64 The
65 .Nm
66 interface allows an administrator to see incoming and outgoing packets
67 before and after they will be or have been processed by
68 .Xr ipsec 4
69 via
70 .Xr tcpdump 1 .
71 .Pp
72 The
73 .Dq Li enc0
74 interface inherits all IPsec traffic.
75 Thus all IPsec traffic can be filtered based on
76 .Dq Li enc0 ,
77 and all IPsec traffic could be seen by invoking
78 .Xr tcpdump 1
79 on the
80 .Dq Li enc0
81 interface.
82 .Pp
83 What can be seen with
84 .Xr tcpdump 1
85 and what will be passed on to the firewalls via the
86 .Xr pfil 9
87 framework can be independently controlled using the following
88 .Xr sysctl 8
89 variables:
90 .Bl -column net.enc.out.ipsec_filter_mask 0x00000000 0x00000000
91 .It Sy "Name    Defaults        Suggested"
92 .It "net.enc.out.ipsec_bpf_mask 0x00000003      0x00000001"
93 .It "net.enc.out.ipsec_filter_mask      0x00000001      0x00000001"
94 .It "net.enc.in.ipsec_bpf_mask  0x00000001      0x00000002"
95 .It "net.enc.in.ipsec_filter_mask       0x00000001      0x00000002"
96 .El
97 .Pp
98 For the incoming path a value of
99 .Li 0x1
100 means
101 .Dq Li before stripping off the outer header
102 and
103 .Li 0x2
104 means
105 .Dq Li after stripping off the outer header .
106 For the outgoing path
107 .Li 0x1
108 means
109 .Dq Li with only the inner header
110 and
111 .Li 0x2
112 means
113 .Dq Li with outer and inner headers .
114 .Bd -literal
115 incoming path                                          |------|
116 ---- IPsec processing ---- (before) ---- (after) ----> |      |
117                                                        | Host |
118 <--- IPsec processing ---- (after) ----- (before) ---- |      |
119 outgoing path                                          |------|
120 .Ed
121 .Pp
122 Most people will want to run with the suggested defaults for
123 .Cm ipsec_filter_mask
124 and rely on the security policy database for the outer headers.
125 .Pp
126 Note that packets are captured by BPF before firewall processing.
127 The special value 0x4 can be configured in the
128 .Ar ipsec_bpf_mask
129 and packets will be also captured after firewall processing.
130 .Sh EXAMPLES
131 To see the packets the processed via
132 .Xr ipsec 4 ,
133 adjust the
134 .Xr sysctl 8
135 variables according to your need and run:
136 .Pp
137 .Dl "tcpdump -i enc0"
138 .Sh SEE ALSO
139 .Xr tcpdump 1 ,
140 .Xr bpf 4 ,
141 .Xr ipf 4 ,
142 .Xr ipfw 4 ,
143 .Xr ipsec 4 ,
144 .Xr pf 4