Iptables, is a great tool to create firewall in Linux, actually it is not only for that, but useful to pre-process or post-process any package of data that arrives to our Linux Operating System machine.

The other day I was needing to block the access to my network using the mac address of a machine, and Iptables come to save my day.

This is my scenario, I have an open Access Point (Do not never do that, always keep your access points closed, using WEP or better WPA, or mac address filtering). Well, I had it open, and had some neighbours using my Internet, I have a Linux box, with two NICs being my firewall, also working as a DHCP server, and doing NAT, so I just looked at the dhcp file /var/lib/dhcp/dhcpd.leases, and discover the mac address of the intruder, and add the following rule to my firewall

This is the command to use

iptables -t nat -D PREROUTING -m mac --mac-source 00:08:a1:ab:75:d1 -j DROP

That was all, if you want to check how to create a firewall with Iptables, read here, or, here