All of lore.kernel.org
 help / color / mirror / Atom feed
From: "hareram" <hareram@sol.net.in>
To: Winanjaya - PBXSoftwares <winanjaya@pbxsoftwares.com>,
	netfilter@lists.netfilter.org
Subject: Re: IP and MAC Address check
Date: Wed, 5 Oct 2005 10:57:25 +0530	[thread overview]
Message-ID: <06a101c5c96d$78a318a0$09603fca@southern> (raw)
In-Reply-To: 006f01c5c96c$512f1c20$580110ac@HO.lippogeneral.com

Hi

better way to do is
store IP and MAC
and try to compare with them

hare
----- Original Message ----- 
From: "Winanjaya - PBXSoftwares" <winanjaya@pbxsoftwares.com>
To: <netfilter@lists.netfilter.org>; "Marcos S. Trazzini" 
<mstrazzini@gmail.com>
Sent: Wednesday, October 05, 2005 10:49 AM
Subject: Re: IP and MAC Address check


> Hi . . I already had the list of MAC Address .. and they stored in the 
> file
> named maclist (ie. /etc/sysconfig/maclist) ..
> what I need is to configure iptables to read maclist file when there is
> incoming trafic from the IP address 172.16.2.241 to 172.16.2.250 ..if the
> MAC Address listed then the traffic will allowed otherwise the traffic 
> will
> be dropped or rejected..
>
> any idea ? .. please advise
>
> Regards
> Winanjaya
>
> ----- Original Message -----
> From: "Marcos S. Trazzini" <mstrazzini@gmail.com>
> To: <netfilter@lists.netfilter.org>
> Sent: Wednesday, October 05, 2005 11:58 AM
> Subject: Re: IP and MAC Address check
>
>
>> On Wed, Oct 05, 2005 at 11:24:46AM +0700, Winanjaya - PBXSoftwares wrote:
>> > Hi All,
>> >
>> > I have list of Mac addresses and also have range of IP addresses.. how
> to set iptables with conditions below:
>> >
>> > Range of IP addresses: 172.16.2.241 to 172.16.2.250
>> >
>> > List of MAC Addresses: (stored in a file named maclist)
>> > 01:02:03:04:05:0a
>> > 01:02:03:04:05:0b
>> > 01:02:03:04:05:0c
>> > 01:02:03:04:05:0d
>> > 01:02:03:04:05:0e
>> > 01:02:03:04:05:0f
>> > 01:02:03:04:05:1a
>> > 01:02:03:04:05:2a
>> > 01:02:03:04:05:3a
>> > 01:02:03:04:05:4a
>> >
>> > When Incoming package from the ranged IP address (172.16.2.241 to
> 172.16.2.250)  then the mac address must be checked from the list of MAC
> Address, if the MAC Address matched then it allowed otherwise it will be
> rejected or dropped..
>>
>> Hi All,
>>
>> This's my first reply to the list (And I wan't to send a lot more...), 
>> and
>> expect to help. Sorry for the the bad english (Need's a litle practice).
>>
>> Can't you associate each IP with a MAC address from the list? It's the
> best thing
>> to do (as it is the most secure...).
>>
>> Or.... maybe this is that you want:
>>
>> ---CUT HERE---
>> while read mac; do
>>   iptables -A INPUT -m mac --mac-source $mac -m iprange --src-range \
>>    172.16.2.241-172.16.2.250 -j ACCEPT
>> done < /path/to/maclist
>> iptables -AINPUT -m iprange --src-range 172.16.2.241-172.16.2.250 -j DROP
>> ---CUT HERE---
>>
>> This will create a lot of rules (One per MAC address from the list)
> instead of only one "wonderful rule". Of course the rules must be "best
> worked", but maybe this can solve the problem.
>>
>> See also:
>> # iptables -m mac --help
>> # iptables -m iprange --help
>>
>> --
>> Marcos S. Trazzini
>>
>>
>
>
>
> 




  parent reply	other threads:[~2005-10-05  5:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-05  4:24 IP and MAC Address check Winanjaya - PBXSoftwares
2005-10-05  4:58 ` Marcos S. Trazzini
2005-10-05  5:19   ` Winanjaya - PBXSoftwares
2005-10-05  5:23     ` Ruben Cardenal
2005-10-05  5:27     ` hareram [this message]
2005-10-05  5:29     ` /dev/rob0
2005-10-05  5:50       ` Winanjaya - PBXSoftwares
2005-10-05  6:23         ` /dev/rob0
2005-10-05  6:44           ` Winanjaya - PBXSoftwares
2005-10-05  7:13             ` Rob Sterenborg
2005-10-05  7:52               ` Winanjaya - PBXSoftwares
2005-10-05  8:11                 ` Rob Sterenborg
  -- strict thread matches above, loose matches on Subject: below --
2005-10-05  5:31 Winanjaya - PBXSoftwares

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='06a101c5c96d$78a318a0$09603fca@southern' \
    --to=hareram@sol.net.in \
    --cc=netfilter@lists.netfilter.org \
    --cc=winanjaya@pbxsoftwares.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.