From: Marvin Greenlee (marvingreenlee@yahoo.com)
Date: Sun May 21 2006 - 13:42:53 ART
For filtering, look at the binary. Evens will have
the last bit set to zero, odds will have the last bit
set to one. Since you care about this bit, it is set
to 0 in the mask. You don't care about the other
bits, so they are set to 1.
11111110 - converts to 254 decimal.
access-list 10 permit 172.16.1.0 0.0.254.0
This would permit 172.16 networks with an odd third
octet, and the fourth octet set to 0.
access-list 10 permit 172.16.0.0 0.0.254.0
This would permit 172.16 networks with an even third
octet, and the fourth octet set to 0.
--- gigi.ccie@gmail.com wrote:
> Friends,
>
> How can I permit or deny even or odd subnets? I mean
> how to know when to use one over the other?
>
> If I have a requirement to allow even subnets from
> 172.16.0.0? Can I just permit the evens? Would I
> be wrong if I denied the odd subnets?
>
> I think I would need something like this
>
> access-list 101 permit ip 172.16.0.0 0.0.254.255
> access-list 101 deny any any
>
> or
>
> access-list 101 deny ip 172.16.0.0 0.0.1.255
> access-list 101 permit any any
>
> or
>
> access-list 101 permit ip 172.16.0.0 0.0.254.0
> access-list deny any any
>
> access-list 101 deny ip 172.16.0.0 0.0.1.0
> access-list permit any any
>
> Does this look right?
>
>
This archive was generated by hypermail 2.1.4 : Thu Jun 01 2006 - 06:33:22 ART