cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3379
Views
13
Helpful
24
Replies

Route map while redistributing OSPF to BGP

raghav.rai
Level 1
Level 1

Hello,

I need to add a route-map to an existing ospf redistribution to filter default and summary routes. Can you please verify my configs below and confirm it would work?

Current config :

!
address-family ipv4 vrf corp
  redistribute connected
  redistribute ospf 100 vrf corp metric 1 match internal external 1 external 2
  maximum-paths ibgp 2
  default-information originate
  no synchronization
exit-address-family
!

Planning to add a route-map to OSPF redistribution:

address-family ipv4 vrf corp
redistribute ospf 100 vrf corp metric 1 match internal external 1 external 2 route-map Non-Interesting-Traffic --

is it allowed?

!!! Also need to check below route-map will block only 10.200.0.0/16 summary and default route rest specific subnets will get advertised?

!
route-map Non-Interesting-Traffic deny 10
match ip address prefix-list deny-list
!
route-map Non-Interesting-Traffic permit 20
!
ip prefix-list deny-list seq 15 permit 10.200.0.0/16
!
ip prefix-list deny-list seq 25 permit 0.0.0.0/0

Tks,

Raghavendra

2 Accepted Solutions

Accepted Solutions

wow - that is perfect. Thanks a Lot!

 

 

View solution in original post

24 Replies 24

Redistrubte ospf into bgp with route-map and deny summary

Your route-map correct 

But for defualt I think it not work 

Becuase you use under bgp address ipv4 vrf 

Defualt information originate 

So even if you dont redistrubte ospf defualt into bgp the bgp will advertise defualt with above command.

MHM

Thank you!

I will remove   default-information originate. Will that work ?

Also, i have doubt on route-map after match internal external 1 external 2 -- is it a correct syntax ? my box is Cisco9606R running on ios-xe 17.6.4

redistribute ospf 100 vrf corp metric 1 match internal external 1 external 2 route-map Non-Interesting-Traffic

Thanks again,

Raghavendra

 

 

 

 

there is no conflict I make double check and the result as you see 

LO 3.3.3.3 is not advertise

(LO in R3, R1-R2 BGP, R2-R3 OSPF)

LO 33.33.33.33 is advertise

 

Screenshot (595).pngScreenshot (596).pngScreenshot (597).png

MHM

wow - that is perfect. Thanks a Lot!

 

 

We here try our best and answer as much as we can prefect answer.

I get your Q but I was need to full check it' that why I make lab and test 

You are so welcome friend 

MHM

Hello MHM,

I got another doubt on the same config. 

redistribute ospf 100 vrf corp metric 1 match internal external 1 external 2 route-map Non-Interesting-Traffic

OSPF 100 is a stub area (stub no-summary) and it is redistributed to BGP with the above command. 

!
router ospf 100 vrf Corp
router-id 100.200.10.10
log-adjacency-changes
auto-cost reference-bandwidth 100000
area 14 stub no-summary
area 14 range 10.200.0.0 255.255.0.0

network 10.200.0.0 0.0.255.255 area 14
.

.

I have SVI's on this routes with subnets of 10.200.0.0/16

SVI-1 - 10.200.100.1

SVI-2 --10.200.200.1

My question is whether 10.200.100.1 and 10.200.200.1 will get advertised from OSPF to BGP ?

Appreciate your support.

Hello
Your prefix-list and route-map look okay, the catch all permit 20 statement should allow all other non matching traffic to be advertise within the ipv4 AF vrf corp stanza

As @MHM Cisco World  remove the default-originate if you do not wish to advertise a default-route  in bgp from this bgp rtr


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

raghav.rai
Level 1
Level 1

Hello MHM,

I got another doubt on the same config. 

redistribute ospf 100 vrf corp metric 1 match internal external 1 external 2 route-map Non-Interesting-Traffic

OSPF 100 is a stub area (stub no-summary) and it is redistributed to BGP with the above command. 

!
router ospf 100 vrf corp
router-id 100.200.10.10
log-adjacency-changes
auto-cost reference-bandwidth 100000
area 14 stub no-summary
area 14 range 10.200.0.0 255.255.0.0

network 10.200.0.0 0.0.255.255 area 14
.

.

I have SVI's on this routes with subnets of 10.200.0.0/16

SVI-1 - 10.200.100.1

SVI-2 --10.200.200.1

My question is whether 10.200.100.1 and 10.200.200.1 will get advertised from OSPF to BGP ?

Appreciate your support.

Or does it requires a redistribute connected subnets in OSPF? to advertise SVI's with subnets on network statement?

router ospf 100 vrf corp

redistribute connected subnets

 

Hello @raghav.rai ,

you don't need the redistribute connected because you have:

network 10.200.0.0 0.0.255.255 area 14

in router ospf config.

Your route-map for redistribution should work as already explained by colleagues @MHM Cisco World  and @paul driver .  The specific subnets of the two SVI should go to BGP.  Your prefix-list requires exact match and only the summary route and the default route can match its statements.

As a result of this all other more specific OSPF routes including those within the summary address should be redistributed into BGP.

They will be advertised to other routers if they are considered BGP best paths

Hope to help

Giuseppe

 

Thanks Giuseppe Larosa 

I think area 14 range 10.200.0.0 255.255.0.0 is the culprit which advertises summary route. in my case summary route is getting adverised at this point.

friend you must careful 
area Stub and no-summary 
this mean that the area is not accept 
LSA3 nor LSA5/LSA7 
i.e. the redistribute will not work nor the LSA3 from other areas 
you can use network command to inject the prefix into the OSPF which add it as L1 and then redistribute it into BGP 
below lab show you two router in area 1 stub no-summary 
some Lo use redistribute and other use network, check which appear in R1 (BGP 100)
Goodluck
MHM

Screenshot (608).pngScreenshot (607).png

Thank you MHM .. If I have understood correctly. OSPF stub with no summary here redistributes SVI's under network statement but doesn't redistribute connected subnets with "redistribute connected statement".

Sorry to ask more clarity .. network 10.0.0.0/8 statement will redistribute specific subnet of a connected SVI with 10.10.10.0/24.

I wanted to make sure that network 10.0.0.0/8 in a OSPF stub with no summary will will redistribute 10.10.10.0/24 subnet and not the summary 10.0.0.0/8. 

Sorry again for asking simple question, but i am a bit confused here.

Sorry dont get it, 

You redistrubte SVI IP in this router and you run only one area which is stub?

Can you share topology 

MHM