Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
#ALLOW USERS
/sbin/iptables -I INPUT -p all -s $IP -m mac --mac-source $MAC -j ACCEPT
/sbin/iptables -I FORWARD -p all -s $IP -m mac --mac-source $MAC -j ACCEPT
#DENY USERS
/sbin/iptables -I INPUT -p all -s $IP -m mac --mac-source $MAC -j DROP
/sbin/iptables -I FORWARD -p all -s $IP -m mac --mac-source $MAC -j REJECT
********************************************************
The problem is that the user in the denied (DROPED) changes his/her ip and mac address to an allowed ip+mac, he/she would gain access to the system.... Now I read some where about this
sbin/iptables -I INPUT -p all -s $IP -m mac --mac-source ! $MAC -j DROP
I tried this but no dice... anyone has any pointers to how a lynx box could check for the real mac addresses???? not the spoofed one??? or anything.. would be gr8ful..
As you know, MAC addresses are spoofable. You'll need to look at other mechanisms for allowing/denying access.
A pretty standard approach is to deny all and set up explicit allow rules for certain subnets via iptables.
On top of that, what services are you providing? There may be application-level access control that you can implement.
Finally, if your situation requires your packet filtering rules to allow large, untrusted subnets, there are applications that can help blacklist abusers (e.g. denyhosts, fail2ban, etc.).
Your policies are set to DROP. That means any packets which don't match any rules will get sent to DROP regardless. So by only having ACCEPT rules for good MAC/IP combinations, you'll automatically be sending to DROP any bad MAC/IP combinations - without the need for any DROP rules. This is called whitelisting. And as has been said, this offers no protection against spoofing.
My Lynx box is providing internet access to a few users on lan using NAT and transparent squid.
i would be gr8ful if anyone could point me towards other mechanisms for allowing/denying access or should I use some other distro or some other firewall?????
Well, you could make Squid non-transparent and then set it to authenticate users (I believe it won't do authentication in transparent mode). Or you could leave it transparent and have your firewall do the authentication for all traffic with something like NuFW. You could even set up some some kind of authentication portal like they do on wireless hotspots, using something like Chillispot. You've got tons of choices, really. I don't see any reason why you must use another distro, but using a specialized firewall distro (instead of a generic distro like Fedora) might make things easier if you lack patience.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.