Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Net::Pcap does not work

by rob_au (Abbot)
on Jul 24, 2002 at 11:19 UTC ( #184774=note: print w/replies, xml ) Need Help??


in reply to Net::Pcap does not work

The 04-loop.t test script for Net::Pcap can take a moment or two to complete - This script creates a Net::Pcap object which, using the loop method, listens for ten packets on the network interface returned by lookupdev method of this module and the underlying libpcap library. If your network is nascent, this process may take some time - It may be worthwhile to start an FTP download or alike in the background to generate the necessary network traffic for the loop method and underlying libpcap library to capture.

The loop method of the Net::Pcap library is described in my tutorial on this module here.

 

Replies are listed 'Best First'.
Re: Re: Net::Pcap does not work
by arc_of_descent (Hermit) on Jul 24, 2002 at 11:36 UTC
    Hi,
    Thanx for the link to the tutorial
    I had a brief look at it and will study it further.
    But unfortunately, the loop method does
    not work even after i started some heavy downloads, etc
    Is there something wrong with my libpcap installation?
    Does tcpdump use libpcap? cause my tcpdump works fine

    --
    arc_of_descent

      Yes, libpcap is underneath tcpdump as well as being the basis for Net::Pcap. Could it be that your interface is not in promiscuious mode? Newer versions of tcpdump do not put the interface into permiscuous mode by default, if this behavior is inherited from libpcap, you may have to manually put the interace into permiscuous mode. Also make sure you're explicitly telling Net::Pcap which interface you want it to listen to. Permissions can also be a problem with pcap, in many cases the program using it has to run with root permissions.
        Hi,

        Well... I have tried promiscous mode as well as
        manually specifying the interface(eth0 and lo)
        I have also done it using root permissions.
        I guess whats left now is to check my pcap library
        with a C program!
        Help!! :-)

        --
        arc_of_descent

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://184774]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2020-02-17 03:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What numbers are you going to focus on primarily in 2020?










    Results (70 votes). Check out past polls.

    Notices?