LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 07-19-2013, 12:13 AM   #1
neopandid
Member
 
Registered: Aug 2011
Location: Russia
Distribution: Debian
Posts: 32

Rep: Reputation: Disabled
IPTables How To "Deny all MAC" on router


Hi,
I have a several debian squid routers and on one of these routers, I want to allow only certain MAC addresses in IPTABLES.

I searched but I couldn't find any documents about this.

My system administrators told me that we can't do that.
But we have ZyXEL routers and these machines can create "Black Lists" or more importantly "White Lists" for MAC Filtering, I'm pretty sure these routers use linux and iptables.

Thanks in advance

Last edited by neopandid; 07-19-2013 at 12:15 AM.
 
Old 07-19-2013, 01:26 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by neopandid View Post
I want to allow only certain MAC addresses in IPTABLES. I searched but I couldn't find any documents about this.
'man iptables' says to use "-m mac --mac-source XX:XX:XX:XX:XX:XX".


Quote:
Originally Posted by neopandid View Post
My system administrators told me that we can't do that. But we have ZyXEL routers and (..) I'm pretty sure these routers use linux and iptables.
Either check the vendors documentation or (have someone) log in and find out.
 
Old 07-19-2013, 02:13 AM   #3
neopandid
Member
 
Registered: Aug 2011
Location: Russia
Distribution: Debian
Posts: 32

Original Poster
Rep: Reputation: Disabled
Thank you but I have already checked manual pages, but I couldn't find how to create a "White MAC List" and deny every other MAC address in IPTables.

Last edited by neopandid; 07-19-2013 at 02:15 AM.
 
Old 07-19-2013, 02:38 AM   #4
Celyr
Member
 
Registered: Mar 2012
Location: Italy
Distribution: Slackware+Debian
Posts: 321

Rep: Reputation: 81
you can do it in several way, the easiest is maybe to do a list of accept in that chain and then a drop for example:

Code:
iptables -A INPUT -m mac --mac-source 01:02:03:04:05:06 -j ACCEPT
iptables -A INPUT -m mac --mac-source 01:02:03:04:05:07 -j ACCEPT
iptables -A INPUT -m mac --mac-source 01:02:03:04:05:08 -j ACCEPT
iptables -A INPUT -m mac --mac-source 01:02:03:04:05:09 -j ACCEPT
iptables -A INPUT -m mac --mac-source 01:02:03:04:05:10 -j ACCEPT

iptables -A INPUT -j DROP
Since the kernel executes the firewall in order from the first to the last rule and the ACCEPT target stops the execution of next rules packets from desidered macs will be accepted and the others dropped.
hth.
 
Old 07-19-2013, 07:42 AM   #5
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
Two other things to bear in mind are one, that MAC addresses do not pass through routers and filtering by MAC will be inherently limited as a result. Two, devices tend to easily give out MAC information because MAC was never meant to be a secure ID and hence it is easy to bypass a filter by simply identifying MAC numbers associated with the access point.
 
  


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
warning: /etc/hosts.deny, line 20: missing ":" separator tkmsr Linux - Security 23 01-10-2015 11:01 AM
how to permanent spoof "fake" mac address for eth0 & eth1? in NEW linux distro"s... vastvet Linux - Newbie 22 02-02-2013 12:40 AM
Iptables firewall deny "P win 512" 128 Linux - Security 14 09-29-2012 05:54 AM
In RHEL 5.1 unchecking "Deny TCP connections to Xserver" doesn't work Passions Linux - General 1 02-18-2009 01:28 PM
IPTABLES: interface on "192.168.1.0/24" won't route clients from "10.65.0.0" zivota Linux - Networking 2 06-09-2008 01:35 PM

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

All times are GMT -5. The time now is 06:28 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