<div dir="ltr">Not relevant to the issue you still face, but I just wanted to point out that triggering commands (such as iptables rule creation) based on leases being issued can be done using either the dhcp-script or DBus messaging, without having to hack the dnsmasq code itself.<div><br></div><div>Actually, looking at the man page, some enhancements have been made to that functionality in newer versions.  Quite possibly the arp-add action might have exactly the information you need for creating rules to match these pseudo-routed packets.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 29, 2016 at 10:41 AM, Ashish Sharma <span dir="ltr"><<a href="mailto:pocha.sharma@gmail.com" target="_blank">pocha.sharma@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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><span class="HOEnZb"><font color="#888888"><div><br></div><div>Ashish</div></font></span><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>
<br>______________________________<wbr>_________________<br>
Dnsmasq-discuss mailing list<br>
<a href="mailto:Dnsmasq-discuss@lists.thekelleys.org.uk">Dnsmasq-discuss@lists.<wbr>thekelleys.org.uk</a><br>
<a href="http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss" rel="noreferrer" target="_blank">http://lists.thekelleys.org.<wbr>uk/mailman/listinfo/dnsmasq-<wbr>discuss</a><br>
<br></blockquote></div><br></div>