All of lore.kernel.org
 help / color / mirror / Atom feed
* IP and MAC Address check
@ 2005-10-05  4:24 Winanjaya - PBXSoftwares
  2005-10-05  4:58 ` Marcos S. Trazzini
  0 siblings, 1 reply; 13+ messages in thread
From: Winanjaya - PBXSoftwares @ 2005-10-05  4:24 UTC (permalink / raw)
  To: netfilter

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..


please advise

thanks a lot in advance

Regards
Winanjaya

^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: IP and MAC Address check
@ 2005-10-05  5:31 Winanjaya - PBXSoftwares
  0 siblings, 0 replies; 13+ messages in thread
From: Winanjaya - PBXSoftwares @ 2005-10-05  5:31 UTC (permalink / raw)
  To: Ruben Cardenal, netfilter

Ok .. thanks, is it also impossible to read a textfile thru iptables?
..please confirm

TIA
Winanjaya




----- Original Message -----
From: "Ruben Cardenal" <ruben@ruben.cn>
To: <netfilter@lists.netfilter.org>
Sent: Wednesday, October 05, 2005 12:23 PM
Subject: RE: IP and MAC Address check


> Hi,
>
> > 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..
>
>   That's were you were showed to implement.
>
> > > 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 -A INPUT -m iprange --src-range 172.16.2.241-172.16.2.250 -j
> > DROP
>
>   You can't create "condicional" rules with iptables, you only create the
> rules you need, and if such condition ever exists, the rule will be
applied.
> If it never does, the rule will never be applied.
>
> -Ruben
>
>
>
>



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2005-10-05  8:11 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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.