I'm trying to catch and process (in 3rd party analytics app) DHCP packets from ERSPAN session, but cannot do this. There is PHY interface which receive ERSPAN traffic and erspan-type interface to get decapsulated packets (ip link add inspan type erspan seq key 10 local 10.171.165.65 erspan_ver 1)
I'm using nftables to match and handle and the easiest rule:
table netdev inspan {
chain catch {
type filter hook ingress device "inspan" priority filter ; policy accept;
iifname "inspan" udp dport 67 counter meta nftrace set 1 accept
}
}
shows ONLY broadcast packets (ip daddr 255.255.255.255):
# nft monitor trace
trace id 6fd1132b inet filter input packet: iif "inspan" ether saddr 00:1a:64:33:8d:fa ether daddr ff:ff:ff:ff:ff:ff ip saddr 0.0.0.0 ip daddr 255.255.255.255 ip dscp cs0 ip ecn not-ect ip ttl 128 ip id 20986 ip protocol udp ip length 328 udp sport 68 udp dport 67 udp length 308 @th,64,96 0x1010600d5d272d200000000
trace id 6fd1132b inet filter input rule iifname "inspan" udp dport 67 counter packets 0 bytes 0 meta nftrace set 1 accept (verdict accept)
while ALL unicast packets (being present in encapsulated ERSPAN-traffic on PHY) are missing in this trace like they consumed (and dropped) somewhere between PHY and inspan.
Note that EVERYTHING ELSE appear in the inspan (when looking using tcpdump) - any other TCP, UDP, etc, EXCEPT DHCP uincast and it does not depend on promisc settings of all interfaces in the chain.
The system looks to be clean. This is Ubuntu 22.04, but without any DHCP server, DHCP clients as well, netplan, ifupdown and other DHCP-related stuff; systemd-networkd completely disabled (for the test purposes I'm configuring networking manually).
Any ideas where unicast DHCP packets lost? For me, it looks like something in kernel catch these packets and drop them since they aren't targeted for this host.
Thank you.