cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
685
Views
0
Helpful
4
Replies

What is wrong with this basic prefix-list?

news2010a
Level 3
Level 3

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

1 Accepted Solution

Accepted Solutions

Giuseppe Larosa
Hall of Fame
Hall of Fame

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

View solution in original post

4 Replies 4

Giuseppe Larosa
Hall of Fame
Hall of Fame

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

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

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
Hall of Fame
Hall of Fame

Hi,

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

Reza

Review Cisco Networking products for a $25 gift card