RE: Access-list question - Allowing even and odd numbers in 3rd

From: Anthony Liu (zodiak@hawaii.rr.com)
Date: Sun Apr 17 2005 - 09:27:26 GMT-3


Donald,

When I first was getting into ACL's, I found it usefull to draw them out in
binary first.

With that in mind... let's look at some examples of odd numbers :

Binary Number
00000001 1
00000011 3
00000101 5
00000111 7

If you notice, the last value is always a 1, so that's what you want to keep
constant in the ACL.

0.0.1.0 255.255.254.255 will match all odd numbers, since the mask 254, will
do like you stated... and wildcard everything but the last number. You're
basically telling it as long as the last value is a 1, permit it through.

Here's some even numbers in binary :

Binary Number
00000010 2
00000100 4
00000110 6
00001000 8

As you can see, the last number will always be a 0.

0.0.0.0 255.255.254.255 will match all even numbers.

Hope this clears things up a bit!

Anthony

-----Original Message-----
From: nobody@groupstudy.com [mailto:nobody@groupstudy.com]On Behalf Of
Lee Donald
Sent: Sunday, April 17, 2005 2:00 AM
To: 'Anthony Liu'; Lee Donald; ccielab@groupstudy.com
Subject: RE: Access-list question - Allowing even and odd numbers in 3rd
octet -

Anthony,

I'm using 0.0.0.0 255.255.254.255

And it is working fine.

I still don't understand really.

According to my access-list, as I understand it with my suffering brain, is
that the 255.255.254.255 means don't care about the first 2nd or 4th octet,
also don't care about 254 bits of the 3rd, but I do care about the last bit
in the 3rd, does that sound right?

What would be the correct access-list to just allow evens in the 3rd octet?
That might get it into my skull!

-----Original Message-----
From: Anthony Liu [mailto:zodiak@hawaii.rr.com]
Sent: Sunday, April 17, 2005 12:40 PM
To: Lee Donald; ccielab@groupstudy.com
Subject: RE: Access-list question - Allowing even and odd numbers in 3rd
octet -

If you want to permit all odds in the 3rd octet, it should be :

Access-list 5 permit 0.0.1.0 0.0.254.0

I've never been good at explaining ACL's but i'll try anyways ;)

The reason being, is as long as the 8th value of the third octet is 1, the
number will be odd, indicated by the 1(00000001) in the 3rd octect of the
first number. The second number determines which values to change, and
which to remain constant(1's representing wildcard's, and 0's representing
constants)... in this case the 254 in binary is 11111110, meaning the first
7 values can change in the first number, but not the 8'th(which will keep
the number odd) allowing all possible odds.

Anthony

-----Original Message-----
From: nobody@groupstudy.com [mailto:nobody@groupstudy.com]On Behalf Of Lee
Donald
Sent: Sunday, April 17, 2005 1:13 AM
To: ccielab@groupstudy.com
Subject: Access-list question - Allowing even and odd numbers in 3rd octet -

Can anyone put some more logic to this for me, I'm having a bad brain day.

I need to allow all odd numbers in the 3rd octet in via an access-list which
I know is

Access-list 5 permit 0.0.0.0 0.0.252.0

Then I tried to let just the evens in but got confused, and couldn't get my
dough brain round it.

Can anybody remind me of this and the way it works?

Thanks in advance.

Regards

Lee.



This archive was generated by hypermail 2.1.4 : Tue May 03 2005 - 07:54:59 GMT-3