What is wrong with this basic prefix-list?

Answered Question
Feb 26th, 2010
User Badges:

I have a simple configuration:

R1----R3(bgp 100)------------------------------(bgp 200)R4



Then on R4 I would like to see networks 10.177.206.0 and any 10.2.0.0 network advertised.

However, once I applied the prefix-list shown below, I get no such networks.


Routing is working accordingly because if I remove the prefix-list on the redistribute command on R3, I see all networks advertised OK.



R3#show run
Building configuration...

Current configuration : 1462 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R3
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
ip cef
!
!
!
!
ip auth-proxy max-nodata-conns 3
ip admission max-nodata-conns 3
!
!
!
!
!
!
!
!
!
interface Loopback0
ip address 10.2.255.15 255.255.255.255
ip ospf 1 area 0
!
interface FastEthernet0/0
ip address 10.2.80.1 255.255.255.0
ip ospf 1 area 0
speed 100
full-duplex
!
interface FastEthernet0/1
ip address 10.2.60.105 255.255.255.252
ip ospf 1 area 0
speed 100
full-duplex
!
interface FastEthernet1/0
ip address 10.2.47.200 255.255.255.240
speed 100
full-duplex
!
interface FastEthernet2/0
no ip address
shutdown
duplex auto
speed auto
!
router ospf 1
router-id 10.2.255.15
log-adjacency-changes
redistribute bgp 100 metric 10 subnets
default-information originate
!
router bgp 100
no synchronization
bgp log-neighbor-changes
redistribute ospf 1 route-map RM_ENG
neighbor 10.2.47.193 remote-as 200
no auto-summary
!
ip forward-protocol nd
!
!
ip http server
no ip http secure-server
!
!
ip prefix-list LIST_ENG seq 5 permit 10.2.0.0/16
ip prefix-list LIST_ENG seq 10 permit 10.177.206.0/24
!
route-map RM_ENG permit 10
match ip address prefix-list LIST_ENG
set local-preference 200
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
!
line con 0
line aux 0
line vty 0 4
login
!
!
end

R3#


Below is the show ip bgp on R4 if use only "redistribute ospf 1" under the R3 BGP process, without applying the prefix-list.

R4#show ip bgp
BGP table version is 17, local router ID is 4.4.4.4
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 4.4.4.4/32       0.0.0.0                  0         32768 i
*> 10.2.40.0/24     10.2.47.200              2             0 100 ?
*> 10.2.60.104/30   10.2.47.200              0             0 100 ?
*> 10.2.80.0/24     10.2.47.200              0             0 100 ?
*> 10.2.255.15/32   10.2.47.200              0             0 100 ?
*> 10.177.206.1/32  10.2.47.200              2             0 100 ?
R4#
===BELOW IS THE OUTPUT AFTER I APPLY THE PREFIX-LIST as "redistribute ospf 1 . MY INTENTION IS TO SEE 10.2.40.0/24, 10.177.206.0  and other 10.2.0.0 listed but I only see 4.4.4.4



R4#show ip bgp
BGP table version is 22, local router ID is 4.4.4.4
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 4.4.4.4/32       0.0.0.0                  0         32768 i

Correct Answer by Giuseppe Larosa about 7 years 3 months ago

Hello Marlon,

with this formulation


>>ip prefix-list LIST_ENG seq 5 permit 10.2.0.0/16
ip prefix-list  LIST_ENG seq 10 permit 10.177.206.0/24


your prefix-list matches only the described prefixes. (exact match)


to get what you want you need to use:

ip prefix-list LIST_ENG seq 5 permit 10.2.0.0/16 le 32
ip prefix-list  LIST_ENG seq 10 permit 10.177.206.0/24 le 32


that is the first prefix/len identifies the block, prefix-list allows then to specify a range of prefix lengths for subnets falling within the block


so if you use:


ip prefix-list LIST_ENG seq 5 permit 10.2.0.0/16 ge 25 le 32
ip prefix-list  LIST_ENG seq 10 permit 10.177.206.0/24 le 30


you will see the full potential of prefix-list with this third formulation some ip subnets will be filtered



Hope to help

Giuseppe

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
Loading.
Correct Answer
Giuseppe Larosa Fri, 02/26/2010 - 16:48
User Badges:
  • Super Silver, 17500 points or more
  • Hall of Fame,

    Founding Member

Hello Marlon,

with this formulation


>>ip prefix-list LIST_ENG seq 5 permit 10.2.0.0/16
ip prefix-list  LIST_ENG seq 10 permit 10.177.206.0/24


your prefix-list matches only the described prefixes. (exact match)


to get what you want you need to use:

ip prefix-list LIST_ENG seq 5 permit 10.2.0.0/16 le 32
ip prefix-list  LIST_ENG seq 10 permit 10.177.206.0/24 le 32


that is the first prefix/len identifies the block, prefix-list allows then to specify a range of prefix lengths for subnets falling within the block


so if you use:


ip prefix-list LIST_ENG seq 5 permit 10.2.0.0/16 ge 25 le 32
ip prefix-list  LIST_ENG seq 10 permit 10.177.206.0/24 le 30


you will see the full potential of prefix-list with this third formulation some ip subnets will be filtered



Hope to help

Giuseppe

news2010a Fri, 02/26/2010 - 16:55
User Badges:

Indeed. That worked.


Do you know why the subnet in red below appears as /32?
In reality that is a loopback on R12 that I advertised as /24.  Just curious.

Thank you very much.


Do you know why

   Network          Next Hop
*> 4.4.4.4/32       0.0.0.0
*> 10.2.40.0/24     10.2.47.200
*> 10.2.60.104/30   10.2.47.200
*> 10.2.80.0/24     10.2.47.200
*> 10.2.255.15/32   10.2.47.200
*> 10.177.206.1/32  10.2.47.200

Jon Marshall Fri, 02/26/2010 - 21:07
User Badges:
  • Super Blue, 32500 points or more
  • Hall of Fame,

    Founding Member

  • Cisco Designated VIP,

    2017 LAN, WAN

news2010a wrote:


Indeed. That worked.


Do you know why the subnet in red below appears as /32?
In reality that is a loopback on R12 that I advertised as /24.  Just curious.

Thank you very much.


Do you know why

   Network          Next Hop
*> 4.4.4.4/32       0.0.0.0
*> 10.2.40.0/24     10.2.47.200
*> 10.2.60.104/30   10.2.47.200
*> 10.2.80.0/24     10.2.47.200
*> 10.2.255.15/32   10.2.47.200
*> 10.177.206.1/32  10.2.47.200

Marlon


Not entirely sure without seeing configs but if this route is being redistributed from OSPF then OSPF always advertises loopbacks as /32. If you want OSPF to treat it as a /24 then under the loopback interface you need


int loopback 10

ip address x.x.x.x

ip ospf network point-to-point


Jon

Reza Sharifi Fri, 02/26/2010 - 16:49
User Badges:
  • Super Bronze, 10000 points or more
  • Cisco Designated VIP,

    2017 LAN

Hi,


Can you remove "set local-preference 200" from the route map and test again?


Reza

Actions

This Discussion