From: Daniel Iliev <danny@ilievnet.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] OT: iptables mac filtering
Date: Wed, 09 Aug 2006 22:16:15 +0300 [thread overview]
Message-ID: <44DA347F.2080900@ilievnet.com> (raw)
In-Reply-To: <loom.20060809T191535-468@post.gmane.org>
James wrote:
> Hello,
>
> Continuing my quest for iptables enlightenment....I have a question
> about 'mac address' syntax. All options for mac and arp have been compiled
> into a gentoo-hardened kernel.
>
> I'm using variations of this syntax in my script.
>
> # Rule to only allow ssh by MAC address
> iptables -A INPUT -i eth0 -p tcp -m mac --mac-source xx:xx:xx:xx:xx:xx \
> --source-port 1024:65535 -d <ip.address> --dport 22 -j ACCEPT
>
> Where the mac address xx...xx is the system allowed in, via ssh
> and the ip.address is that of the destination (/24 based) host
> The rule works well when packets have to traverse
> a firewall/router as mac addresses do not get propagated (I think).
>
> However, when I use similar syntax to prevent a system on the same
> local (ethernet) segment from being able to ssh into a local system,
> it does prevent ssh access, as expected. Granted MAC addresses
> can be foiled, especially on the same segment, but how do I make this
> rule work?: On a local segemnt how would I modify the syntax so
> that only a select machine (maybe IP + MAC) could access a host,
> running iptables, via ssh?
>
> thoughts and ideas are most welcome.
>
> James
>
>
>
>
>
>
The rule you give in the example seems correct to me. I can imagine 2
reasons because of which its not working for you.
First this rule ends with "ACCEPT" - it allows, does not forbid access.
The second reason is that there could be some other rules which take
precedence before a packet meets the rule in question and it obeys those
preceding rules.
--
Best regards,
Daniel
--
gentoo-user@gentoo.org mailing list
next prev parent reply other threads:[~2006-08-09 19:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-09 18:54 [gentoo-user] OT: iptables mac filtering James
2006-08-09 19:16 ` Daniel Iliev [this message]
2006-08-09 19:43 ` Hans-Werner Hilse
[not found] ` <loom.20060811T003230-539@post.gmane.org>
2006-08-11 7:24 ` [gentoo-user] " Richard Fish
2006-08-11 21:39 ` James
2006-08-11 22:20 ` Richard Fish
2006-08-12 2:02 ` James
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=44DA347F.2080900@ilievnet.com \
--to=danny@ilievnet.com \
--cc=gentoo-user@lists.gentoo.org \
/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