LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-03-2006, 04:51 PM   #1
Farrukh Fida
Member
 
Registered: Jun 2006
Location: Dubai
Distribution: Cent OS
Posts: 34

Rep: Reputation: 15
by using iptables block mac address to restric user to access internet


I want to know how to block a user to get access internet, by blocking their MAC address. I used 1 configuration the resulat is that client are no longer to ping the gateway but still get access to internet.

My config.

iptables -A INPUT -m mac --mac-source 00:0BB:45:56:42 -j DROP

Please help me
 
Old 10-04-2006, 04:26 PM   #2
jaz_comp
LQ Newbie
 
Registered: Nov 2004
Posts: 18

Rep: Reputation: 0
Hi,

Try this i hope it will work.

iptables -A INPUT -p tcp -m mac --mac-source 00:0BB:45:56:42 -j DROP

if you have any proxy server then

iptables -A INPUT -m -p (port number) -d (proxy server ip)mac --mac-source 00:0BB:45:56:42 -j DROP

Thanks & Regards

jaz_comp
 
Old 10-04-2006, 04:30 PM   #3
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
And just so you know, MAC addresses are trivial to spoof, so this may not do the trick if the users has any knowledge. It is also possible depending on what hardware is between you and the computer you're trying to block, the MAC address may have been changed.

Last edited by Hangdog42; 10-04-2006 at 04:31 PM.
 
Old 10-09-2006, 07:59 AM   #4
fotoguy
Senior Member
 
Registered: Mar 2003
Location: Brisbane Queensland Australia
Distribution: Custom Debian Live ISO's
Posts: 1,291

Rep: Reputation: 62
Block access to the internet you need to use the FORWARD chain not the INPUT chain try:

Code:
iptables -A FORWARD -p tcp -m mac --mac-source 00:0BB:45:56:42 -j DROP

Last edited by fotoguy; 10-09-2006 at 08:00 AM.
 
  


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
block mac address Ammad Linux - General 1 09-11-2005 01:00 PM
DESPERATE : Iptables block users by MAC address. ranjan303 Linux - Security 28 03-29-2005 01:15 AM
iptables : how do I block inbound traffic from one ip address only? Apollo77 Linux - Security 7 03-22-2004 10:22 AM
DESPERATE : Iptables , permit know MAC , block rest. ranjan303 Linux - Networking 3 12-14-2003 09:10 AM
iptables - howto block by a port and IP address -HELP! macnanc Linux - Networking 2 03-07-2003 04:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:12 AM.

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