MAC Allow With Bind Ip

Discussion regarding the installation and configuration of Linux distributions.
Post Reply
zeeshan84
Cadet
Posts: 3
Joined: Sat Jul 14, 2007 6:20 am
Location: Karachi
Contact:

MAC Allow With Bind Ip

Post 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
M.Zeeshan
lambda
Major General
Posts: 3452
Joined: Tue May 27, 2003 7:04 pm
Location: Lahore
Contact:

Post by lambda »

there are several scripts on this site about limiting access by ethernet addresses. please use one of them instead of this one.
zeeshan84
Cadet
Posts: 3
Joined: Sat Jul 14, 2007 6:20 am
Location: Karachi
Contact:

Post by zeeshan84 »

ok dear i will try
M.Zeeshan
mudasir
Captain
Posts: 565
Joined: Tue Oct 17, 2006 5:23 am
Location: Dubai
Contact:

Post by mudasir »

Salam.

You can use the script made by Farrukh Bhai, it is much easire.
I have personally used it, it works great.
Kind Regards
Mudasir Mirza (RHCE)
(+971)55-1045754
http://www.crystalnetworks.org
http://www.diglinux.com
Post Reply