Ubuntu Server: Block all MAC address with exceptions
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
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.
Ubuntu Server: Block all MAC address with exceptions
Hi.
I'm sitting with a quite annoying problem.
Some kids are trying to get into my SSH, and it's filling my logs daily to be over 5 MB.
My server is running Ubuntu 11.04 LTS.
I want to do, so that only those I approve can use port 22, and the current users has dynamic IP addresses, so my only option is to filter on MAC address.
We cannot get a static IP address at all, our ISP doesn't accept that, and we got no other options for ISPs.
I've tried with IPtables, but it works quite bad to be honest.
I added my own MAC address to start off with, then I added my brother's MAC address, and for some reason, I couldn't connect on port 22 at all.
You can not filter based on MAC addresses over the Internet.
MAC filtering only works on the local network segment, as soon as you go though a router the only MAC address you will see is the MAC address of that router.
EDIT Handling dynamic IP's may not be that hard especially if your allocated an IP within a set IP block, you can just allow that IP block and most of the hack attempts will disappear.
Last edited by wildwizard; 04-30-2012 at 08:03 AM.
If you only see this level of variation you can allow 192.168.0.0/16, which will allow anything so long as the first 2 are 192.168
Your ISP will always allocate IP's from the same pool so you will see a pattern, you just need to find it and then allow it while blocking everything else.
The simple solution I've been using for years for this problem (yes, specifically the log flooding) is to use a different non-standard port for SSH. Yes, it is obscurity which does not improve security ... in a technical sense. But I say it helps in that without flooding logs, it's easier to see the real issues that might exist in the logs. And so it is a bit more secure in the administrative sense (something too often overlooked in security design).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.