3

How to listen all interfaces on FreeBSD with tcpdump

> tcpdump -i any
tcpdump: any: No such device exists
(BIOCSETIF failed: Device not configured)

(I would like to listen ICMP)

  • 2
    any is a linux specific construct... – Rui F Ribeiro Mar 17 '18 at 23:23
  • try to run without -i. – Yurij Goncharuk Mar 18 '18 at 0:04
  • @RuiFRibeiro what is correct under FreeBSD? – Dims Mar 18 '18 at 9:40
  • @YurijGoncharuk tcpdump any icmp doesn't work – Dims Mar 18 '18 at 9:41
  • As @RuiFRibeiro already stated, "any" is a Linux only option and doesn't work anywhere else. Read the man page. – Rob Mar 18 '18 at 10:55
0

From the tcpdump man page:

An interface argument of "all" or "pktap,all" can be used to capture packets from all interfaces, including loopback and tunnel interfaces.

Therefore you can simply do, for example:

tcpdump -i all tcp port 80

If you don't specify the -i flag, then a set of all interfaces are again included in a pseudo interface that by default excludes loopback and tunnel interfaces. Again from the tcpdump man page:

On Darwin systems version 13 or later, when the interface is unspecified, tcpdump will use a pseudo interface to capture packets on a set of interfaces determined by the kernel (excludes by default loopback and tunnel interfaces).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.