TCPPREP(1)
tcpprep β straight outta the Tcpreplay Suite, manual section 1. Bestie, buckle up. π
β¨ NAME β¨
tcpprep β Create a tcpreplay cache cache file from a pcap file. (yes, it really says "cache cache", we don't make the rules π)
πΈ SYNOPSIS πΈ
tcpprep [OPTION]...
π DESCRIPTION π
Okay so tcpprep is a pcap(3) file pre-processor, and what it does is it makes a cache file. That cache file is literally a little rulebook for tcprewrite(1) and tcpreplay(1), telling them how to process and send packets. It's giving "manager energy", fr fr. π
Here's the vibe: the whole point of tcpreplay is to resend every single packet from the input file(s) out one single file. tcpprep rolls up, looks at a pcap file, applies whatever user-specified rules you gave it, and spits out a cache file. That cache file then tells tcpreplay whether or not to send each packet, and which interface that packet should go out of. Iconic behaviour, honestly. β¨
Wanna go deeper? The Tcpreplay Manual lives at: http://tcpreplay.appneta.com
π OPTIONS π
-d,--dbug=numberβ Turn on debugging output. Range:0to5. Default:0.
If it was configured with --enable-debug, then you get to pick a verbosity level for the debugging output. Bigger numbers = more yapping. π£οΈ
-a,--auto=stringβ Auto-split mode. Cannot be combined with:--cidr,--port,--regex,--mac.
tcpprep will try to figure out, all on its own, what the primary function of each host is β based on the traffic it captured β and classify every host as either client or server. But bestie, you do have to give it a hint about how to go looking for clients and servers. The valid hints are:
bridgeβ Bridge mode goes through each packet trying to figure out if the sender is a client or a server. Once all the packets are processed, the results get weighed according to the server/client ratio (--ratio), and then systems get assigned an interface. Iftcpprepcan't tell what role a system plays? It aborts. πrouterβ Router mode works exactly like bridge mode, except after the weighing is done, any system that's still undetermined is considered a server if it falls inside a network that's known to contain other servers. Router has a better shot at successfully splitting clients and servers, but it is not 100% foolproof.clientβ Client mode works exactly like bridge mode, except unclassified systems get treated as clients. Client mode should always complete successfully. π«Άserverβ Server mode works exactly like bridge mode, except unclassified systems get treated as servers. Server mode should always complete successfully.firstβ First mode works by looking at the first time each IP shows up in theSRCandDSTfields of the IP header. If the host is first seen in theSRCfield, it's a client. If it's first seen in theDSTfield, it's marked as a server. This basically replicates the processing of thetomahawktest tool. First mode should always complete successfully. β
-c,--cidr=stringβ CIDR-split mode. Cannot be combined with:--auto,--port,--regex,--mac.
Hand it a comma delimited list of CIDR netblocks, and it matches them against the source IP of every packet. Any packet that matches one of the CIDRs gets classified as a server.
IPv4 example:
--cidr=192.168.0.0/16,172.16.0.0/12,10.0.0.0/8
IPv6 example:
--cidr=[::ffff:0:0/96],[fe80::/16]
-r,--regex=stringβ Regex-split mode. Cannot be combined with:--auto,--port,--cidr,--mac.
Give it a regular expression and it matches that against the source IP of each packet. Packets that match the regex get classified as servers. π
-p,--portβ Port-split mode. Cannot be combined with:--auto,--regex,--cidr,--mac.
Says that TCP and UDP traffic over IPv4 and IPv6 should be classified as client or server based on the destination port of the header.
-e,--mac=stringβ Source MAC split mode. Cannot be combined with:--auto,--regex,--cidr,--port.
Give it a list of MAC addresses to match against the source MAC of each packet. Packets matching one of the values get classified as servers.
--reverseβ Matches to be client instead of server.
Normally --mac, --regex and --cidr are used to specify the servers, and non-IP packets get classified as clients. With --reverse, all of that flips: the flags specify clients instead, and non-IP packets get classified as servers. π
-C,--comment=stringβ Embedded cache file comment.
Pick a comment to be imbedded inside the output cache file, so you can view it later. Little love note to your future self. π
--no-arg-commentβ Do not embed any cache file comment.
By default, tcpprep sticks the arguments you passed on the command line into the cache file comment (on top of whatever --comment you gave it). If for some reason you do not want that, hit this option.
-x,--include=stringβ Include only packets matching rule. Cannot be combined with:--exclude.
This overrides the default of processing every packet in the capture file, so instead it only sends/edits packets that match the rule you gave. Rules can be one of:
S:<CIDR1>,...β Source IP must match specified IPv4/v6 CIDR(s)D:<CIDR1>,...β Destination IP must match specified IPv4/v6 CIDR(s)B:<CIDR1>,...β Both source and destination IP must match specified IPv4/v6 CIDR(s)E:<CIDR1>,...β Either IP must match specified IPv4/v6 CIDR(s)P:<LIST>β Must be one of the listed packets, where the list corresponds to the packet number in the capture file.
-x P:1-5,9,15,72-
would process packets 1 through 5, the 9th and 15th packet, and packets 72 until the end of the file
F:'<bpf>'β BPF filter. See thetcpdump(8)man page for syntax.
-X,--exclude=stringβ Exclude any packet matching this rule. Cannot be combined with:--include.
This overrides the default of processing every packet in the capture file, so instead it only sends/edits packets which do NOT match the rule you gave. Rules can be one of:
S:<CIDR1>,...β Source IP must not match specified IPv4/v6 CIDR(s)D:<CIDR1>,...β Destination IP must not match specified IPv4/v6 CIDR(s)B:<CIDR1>,...β Both source and destination IP must not match specified IPv4/v6 CIDR(s)E:<CIDR1>,...β Either IP must not match specified IPv4/v6 CIDR(s)P:<LIST>β Must not be one of the listed packets, where the list corresponds to the packet number in the capture file.
-x P:1-5,9,15,72-
would skip packets 1 through 5, the 9th and 15th packet, and packets 72 until the end of the file
-o,--cachefile=stringβ Output cache file.-i,--pcap=stringβ Input pcap file to process.-P,--print-comment=stringβ Print embedded comment in the specified cache file.-I,--print-info=stringβ Print basic info from the specified cache file.-S,--print-stats=stringβ Print statistical information about the specified cache file.-s,--services=stringβ Load services file for server ports. Requires:--port.
Uses a list of ports used by servers, in the same format as /etc/services:
<service_name> <port>/<protocol> # comment
Example: http 80/tcp
-N,--nonipβ Send non-IP traffic out server interface.
By default, non-IP traffic that can't be classified as client or server gets classified as "client". Specifying --nonip reclassifies non-IP traffic as "server". Heads up though: the meaning of this flag is reversed if --reverse is used. π
-R,--ratio=stringβ Ratio of client to server packets. Default:2.0. Requires:--auto.
Since any given host might have both client and server traffic being sent to/from it, tcpprep uses a ratio to weigh those packets. If you wanna override the default of 2:1 server to client packets required for a host to be classified as a server, just specify it as a floating point value.
-m,--minmask=numberβ Minimum network mask length in auto mode. Range:0to32. Default:30. Requires:--auto.
By default, auto modes use a minimum network mask length of 30 bits to build networks containing clients and servers. This lets you override that value. Larger values will increase performance but may give you inaccurate results. β οΈ
-M,--maxmask=numberβ Maximum network mask length in auto mode. Range:0to32. Default:8. Requires:--auto.
By default, auto modes use a maximum network mask length of 8 bits to build networks containing clients and servers. This lets you override that value. Larger values will decrease performance and accuracy, but will give you a greater chance of success.
-v,--verboseβ Print decoded packets via tcpdump to STDOUT.-A,--decode=stringβ Arguments passed to tcpdump decoder. Requires:--verbose.
When you enable verbose mode (-v), you can also hand over one or more extra arguments to pass to tcpdump, to change the way packets get decoded. By default, -n and -l are used. Make sure you quote the arguments so they don't get interpreted by tcprewrite. The following arguments are valid:
[ -aAeNqRStuvxX ]
[ -E spi@ipaddr algo:secret,... ]
[ -s snaplen ]
-V,--versionβ Print version information.-h,--less-helpβ Display less usage information and exit.-w,--suppress-warningsβ suppress printing warning messages.-H,--helpβ Display usage information and exit.--more-helpβ Pass the extended usage information through a pager.--save-opts[=string]β Save the current option state to a config file.--load-opts=string,--no-load-optsβ Load options from a config file;--no-load-optsdisables this.
π OPTION PRESETS π
Any option that is not marked as not presettable may be preset by loading values from configuration ("RC" or ".INI") file(s). The homerc file is $$/, unless that is a directory; in that case .tcppreprc is searched for within it. π¦
π FILES π
See OPTION PRESETS for configuration files.
β EXIT STATUS β
One of the following exit values will be returned:
0(EXIT_SUCCESS) β Successful program execution. slay. β1(EXIT_FAILURE) β The operation failed or the command syntax was not valid.66(EX_NOINPUT) β A specified configuration file could not be loaded.70(EX_SOFTWARE) βliboptshad an internal operational error. Please report it toautogen-users@lists.sourceforge.net. Thank you. π
π AUTHORS π
okay so this page has two copyright holders and they're both legends, ngl:
- Copyright 2013-2026 Fred Klassen - AppNeta by Broadcom
- Copyright 2000-2012 Aaron Turner
if you need support, bestie, please use the tcpreplay-users@lists.sourceforge.net mailing list. that's the move. fr fr. π
and the latest version of this software is always available from:
http://tcpreplay.appneta.com/
like, always always. go get it. π¦
π COPYRIGHT π
Copyright Β© 2000-2026 Aaron Turner and Fred Klassen, all rights reserved.</purl>
This program is released under the terms of the GNU General Public License, version 3 or later. periodt. π
π BUGS π
Please send bug reports to: tcpreplay-users@lists.sourceforge.net
not me asking you to tell them about the bugs though β they want to know, it's giving responsible disclosure, it's giving community, it's giving slay. π«Ά
π NOTES π
This manual page was generated from the tcpprep option definitions.
iykyk β the manpage is literally auto-generated from the source, so if you ever spot something cursed in here, that's why. it's not vibes-based documentation, it's definitions-based documentation. β¨
okay that's the whole page bestie, we made it, we read every single line, we are so back. this was Tcpreplay Suite TCPPREP(1), dated 2026-07-29 β go prep some packets, you absolute icon. πππΈπ¦
π¦ where this page comes from
- alpine 3.24: tcpreplay-doc 4.6.1-r0 Β· GPL-3.0-or-later
- arch rolling: tcpreplay 4.6.1-1 Β· GPL-3.0-only
- epel 10: tcpreplay 4.6.1-1.el10_3 Β· GPL-3.0-only
- epel 9: tcpreplay 4.6.1-1.el9 Β· GPL-3.0-only
- epel 9: tcpreplay 4.6.2-1.el9 Β· GPL-3.0-only
- fedora 43: tcpreplay 4.6.1-1.fc43 Β· GPL-3.0-only
- fedora 43: tcpreplay 4.6.1-1.fc43 Β· GPL-3.0-only
- fedora 44: tcpreplay 4.6.1-1.fc44 Β· GPL-3.0-only
- fedora 44: tcpreplay 4.6.1-1.fc44 Β· GPL-3.0-only
- nixpkgs unstable: tcpreplay 4.6.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms