Libpcap on Ubuntu — Install libpcap

I have to say that it’s an awesome tool!!

Since I’m working on the summer project of SCION (Scalability Control and Isolation on Next-generation Network), I have to learn some powerful tools. My primary goal is to set up this new network architecture on several virtual machines and make it run well. After it’s done, we want to  move the whole Linux system into the SCION network environment. Unfortunately the SCION is totally new system, which means every network APIs are not compatible with it.

We google some approaches and tools. Finally we decide to use libpcap to develop our tool. And the alpha plan came out immediately.

But at the very beginning, we have to install the libpcap!

Here are the brief steps of installing libpcap on ubuntu(my version is 14.04), YMMV.

  1. Download the source code from here
  2. ./configure
  3. If everything goes fine,  then
    sudo make && sudo make install

    , you may need to update flex and install yacc at first

            sudo apt-get install flex
            sudo apt-get install bison
            
  4. Now you can find libpcap.so.1 in /usr/local/lib
  5. You can compile your c/c++ code with appendix “-lpcap”

Hint: If the console show a message such as “error while loading shared libraries: libpcap.so.1: cannot open shared object file: No such file or directory” follow these steps

  1. sudo vi /etc/ld.so.conf
  2. add two lines at the end.”/usr/lib” and “/usr/local/lib”
  3. sudo ldconfig
  4. recompile your code and you can run it!

On the next post, I will talk about our naive alpha plan. It’s pretty trick!

 

Advertisements

5 thoughts on “Libpcap on Ubuntu — Install libpcap

  1. I have installed libpcap and found libpcap.so.1 in /usr/local/lib. I also did 4 steps at the end of your post but I still have get this message: “/usr/local/ampps/Pure-FTPd/sbin/pure-ftpd: error while loading shared libraries: libcap.so.1: cannot open shared object file: No such file or directory”
    This is my command:
    /usr/local/ampps/Pure-FTPd/sbin/pure-config.pl /usr/local/ampps/Pure-FTPd/etc/pure-ftpd.conf -H -B
    Please help 🙂

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s