A mac address is acronym for media access control address, is a unique address assigned to almost all-networking hardware such as Ethernet cards, router etc

If you want to filter packets on the basis of mac address, it is possible on linux with iptables.

Iptables comes with MAC module. this matches packets traveling through the firewall based on their MAC (Ethernet hardware) address. It offers good protection against malicious users who spoof or change their IP address. Remember that mac filtering only makes sense for packets coming from an Ethernet device and entering the chains:

1. PREROUTING
2. FORWARD
3. INPUT

iptables blocking with mac address
Drop all connection coming from mac address 00:0F:EA:91:04:08 (add command to your firewall script)

iptables -A INPUT -m mac –mac-source 00:0F:EA:91:04:08 -j DROP

iptables allowing with mac address
Allow port 22 for mac address 00:0F:EA:91:04:07

iptables -A INPUT -p tcp –destination-port 22 -m mac –mac-source
00:0F:EA:91:04:07 -j ACCEPT

Read man page of iptables for more information.


Comments

3 Comments so far

  1. Palonek on June 25, 2008 4:53 pm

    What is even more interesting is that you can use this method to route traffic between interfaces with options like skipto and via interface. Palonek from http://www.paloneks.ca/

  2. ThakshinaMoorthy on August 20, 2008 7:01 am

    Hello.,

    How to filter mac for an specific ipaddress, and how to implement,plz help me and mail me

  3. ThakshinaMoorthy on August 20, 2008 7:02 am

    Hello.,

    How to filter mac for an specific ipaddress in RHEL, and how to implement,plz help me and mail me thakshina_v@yahoo.com

Name (required)

Email (required)

Website

Speak your mind

Yeah SEO Friendly Web Directory | Directory Central | Directory Dot | My SEO Directory | The SEO Directory | Web SEO Directory | SEO Directory