<div dir="ltr">Hi, <div><br></div><div> I have been running Dnsmasq on Openwrt (opensource router OS). It also acts as DHCP server. </div><div><br></div><div>  Once a client connects, I need to whitelist his ip & mac through iptables depending on a few criteria. I am able to hack this part out by calling appropriate iptables command before the DHCP ACK packets are being sent in Dnsmasq code. </div><div><br></div><div> The issue with virtual machines in bridged mode connecting is - while Dnsmasq resolve their mac address as the true address, the packets that iptables see mac source of the packets as that of the host. </div><div><br></div><div> Now I have two options - either fiddle with Dnsmasq to see if it could figure out the host mac address & eventually use that with iptables command, or fiddle with iptables to see if it could identify the virtual machine packets . I figured, changing Dnsmasq would lead to lesser probability of breaking things as it would just happen while the client connects, while packets will keep on coming & going all the time. </div><div> </div><div> Can someone help me on this. Advance thanks.</div><div><br></div><div>Ashish</div><div><br></div><div>P.S. - if someone knows a better way of doing it,  I am ready to discard my work so far & start from scratch. </div><div><br></div><div><br></div></div>