1892cb98eSJohn-Mark Gurney.\" 27f3dea24SPeter Wemm.\" $FreeBSD$ 3892cb98eSJohn-Mark Gurney.\" 4*24234982SRodney W. Grimes.Dd May 21, 2020 59a96729cSLuigi Rizzo.Dt IPFW 4 6a53227ffSUgen J.S. Antsilevich.Os 7a53227ffSUgen J.S. Antsilevich.Sh NAME 89a96729cSLuigi Rizzo.Nm ipfw 92a81fd7cSJulian Elischer.Nd IP packet filter and traffic accounting 10910201d9SDaniel Gerzo.Sh SYNOPSIS 11910201d9SDaniel GerzoTo compile 127646a841SJoel Dahlthe driver 13910201d9SDaniel Gerzointo the kernel, place the following option in the kernel configuration 14910201d9SDaniel Gerzofile: 15910201d9SDaniel Gerzo.Bd -ragged -offset indent 16910201d9SDaniel Gerzo.Cd "options IPFIREWALL" 17910201d9SDaniel Gerzo.Ed 18910201d9SDaniel Gerzo.Pp 197646a841SJoel DahlOther related kernel options 20910201d9SDaniel Gerzowhich may also be useful are: 21910201d9SDaniel Gerzo.Bd -ragged -offset indent 22910201d9SDaniel Gerzo.Cd "options IPFIREWALL_DEFAULT_TO_ACCEPT" 23*24234982SRodney W. Grimes.Cd "options IPDIVERT" 24*24234982SRodney W. Grimes.Cd "options IPFIREWALL_NAT" 25*24234982SRodney W. Grimes.Cd "options IPFIREWALL_NAT64" 26*24234982SRodney W. Grimes.Cd "options IPFIREWALL_NPTV6" 27*24234982SRodney W. Grimes.Cd "options IPFIREWALL_PMOD" 28910201d9SDaniel Gerzo.Cd "options IPFIREWALL_VERBOSE" 29910201d9SDaniel Gerzo.Cd "options IPFIREWALL_VERBOSE_LIMIT=100" 30*24234982SRodney W. Grimes.Cd "options LIBALIAS" 31910201d9SDaniel Gerzo.Ed 32910201d9SDaniel Gerzo.Pp 33910201d9SDaniel GerzoTo load 347646a841SJoel Dahlthe driver 35910201d9SDaniel Gerzoas a module at boot time, add the following line into the 367ebbc96cSDaniel Gerzo.Xr loader.conf 5 37910201d9SDaniel Gerzofile: 38910201d9SDaniel Gerzo.Bd -literal -offset indent 397ebbc96cSDaniel Gerzoipfw_load="YES" 40910201d9SDaniel Gerzo.Ed 412a81fd7cSJulian Elischer.Sh DESCRIPTION 42d962d52aSRuslan ErmilovThe 43d962d52aSRuslan Ermilov.Nm 44d962d52aSRuslan Ermilovsystem facility allows filtering, 45d962d52aSRuslan Ermilovredirecting, and other operations on 46d962d52aSRuslan Ermilov.Tn IP 47d962d52aSRuslan Ermilovpackets travelling through 48d962d52aSRuslan Ermilovnetwork interfaces. 492a81fd7cSJulian Elischer.Pp 50910201d9SDaniel GerzoThe default behavior of 51910201d9SDaniel Gerzo.Nm 52910201d9SDaniel Gerzois to block all incoming and outgoing traffic. 53910201d9SDaniel GerzoThis behavior can be modified, to allow all traffic through the 54910201d9SDaniel Gerzo.Nm 55910201d9SDaniel Gerzofirewall by default, by enabling the 56910201d9SDaniel Gerzo.Dv IPFIREWALL_DEFAULT_TO_ACCEPT 57910201d9SDaniel Gerzokernel option. 58910201d9SDaniel GerzoThis option may be useful when configuring 59910201d9SDaniel Gerzo.Nm 60910201d9SDaniel Gerzofor the first time. 61910201d9SDaniel GerzoIf the default 62910201d9SDaniel Gerzo.Nm 63910201d9SDaniel Gerzobehavior is to allow everything, it is easier to cope with 64910201d9SDaniel Gerzofirewall-tuning mistakes which may accidentally block all traffic. 65910201d9SDaniel Gerzo.Pp 66*24234982SRodney W. GrimesWhen using 67*24234982SRodney W. Grimes.Xr natd 8 68*24234982SRodney W. Grimesin conjunction with 69*24234982SRodney W. Grimes.Nm 70*24234982SRodney W. Grimesas 71*24234982SRodney W. Grimes.Tn NAT 72*24234982SRodney W. Grimesfacility, the kernel option 73*24234982SRodney W. Grimes.Dv IPDIVERT 74*24234982SRodney W. Grimesenables diverting packets to 75*24234982SRodney W. Grimes.Xr natd 8 76*24234982SRodney W. Grimesfor translation. 77*24234982SRodney W. Grimes.Pp 78*24234982SRodney W. GrimesWhen using the in-kernel 79*24234982SRodney W. Grimes.Tn NAT 80*24234982SRodney W. Grimesfacility of 81*24234982SRodney W. Grimes.Nm , 82*24234982SRodney W. Grimesthe kernel option 83*24234982SRodney W. Grimes.Dv IPFIREWALL_NAT 84*24234982SRodney W. Grimesenables basic 85*24234982SRodney W. Grimes.Xr libalias 3 86*24234982SRodney W. Grimesfunctionality in the kernel. 87*24234982SRodney W. Grimes.Pp 88*24234982SRodney W. GrimesWhen using any of the 89*24234982SRodney W. Grimes.Tn IPv4 90*24234982SRodney W. Grimesto 91*24234982SRodney W. Grimes.Tn IPv6 92*24234982SRodney W. Grimestransition mechanisms in 93*24234982SRodney W. Grimes.Nm , 94*24234982SRodney W. Grimesthe kernel option 95*24234982SRodney W. Grimes.Dv IPFIREWALL_NAT64 96*24234982SRodney W. Grimesenables all of these 97*24234982SRodney W. Grimes.Tn NAT64 98*24234982SRodney W. Grimesmethods in the kernel. 99*24234982SRodney W. Grimes.Pp 100*24234982SRodney W. GrimesWhen using the 101*24234982SRodney W. Grimes.Tn IPv6 102*24234982SRodney W. Grimesnetwork prefix translation facility of 103*24234982SRodney W. Grimes.Nm , 104*24234982SRodney W. Grimesthe kernel option 105*24234982SRodney W. Grimes.Dv IPFIREWALL_NPTV6 106*24234982SRodney W. Grimesenables this functionality in the kernel. 107*24234982SRodney W. Grimes.Pp 108*24234982SRodney W. GrimesWhen using the packet modification facility of 109*24234982SRodney W. Grimes.Nm , 110*24234982SRodney W. Grimesthe kernel option 111*24234982SRodney W. Grimes.Dv IPFIREWALL_PMOD 112*24234982SRodney W. Grimesenables this functionality in the kernel. 113*24234982SRodney W. Grimes.Pp 114910201d9SDaniel GerzoTo enable logging of packets passing through 115910201d9SDaniel Gerzo.Nm , 116910201d9SDaniel Gerzoenable the 117910201d9SDaniel Gerzo.Dv IPFIREWALL_VERBOSE 118910201d9SDaniel Gerzokernel option. 119910201d9SDaniel GerzoThe 120910201d9SDaniel Gerzo.Dv IPFIREWALL_VERBOSE_LIMIT 121910201d9SDaniel Gerzooption will prevent 122910201d9SDaniel Gerzo.Xr syslogd 8 123910201d9SDaniel Gerzofrom flooding system logs or causing local Denial of Service. 124910201d9SDaniel GerzoThis option may be set to the number of packets which will be logged on 125910201d9SDaniel Gerzoa per-entry basis before the entry is rate-limited. 126910201d9SDaniel Gerzo.Pp 127*24234982SRodney W. GrimesWhen using the in-kernel 128*24234982SRodney W. Grimes.Tn NAT 129*24234982SRodney W. Grimesfacility of 130*24234982SRodney W. Grimes.Nm , 131*24234982SRodney W. Grimesthe kernel option 132*24234982SRodney W. Grimes.Dv LIBALIAS 133*24234982SRodney W. Grimesenables full 134*24234982SRodney W. Grimes.Xr libalias 3 135*24234982SRodney W. Grimesfunctionality in the kernel. 136*24234982SRodney W. GrimesFull functionality refers to included support for cuseeme, ftp, bbt, 137*24234982SRodney W. Grimesskinny, irc, pptp and smedia packets, which are missing in the basic 138*24234982SRodney W. Grimes.Xr libalias 3 139*24234982SRodney W. Grimesfunctionality accomplished with the 140*24234982SRodney W. Grimes.Dv IPFIREWALL_NAT 141*24234982SRodney W. Grimeskernel option. 142*24234982SRodney W. Grimes.Pp 1439a96729cSLuigi RizzoThe user interface for 144d962d52aSRuslan Ermilov.Nm 1459a96729cSLuigi Rizzois implemented by the 1469a96729cSLuigi Rizzo.Xr ipfw 8 147d962d52aSRuslan Ermilovutility, so please refer to the 148d962d52aSRuslan Ermilov.Xr ipfw 8 149d962d52aSRuslan Ermilovman page for a complete description of the 150d962d52aSRuslan Ermilov.Nm 151d962d52aSRuslan Ermilovcapabilities and how to use it. 152a53227ffSUgen J.S. Antsilevich.Sh SEE ALSO 153b805452cSMike Pritchard.Xr setsockopt 2 , 1542a81fd7cSJulian Elischer.Xr divert 4 , 155bceb8aedSWolfram Schneider.Xr ip 4 , 156*24234982SRodney W. Grimes.Xr ip6 4 , 1572a81fd7cSJulian Elischer.Xr ipfw 8 , 158*24234982SRodney W. Grimes.Xr libalias 3 , 159*24234982SRodney W. Grimes.Xr natd 8 , 160dc60ef4aSRuslan Ermilov.Xr sysctl 8 , 1611cc2c797SAndre Oppermann.Xr syslogd 8 , 1621cc2c797SAndre Oppermann.Xr pfil 9 163