cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
894
Views
25
Helpful
2
Replies

/24 route redistributed from OSPF to BGP even prefix-suppression configured

Dan22
Level 1
Level 1

Hello,

My question is about route redistribution from OSPF to BGP.

Below is my topology.

Image 9.png

eBGP is configured between R1 and R2. OSPF is configured in R2-R4.

On R2-R4, prefix-suppression is added in router ospf context.

Redistribution is configured on R2 to inject OSPF route to BGP.

In BGP, I can see not only /32 route but also /24 route which is between R2 and R3 has been redistributed in BGP.

Router(config-router)#do sh ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override

Gateway of last resort is not set

10.0.0.0/8 is variably subnetted, 7 subnets, 2 masks
C 10.0.12.0/24 is directly connected, Ethernet0/0
L 10.0.12.1/32 is directly connected, Ethernet0/0
B 10.0.23.0/24 [20/0] via 10.0.12.2, 00:04:31
C 10.255.255.1/32 is directly connected, Loopback0
B 10.255.255.2/32 [20/0] via 10.0.12.2, 00:04:31
B 10.255.255.3/32 [20/11] via 10.0.12.2, 00:01:37
B 10.255.255.4/32 [20/21] via 10.0.12.2, 00:00:12

 

May I ask why and how to avoid it?

 

Thanks a lot.

BR,

Dan

 

------------------------------------

Below the R2 config for reference.

R2:

interface Loopback0
ip address 10.255.255.2 255.255.255.255
ip ospf 1 area 0
!
interface Ethernet0/0
ip address 10.0.12.2 255.255.255.0
!
interface Ethernet0/1
ip address 10.0.23.2 255.255.255.0
ip ospf 1 area 0
!
router ospf 1
prefix-suppression
!
router bgp 10001
bgp router-id 10.255.255.2
bgp log-neighbor-changes
redistribute ospf 1
neighbor 10.0.12.1 remote-as 10000

1 Accepted Solution

Accepted Solutions

Harold Ritter
Cisco Employee
Cisco Employee

Hi @Dan22 ,

 

This is due to the fact that this prefix (192.168.23.0/24) is local and attached to an interface that is owned by OSPF. If you may want to use a route-map when you redistribute OSPF in BGP to only include host routes (/32).

 

route-map ospf2bgp permit 10

match IP address prefix-list host-routes

!

ip prefix-list host-routes seq 5 permit 0.0.0.0/0 ge 32

!

router bgp 10001

redistribute ospf 1 route-map ospf2bgp

 

Regards,

Harold Ritter
Sr Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México

View solution in original post

2 Replies 2

balaji.bandi
Hall of Fame
Hall of Fame

You need to post more information - what IP address each segment configured, what where is this output taken from what Router ?

 

 

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

Harold Ritter
Cisco Employee
Cisco Employee

Hi @Dan22 ,

 

This is due to the fact that this prefix (192.168.23.0/24) is local and attached to an interface that is owned by OSPF. If you may want to use a route-map when you redistribute OSPF in BGP to only include host routes (/32).

 

route-map ospf2bgp permit 10

match IP address prefix-list host-routes

!

ip prefix-list host-routes seq 5 permit 0.0.0.0/0 ge 32

!

router bgp 10001

redistribute ospf 1 route-map ospf2bgp

 

Regards,

Harold Ritter
Sr Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México
Review Cisco Networking products for a $25 gift card