Linux primer for networkers: Using the sniffer

01.05.2006

In the /download directory, first unzip libpcap (gzip-d libpcap-version.tar.gz) and then unpack the resultant tar file (tar -xvf libpcap-version.tar). This will build the directory structure under /download. When the unpacking is complete, change to the libpcap directory.

In most packages, there are text files -- usually called Readme, Install or something similar -- that contain installation instructions and other tidbits of information, such as dependencies (such as in the case of installing TCPdump without libpcap). The directions should be followed closely, but most contain the same three steps mentioned above: run configure, make and make install.

Run these commands in the package source directory -- remembering to type the path (./) -- and your package is installed. Note that if you didn't choose the developer option when installing Linux, you probably are lacking a compiler. If the error messages indicate that, download gcc as a package and follow the same procedure.

Once libpcap is installed, install TCPdump and iptraf.

Congratulations, you now have built a powerful network sniffer. In the next article, I'll discuss how to use TCPdump and iptraf.