RE: Redistribution_ACL, tutuorial.

From: Victor Cappuccio (vcappuccio@desca.com)
Date: Sun Dec 24 2006 - 17:30:41 ART


Excellent Comments there Marvin, also you can let the router become your
pocket calculator ;)

R1#show ip route 150.150.0.0 255.255.0.0 longer-prefixes | b Gate
Gateway of last resort is not set

     150.150.0.0/24 is subnetted, 16 subnets
C 150.150.0.0 is directly connected, Loopback200
C 150.150.1.0 is directly connected, Loopback200
C 150.150.2.0 is directly connected, Loopback200
C 150.150.3.0 is directly connected, Loopback200
C 150.150.4.0 is directly connected, Loopback200
C 150.150.5.0 is directly connected, Loopback200
C 150.150.6.0 is directly connected, Loopback200
C 150.150.7.0 is directly connected, Loopback200
C 150.150.8.0 is directly connected, Loopback200
C 150.150.9.0 is directly connected, Loopback200
C 150.150.10.0 is directly connected, Loopback200
C 150.150.11.0 is directly connected, Loopback200
C 150.150.12.0 is directly connected, Loopback200
C 150.150.13.0 is directly connected, Loopback200
C 150.150.14.0 is directly connected, Loopback200
C 150.150.15.0 is directly connected, Loopback200
R1#

If you like to select only the Odd (Impares), then

R1#show ip route 150.150.1.0 255.255.1.0 longer-prefixes | b Gate
     150.150.0.0/24 is subnetted, 16 subnets
C 150.150.1.0 is directly connected, Loopback200
C 150.150.3.0 is directly connected, Loopback200
C 150.150.5.0 is directly connected, Loopback200
C 150.150.7.0 is directly connected, Loopback200
C 150.150.9.0 is directly connected, Loopback200
C 150.150.11.0 is directly connected, Loopback200
C 150.150.13.0 is directly connected, Loopback200
C 150.150.15.0 is directly connected, Loopback200
R1#! or Evens (pares)
R1#show ip route 150.150.0.0 255.255.1.0 longer-prefixes | b Gate
Gateway of last resort is not set

     150.150.0.0/24 is subnetted, 16 subnets
C 150.150.0.0 is directly connected, Loopback200
C 150.150.2.0 is directly connected, Loopback200
C 150.150.4.0 is directly connected, Loopback200
C 150.150.6.0 is directly connected, Loopback200
C 150.150.8.0 is directly connected, Loopback200
C 150.150.10.0 is directly connected, Loopback200
C 150.150.12.0 is directly connected, Loopback200
C 150.150.14.0 is directly connected, Loopback200

SW1#show ip route 150.150.2.0 255.255.249.0 longer-prefixes | b Gate
Gateway of last resort is not set

     150.150.0.0/24 is subnetted, 16 subnets
C 150.150.0.0 is directly connected, Loopback200
C 150.150.2.0 is directly connected, Loopback200
C 150.150.4.0 is directly connected, Loopback200
C 150.150.6.0 is directly connected, Loopback200

Enjoy
Victor.-

-----Original Message-----
From: nobody@groupstudy.com [mailto:nobody@groupstudy.com] On Behalf Of
Marvin Greenlee
Sent: Sunday, December 24, 2006 4:08 PM
To: prashant shukla; ccielab@groupstudy.com
Subject: Re: Redistribution_ACL, tutuorial.

For the first part, I'm assuming you mean the range 0
to 15, since that is where the bit boundaries fall.

For a binary match, there are a number of bits that
you are matching for a range.

Start by looking at binary blocks for ranges.
4, 8, 16, 32

For the full binary blocks, the mask will be one less
than the block size. This only works when the block
size is a power of 2. ( 2^x )
block of 256 - mask of 255
block of 128 - mask of 127
block of 64 - mask of 63
block of 32 - mask of 31
block of 16 - mask of 15
block of 8 - mask of 7
block of 4 - mask of 3

For even/odd matching, you care about the 'ones' bit,
so that bit will be set to 0 in the mask.
block of 256 - mask of 254
block of 128 - mask of 126
block of 64 - mask of 62
block of 32 - mask of 30
block of 16 - mask of 14
block of 8 - mask of 6
block of 4 - mask of 2

Whether you are matching evens or odd depends on what
your access list is matching.
1 with a mask of 254, will match odds for the octet
0 with a mask of 254, will match evens for the octet

5 to 16
-Matching evens-
(really 6 to 16, since 5 is odd)
This is a range of 11. Looking at the nearest binary
block sizes to 11 gives 8 and 16. The nearest 16
block is 0-15. The nearest 8 blocks are 0-7 and 8-15.

Three lines for the ACL:
permit 8 with mask 6 will match evens for the range
8-15.
permit 6 with mask 0 - exact match
permit 16 with mask 0 - exact match

5 to 16
-Matching odds-
(really 5 to 15, since 16 is even)

Again, a range of 11. Nearest block of 16 is 0-15,
nearest blocks of 8 are 0-7 and 8-15.

8-15 covers the upper portion, leaving 5 and 7 to
match. 5 and 7 are the only odds in the block of 4
addresses between 4 and 7.

Due to the way the range falls with respect to the bit
boundaries, this can be done in two lines.

permit 5 with mask 2 will match odds for the range
4-7.
permit 9 with mask 6 will match odds for the range
8-15.

Thanks,
Marvin

--- prashant shukla <shukla_cisco@yahoo.co.in> wrote:

> Hey Guys,
>
> Im able to redistribute from eigrp to ospf say even
> or odd routes from the range, 150.150.1.0 to
> 150.150.16.0 , assign diff metrics to diff route
> types .( odd=E1 & even=E2)
>
> also i can redistribute routes with multiples of
> 2/4/6/8 in the 3rd octet, but am confused for the
> ODD ones. need assistance on it.
>
> Secondly, if i would like to redistribute routes
> from 150.150.5.0 to 150.150.16.0 and only the EVEN
> or the ODD ones only , how do i go about it.
>
> would appreciate some insight.
>
> Shukla.
> "Accept your limitations,
> Then go beyond them."
>
>
>
>
> Send free SMS to your Friends on Mobile from your
> Yahoo! Messenger. Download Now!
> http://messenger.yahoo.com/download.php
>
>



This archive was generated by hypermail 2.1.4 : Tue Jan 02 2007 - 07:50:39 ART