Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an IP packet with x bytes of custom header coming in on an interface. Is there a way to tell tcpdump or tshark to ignore the first x bytes and decode and display the IP packet? Any pointers would be helpful; I don't want to write a custom discector

share|improve this question
I wonder if you could use wireshark instead. You could try the Disable Protocol, it helped me to skip a socks header. – ott-- Jan 29 '13 at 23:03
@ott-- i have only command line access – Mike Ryan Jan 29 '13 at 23:37
then write your pcap based sniffer – warl0ck Jan 30 '13 at 4:02
See ask.wireshark.org/questions/5613/… – jofel Jan 30 '13 at 8:10

Wireshark's editcap has a "chop" feature (-C) which can top and tail packets for exactly this purpose.

You can do it real-time like this:

 tcpdump -w - [...filter...] | editcap -F libpcap -C 16 - - | tcpdump -nlvvv -r -
share|improve this answer

Your Answer


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.