MAC Allow With Bind Ip

Discussion regarding the installation and configuration of Linux distributions.

MAC Allow With Bind Ip

Postby zeeshan84 » Tue Jul 17, 2007 6:52 pm

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
zeeshan84
Cadet
 
Posts: 3
Joined: Sat Jul 14, 2007 6:20 am
WLM: dotcom_netcable@hotmail.com
Yahoo Messenger: dotcom_netcable@hotmail.com
Location: Karachi

Postby lambda » Tue Jul 17, 2007 7:08 pm

there are several scripts on this site about limiting access by ethernet addresses. please use one of them instead of this one.
lambda
Major General
 
Posts: 3452
Joined: Tue May 27, 2003 7:04 pm
Website: http://www.hungry.com/~fn/
Location: Lahore

Postby zeeshan84 » Tue Jul 17, 2007 7:30 pm

ok dear i will try
M.Zeeshan
zeeshan84
Cadet
 
Posts: 3
Joined: Sat Jul 14, 2007 6:20 am
WLM: dotcom_netcable@hotmail.com
Yahoo Messenger: dotcom_netcable@hotmail.com
Location: Karachi

Postby mudasir » Wed Jul 18, 2007 5:14 am

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
mudasir
Captain
 
Posts: 565
Joined: Tue Oct 17, 2006 5:23 am
Website: http://www.crystalnetworks.org
Location: Dubai


Return to “%s” Installation

Who is online

Users browsing this forum: No registered users and 3 guests

cron