From: Andrew Beverley <andy@andybev.com>
To: Scott Mayo <scotgmayo@gmail.com>
Cc: netfilter@vger.kernel.org
Subject: Re: Blocking machines by both Mac Address and IP address
Date: Sat, 23 Oct 2010 23:33:54 +0100 [thread overview]
Message-ID: <1287873234.1700.330.camel@andybev> (raw)
In-Reply-To: <AANLkTimE3DpKibaqKH53D9PEtt_AxSAimdaTiyTy1VZK@mail.gmail.com>
On Sat, 2010-10-23 at 17:19 -0500, Scott Mayo wrote:
> I have my DHCP server setup so that it hands out IP adresses according
> to a machine's Mac address. Is there a way to deny traffic to the
> internet by both MAC address and IP address?
>
> i.e. If MAC address 00:11:22:33:44:55 is given IP address 192.168.0.1
> by DHCP then that should be the only combo that can get to the outside
> world. If the IP address is changed to something else or if another
> machine that has a different MAC address is given the IP address
> 192.168.0.1 statically, then in neither situation should the machine
> be able to get out to the world.
Something like this...
Set your default policy to drop:
iptables -t mangle -P FORWARD DROP
Then set up a rule for each client that matches both IP address and MAC:
iptables -t mangle -A FORWARD -s 1.2.3.4 \
-m mac --mac-source aa:aa:aa:aa:aa:aa -j ACCEPT
Andy
next prev parent reply other threads:[~2010-10-23 22:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-23 22:19 Blocking machines by both Mac Address and IP address Scott Mayo
2010-10-23 22:33 ` Andrew Beverley [this message]
2010-10-24 13:14 ` Scott Mayo
2010-10-24 14:22 ` Pascal Hambourg
2010-10-24 14:46 ` Andrew Beverley
2010-10-23 22:51 ` Jan Engelhardt
2010-10-25 16:02 ` Grant Taylor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1287873234.1700.330.camel@andybev \
--to=andy@andybev.com \
--cc=netfilter@vger.kernel.org \
--cc=scotgmayo@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).