How to fix receiving 802.1Q VLAN-prefixed packets from VLAN virtual interface on Linux
Problem
You are trying to receive raw packets from a network interface, which happens to be a VLAN interface, on Linux.
When you are looking at the packets, all packets are encapsulated in 802.1Q headers, even though you would expect the kernel to strip the VLAN tags
Solution
You need to set the network interface option reorder_hdr to on, eg
example.sh
sudo ip link set dev enp1s0.999 type vlan id 999 reorder_hdr onwhere:
enp1s0.999is the name of your VLAN network interface and999is your VLAN ID
Check out similar posts by category:
Networking
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow