Hi, is there a way to do capture filter for IPv6 on GTP encapsulated packets? (ip[64:16]==0x2a008a00200000350000000000000011) or (ip6[64:16]==0x2a008a00200000350000000000000011) I tried both, don't seem to work. Thanks! Joseph asked 03 Mar '16, 06:54 joseph75074 edited 04 Mar '16, 09:46 |
One Answer:
From the pcap-filter man page, you can only specify sizes of 1, 2, or 4.
The
So, assuming the packet is IPv4-encapsulated, you probably need something like:
answered 03 Mar ‘16, 09:13 cmaynard ♦♦ edited 03 Mar ‘16, 09:14 showing 5 of 8 show 3 more comments |
Hi, cmaynard:
Thanks for your reply! I tried with ‘=’, still not working, this is for IPv6 GTP encapsulated packets.
Maybe you could post a small capture file then? A single packet should suffice to get an idea of what the traffic looks like exactly.
Sorry I am new to this website, how do I upload a pcap file? seems like .pcapng type is not allowed in the edit page.
Post the capture somewhere publicly accessible, e.g. Google Drive, Dropbox etc. and then edit your question with a link to the file.
Another possibility, since we probably only need to look at a single packet to determine the correct offsets (which is where I suspect the problem lies), you could also just convert a single packet to text using Wireshark’s
File -> Export Packet Dissections -> as “Plain Text” file…
mechanism.Choose only the Selected Packet, then deselect everything under the Packet Format section except DO select Packet Bytes. You can then just edit your question or add a comment with the resulting text output that represent the bytes of the packet.
It ought to be possible to determine the correct offsets and data needed from the text alone and the packet can always be reconstructed using
text2pcap
, if needed.EDIT: I’m not sure why the previous comment was deleted, but the posted text essentially showed the following stack:
Well, that wasn’t the format I was looking for, but it’s probably enough to answer the question. You’ve got a vlan tag with outer IPv6 and your desired filter has changed, so try this instead:
I think the important piece you were missing was the vlan primitive. From the pcap-filter man page:
Thanks! Cmaynard. This works! I was able to capture for those packets with that header size. But my problem is that I have other GTP SIP messages that have different header sizes, and I was not able to capture all of them related to the IPv6 address, is there an easy way to capture based on GTP IPv6 address, irregardless of the header sizes?
It might be possible. If there are only a few different fixed-sized headers, then you might simply
or
them all together.For example, suppose you have some headers such that the inner-IPv6 address starts at offset 64 from the outer-IPv6 header but others start at offset 80, then you might do something like so:
If there are too many different offsets, then it might be possible to dynamically find the offset for the given packet, but this really depends on your traffic, so you’d really need to post a capture file somewhere to see if it would be possible. Graham mentioned above some places where you can upload a capture file.