# Pcaplet 'lookupdev': no suitable device found

**URL:** <https://www.ruby-forum.com/t/pcaplet-lookupdev-no-suitable-device-found/90548>\
**Category:** Ruby\
**Created:** [March 29, 2007, 9:33pm UTC](https://www.ruby-forum.com/t/pcaplet-lookupdev-no-suitable-device-found/90548 "2007-03-29T21:33:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikec](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/977dab/32.png) [@mikec](https://www.ruby-forum.com/u/mikec)\
**Post date:** [March 29, 2007, 9:33pm UTC](https://www.ruby-forum.com/t/pcaplet-lookupdev-no-suitable-device-found/90548/1 "2007-03-29T21:33:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mikec](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/977dab/32.png) [@mikec](https://www.ruby-forum.com/u/mikec)\
**Post date:** [March 30, 2007, 12:03am UTC](https://www.ruby-forum.com/t/pcaplet-lookupdev-no-suitable-device-found/90548/2 "2007-03-30T00:03:18Z")

</div>

On 29 Mar 2007, at 20:33, Mike Cook wrote:

> /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

raise ArgumentError unless @reality.responds\_to? :reason

---

<div class="post-metadata">

**Author:** ![mikec](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/977dab/32.png) [@mikec](https://www.ruby-forum.com/u/mikec)\
**Post date:** [March 30, 2007, 12:45am UTC](https://www.ruby-forum.com/t/pcaplet-lookupdev-no-suitable-device-found/90548/3 "2007-03-30T00:45:10Z")

</div>

Eleanor McHugh wrote:

> On 29 Mar 2007, at 20:33, Mike Cook wrote:
> 
> > /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
> 
> raise ArgumentError unless @reality.responds\_to? :reason

Ellie,

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

-Mike

---

<div class="post-metadata">

**Author:** ![mikec](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/977dab/32.png) [@mikec](https://www.ruby-forum.com/u/mikec)\
**Post date:** [March 30, 2007, 1:54pm UTC](https://www.ruby-forum.com/t/pcaplet-lookupdev-no-suitable-device-found/90548/4 "2007-03-30T13:54:12Z")

</div>

On 29 Mar 2007, at 23:45, Mike Cook wrote:

> Thanks for your quick reply, your solution worked like a charm. I was  
> following a Ruby/Pcap tutorial from [Arstechnica.com](http://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.
