xref: /freebsd-src/sbin/pfctl/pfctl.8 (revision 5b59b0c61e29f684a019afdd2848ffe2d5604e0c)
13b3a8eb9SGleb Smirnoff.\" $OpenBSD: pfctl.8,v 1.138 2008/06/10 20:55:02 mcbride Exp $
23b3a8eb9SGleb Smirnoff.\"
33b3a8eb9SGleb Smirnoff.\" Copyright (c) 2001 Kjell Wooding.  All rights reserved.
43b3a8eb9SGleb Smirnoff.\"
53b3a8eb9SGleb Smirnoff.\" Redistribution and use in source and binary forms, with or without
63b3a8eb9SGleb Smirnoff.\" modification, are permitted provided that the following conditions
73b3a8eb9SGleb Smirnoff.\" are met:
83b3a8eb9SGleb Smirnoff.\" 1. Redistributions of source code must retain the above copyright
93b3a8eb9SGleb Smirnoff.\"    notice, this list of conditions and the following disclaimer.
103b3a8eb9SGleb Smirnoff.\" 2. Redistributions in binary form must reproduce the above copyright
113b3a8eb9SGleb Smirnoff.\"    notice, this list of conditions and the following disclaimer in the
123b3a8eb9SGleb Smirnoff.\"    documentation and/or other materials provided with the distribution.
133b3a8eb9SGleb Smirnoff.\" 3. The name of the author may not be used to endorse or promote products
143b3a8eb9SGleb Smirnoff.\"    derived from this software without specific prior written permission.
153b3a8eb9SGleb Smirnoff.\"
163b3a8eb9SGleb Smirnoff.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
173b3a8eb9SGleb Smirnoff.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
183b3a8eb9SGleb Smirnoff.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
193b3a8eb9SGleb Smirnoff.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
203b3a8eb9SGleb Smirnoff.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
213b3a8eb9SGleb Smirnoff.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
223b3a8eb9SGleb Smirnoff.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
233b3a8eb9SGleb Smirnoff.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
243b3a8eb9SGleb Smirnoff.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
253b3a8eb9SGleb Smirnoff.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
263b3a8eb9SGleb Smirnoff.\"
27*5b59b0c6SLeonid Evdokimov.Dd November 25, 2024
283b3a8eb9SGleb Smirnoff.Dt PFCTL 8
293b3a8eb9SGleb Smirnoff.Os
303b3a8eb9SGleb Smirnoff.Sh NAME
313b3a8eb9SGleb Smirnoff.Nm pfctl
323b3a8eb9SGleb Smirnoff.Nd control the packet filter (PF) device
333b3a8eb9SGleb Smirnoff.Sh SYNOPSIS
343b3a8eb9SGleb Smirnoff.Nm pfctl
353b3a8eb9SGleb Smirnoff.Bk -words
3693abcf17SKristof Provost.Op Fl AdeghMmNnOPqRrvz
373b3a8eb9SGleb Smirnoff.Op Fl a Ar anchor
383b3a8eb9SGleb Smirnoff.Oo Fl D Ar macro Ns =
393b3a8eb9SGleb Smirnoff.Ar value Oc
403b3a8eb9SGleb Smirnoff.Op Fl F Ar modifier
413b3a8eb9SGleb Smirnoff.Op Fl f Ar file
423b3a8eb9SGleb Smirnoff.Op Fl i Ar interface
433b3a8eb9SGleb Smirnoff.Op Fl K Ar host | network
443b3a8eb9SGleb Smirnoff.Xo
453b3a8eb9SGleb Smirnoff.Oo Fl k
464f337550SKristof Provost.Ar host | network | label | id | gateway | nat
473b3a8eb9SGleb Smirnoff.Oc Xc
483b3a8eb9SGleb Smirnoff.Op Fl o Ar level
493b3a8eb9SGleb Smirnoff.Op Fl p Ar device
503b3a8eb9SGleb Smirnoff.Op Fl s Ar modifier
513b3a8eb9SGleb Smirnoff.Xo
523b3a8eb9SGleb Smirnoff.Oo Fl t Ar table
533b3a8eb9SGleb Smirnoff.Fl T Ar command
5486dcb2eeSJoel Dahl.Op Ar address ...
5586dcb2eeSJoel Dahl.Oc Xc
563b3a8eb9SGleb Smirnoff.Op Fl x Ar level
573b3a8eb9SGleb Smirnoff.Ek
583b3a8eb9SGleb Smirnoff.Sh DESCRIPTION
593b3a8eb9SGleb SmirnoffThe
603b3a8eb9SGleb Smirnoff.Nm
613b3a8eb9SGleb Smirnoffutility communicates with the packet filter device using the
623b3a8eb9SGleb Smirnoffioctl interface described in
633b3a8eb9SGleb Smirnoff.Xr pf 4 .
643b3a8eb9SGleb SmirnoffIt allows ruleset and parameter configuration and retrieval of status
653b3a8eb9SGleb Smirnoffinformation from the packet filter.
663b3a8eb9SGleb Smirnoff.Pp
673b3a8eb9SGleb SmirnoffPacket filtering restricts the types of packets that pass through
683b3a8eb9SGleb Smirnoffnetwork interfaces entering or leaving the host based on filter
693b3a8eb9SGleb Smirnoffrules as described in
703b3a8eb9SGleb Smirnoff.Xr pf.conf 5 .
713b3a8eb9SGleb SmirnoffThe packet filter can also replace addresses and ports of packets.
723b3a8eb9SGleb SmirnoffReplacing source addresses and ports of outgoing packets is called
733b3a8eb9SGleb SmirnoffNAT (Network Address Translation) and is used to connect an internal
743b3a8eb9SGleb Smirnoffnetwork (usually reserved address space) to an external one (the
753b3a8eb9SGleb SmirnoffInternet) by making all connections to external hosts appear to
763b3a8eb9SGleb Smirnoffcome from the gateway.
773b3a8eb9SGleb SmirnoffReplacing destination addresses and ports of incoming packets
783b3a8eb9SGleb Smirnoffis used to redirect connections to different hosts and/or ports.
793b3a8eb9SGleb SmirnoffA combination of both translations, bidirectional NAT, is also
803b3a8eb9SGleb Smirnoffsupported.
813b3a8eb9SGleb SmirnoffTranslation rules are described in
823b3a8eb9SGleb Smirnoff.Xr pf.conf 5 .
833b3a8eb9SGleb Smirnoff.Pp
843b3a8eb9SGleb SmirnoffWhen the variable
853b3a8eb9SGleb Smirnoff.Va pf
863b3a8eb9SGleb Smirnoffis set to
873b3a8eb9SGleb Smirnoff.Dv YES
883b3a8eb9SGleb Smirnoffin
893b3a8eb9SGleb Smirnoff.Xr rc.conf 5 ,
903b3a8eb9SGleb Smirnoffthe rule file specified with the variable
913b3a8eb9SGleb Smirnoff.Va pf_rules
923b3a8eb9SGleb Smirnoffis loaded automatically by the
933b3a8eb9SGleb Smirnoff.Xr rc 8
943b3a8eb9SGleb Smirnoffscripts and the packet filter is enabled.
953b3a8eb9SGleb Smirnoff.Pp
963b3a8eb9SGleb SmirnoffThe packet filter does not itself forward packets between interfaces.
973b3a8eb9SGleb SmirnoffForwarding can be enabled by setting the
983b3a8eb9SGleb Smirnoff.Xr sysctl 8
993b3a8eb9SGleb Smirnoffvariables
1003b3a8eb9SGleb Smirnoff.Em net.inet.ip.forwarding
1013b3a8eb9SGleb Smirnoffand/or
1023b3a8eb9SGleb Smirnoff.Em net.inet6.ip6.forwarding
1033b3a8eb9SGleb Smirnoffto 1.
1043b3a8eb9SGleb SmirnoffSet them permanently in
1053b3a8eb9SGleb Smirnoff.Xr sysctl.conf 5 .
1063b3a8eb9SGleb Smirnoff.Pp
1073b3a8eb9SGleb SmirnoffThe
1083b3a8eb9SGleb Smirnoff.Nm
1093b3a8eb9SGleb Smirnoffutility provides several commands.
1103b3a8eb9SGleb SmirnoffThe options are as follows:
1113b3a8eb9SGleb Smirnoff.Bl -tag -width Ds
1123b3a8eb9SGleb Smirnoff.It Fl A
1133b3a8eb9SGleb SmirnoffLoad only the queue rules present in the rule file.
1143b3a8eb9SGleb SmirnoffOther rules and options are ignored.
1153b3a8eb9SGleb Smirnoff.It Fl a Ar anchor
1163b3a8eb9SGleb SmirnoffApply flags
1173b3a8eb9SGleb Smirnoff.Fl f ,
1183b3a8eb9SGleb Smirnoff.Fl F ,
1193b3a8eb9SGleb Smirnoffand
1203b3a8eb9SGleb Smirnoff.Fl s
1213b3a8eb9SGleb Smirnoffonly to the rules in the specified
1223b3a8eb9SGleb Smirnoff.Ar anchor .
1233b3a8eb9SGleb SmirnoffIn addition to the main ruleset,
1243b3a8eb9SGleb Smirnoff.Nm
1253b3a8eb9SGleb Smirnoffcan load and manipulate additional rulesets by name,
1263b3a8eb9SGleb Smirnoffcalled anchors.
1273b3a8eb9SGleb SmirnoffThe main ruleset is the default anchor.
1283b3a8eb9SGleb Smirnoff.Pp
1293b3a8eb9SGleb SmirnoffAnchors are referenced by name and may be nested,
1303b3a8eb9SGleb Smirnoffwith the various components of the anchor path separated by
1313b3a8eb9SGleb Smirnoff.Sq /
1323b3a8eb9SGleb Smirnoffcharacters, similar to how file system hierarchies are laid out.
1333b3a8eb9SGleb SmirnoffThe last component of the anchor path is where ruleset operations are
1343b3a8eb9SGleb Smirnoffperformed.
1353b3a8eb9SGleb Smirnoff.Pp
1363b3a8eb9SGleb SmirnoffEvaluation of
1373b3a8eb9SGleb Smirnoff.Ar anchor
1383b3a8eb9SGleb Smirnoffrules from the main ruleset is described in
1393b3a8eb9SGleb Smirnoff.Xr pf.conf 5 .
1403b3a8eb9SGleb Smirnoff.Pp
1413b3a8eb9SGleb SmirnoffFor example, the following will show all filter rules (see the
1423b3a8eb9SGleb Smirnoff.Fl s
1433b3a8eb9SGleb Smirnoffflag below) inside the anchor
1443b3a8eb9SGleb Smirnoff.Dq authpf/smith(1234) ,
1453b3a8eb9SGleb Smirnoffwhich would have been created for user
1463b3a8eb9SGleb Smirnoff.Dq smith
1473b3a8eb9SGleb Smirnoffby
1483b3a8eb9SGleb Smirnoff.Xr authpf 8 ,
1493b3a8eb9SGleb SmirnoffPID 1234:
1503b3a8eb9SGleb Smirnoff.Bd -literal -offset indent
1513b3a8eb9SGleb Smirnoff# pfctl -a "authpf/smith(1234)" -s rules
1523b3a8eb9SGleb Smirnoff.Ed
1533b3a8eb9SGleb Smirnoff.Pp
1543b3a8eb9SGleb SmirnoffPrivate tables can also be put inside anchors, either by having table
1553b3a8eb9SGleb Smirnoffstatements in the
1563b3a8eb9SGleb Smirnoff.Xr pf.conf 5
1573b3a8eb9SGleb Smirnofffile that is loaded in the anchor, or by using regular table commands, as in:
1583b3a8eb9SGleb Smirnoff.Bd -literal -offset indent
1593b3a8eb9SGleb Smirnoff# pfctl -a foo/bar -t mytable -T add 1.2.3.4 5.6.7.8
1603b3a8eb9SGleb Smirnoff.Ed
1613b3a8eb9SGleb Smirnoff.Pp
1623b3a8eb9SGleb SmirnoffWhen a rule referring to a table is loaded in an anchor, the rule will use the
1633b3a8eb9SGleb Smirnoffprivate table if one is defined, and then fall back to the table defined in the
1643b3a8eb9SGleb Smirnoffmain ruleset, if there is one.
1653b3a8eb9SGleb SmirnoffThis is similar to C rules for variable scope.
1663b3a8eb9SGleb SmirnoffIt is possible to create distinct tables with the same name in the global
1673b3a8eb9SGleb Smirnoffruleset and in an anchor, but this is often bad design and a warning will be
1683b3a8eb9SGleb Smirnoffissued in that case.
1693b3a8eb9SGleb Smirnoff.Pp
1703b3a8eb9SGleb SmirnoffBy default, recursive inline printing of anchors applies only to unnamed
1713b3a8eb9SGleb Smirnoffanchors specified inline in the ruleset.
1723b3a8eb9SGleb SmirnoffIf the anchor name is terminated with a
1733b3a8eb9SGleb Smirnoff.Sq *
1743b3a8eb9SGleb Smirnoffcharacter, the
1753b3a8eb9SGleb Smirnoff.Fl s
1763b3a8eb9SGleb Smirnoffflag will recursively print all anchors in a brace delimited block.
1773b3a8eb9SGleb SmirnoffFor example the following will print the
1783b3a8eb9SGleb Smirnoff.Dq authpf
1793b3a8eb9SGleb Smirnoffruleset recursively:
1803b3a8eb9SGleb Smirnoff.Bd -literal -offset indent
1813b3a8eb9SGleb Smirnoff# pfctl -a 'authpf/*' -sr
1823b3a8eb9SGleb Smirnoff.Ed
1833b3a8eb9SGleb Smirnoff.Pp
1843b3a8eb9SGleb SmirnoffTo print the main ruleset recursively, specify only
1853b3a8eb9SGleb Smirnoff.Sq *
1863b3a8eb9SGleb Smirnoffas the anchor name:
1873b3a8eb9SGleb Smirnoff.Bd -literal -offset indent
1883b3a8eb9SGleb Smirnoff# pfctl -a '*' -sr
1893b3a8eb9SGleb Smirnoff.Ed
1903b3a8eb9SGleb Smirnoff.It Fl D Ar macro Ns = Ns Ar value
1913b3a8eb9SGleb SmirnoffDefine
1923b3a8eb9SGleb Smirnoff.Ar macro
1933b3a8eb9SGleb Smirnoffto be set to
1943b3a8eb9SGleb Smirnoff.Ar value
1953b3a8eb9SGleb Smirnoffon the command line.
1963b3a8eb9SGleb SmirnoffOverrides the definition of
1973b3a8eb9SGleb Smirnoff.Ar macro
1983b3a8eb9SGleb Smirnoffin the ruleset.
1993b3a8eb9SGleb Smirnoff.It Fl d
2003b3a8eb9SGleb SmirnoffDisable the packet filter.
2013b3a8eb9SGleb Smirnoff.It Fl e
2023b3a8eb9SGleb SmirnoffEnable the packet filter.
2033b3a8eb9SGleb Smirnoff.It Fl F Ar modifier
2043b3a8eb9SGleb SmirnoffFlush the filter parameters specified by
2053b3a8eb9SGleb Smirnoff.Ar modifier
2063b3a8eb9SGleb Smirnoff(may be abbreviated):
2073b3a8eb9SGleb Smirnoff.Pp
2083b3a8eb9SGleb Smirnoff.Bl -tag -width xxxxxxxxxxxx -compact
2093b3a8eb9SGleb Smirnoff.It Fl F Cm nat
2103b3a8eb9SGleb SmirnoffFlush the NAT rules.
2113b3a8eb9SGleb Smirnoff.It Fl F Cm queue
2123b3a8eb9SGleb SmirnoffFlush the queue rules.
2136ea1c3cfSKristof Provost.It Fl F Cm ethernet
2146ea1c3cfSKristof ProvostFlush the Ethernet filter rules.
2153b3a8eb9SGleb Smirnoff.It Fl F Cm rules
2163b3a8eb9SGleb SmirnoffFlush the filter rules.
2173b3a8eb9SGleb Smirnoff.It Fl F Cm states
2183b3a8eb9SGleb SmirnoffFlush the state table (NAT and filter).
2193b3a8eb9SGleb Smirnoff.It Fl F Cm Sources
2203b3a8eb9SGleb SmirnoffFlush the source tracking table.
2213b3a8eb9SGleb Smirnoff.It Fl F Cm info
2223b3a8eb9SGleb SmirnoffFlush the filter information (statistics that are not bound to rules).
2233b3a8eb9SGleb Smirnoff.It Fl F Cm Tables
2243b3a8eb9SGleb SmirnoffFlush the tables.
2253b3a8eb9SGleb Smirnoff.It Fl F Cm osfp
2263b3a8eb9SGleb SmirnoffFlush the passive operating system fingerprints.
2273b3a8eb9SGleb Smirnoff.It Fl F Cm all
2283b3a8eb9SGleb SmirnoffFlush all of the above.
2293b3a8eb9SGleb Smirnoff.El
2303b3a8eb9SGleb Smirnoff.It Fl f Ar file
2313b3a8eb9SGleb SmirnoffLoad the rules contained in
2323b3a8eb9SGleb Smirnoff.Ar file .
2333b3a8eb9SGleb SmirnoffThis
2343b3a8eb9SGleb Smirnoff.Ar file
2353b3a8eb9SGleb Smirnoffmay contain macros, tables, options, and normalization, queueing,
2363b3a8eb9SGleb Smirnofftranslation, and filtering rules.
2373b3a8eb9SGleb SmirnoffWith the exception of macros and tables, the statements must appear in that
2383b3a8eb9SGleb Smirnofforder.
2393b3a8eb9SGleb Smirnoff.It Fl g
2403b3a8eb9SGleb SmirnoffInclude output helpful for debugging.
2413b3a8eb9SGleb Smirnoff.It Fl h
2423b3a8eb9SGleb SmirnoffHelp.
2433b3a8eb9SGleb Smirnoff.It Fl i Ar interface
2443b3a8eb9SGleb SmirnoffRestrict the operation to the given
2453b3a8eb9SGleb Smirnoff.Ar interface .
2463b3a8eb9SGleb Smirnoff.It Fl K Ar host | network
2473b3a8eb9SGleb SmirnoffKill all of the source tracking entries originating from the specified
2483b3a8eb9SGleb Smirnoff.Ar host
2493b3a8eb9SGleb Smirnoffor
2503b3a8eb9SGleb Smirnoff.Ar network .
2513b3a8eb9SGleb SmirnoffA second
2523b3a8eb9SGleb Smirnoff.Fl K Ar host
2533b3a8eb9SGleb Smirnoffor
2543b3a8eb9SGleb Smirnoff.Fl K Ar network
2553b3a8eb9SGleb Smirnoffoption may be specified, which will kill all the source tracking
2563b3a8eb9SGleb Smirnoffentries from the first host/network to the second.
2573b3a8eb9SGleb Smirnoff.It Xo
2583b3a8eb9SGleb Smirnoff.Fl k
2594f337550SKristof Provost.Ar host | network | label | id | gateway | nat
2603b3a8eb9SGleb Smirnoff.Xc
2613b3a8eb9SGleb SmirnoffKill all of the state entries matching the specified
2623b3a8eb9SGleb Smirnoff.Ar host ,
2633b3a8eb9SGleb Smirnoff.Ar network ,
2643b3a8eb9SGleb Smirnoff.Ar label ,
265abbcba9cSKristof Provost.Ar id ,
2664f337550SKristof Provost.Ar gateway,
2673b3a8eb9SGleb Smirnoffor
2684f337550SKristof Provost.Ar nat.
2693b3a8eb9SGleb Smirnoff.Pp
2703b3a8eb9SGleb SmirnoffFor example, to kill all of the state entries originating from
2713b3a8eb9SGleb Smirnoff.Dq host :
2723b3a8eb9SGleb Smirnoff.Pp
2733b3a8eb9SGleb Smirnoff.Dl # pfctl -k host
2743b3a8eb9SGleb Smirnoff.Pp
2753b3a8eb9SGleb SmirnoffA second
2763b3a8eb9SGleb Smirnoff.Fl k Ar host
2773b3a8eb9SGleb Smirnoffor
2783b3a8eb9SGleb Smirnoff.Fl k Ar network
2793b3a8eb9SGleb Smirnoffoption may be specified, which will kill all the state entries
2803b3a8eb9SGleb Smirnofffrom the first host/network to the second.
2813b3a8eb9SGleb SmirnoffTo kill all of the state entries from
2823b3a8eb9SGleb Smirnoff.Dq host1
2833b3a8eb9SGleb Smirnoffto
2843b3a8eb9SGleb Smirnoff.Dq host2 :
2853b3a8eb9SGleb Smirnoff.Pp
2863b3a8eb9SGleb Smirnoff.Dl # pfctl -k host1 -k host2
2873b3a8eb9SGleb Smirnoff.Pp
2883b3a8eb9SGleb SmirnoffTo kill all states originating from 192.168.1.0/24 to 172.16.0.0/16:
2893b3a8eb9SGleb Smirnoff.Pp
2903b3a8eb9SGleb Smirnoff.Dl # pfctl -k 192.168.1.0/24 -k 172.16.0.0/16
2913b3a8eb9SGleb Smirnoff.Pp
2923b3a8eb9SGleb SmirnoffA network prefix length of 0 can be used as a wildcard.
2933b3a8eb9SGleb SmirnoffTo kill all states with the target
2943b3a8eb9SGleb Smirnoff.Dq host2 :
2953b3a8eb9SGleb Smirnoff.Pp
2963b3a8eb9SGleb Smirnoff.Dl # pfctl -k 0.0.0.0/0 -k host2
2973b3a8eb9SGleb Smirnoff.Pp
2983b3a8eb9SGleb SmirnoffIt is also possible to kill states by rule label or state ID.
2993b3a8eb9SGleb SmirnoffIn this mode the first
3003b3a8eb9SGleb Smirnoff.Fl k
3013b3a8eb9SGleb Smirnoffargument is used to specify the type
3023b3a8eb9SGleb Smirnoffof the second argument.
3033b3a8eb9SGleb SmirnoffThe following command would kill all states that have been created
3043b3a8eb9SGleb Smirnofffrom rules carrying the label
3053b3a8eb9SGleb Smirnoff.Dq foobar :
3063b3a8eb9SGleb Smirnoff.Pp
3073b3a8eb9SGleb Smirnoff.Dl # pfctl -k label -k foobar
3083b3a8eb9SGleb Smirnoff.Pp
3093b3a8eb9SGleb SmirnoffTo kill one specific state by its unique state ID
3103b3a8eb9SGleb Smirnoff(as shown by pfctl -s state -vv),
3113b3a8eb9SGleb Smirnoffuse the
3123b3a8eb9SGleb Smirnoff.Ar id
3133b3a8eb9SGleb Smirnoffmodifier and as a second argument the state ID and optional creator ID.
3143b3a8eb9SGleb SmirnoffTo kill a state with ID 4823e84500000003 use:
3153b3a8eb9SGleb Smirnoff.Pp
3163b3a8eb9SGleb Smirnoff.Dl # pfctl -k id -k 4823e84500000003
3173b3a8eb9SGleb Smirnoff.Pp
3183b3a8eb9SGleb SmirnoffTo kill a state with ID 4823e84500000018 created from a backup
3193b3a8eb9SGleb Smirnofffirewall with hostid 00000002 use:
3203b3a8eb9SGleb Smirnoff.Pp
3213b3a8eb9SGleb Smirnoff.Dl # pfctl -k id -k 4823e84500000018/2
322abbcba9cSKristof Provost.Pp
323abbcba9cSKristof ProvostIt is also possible to kill states created from a rule with the route-to/reply-to
324abbcba9cSKristof Provostparameter set to route the connection through a particular gateway.
325abbcba9cSKristof ProvostNote that rules routing via the default routing table (not via a route-to
326abbcba9cSKristof Provostrule) will have their rt_addr set as 0.0.0.0 or ::.
327abbcba9cSKristof ProvostTo kill all states using a gateway of 192.168.0.1 use:
328abbcba9cSKristof Provost.Pp
329abbcba9cSKristof Provost.Dl # pfctl -k gateway -k 192.168.0.1
330abbcba9cSKristof Provost.Pp
331abbcba9cSKristof ProvostA network prefix length can also be specified.
332abbcba9cSKristof ProvostTo kill all states using a gateway in 192.168.0.0/24:
333abbcba9cSKristof Provost.Pp
334abbcba9cSKristof Provost.Dl # pfctl -k gateway -k 192.168.0.0/24
33593abcf17SKristof Provost.Pp
3364f337550SKristof ProvostStates can also be killed based on their pre-NAT address:
3374f337550SKristof Provost.Pp
3384f337550SKristof Provost.Dl # pfctl -k nat -k 192.168.0.1
3394f337550SKristof Provost.Pp
34093abcf17SKristof Provost.It Fl M
34193abcf17SKristof ProvostKill matching states in the opposite direction (on other interfaces) when
34293abcf17SKristof Provostkilling states.
34393abcf17SKristof ProvostThis applies to states killed using the -k option and also will apply to the
34493abcf17SKristof Provostflush command when flushing states.
34593abcf17SKristof ProvostThis is useful when an interface is specified when flushing states.
34693abcf17SKristof ProvostExample:
34793abcf17SKristof Provost.Pp
34893abcf17SKristof Provost.Dl # pfctl -M -i interface -Fs
34993abcf17SKristof Provost.Pp
3503b3a8eb9SGleb Smirnoff.It Fl m
3513b3a8eb9SGleb SmirnoffMerge in explicitly given options without resetting those
3523b3a8eb9SGleb Smirnoffwhich are omitted.
3533b3a8eb9SGleb SmirnoffAllows single options to be modified without disturbing the others:
3543b3a8eb9SGleb Smirnoff.Bd -literal -offset indent
3553b3a8eb9SGleb Smirnoff# echo "set loginterface fxp0" | pfctl -mf -
3563b3a8eb9SGleb Smirnoff.Ed
3573b3a8eb9SGleb Smirnoff.It Fl N
3583b3a8eb9SGleb SmirnoffLoad only the NAT rules present in the rule file.
3593b3a8eb9SGleb SmirnoffOther rules and options are ignored.
3603b3a8eb9SGleb Smirnoff.It Fl n
3613b3a8eb9SGleb SmirnoffDo not actually load rules, just parse them.
3623b3a8eb9SGleb Smirnoff.It Fl O
3633b3a8eb9SGleb SmirnoffLoad only the options present in the rule file.
3643b3a8eb9SGleb SmirnoffOther rules and options are ignored.
3653b3a8eb9SGleb Smirnoff.It Fl o Ar level
3663b3a8eb9SGleb SmirnoffControl the ruleset optimizer, overriding any rule file settings.
3673b3a8eb9SGleb Smirnoff.Pp
3683b3a8eb9SGleb Smirnoff.Bl -tag -width xxxxxxxxxxxx -compact
3693b3a8eb9SGleb Smirnoff.It Fl o Cm none
3703b3a8eb9SGleb SmirnoffDisable the ruleset optimizer.
3713b3a8eb9SGleb Smirnoff.It Fl o Cm basic
3723b3a8eb9SGleb SmirnoffEnable basic ruleset optimizations.
3733b3a8eb9SGleb SmirnoffThis is the default behaviour.
3743b3a8eb9SGleb Smirnoff.It Fl o Cm profile
3753b3a8eb9SGleb SmirnoffEnable basic ruleset optimizations with profiling.
3763b3a8eb9SGleb Smirnoff.El
3773b3a8eb9SGleb SmirnoffFor further information on the ruleset optimizer, see
3783b3a8eb9SGleb Smirnoff.Xr pf.conf 5 .
3793b3a8eb9SGleb Smirnoff.It Fl P
3803b3a8eb9SGleb SmirnoffDo not perform service name lookup for port specific rules,
3813b3a8eb9SGleb Smirnoffinstead display the ports numerically.
3823b3a8eb9SGleb Smirnoff.It Fl p Ar device
3833b3a8eb9SGleb SmirnoffUse the device file
3843b3a8eb9SGleb Smirnoff.Ar device
3853b3a8eb9SGleb Smirnoffinstead of the default
3863b3a8eb9SGleb Smirnoff.Pa /dev/pf .
3873b3a8eb9SGleb Smirnoff.It Fl q
3883b3a8eb9SGleb SmirnoffOnly print errors and warnings.
3893b3a8eb9SGleb Smirnoff.It Fl R
3903b3a8eb9SGleb SmirnoffLoad only the filter rules present in the rule file.
3913b3a8eb9SGleb SmirnoffOther rules and options are ignored.
3923b3a8eb9SGleb Smirnoff.It Fl r
3933b3a8eb9SGleb SmirnoffPerform reverse DNS lookups on states when displaying them.
3943b3a8eb9SGleb Smirnoff.It Fl s Ar modifier
3953b3a8eb9SGleb SmirnoffShow the filter parameters specified by
3963b3a8eb9SGleb Smirnoff.Ar modifier
3973b3a8eb9SGleb Smirnoff(may be abbreviated):
3983b3a8eb9SGleb Smirnoff.Pp
3993b3a8eb9SGleb Smirnoff.Bl -tag -width xxxxxxxxxxxxx -compact
4003b3a8eb9SGleb Smirnoff.It Fl s Cm nat
4013b3a8eb9SGleb SmirnoffShow the currently loaded NAT rules.
4023b3a8eb9SGleb Smirnoff.It Fl s Cm queue
4033b3a8eb9SGleb SmirnoffShow the currently loaded queue rules.
4043b3a8eb9SGleb SmirnoffWhen used together with
4053b3a8eb9SGleb Smirnoff.Fl v ,
4063b3a8eb9SGleb Smirnoffper-queue statistics are also shown.
4073b3a8eb9SGleb SmirnoffWhen used together with
4083b3a8eb9SGleb Smirnoff.Fl v v ,
4093b3a8eb9SGleb Smirnoff.Nm
4103b3a8eb9SGleb Smirnoffwill loop and show updated queue statistics every five seconds, including
4113b3a8eb9SGleb Smirnoffmeasured bandwidth and packets per second.
41277207b60SKristof Provost.It Fl s Cm ether
41377207b60SKristof ProvostShow the currently loaded Ethernet rules.
41477207b60SKristof ProvostWhen used together with
41577207b60SKristof Provost.Fl v ,
41677207b60SKristof Provostthe per-rule statistics (number of evaluations,
4175bed7d2fSKristof Provostpackets, and bytes) are also shown.
4183b3a8eb9SGleb Smirnoff.It Fl s Cm rules
4193b3a8eb9SGleb SmirnoffShow the currently loaded filter rules.
4203b3a8eb9SGleb SmirnoffWhen used together with
4213b3a8eb9SGleb Smirnoff.Fl v ,
4223b3a8eb9SGleb Smirnoffthe per-rule statistics (number of evaluations,
4235bed7d2fSKristof Provostpackets, and bytes) are also shown.
4243b3a8eb9SGleb SmirnoffNote that the
4253b3a8eb9SGleb Smirnoff.Dq skip step
4263b3a8eb9SGleb Smirnoffoptimization done automatically by the kernel
4273b3a8eb9SGleb Smirnoffwill skip evaluation of rules where possible.
4283b3a8eb9SGleb SmirnoffPackets passed statefully are counted in the rule that created the state
429eb6d64f8SSevan Janiyan(even though the rule is not evaluated more than once for the entire
4303b3a8eb9SGleb Smirnoffconnection).
4313b3a8eb9SGleb Smirnoff.It Fl s Cm Anchors
4323b3a8eb9SGleb SmirnoffShow the currently loaded anchors directly attached to the main ruleset.
4333b3a8eb9SGleb SmirnoffIf
4343b3a8eb9SGleb Smirnoff.Fl a Ar anchor
4353b3a8eb9SGleb Smirnoffis specified as well, the anchors loaded directly below the given
4363b3a8eb9SGleb Smirnoff.Ar anchor
4373b3a8eb9SGleb Smirnoffare shown instead.
4383b3a8eb9SGleb SmirnoffIf
4393b3a8eb9SGleb Smirnoff.Fl v
4403b3a8eb9SGleb Smirnoffis specified, all anchors attached under the target anchor will be
4413b3a8eb9SGleb Smirnoffdisplayed recursively.
4423b3a8eb9SGleb Smirnoff.It Fl s Cm states
4433b3a8eb9SGleb SmirnoffShow the contents of the state table.
4443b3a8eb9SGleb Smirnoff.It Fl s Cm Sources
4453b3a8eb9SGleb SmirnoffShow the contents of the source tracking table.
4463b3a8eb9SGleb Smirnoff.It Fl s Cm info
4473b3a8eb9SGleb SmirnoffShow filter information (statistics and counters).
4483b3a8eb9SGleb SmirnoffWhen used together with
4493b3a8eb9SGleb Smirnoff.Fl v ,
4503b3a8eb9SGleb Smirnoffsource tracking statistics are also shown.
451fa1d4439SKristof Provost.It Fl s Cm Running
452fa1d4439SKristof ProvostShow the running status and provide a non-zero exit status when disabled.
4533b3a8eb9SGleb Smirnoff.It Fl s Cm labels
4543b3a8eb9SGleb SmirnoffShow per-rule statistics (label, evaluations, packets total, bytes total,
4553b3a8eb9SGleb Smirnoffpackets in, bytes in, packets out, bytes out, state creations) of
4563b3a8eb9SGleb Smirnofffilter rules with labels, useful for accounting.
4573b3a8eb9SGleb Smirnoff.It Fl s Cm timeouts
4583b3a8eb9SGleb SmirnoffShow the current global timeouts.
4593b3a8eb9SGleb Smirnoff.It Fl s Cm memory
4603b3a8eb9SGleb SmirnoffShow the current pool memory hard limits.
4613b3a8eb9SGleb Smirnoff.It Fl s Cm Tables
4623b3a8eb9SGleb SmirnoffShow the list of tables.
4633b3a8eb9SGleb Smirnoff.It Fl s Cm osfp
4643b3a8eb9SGleb SmirnoffShow the list of operating system fingerprints.
4653b3a8eb9SGleb Smirnoff.It Fl s Cm Interfaces
4663b3a8eb9SGleb SmirnoffShow the list of interfaces and interface drivers available to PF.
4673b3a8eb9SGleb SmirnoffWhen used together with
4683b3a8eb9SGleb Smirnoff.Fl v ,
4693b3a8eb9SGleb Smirnoffit additionally lists which interfaces have skip rules activated.
4703b3a8eb9SGleb SmirnoffWhen used together with
4713b3a8eb9SGleb Smirnoff.Fl vv ,
4723b3a8eb9SGleb Smirnoffinterface statistics are also shown.
4733b3a8eb9SGleb Smirnoff.Fl i
4743b3a8eb9SGleb Smirnoffcan be used to select an interface or a group of interfaces.
4753b3a8eb9SGleb Smirnoff.It Fl s Cm all
4763b3a8eb9SGleb SmirnoffShow all of the above, except for the lists of interfaces and operating
4773b3a8eb9SGleb Smirnoffsystem fingerprints.
4783b3a8eb9SGleb Smirnoff.El
4793b3a8eb9SGleb Smirnoff.It Fl T Ar command Op Ar address ...
4803b3a8eb9SGleb SmirnoffSpecify the
4813b3a8eb9SGleb Smirnoff.Ar command
4823b3a8eb9SGleb Smirnoff(may be abbreviated) to apply to the table.
4833b3a8eb9SGleb SmirnoffCommands include:
4843b3a8eb9SGleb Smirnoff.Pp
4853b3a8eb9SGleb Smirnoff.Bl -tag -width xxxxxxxxxxxx -compact
4863b3a8eb9SGleb Smirnoff.It Fl T Cm kill
4873b3a8eb9SGleb SmirnoffKill a table.
4883b3a8eb9SGleb Smirnoff.It Fl T Cm flush
4893b3a8eb9SGleb SmirnoffFlush all addresses of a table.
4903b3a8eb9SGleb Smirnoff.It Fl T Cm add
4913b3a8eb9SGleb SmirnoffAdd one or more addresses in a table.
4923b3a8eb9SGleb SmirnoffAutomatically create a nonexisting table.
4933b3a8eb9SGleb Smirnoff.It Fl T Cm delete
4943b3a8eb9SGleb SmirnoffDelete one or more addresses from a table.
4953b3a8eb9SGleb Smirnoff.It Fl T Cm expire Ar number
4963b3a8eb9SGleb SmirnoffDelete addresses which had their statistics cleared more than
4973b3a8eb9SGleb Smirnoff.Ar number
4983b3a8eb9SGleb Smirnoffseconds ago.
4993b3a8eb9SGleb SmirnoffFor entries which have never had their statistics cleared,
5003b3a8eb9SGleb Smirnoff.Ar number
5013b3a8eb9SGleb Smirnoffrefers to the time they were added to the table.
5023b3a8eb9SGleb Smirnoff.It Fl T Cm replace
5033b3a8eb9SGleb SmirnoffReplace the addresses of the table.
5043b3a8eb9SGleb SmirnoffAutomatically create a nonexisting table.
5053b3a8eb9SGleb Smirnoff.It Fl T Cm show
5063b3a8eb9SGleb SmirnoffShow the content (addresses) of a table.
5073b3a8eb9SGleb Smirnoff.It Fl T Cm test
5083b3a8eb9SGleb SmirnoffTest if the given addresses match a table.
5096463b6b5SKristof Provost.It Fl T Cm zero Op Ar address ...
5106463b6b5SKristof ProvostClear all the statistics of a table, or only for specified addresses.
511*5b59b0c6SLeonid Evdokimov.It Fl T Cm reset
512*5b59b0c6SLeonid EvdokimovClear statistics only for addresses with non-zero statistics. Addresses
513*5b59b0c6SLeonid Evdokimovwith counter values at zero and their
514*5b59b0c6SLeonid Evdokimov.Dq Cleared
515*5b59b0c6SLeonid Evdokimovtimestamp are left untouched.
5163b3a8eb9SGleb Smirnoff.It Fl T Cm load
5173b3a8eb9SGleb SmirnoffLoad only the table definitions from
5183b3a8eb9SGleb Smirnoff.Xr pf.conf 5 .
5193b3a8eb9SGleb SmirnoffThis is used in conjunction with the
5203b3a8eb9SGleb Smirnoff.Fl f
5213b3a8eb9SGleb Smirnoffflag, as in:
5223b3a8eb9SGleb Smirnoff.Bd -literal -offset indent
5233b3a8eb9SGleb Smirnoff# pfctl -Tl -f pf.conf
5243b3a8eb9SGleb Smirnoff.Ed
5253b3a8eb9SGleb Smirnoff.El
5263b3a8eb9SGleb Smirnoff.Pp
5273b3a8eb9SGleb SmirnoffFor the
5283b3a8eb9SGleb Smirnoff.Cm add ,
5293b3a8eb9SGleb Smirnoff.Cm delete ,
5303b3a8eb9SGleb Smirnoff.Cm replace ,
5313b3a8eb9SGleb Smirnoffand
5323b3a8eb9SGleb Smirnoff.Cm test
5333b3a8eb9SGleb Smirnoffcommands, the list of addresses can be specified either directly on the command
5343b3a8eb9SGleb Smirnoffline and/or in an unformatted text file, using the
5353b3a8eb9SGleb Smirnoff.Fl f
5363b3a8eb9SGleb Smirnoffflag.
5373b3a8eb9SGleb SmirnoffComments starting with a
5383b3a8eb9SGleb Smirnoff.Sq #
539a8a95277SJuraj Lutteror
540a8a95277SJuraj Lutter.Sq \;
5413b3a8eb9SGleb Smirnoffare allowed in the text file.
5423b3a8eb9SGleb SmirnoffWith these commands, the
5433b3a8eb9SGleb Smirnoff.Fl v
5443b3a8eb9SGleb Smirnoffflag can also be used once or twice, in which case
5453b3a8eb9SGleb Smirnoff.Nm
5463b3a8eb9SGleb Smirnoffwill print the
5473b3a8eb9SGleb Smirnoffdetailed result of the operation for each individual address, prefixed by
5483b3a8eb9SGleb Smirnoffone of the following letters:
5493b3a8eb9SGleb Smirnoff.Pp
5503b3a8eb9SGleb Smirnoff.Bl -tag -width XXX -compact
5513b3a8eb9SGleb Smirnoff.It A
5523b3a8eb9SGleb SmirnoffThe address/network has been added.
5533b3a8eb9SGleb Smirnoff.It C
5543b3a8eb9SGleb SmirnoffThe address/network has been changed (negated).
5553b3a8eb9SGleb Smirnoff.It D
5563b3a8eb9SGleb SmirnoffThe address/network has been deleted.
5573b3a8eb9SGleb Smirnoff.It M
5583b3a8eb9SGleb SmirnoffThe address matches
5593b3a8eb9SGleb Smirnoff.Po
5603b3a8eb9SGleb Smirnoff.Cm test
5613b3a8eb9SGleb Smirnoffoperation only
5623b3a8eb9SGleb Smirnoff.Pc .
5633b3a8eb9SGleb Smirnoff.It X
5643b3a8eb9SGleb SmirnoffThe address/network is duplicated and therefore ignored.
5653b3a8eb9SGleb Smirnoff.It Y
5663b3a8eb9SGleb SmirnoffThe address/network cannot be added/deleted due to conflicting
5673b3a8eb9SGleb Smirnoff.Sq \&!
5683b3a8eb9SGleb Smirnoffattributes.
5693b3a8eb9SGleb Smirnoff.It Z
5703b3a8eb9SGleb SmirnoffThe address/network has been cleared (statistics).
5713b3a8eb9SGleb Smirnoff.El
5723b3a8eb9SGleb Smirnoff.Pp
5733b3a8eb9SGleb SmirnoffEach table can maintain a set of counters that can be retrieved using the
5743b3a8eb9SGleb Smirnoff.Fl v
5753b3a8eb9SGleb Smirnoffflag of
5763b3a8eb9SGleb Smirnoff.Nm .
5773b3a8eb9SGleb SmirnoffFor example, the following commands define a wide open firewall which will keep
5783b3a8eb9SGleb Smirnofftrack of packets going to or coming from the
5793b3a8eb9SGleb Smirnoff.Ox
5803b3a8eb9SGleb SmirnoffFTP server.
5813b3a8eb9SGleb SmirnoffThe following commands configure the firewall and send 10 pings to the FTP
5823b3a8eb9SGleb Smirnoffserver:
5833b3a8eb9SGleb Smirnoff.Bd -literal -offset indent
5843b3a8eb9SGleb Smirnoff# printf "table <test> counters { ftp.openbsd.org }\en \e
5853b3a8eb9SGleb Smirnoff    pass out to <test>\en" | pfctl -f-
5863b3a8eb9SGleb Smirnoff# ping -qc10 ftp.openbsd.org
5873b3a8eb9SGleb Smirnoff.Ed
5883b3a8eb9SGleb Smirnoff.Pp
5893b3a8eb9SGleb SmirnoffWe can now use the table
5903b3a8eb9SGleb Smirnoff.Cm show
5913b3a8eb9SGleb Smirnoffcommand to output, for each address and packet direction, the number of packets
5923b3a8eb9SGleb Smirnoffand bytes that are being passed or blocked by rules referencing the table.
5933b3a8eb9SGleb SmirnoffThe time at which the current accounting started is also shown with the
5943b3a8eb9SGleb Smirnoff.Dq Cleared
5953b3a8eb9SGleb Smirnoffline.
5963b3a8eb9SGleb Smirnoff.Bd -literal -offset indent
5973b3a8eb9SGleb Smirnoff# pfctl -t test -vTshow
5983b3a8eb9SGleb Smirnoff   129.128.5.191
5993b3a8eb9SGleb Smirnoff    Cleared:     Thu Feb 13 18:55:18 2003
6003b3a8eb9SGleb Smirnoff    In/Block:    [ Packets: 0        Bytes: 0        ]
6013b3a8eb9SGleb Smirnoff    In/Pass:     [ Packets: 10       Bytes: 840      ]
6023b3a8eb9SGleb Smirnoff    Out/Block:   [ Packets: 0        Bytes: 0        ]
6033b3a8eb9SGleb Smirnoff    Out/Pass:    [ Packets: 10       Bytes: 840      ]
6043b3a8eb9SGleb Smirnoff.Ed
6053b3a8eb9SGleb Smirnoff.Pp
6063b3a8eb9SGleb SmirnoffSimilarly, it is possible to view global information about the tables
6073b3a8eb9SGleb Smirnoffby using the
6083b3a8eb9SGleb Smirnoff.Fl v
6093b3a8eb9SGleb Smirnoffmodifier twice and the
6103b3a8eb9SGleb Smirnoff.Fl s
6113b3a8eb9SGleb Smirnoff.Cm Tables
6123b3a8eb9SGleb Smirnoffcommand.
6133b3a8eb9SGleb SmirnoffThis will display the number of addresses on each table,
6143b3a8eb9SGleb Smirnoffthe number of rules which reference the table, and the global
6153b3a8eb9SGleb Smirnoffpacket statistics for the whole table:
6163b3a8eb9SGleb Smirnoff.Bd -literal -offset indent
6173b3a8eb9SGleb Smirnoff# pfctl -vvsTables
6183b3a8eb9SGleb Smirnoff--a-r-C test
6193b3a8eb9SGleb Smirnoff    Addresses:   1
6203b3a8eb9SGleb Smirnoff    Cleared:     Thu Feb 13 18:55:18 2003
6213b3a8eb9SGleb Smirnoff    References:  [ Anchors: 0        Rules: 1        ]
6223b3a8eb9SGleb Smirnoff    Evaluations: [ NoMatch: 3496     Match: 1        ]
6233b3a8eb9SGleb Smirnoff    In/Block:    [ Packets: 0        Bytes: 0        ]
6243b3a8eb9SGleb Smirnoff    In/Pass:     [ Packets: 10       Bytes: 840      ]
6253b3a8eb9SGleb Smirnoff    In/XPass:    [ Packets: 0        Bytes: 0        ]
6263b3a8eb9SGleb Smirnoff    Out/Block:   [ Packets: 0        Bytes: 0        ]
6273b3a8eb9SGleb Smirnoff    Out/Pass:    [ Packets: 10       Bytes: 840      ]
6283b3a8eb9SGleb Smirnoff    Out/XPass:   [ Packets: 0        Bytes: 0        ]
6293b3a8eb9SGleb Smirnoff.Ed
6303b3a8eb9SGleb Smirnoff.Pp
6313b3a8eb9SGleb SmirnoffAs we can see here, only one packet \- the initial ping request \- matched the
6323b3a8eb9SGleb Smirnofftable, but all packets passing as the result of the state are correctly
6333b3a8eb9SGleb Smirnoffaccounted for.
6343b3a8eb9SGleb SmirnoffReloading the table(s) or ruleset will not affect packet accounting in any way.
6353b3a8eb9SGleb SmirnoffThe two
6363b3a8eb9SGleb Smirnoff.Dq XPass
6373b3a8eb9SGleb Smirnoffcounters are incremented instead of the
6383b3a8eb9SGleb Smirnoff.Dq Pass
6393b3a8eb9SGleb Smirnoffcounters when a
6403b3a8eb9SGleb Smirnoff.Dq stateful
641eb6d64f8SSevan Janiyanpacket is passed but does not match the table anymore.
6423b3a8eb9SGleb SmirnoffThis will happen in our example if someone flushes the table while the
6433b3a8eb9SGleb Smirnoff.Xr ping 8
6443b3a8eb9SGleb Smirnoffcommand is running.
6453b3a8eb9SGleb Smirnoff.Pp
6463b3a8eb9SGleb SmirnoffWhen used with a single
6473b3a8eb9SGleb Smirnoff.Fl v ,
6483b3a8eb9SGleb Smirnoff.Nm
6493b3a8eb9SGleb Smirnoffwill only display the first line containing the table flags and name.
6503b3a8eb9SGleb SmirnoffThe flags are defined as follows:
6513b3a8eb9SGleb Smirnoff.Pp
6523b3a8eb9SGleb Smirnoff.Bl -tag -width XXX -compact
6533b3a8eb9SGleb Smirnoff.It c
6543b3a8eb9SGleb SmirnoffFor constant tables, which cannot be altered outside
6553b3a8eb9SGleb Smirnoff.Xr pf.conf 5 .
6563b3a8eb9SGleb Smirnoff.It p
657eb6d64f8SSevan JaniyanFor persistent tables, which do not get automatically killed when no rules
6583b3a8eb9SGleb Smirnoffrefer to them.
6593b3a8eb9SGleb Smirnoff.It a
6603b3a8eb9SGleb SmirnoffFor tables which are part of the
6613b3a8eb9SGleb Smirnoff.Em active
6623b3a8eb9SGleb Smirnofftableset.
6633b3a8eb9SGleb SmirnoffTables without this flag do not really exist, cannot contain addresses, and are
6643b3a8eb9SGleb Smirnoffonly listed if the
6653b3a8eb9SGleb Smirnoff.Fl g
6663b3a8eb9SGleb Smirnoffflag is given.
6673b3a8eb9SGleb Smirnoff.It i
6683b3a8eb9SGleb SmirnoffFor tables which are part of the
6693b3a8eb9SGleb Smirnoff.Em inactive
6703b3a8eb9SGleb Smirnofftableset.
6713b3a8eb9SGleb SmirnoffThis flag can only be witnessed briefly during the loading of
6723b3a8eb9SGleb Smirnoff.Xr pf.conf 5 .
6733b3a8eb9SGleb Smirnoff.It r
6743b3a8eb9SGleb SmirnoffFor tables which are referenced (used) by rules.
6753b3a8eb9SGleb Smirnoff.It h
6763b3a8eb9SGleb SmirnoffThis flag is set when a table in the main ruleset is hidden by one or more
6773b3a8eb9SGleb Smirnofftables of the same name from anchors attached below it.
6783b3a8eb9SGleb Smirnoff.It C
6793b3a8eb9SGleb SmirnoffThis flag is set when per-address counters are enabled on the table.
6803b3a8eb9SGleb Smirnoff.El
6813b3a8eb9SGleb Smirnoff.It Fl t Ar table
6823b3a8eb9SGleb SmirnoffSpecify the name of the table.
6833b3a8eb9SGleb Smirnoff.It Fl v
6843b3a8eb9SGleb SmirnoffProduce more verbose output.
6853b3a8eb9SGleb SmirnoffA second use of
6863b3a8eb9SGleb Smirnoff.Fl v
6873b3a8eb9SGleb Smirnoffwill produce even more verbose output including ruleset warnings.
6883b3a8eb9SGleb SmirnoffSee the previous section for its effect on table commands.
6893b3a8eb9SGleb Smirnoff.It Fl x Ar level
6903b3a8eb9SGleb SmirnoffSet the debug
6913b3a8eb9SGleb Smirnoff.Ar level
6923b3a8eb9SGleb Smirnoff(may be abbreviated) to one of the following:
6933b3a8eb9SGleb Smirnoff.Pp
6943b3a8eb9SGleb Smirnoff.Bl -tag -width xxxxxxxxxxxx -compact
6953b3a8eb9SGleb Smirnoff.It Fl x Cm none
696eb6d64f8SSevan JaniyanDo not generate debug messages.
6973b3a8eb9SGleb Smirnoff.It Fl x Cm urgent
6983b3a8eb9SGleb SmirnoffGenerate debug messages only for serious errors.
6993b3a8eb9SGleb Smirnoff.It Fl x Cm misc
7003b3a8eb9SGleb SmirnoffGenerate debug messages for various errors.
7013b3a8eb9SGleb Smirnoff.It Fl x Cm loud
7023b3a8eb9SGleb SmirnoffGenerate debug messages for common conditions.
7033b3a8eb9SGleb Smirnoff.El
7043b3a8eb9SGleb Smirnoff.It Fl z
7053b3a8eb9SGleb SmirnoffClear per-rule statistics.
7063b3a8eb9SGleb Smirnoff.El
7073b3a8eb9SGleb Smirnoff.Sh FILES
7083b3a8eb9SGleb Smirnoff.Bl -tag -width "/etc/pf.conf" -compact
7093b3a8eb9SGleb Smirnoff.It Pa /etc/pf.conf
7103b3a8eb9SGleb SmirnoffPacket filter rules file.
7113b3a8eb9SGleb Smirnoff.It Pa /etc/pf.os
7123b3a8eb9SGleb SmirnoffPassive operating system fingerprint database.
7133b3a8eb9SGleb Smirnoff.El
7143b3a8eb9SGleb Smirnoff.Sh SEE ALSO
7153b3a8eb9SGleb Smirnoff.Xr pf 4 ,
7163b3a8eb9SGleb Smirnoff.Xr pf.conf 5 ,
7173b3a8eb9SGleb Smirnoff.Xr pf.os 5 ,
7183b3a8eb9SGleb Smirnoff.Xr rc.conf 5 ,
7193b3a8eb9SGleb Smirnoff.Xr services 5 ,
7203b3a8eb9SGleb Smirnoff.Xr sysctl.conf 5 ,
7213b3a8eb9SGleb Smirnoff.Xr authpf 8 ,
7223b3a8eb9SGleb Smirnoff.Xr ftp-proxy 8 ,
7233b3a8eb9SGleb Smirnoff.Xr rc 8 ,
7243b3a8eb9SGleb Smirnoff.Xr sysctl 8
7253b3a8eb9SGleb Smirnoff.Sh HISTORY
7263b3a8eb9SGleb SmirnoffThe
7273b3a8eb9SGleb Smirnoff.Nm
7283b3a8eb9SGleb Smirnoffprogram and the
7293b3a8eb9SGleb Smirnoff.Xr pf 4
730eb6d64f8SSevan Janiyanfilter mechanism appeared in
7313b3a8eb9SGleb Smirnoff.Ox 3.0 .
732eb6d64f8SSevan JaniyanThey first appeared in
733eb6d64f8SSevan Janiyan.Fx 5.3
734eb6d64f8SSevan Janiyanported from the version in
735eb6d64f8SSevan Janiyan.Ox 3.5
736