]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/man/man4/ipfirewall.4
zfs: merge openzfs/zfs@14b43fbd9 (master) into main
[FreeBSD/FreeBSD.git] / share / man / man4 / ipfirewall.4
1 .\"
2 .\" $FreeBSD$
3 .\"
4 .Dd August 19, 2020
5 .Dt IPFW 4
6 .Os
7 .Sh NAME
8 .Nm ipfw
9 .Nd IP packet filter and traffic accounting
10 .Sh SYNOPSIS
11 To compile
12 the driver
13 into the kernel, place the following option in the kernel configuration
14 file:
15 .Bd -ragged -offset indent
16 .Cd "options IPFIREWALL"
17 .Ed
18 .Pp
19 Other related kernel options
20 which may also be useful are:
21 .Bd -ragged -offset indent
22 .Cd "options IPFIREWALL_DEFAULT_TO_ACCEPT"
23 .Cd "options IPDIVERT"
24 .Cd "options IPFIREWALL_NAT"
25 .Cd "options IPFIREWALL_NAT64"
26 .Cd "options IPFIREWALL_NPTV6"
27 .Cd "options IPFIREWALL_PMOD"
28 .Cd "options IPFIREWALL_VERBOSE"
29 .Cd "options IPFIREWALL_VERBOSE_LIMIT=100"
30 .Cd "options LIBALIAS"
31 .Ed
32 .Pp
33 To load
34 the driver
35 as a module at boot time, add the following line into the
36 .Xr loader.conf 5
37 file:
38 .Bd -literal -offset indent
39 ipfw_load="YES"
40 .Ed
41 .Sh DESCRIPTION
42 The
43 .Nm
44 system facility allows filtering,
45 redirecting, and other operations on
46 .Tn IP
47 packets travelling through
48 network interfaces.
49 .Pp
50 The default behavior of
51 .Nm
52 is to block all incoming and outgoing traffic.
53 This behavior can be modified, to allow all traffic through the
54 .Nm
55 firewall by default, by enabling the
56 .Dv IPFIREWALL_DEFAULT_TO_ACCEPT
57 kernel option.
58 This option may be useful when configuring
59 .Nm
60 for the first time.
61 If the default
62 .Nm
63 behavior is to allow everything, it is easier to cope with
64 firewall-tuning mistakes which may accidentally block all traffic.
65 .Pp
66 When using
67 .Xr natd 8
68 in conjunction with
69 .Nm
70 as
71 .Tn NAT
72 facility, the kernel option
73 .Dv IPDIVERT
74 enables diverting packets to
75 .Xr natd 8
76 for translation.
77 .Pp
78 When using the in-kernel
79 .Tn NAT
80 facility of
81 .Nm ,
82 the kernel option
83 .Dv IPFIREWALL_NAT
84 enables basic
85 .Xr libalias 3
86 functionality in the kernel.
87 .Pp
88 When using any of the
89 .Tn IPv4
90 to
91 .Tn IPv6
92 transition mechanisms in
93 .Nm ,
94 the kernel option
95 .Dv IPFIREWALL_NAT64
96 enables all of these
97 .Tn NAT64
98 methods in the kernel.
99 .Pp
100 When using the
101 .Tn IPv6
102 network prefix translation facility of
103 .Nm ,
104 the kernel option
105 .Dv IPFIREWALL_NPTV6
106 enables this functionality in the kernel.
107 .Pp
108 When using the packet modification facility of
109 .Nm ,
110 the kernel option
111 .Dv IPFIREWALL_PMOD
112 enables this functionality in the kernel.
113 .Pp
114 To enable logging of packets passing through
115 .Nm ,
116 enable the
117 .Dv IPFIREWALL_VERBOSE
118 kernel option.
119 The
120 .Dv IPFIREWALL_VERBOSE_LIMIT
121 option will prevent
122 .Xr syslogd 8
123 from flooding system logs or causing local Denial of Service.
124 This option may be set to the number of packets which will be logged on
125 a per-entry basis before the entry is rate-limited.
126 .Pp
127 When using the in-kernel
128 .Tn NAT
129 facility of
130 .Nm ,
131 the kernel option
132 .Dv LIBALIAS
133 enables full
134 .Xr libalias 3
135 functionality in the kernel.
136 Full functionality refers to included support for ftp, bbt,
137 skinny, irc, pptp and smedia packets, which are missing in the basic
138 .Xr libalias 3
139 functionality accomplished with the
140 .Dv IPFIREWALL_NAT
141 kernel option.
142 .Pp
143 The user interface for
144 .Nm
145 is implemented by the
146 .Xr ipfw 8
147 utility, so please refer to the
148 .Xr ipfw 8
149 man page for a complete description of the
150 .Nm
151 capabilities and how to use it.
152 .Sh SEE ALSO
153 .Xr setsockopt 2 ,
154 .Xr divert 4 ,
155 .Xr ip 4 ,
156 .Xr ip6 4 ,
157 .Xr ipfw 8 ,
158 .Xr libalias 3 ,
159 .Xr natd 8 ,
160 .Xr sysctl 8 ,
161 .Xr syslogd 8 ,
162 .Xr pfil 9