16

I want to capture the package on a specific port on any interface of my machine.

I know how to capture the package on a specific port with a specific interface. And the command is

tshark -f "udp port 162" -i bond0

And if no interface is specified, TShark searches the list of interfaces, choosing the first non-loopback interface if there are any non-loopback interfaces.

But I want to capture the package on all the interface of my machine. Could anyone help me on this?

Thanks a lot!

zhaojing
  • 585
  • 3
  • 11
  • 33

1 Answers1

29
tshark -f "udp port 162" -i any

works for me here on Linux(CentOS).

Ron Klein
  • 9,178
  • 9
  • 55
  • 88
dc5553
  • 1,243
  • 11
  • 21
  • 3
    Note that the "any" device is available only on Linux (other OS's packet capture mechanisms require that you specify a specific interface). –  Apr 29 '12 at 18:43