Re: ACL blocking odd ip address

From: Bob Sinclair (bsin@xxxxxxxxx)
Date: Tue Apr 23 2002 - 21:01:22 GMT-3


   
The trick to matching odd and even ip addresses is to place a 0 in the right-mo
st bit of the mask. If you want odd, then make sure the right-most bit in the
reference IP address is 1. If you want even, make sure the right-most bit in t
he reference IP address is 0.

For your example, odd ip addresses in 192.168.1.0/24:

permit 192.168.1.1 0.0.0.254

For Even:

permit 192.168.1.0 0.0.0.254

The mask is the same in each case, you "care about" the first three octets and
 the right-most bit.

254 - 11111110 - means any number in this octet but right-most bit must mat
ch the reference IP exactly. If reference has 1 in the right-most bit, then th
e number is odd, if reference has 0 in the right-most bit then the number is ev
en.

A cool and useful thing to know. Give it a try.

-Bob

----- Original Message -----
From: "Jeongwoo Park" <jpark@wams.com>
To: <ccielab@groupstudy.com>
Sent: Tuesday, April 23, 2002 7:02 PM
Subject: ACL blocking odd ip address

> Hi all,
> ACL is like the more I see it, the more I get confused.
> How would you set up standard ACL to block odd ip addresses in the subnet
> 192.168.1.0/24? And how about blocking even numbers?
>
> JP



This archive was generated by hypermail 2.1.4 : Thu Jun 13 2002 - 10:58:18 GMT-3