Skip to content

Instantly share code, notes, and snippets.

@mdpuma
Last active February 23, 2021 09:48
Show Gist options
  • Save mdpuma/12a73204fbb9e0fa6b43ce45affdb0c9 to your computer and use it in GitHub Desktop.
Save mdpuma/12a73204fbb9e0fa6b43ce45affdb0c9 to your computer and use it in GitHub Desktop.
tcpdump vlan capture tag priority
#!/bin/sh
# VLANID is 10 | 0xa
# VLANID is 20 | 0x14
# VLANID is 3342 | 0x0d0e
# VLANID is 3340 | 0x0d0c
# https://www.binaryhexconverter.com/hex-to-binary-converter
# https://www.tcpdump.org/manpages/pcap-filter.7.html
# filter by VLAN 20 & prio 0
tcpdump -i eno1 -n -w - -s 50 | tcpdump -r - -n 'ether[14:2] == 0x0014' -e -xx
# filter by VLAN 10 & prio = 6
# vlan 10 = 0x0a
tcpdump -i bond4 -n -w - -s 50 | tcpdump -r - -n 'ether[15] == 0xa && ether[14] >> 5 = 6' -e -xx -c 100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment