How to install tcpreplay on Linux

Last updated on November 17, 2020 by Dan Nanni

tcpreplay is a suite of command-line utilities that are used to replay previously captured packet dumps in a real network. In order to use tcpreplay, you first need to capture live network traffic using packet capture tools such as tcpdump, rewrite TCP/IP packet headers of the captured packets appropriately (usually MAC and IP addresses), and then re-inject the packets on to any arbitrary network under consideration.

tcpreplay is useful when you are testing network devices and middleware, such as routers, switches, firewalls and intrusion detection/prevention systems, because it allows you to test the devices under a controlled environment using reproducible scenarios.

If you would like to install tcpreplay on Linux, you can refer to the following distro-specific instructions.

Install tcpreplay on Ubuntu or Debian

$ sudo apt-get install tcpreplay

Install tcpreplay on Fedora

$ sudo yum install tcpreplay

Install tcpreplay on CentOS/RHEL 5

First set up RPMforge repository on your system. Then, install tcpreplay using yum.
$ sudo yum install tcpreplay

Install tcpreplay on CentOS/RHEL 6 and higher

You need to build tcpreplay from the source and install it manually as follows.

$ sudo yum groupinstall "Development Tools"
$ sudo yum install libpcap-devel
$ wget http://downloads.sourceforge.net/project/tcpreplay/tcpreplay/3.4.4/tcpreplay-3.4.4.tar.gz
$ tar xvfvz tcpreplay-3.4.4.tar.gz
$ cd tcpreplay-3.4.4
$ ./configure --enable-dynamic-link
$ make
$ sudo make install

Support Xmodulo

This website is made possible by minimal ads and your gracious donation via PayPal or credit card

Please note that this article is published by Xmodulo.com under a Creative Commons Attribution-ShareAlike 3.0 Unported License. If you would like to use the whole or any part of this article, you need to cite this web page at Xmodulo.com as the original source.

Xmodulo © 2021 ‒ AboutWrite for UsFeed ‒ Powered by DigitalOcean