From: Joel Newkirk <netfilter@newkirk.us>
To: hare ram <hareram@sol.net.in>, netfilter <netfilter@lists.netfilter.org>
Subject: Re: Lot of MAC Address
Date: Tue, 18 Feb 2003 13:07:14 -0500 [thread overview]
Message-ID: <200302181307.14726.netfilter@newkirk.us> (raw)
In-Reply-To: <05e701c2d764$08de8f20$13fcc5cb@Housecall>
On Tuesday 18 February 2003 10:40 am, hare ram wrote:
> Hi all
>
> In my LAN, i have lot of MAC address, ( pc's)
> how do i make a rule for 100 MAC address (PC) to allow
> and any other MAC address to Deny
>
> any suggestions
> thanks
> hare
You have to match each MAC individually, one at a time. If there is no
other acceptable filtering criteria (IP + incoming interface, for
example) then your best bet is something like this:
iptables -N MACtest
iptables -A MACtest -m mac --mac-source 00:11:22:33:44:55 -j RETURN
iptables -A MACtest -m mac --mac-source 00:11:22:33:44:66 -j RETURN
[... etc with all 100 MACs in individual rules, followed by ...]
iptables -A MACtest -j DROP
iptables -A FORWARD -m state --state ESTABLISHED,RELATED \
-j ACCEPT
iptables -A FORWARD -i eth0 -m state --state NEW -j MACtest
iptables -A FORWARD {ordinary rules from here on in FORWARD}
This will take any NEW traffic coming from eth0 to be forwarded and pass
ALL of it to the user-defined MACtest chain, which will RETURN
acceptable MACs back to FORWARD for continued processing, and DROP any
that don't match up with one of the rules. ( This way only the NEW
packets have to traverse potentially 101 extra rules before ordinary
matching in FORWARD continues.) You can call the same user-def chain
from INPUT as well, or instead.
Keep in mind that a script can build the MACtest chain in a loop, reading
the MAC addresses from a separate textfile and appending the DROP
'policy' after the loop completes.
j
prev parent reply other threads:[~2003-02-18 18:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-18 13:49 Iptables -FTP Paulo Andre
2003-02-18 15:40 ` Lot of MAC Address hare ram
2003-02-18 18:07 ` Joel Newkirk [this message]
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=200302181307.14726.netfilter@newkirk.us \
--to=netfilter@newkirk.us \
--cc=hareram@sol.net.in \
--cc=netfilter@lists.netfilter.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