UnixServerAdmin

Server Administration & Management

allow_mac.sh

#############################################################################
# MAC Address Allow File ####################### #######
#################################################
/sbin/iptables -F # Flush Iptables ####### ##################
#################################################
# Allow Incoming Connection from PArticular MAC Address ########
# iptables -A INPUT -j DROP ## Block all others Connection #######
#############################################################################

/sbin/iptables -A INPUT -m mac –mac-source 0A:0B:0C:0D:0E:0F -j ACCEPT ## Allow Traffic from MAC  0A:0B:0C:0D:0E:0F ##
/sbin/iptables -A INPUT -m mac –mac-source 1A:1B:1C:1D:1E:1F -j ACCEPT ## Allow Traffic from MAC  1A:1B:1C:1D:1E:1F ##
/sbin/iptables -A INPUT -m mac –mac-source 2A:2B:2C:2D:2E:2F -j ACCEPT ## Allow Traffic from MAC  2A:2B:2C:2D:2E:2F ##
/sbin/iptables -A INPUT -m mac –mac-source 3A:3B:3C:3D:3E:3F -j ACCEPT ## Allow Traffic from MAC  3A:3B:3C:3D:3E:3F ##
/sbin/iptables -A INPUT -m mac –mac-source 4A:4B:4C:4D:4E:4F -j ACCEPT ## Allow Traffic from MAC  4A:4B:4C:4D:4E:4F ##
/sbin/iptables -A INPUT -m mac –mac-source 5A:5B:5C:5D:5E:5F -j ACCEPT ## Allow Traffic from MAC  5A:5B:5C:5D:5E:5F ##
/sbin/iptables -A INPUT -j DROP    ##  Drop all Others Traffic ##
/sbin/service iptables save

#############################################################################

Advertisements

February 11, 2013 Posted by | Shell Script | | Leave a comment