clinuxsocketssnmpvlan

How to fix:UDP packet send through vlan(eth0.4092), reaching at both eth0 and eth0.4092


I tried to send snmp UDP packet through vlan interface by using "setsockopt bind to interface", but in client side when i capture packet using wireshark i can capture the packet both in eth0.4092 and eth0.

1:I tried to bind the interface name using setsockopt, its working but packet reaching at eth0 and eth0.4092

2:I tried with bind to specific address , no change

expected:The packet should reach only at vlan interface.


Solution

  • It is expected, packet with vlan tag reach at eth0 and vlan tag removed packet reach at eth0.4092, vlan is a software feature so the packet should reach at physical interface then only it moves to virtual interface.