<br><br><div class="gmail_quote">2011/2/9 Peter Rathlev <span dir="ltr"><<a href="mailto:peter@rathlev.dk">peter@rathlev.dk</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On Wed, 2011-02-09 at 12:25 -0200, José Queiroz wrote:<br>
> 2011/2/9 Peter Rathlev <<a href="mailto:peter@rathlev.dk">peter@rathlev.dk</a>><br>
</div><div class="im">> > The thread has since moved on to discussing different ways of<br>
> > detecting the misbehaving clients. And iptables alone simply cannot<br>
> > do what you describe.<br>
><br>
> Yes, iptables can do it. It's just a matter of how to chain the tests.<br>
<br>
</div>No, iptables can IMHO not do this. I don't understand why people keep<br>
saying it can. I provided a working example (using a string match) for a<br>
_known_ MAC address, but I'm pretty sure iptables cannot do it for an<br>
unknown MAC address.<br>
<br>
If you insist it can then please provide a working example of limiting<br>
DHCP requests based on the MAC address contained inside the DHCP packet<br>
only using iptables commands. And remember: You don't know the MAC<br>
address in advance.<br>
<div><div></div><div class="h5"><br></div></div></blockquote><div><br><br>I gave this example a few messages ago. Althought I didn't tested it, I think is a feasible approach.<br><br>iptables -A INPUT -p udp --dport 67 --u32 "28 = 0xaa && 29 = 0xbb && 30 = 0xcc && 31 = 0xdd && 32 = 0xee && 33 = 0xff" -j BLOCK_DHCP_CLIENT<br>
<br>iptables -A BLOCK_DHCP_CLIENT -m recent --update --seconds 60 -j DROP<br>iptables -A BLOCK_DHCP_CLIENT -m recent --set -j ACCEPT<br><br>Note that we're not thinking on **discovering** a misbehaviored client with iptables, we're thinking on blocking an **already discovered** misbehaviored client using iptables.<br>
<br>If the problem is discovering a misbehaviored client, this should be done in a full feature monitoring application, not in a low-level filter front-end.<br></div></div>