2

Why would one want to force "tcp" in a "tcpdump" filter when using "port", given port numbers are defined in TCP Headers (as opposed to IP)

In other words, is

tcpdump tcp and port 10000

synonym to

tcpdump port 10000

1 Answer 1

5

No.

  • tcp and port 10000 means "tcp port 10000"
  • port 10000 means "tcp port 10000 or udp port 10000" and is a synonym for (tcp or udp) and port 10000

I would force TCP if I wanted, for example, to see only DNS packets that are being transported over TCP (as opposed to the default UDP).


(tcpdump should have been named packetdump or netdump since it can dump packet information as low as layer 2, rather than layer 4 which its name implies.)

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.