ipfwpcap(8)

ipfwpcap8

Copy diverted packets to a file in tcpdump format

Usage

ipfwpcap [-dr] [-b maxbytes] [-p maxpkts] [-P pidfile] portnum dumpfile

Overview

The ipfwpcap utility is used to copy diverted packets to a file in tcpdump(1) format. The interesting packets are diverted by ipfw(8) to a port on which ipfwpcap listens. The packets are then dropped unless -r is used.

The options are as follows:

-d

Turns on extra debugging messages.

-r

Writes packets back to the divert(4) socket.

-rr

Indicates that it is okay to quit if maxbytes or maxpkts are reached. Diverted packets will silently disappear if nothing is listening on the divert(4) socket.

-b maxbytes

Stop dumping after maxbytes bytes.

-p maxpkts

Stop dumping after maxpkt packets.

-P pidfile

File to store PID number in. Default is /var/run/ipwfpcap.portnr.pid.

The portnum argument specifies which divert(4) socket port to listen on. The dumpfile argument is the path to the file to write captured packets to. Specify ‘-’ to write to stdout.

Exit status

The ipfwpcap utility exits 0 on success, and >0 if an error occurs.

Examples

ipfwpcap -r 8091 divt.log &

Starts ipfwpcap as a background job listening to port 8091 and reflecting the packets back to the socket.

ipfw add 2864 divert 8091 ip from 192.0.2.101

Example ipfw(8) rule to divert all packets from 192.0.2.101 to port 8091. See ipfw(8) for details.

Releases

45 releases since FreeBSD 6.4-RELEASE; the text changed 31 times.

  1. 6.4
  2. 7.0
  3. 7.1
  4. 7.2
  5. 7.3
  6. 7.4
  7. 8.0
  8. 8.1
  9. 8.2
  10. 8.3
  11. 8.4
  12. 9.0
  13. 9.1
  14. 9.2
  15. 9.3
  16. 10.0
  17. 10.1
  18. 10.2
  19. 10.3
  20. 10.4
  21. 11.0
  22. 11.1
  23. 11.2
  24. 11.3
  25. 11.4
  26. 12.0
  27. 12.1
  28. 12.2
  29. 12.3
  30. 12.4
  31. 13.0–13.2
  32. 13.3–16.0

History

The ipfwpcap utility first appeared in FreeBSD 7.0.

Authors

ipfwpcap was written by P. Kern ⟨[email protected]⟩. This manual page was written by Niclas Zeising ⟨[email protected]⟩.

From base 16.0-CURRENT-20261027-61c70dc16a79 in FreeBSD 16.0-CURRENT (2026-10-27). Parsed by carta from the page's mdoc source.