LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 04-26-2006, 09:40 AM   #1
hermouche
Member
 
Registered: Nov 2004
Location: Algeria
Posts: 111

Rep: Reputation: 15
Smile using iptables...........mac address......bloc pc


hy

i am using FC5.

i would like to use iptables in order to block a host fromgetting outside 'internet".

since the host is getting an IP address from a DHCP, so i can't just block th host using his IP address since the IP address is changing.

So i would like to use the host mac address in orther to block it.

i loocked at the "man iptables" it says:
#iptables -A FORWARD --mac-source xx:xx:xx:xx:xx:xx -j DROP

that's what i did but the answer is " unrecognized arg --mac-source"


any help will be appreciated.
thanks.


this works perfectly:
iptables -A FORWARD -s 192.168.0.120 -d 0/0 -j DROP
 
Old 04-26-2006, 10:19 AM   #2
lucktsm
Member
 
Registered: May 2004
Location: Atlanta, GA USA
Distribution: Redhat ES4, FC4, FC5, slax, ubuntu, knoppix
Posts: 155

Rep: Reputation: 30
Interesting. The --mac-source looks correct and is in the man page. Is this machine a proxy for the rest of them? You may try INPUT instead of FORWARD.
 
Old 04-26-2006, 01:40 PM   #3
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Quote:
Originally Posted by hermouche
iptables -A FORWARD --mac-source xx:xx:xx:xx:xx:xx -j DROP

that's what i did but the answer is " unrecognized arg --mac-source"
your syntax is incomplete... it's like this:
Code:
iptables -A FORWARD -m mac --mac-source xx:xx:xx:xx:xx:xx -j DROP
BTW, it would be a good idea to match your LAN interface also... like:
Code:
iptables -A FORWARD -i $LAN_IFACE -m mac \
--mac-source xx:xx:xx:xx:xx:xx -j DROP
just my ...

Last edited by win32sux; 04-26-2006 at 01:45 PM.
 
Old 04-27-2006, 04:41 AM   #4
hermouche
Member
 
Registered: Nov 2004
Location: Algeria
Posts: 111

Original Poster
Rep: Reputation: 15
great

It works.

thanks, thanks
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
IPTABLES rules with mac address? xpathfinder Linux - Security 3 12-11-2005 09:23 PM
Iptables/Mac address InJesus Linux - Security 3 11-17-2005 05:57 AM
blocking mac address using iptables Kendo1979 Linux - Networking 9 10-25-2004 04:09 AM
MAC address iptables questions scottman Linux - Security 2 10-01-2004 01:26 PM
MAC Address + IPTABLES yvesg Linux - Networking 1 05-10-2004 08:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 01:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration