I want to implement the MAC-Check script by Farrukh Bhai in ti my Current Firewall.
I have posted my Firewal Here...
http://www2.linuxpakistan.net/forum2x/v ... fd67124684
Please Help me out in impleenting this mac check script By Farrukh Bhai
One more thing i want to know if i enter the MAC address in the file "/etc/mac.allow" will it automatically be alowed or will i have to restart the script.....#
# MAC Check Script
# This Script will add Allowed/Blocked and Blocked Users in Firewall
#
#!/bin/sh
set -x
MAC_ALLOW="/etc/mac.allow"
MAC_DENY="/etc/mac.deny"
TMP_ALLOW="/tmp/mac.allow"
TMP_DENY="/tmp/mac.deny"
cat $MAC_ALLOW | awk '{ print $1}' > $TMP_ALLOW
cat $MAC_DENY | awk '{ print $1}' > $TMP_DENY
echo -e "Loading MAC Address...."
/sbin/iptables -F INPUT
/sbin/iptables -I INPUT -p all -j DROP
for MAC in `cat $TMP_ALLOW`
do
/sbin/iptables -I INPUT -p all -m mac --mac-source $MAC -j ACCEPT
done
for MAC in `cat $TMP_DENY`
do
/sbin/iptables -I INPUT -p all -m mac --mac-source $MAC -j DROP
done
rm -f $TMP_ALLOW
rm -f $TMP_DENY
echo -e "MAC Address Loaded Successfully...."