Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

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.)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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