Linux command
tcpreplay 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Replay pcap
tcpreplay -i [eth0] [capture.pcap]
Replay at speed
tcpreplay -i [eth0] -M [100] [capture.pcap]
Loop replay
tcpreplay -i [eth0] --loop [10] [capture.pcap]
Replay at topspeed
tcpreplay -i [eth0] --topspeed [capture.pcap]
Multiplier speed
tcpreplay -i [eth0] -x [2.0] [capture.pcap]
说明
tcpreplay replays previously captured network traffic from pcap files back onto the network. It reads packet captures produced by tools like tcpdump or Wireshark and transmits them through a specified network interface at controlled rates. The tool provides flexible speed control: traffic can be replayed at the original recorded speed, at a fixed rate in Mbps, at a speed multiplier, or at maximum wire speed with --topspeed. The --loop option repeats the capture file multiple times, and -K preloads the entire file into memory for consistent high-speed replay. Common use cases include testing network devices like firewalls and IDS/IPS systems, stress-testing network infrastructure, reproducing network issues for debugging, and benchmarking network applications under realistic traffic conditions.
参数
- -i _IFACE_
- Output interface.
- -M _MBPS_
- Rate in Mbps.
- -x _MULT_
- Speed multiplier.
- --loop _N_
- Loop count.
- --topspeed
- Maximum speed.
- -K
- Preload into memory.
FAQ
What is the tcpreplay command used for?
tcpreplay replays previously captured network traffic from pcap files back onto the network. It reads packet captures produced by tools like tcpdump or Wireshark and transmits them through a specified network interface at controlled rates. The tool provides flexible speed control: traffic can be replayed at the original recorded speed, at a fixed rate in Mbps, at a speed multiplier, or at maximum wire speed with --topspeed. The --loop option repeats the capture file multiple times, and -K preloads the entire file into memory for consistent high-speed replay. Common use cases include testing network devices like firewalls and IDS/IPS systems, stress-testing network infrastructure, reproducing network issues for debugging, and benchmarking network applications under realistic traffic conditions.
How do I run a basic tcpreplay example?
Run `tcpreplay -i [eth0] [capture.pcap]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -i _IFACE_ do in tcpreplay?
Output interface.