Pcaplet 'lookupdev': no suitable device found

M

Mike Cook

Hello,

I'm trying to prototype using Ruby for a networking class that I'm
taking, and I need to be able to use libpcap. I found 'pcaplet' and
have been trying to get set up with that, but when trying to execute the
following line:

$network = Pcaplet.new('-s 1500')

I get the following error:

/usr/lib/ruby/1.8/pcaplet.rb:51:in 'lookupdev': no suitable device found
(Pcap::pcapError)
from /usr/lib/ruby/1.8/pcaplet.rb:51:in 'initialize'
from test.rb:3

I'm running on Ubuntu 6.10 under Microsoft Virtual PC 2007 as I don't
have Linux installed directly on my laptop.

Thanks in advance,
-Mike
 
E

Eleanor McHugh

I'm trying to prototype using Ruby for a networking class that I'm
taking, and I need to be able to use libpcap. I found 'pcaplet' and
have been trying to get set up with that, but when trying to
execute the
following line:

$network = Pcaplet.new('-s 1500')

I get the following error:

/usr/lib/ruby/1.8/pcaplet.rb:51:in 'lookupdev': no suitable device
found
(Pcap::pcapError)
from /usr/lib/ruby/1.8/pcaplet.rb:51:in 'initialize'
from test.rb:3

You need to specify the interface to listen on. For example:

en0_listener = Pcaplet.new('-s 1500 -i en0')

which on my Mac will listen on en0.


Ellie

Eleanor McHugh
Games With Brains
 
M

Mike Cook

Eleanor said:
You need to specify the interface to listen on. For example:

en0_listener = Pcaplet.new('-s 1500 -i en0')

which on my Mac will listen on en0.


Ellie

Eleanor McHugh
Games With Brains

Ellie,

Thanks for your quick reply, your solution worked like a charm. I was
following a Ruby/Pcap tutorial from Arstechnica.com and they didn't make
any mention of specifying the interface.

-Mike
 
E

Eleanor McHugh

Thanks for your quick reply, your solution worked like a charm. I was
following a Ruby/Pcap tutorial from Arstechnica.com and they didn't
make
any mention of specifying the interface.

Unfortunately Ruby/Pcap is a very thin wrapper to the underlying
library, which makes it a little less Rubyish than one would like -
in particular passing in configuration strings is just ugly. Still,
it works as advertised and is great for quick sniffing/logging tasks.

My colleague Romek and I use it extensively for our DNS work and he
covered it very briefly as part of our RailsConf Europe presentation
last year. Needless to say there were some baffled faces in the
audience lol


Ellie

Being and Doing are merely useful abstractions for the 'time'-
dependent asymmetries of phase space.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top