ipfstat [-C] [-D addrport] [-P protocol] [-S addrport] [-T refreshtime]
The ipfstat command is part of a suite of commands associated with the Solaris IP Filter feature. See ipfilter(5).
The ipfstat command examines /dev/kmem using the symbols _fr_flags, _frstats, _filterin, and _filterout. To run and work, it needs to be able to read both /dev/kmem and the kernel itself.
The default behavior of ipfstat is to retrieve and display the statistics which have been accumulated over time as the kernel has put packets through the filter.
The role of ipfstat is to display current kernel statistics gathered as a result of applying the filters in place (if any) to packets going in and out of the kernel. This is the default operation when no command line parameters are present. When supplied with either -i or -o, ipfstat will retrieve and display the appropriate list of filter rules currently installed and in use by the kernel.
ipfstat uses kernel device files to obtain information. The default permissions of these files require ipfstat to be run as root for all operations.
# kstat -m ipf
Using the ipfstat -t option causes ipfstat to enter the state top mode. In this mode the state table is displayed similarly to the way the Unix top utility displays the process table. The -C, -D, -P, -S and -T command line options can be used to restrict the state entries that will be shown and to specify the frequency of display updates.
In state top mode, use the following keys to influence the displayed information:
Select information to display.
Redraw the screen.
Quit the program.
Switch between different sorting criteria.
Reverse the sorting criteria.
States can be sorted by protocol number, by number of IP packets, by number of bytes, and by time-to-live of the state entry. The default is to sort by the number of bytes. States are sorted in descending order, but you can use the r key to sort them in ascending order.
It is not possible to interactively change the source, destination, and protocol filters or the refresh frequency. This must be done from the command line.
The screen must have at least 80 columns for correct display. However, ipfstat does not check the screen width.
Only the first X-5 entries that match the sort and filter criteria are displayed (where X is the number of rows on the display). There is no way to see additional entries.
The following options are supported:
Display filter lists and states for IPv6, if available. This option might change in the future.
Display the accounting filter list and show bytes counted against each rule.
Display packet authentication statistics.
Valid only in combination with -t. Display “closed” states as well in the top. Normally, a TCP connection is not displayed when it reaches the CLOSE_WAIT protocol state. With this option enabled, all state entries are displayed.
Produce debugging output when displaying data.
Valid only in combination with -t. Limit the state top display to show only state entries whose destination IP address and port match the addrport argument. The addrport specification is of the form ipaddress[,port]. The ipaddress and port should be either numerical or the string any (specifying any IP address and any port, in that order). If the -D option is not specified, it defaults to -D any,any.
Show fragment state information (statistics) and held state information (in the kernel) if any is present.
Show groups currently configured (both active and inactive).
Show per-rule the number of times each one scores a “hit”. For use in combination with -i.
Display the filter list used for the input side of the kernel IP processing.
Swap between retrieving inactive/active filter list details. For use in combination with -i.
When used with -s, show a list of active state entries (no statistics).
Show the rule number for each rule as it is printed.
Display the filter list used for the output side of the kernel IP processing.
Valid only in combination with -t. Limit the state top display to show only state entries that match a specific protocol. The argument can be a protocol name (as defined in /etc/protocols) or a protocol number. If this option is not specified, state entries for any protocol are specified.
Disable both IP address-to-hostname resolution and port number-to-service name resolution.
Valid only in combination with -t. Limit the state top display to show only state entries whose source IP address and port match the addrport argument. The addrport specification is of the form ipaddress[,port]. The ipaddress and port should be either numerical or the string any (specifying any IP address and any port, in that order). If the -S option is not specified, it defaults to -S any,any.
Show packet/flow state information (statistics only).
Valid only in combination with -t. Specifies how often the state top display should be updated. The refresh time is the number of seconds between an update. Any positive integer can be used. The default (and minimal update time) is 1.
Show the state table in a way similar to the way the Unix utility, top, shows the process table. States can be sorted in a number of different ways.
Turn verbose mode on. Displays additional debugging information.
See attributes(5) for descriptions of the following attributes:
To view license terms, attribution, and copyright for IP Filter, the default path is /usr/lib/ipf/IPFILTER.LICENCE. If the Solaris operating environment has been installed anywhere other than the default, modify the given path to access the file at the installed location.