1997-03-07 02:50:01 +00:00
|
|
|
.\"
|
1999-08-28 00:22:10 +00:00
|
|
|
.\" $FreeBSD$
|
1997-03-07 02:50:01 +00:00
|
|
|
.\"
|
2020-08-19 17:52:06 +00:00
|
|
|
.Dd August 19, 2020
|
2002-10-28 07:24:58 +00:00
|
|
|
.Dt IPFW 4
|
1995-02-17 18:48:36 +00:00
|
|
|
.Os
|
|
|
|
.Sh NAME
|
2002-10-28 07:24:58 +00:00
|
|
|
.Nm ipfw
|
1997-06-23 02:12:21 +00:00
|
|
|
.Nd IP packet filter and traffic accounting
|
2006-09-01 08:50:05 +00:00
|
|
|
.Sh SYNOPSIS
|
|
|
|
To compile
|
2012-05-14 16:25:17 +00:00
|
|
|
the driver
|
2006-09-01 08:50:05 +00:00
|
|
|
into the kernel, place the following option in the kernel configuration
|
|
|
|
file:
|
|
|
|
.Bd -ragged -offset indent
|
|
|
|
.Cd "options IPFIREWALL"
|
|
|
|
.Ed
|
|
|
|
.Pp
|
2012-05-14 16:25:17 +00:00
|
|
|
Other related kernel options
|
2006-09-01 08:50:05 +00:00
|
|
|
which may also be useful are:
|
|
|
|
.Bd -ragged -offset indent
|
|
|
|
.Cd "options IPFIREWALL_DEFAULT_TO_ACCEPT"
|
2020-05-22 03:13:29 +00:00
|
|
|
.Cd "options IPDIVERT"
|
|
|
|
.Cd "options IPFIREWALL_NAT"
|
|
|
|
.Cd "options IPFIREWALL_NAT64"
|
|
|
|
.Cd "options IPFIREWALL_NPTV6"
|
|
|
|
.Cd "options IPFIREWALL_PMOD"
|
2006-09-01 08:50:05 +00:00
|
|
|
.Cd "options IPFIREWALL_VERBOSE"
|
|
|
|
.Cd "options IPFIREWALL_VERBOSE_LIMIT=100"
|
2020-05-22 03:13:29 +00:00
|
|
|
.Cd "options LIBALIAS"
|
2006-09-01 08:50:05 +00:00
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
To load
|
2012-05-14 16:25:17 +00:00
|
|
|
the driver
|
2006-09-01 08:50:05 +00:00
|
|
|
as a module at boot time, add the following line into the
|
2006-10-16 07:56:36 +00:00
|
|
|
.Xr loader.conf 5
|
2006-09-01 08:50:05 +00:00
|
|
|
file:
|
|
|
|
.Bd -literal -offset indent
|
2006-10-16 07:56:36 +00:00
|
|
|
ipfw_load="YES"
|
2006-09-01 08:50:05 +00:00
|
|
|
.Ed
|
1995-02-17 18:48:36 +00:00
|
|
|
.Sh DESCRIPTION
|
2002-11-29 11:39:20 +00:00
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
system facility allows filtering,
|
|
|
|
redirecting, and other operations on
|
|
|
|
.Tn IP
|
|
|
|
packets travelling through
|
|
|
|
network interfaces.
|
1996-07-11 02:37:59 +00:00
|
|
|
.Pp
|
2006-09-01 08:50:05 +00:00
|
|
|
The default behavior of
|
|
|
|
.Nm
|
|
|
|
is to block all incoming and outgoing traffic.
|
|
|
|
This behavior can be modified, to allow all traffic through the
|
|
|
|
.Nm
|
|
|
|
firewall by default, by enabling the
|
|
|
|
.Dv IPFIREWALL_DEFAULT_TO_ACCEPT
|
|
|
|
kernel option.
|
|
|
|
This option may be useful when configuring
|
|
|
|
.Nm
|
|
|
|
for the first time.
|
|
|
|
If the default
|
|
|
|
.Nm
|
|
|
|
behavior is to allow everything, it is easier to cope with
|
|
|
|
firewall-tuning mistakes which may accidentally block all traffic.
|
|
|
|
.Pp
|
2020-05-22 03:13:29 +00:00
|
|
|
When using
|
|
|
|
.Xr natd 8
|
|
|
|
in conjunction with
|
|
|
|
.Nm
|
|
|
|
as
|
|
|
|
.Tn NAT
|
|
|
|
facility, the kernel option
|
|
|
|
.Dv IPDIVERT
|
|
|
|
enables diverting packets to
|
|
|
|
.Xr natd 8
|
|
|
|
for translation.
|
|
|
|
.Pp
|
|
|
|
When using the in-kernel
|
|
|
|
.Tn NAT
|
|
|
|
facility of
|
|
|
|
.Nm ,
|
|
|
|
the kernel option
|
|
|
|
.Dv IPFIREWALL_NAT
|
|
|
|
enables basic
|
|
|
|
.Xr libalias 3
|
|
|
|
functionality in the kernel.
|
|
|
|
.Pp
|
|
|
|
When using any of the
|
|
|
|
.Tn IPv4
|
|
|
|
to
|
|
|
|
.Tn IPv6
|
|
|
|
transition mechanisms in
|
|
|
|
.Nm ,
|
|
|
|
the kernel option
|
|
|
|
.Dv IPFIREWALL_NAT64
|
|
|
|
enables all of these
|
|
|
|
.Tn NAT64
|
|
|
|
methods in the kernel.
|
|
|
|
.Pp
|
|
|
|
When using the
|
|
|
|
.Tn IPv6
|
|
|
|
network prefix translation facility of
|
|
|
|
.Nm ,
|
|
|
|
the kernel option
|
|
|
|
.Dv IPFIREWALL_NPTV6
|
|
|
|
enables this functionality in the kernel.
|
|
|
|
.Pp
|
|
|
|
When using the packet modification facility of
|
|
|
|
.Nm ,
|
|
|
|
the kernel option
|
|
|
|
.Dv IPFIREWALL_PMOD
|
|
|
|
enables this functionality in the kernel.
|
|
|
|
.Pp
|
2006-09-01 08:50:05 +00:00
|
|
|
To enable logging of packets passing through
|
|
|
|
.Nm ,
|
|
|
|
enable the
|
|
|
|
.Dv IPFIREWALL_VERBOSE
|
|
|
|
kernel option.
|
|
|
|
The
|
|
|
|
.Dv IPFIREWALL_VERBOSE_LIMIT
|
|
|
|
option will prevent
|
|
|
|
.Xr syslogd 8
|
|
|
|
from flooding system logs or causing local Denial of Service.
|
|
|
|
This option may be set to the number of packets which will be logged on
|
|
|
|
a per-entry basis before the entry is rate-limited.
|
|
|
|
.Pp
|
2020-05-22 03:13:29 +00:00
|
|
|
When using the in-kernel
|
|
|
|
.Tn NAT
|
|
|
|
facility of
|
|
|
|
.Nm ,
|
|
|
|
the kernel option
|
|
|
|
.Dv LIBALIAS
|
|
|
|
enables full
|
|
|
|
.Xr libalias 3
|
|
|
|
functionality in the kernel.
|
2020-08-19 17:52:06 +00:00
|
|
|
Full functionality refers to included support for ftp, bbt,
|
2020-05-22 03:13:29 +00:00
|
|
|
skinny, irc, pptp and smedia packets, which are missing in the basic
|
|
|
|
.Xr libalias 3
|
|
|
|
functionality accomplished with the
|
|
|
|
.Dv IPFIREWALL_NAT
|
|
|
|
kernel option.
|
|
|
|
.Pp
|
2002-10-28 07:24:58 +00:00
|
|
|
The user interface for
|
2002-11-29 11:39:20 +00:00
|
|
|
.Nm
|
2002-10-28 07:24:58 +00:00
|
|
|
is implemented by the
|
|
|
|
.Xr ipfw 8
|
2002-11-29 11:39:20 +00:00
|
|
|
utility, so please refer to the
|
|
|
|
.Xr ipfw 8
|
2020-05-22 03:13:29 +00:00
|
|
|
man page for a complete description of the
|
2002-11-29 11:39:20 +00:00
|
|
|
.Nm
|
|
|
|
capabilities and how to use it.
|
1995-02-17 18:48:36 +00:00
|
|
|
.Sh SEE ALSO
|
1996-07-11 02:37:59 +00:00
|
|
|
.Xr setsockopt 2 ,
|
1997-06-23 02:12:21 +00:00
|
|
|
.Xr divert 4 ,
|
1997-09-29 10:11:02 +00:00
|
|
|
.Xr ip 4 ,
|
2020-05-22 03:13:29 +00:00
|
|
|
.Xr ip6 4 ,
|
1997-06-23 02:12:21 +00:00
|
|
|
.Xr ipfw 8 ,
|
2020-05-22 03:13:29 +00:00
|
|
|
.Xr libalias 3 ,
|
|
|
|
.Xr natd 8 ,
|
2001-02-22 09:12:44 +00:00
|
|
|
.Xr sysctl 8 ,
|
2004-08-19 18:04:10 +00:00
|
|
|
.Xr syslogd 8 ,
|
|
|
|
.Xr pfil 9
|