Page 1 of 1

MAC Allow With Bind Ip

Posted: Tue Jul 17, 2007 6:52 pm
by zeeshan84
First of Creat new file

touch filename.sh

and edit follwing Steps

Use the following command to bind the mac address with IP address;

/sbin/iptables -A INPUT -i eth0 -s 192.168.1.1 -p all -m mac --mac-source ff:ff:ff:ff:ff:ff -j
ACCEPT

At the end of all mac and IP enteries insert the following line in your script file;

/sbin/iptables -A INPUT -i eth0 -j DROP

To run script just type "sh /filename.sh"

-or-

if you want to run this script at startup use this command once;

echo "sh /filename.sh" >> /etc/rc.local

Posted: Tue Jul 17, 2007 7:08 pm
by lambda
there are several scripts on this site about limiting access by ethernet addresses. please use one of them instead of this one.

Posted: Tue Jul 17, 2007 7:30 pm
by zeeshan84
ok dear i will try

Posted: Wed Jul 18, 2007 5:14 am
by mudasir
Salam.

You can use the script made by Farrukh Bhai, it is much easire.
I have personally used it, it works great.