cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1278
Views
35
Helpful
8
Replies

redistribute ospf<>bgp but only to 1 BGP neighbor?

tlxbx
Level 1
Level 1

Is there a way I can redistribute

ospf<>bgp

to only to1 specific neighbor?

For eg:

 

router bgp 1

neighbor 1.1.1.1 remote-as 2

neighbor 2.2.2.2 remote-as 3

I want to redistribute OSPF learned routes but ONLY to 2.2.2.2. How can I do that?

1 Accepted Solution

Accepted Solutions

Screenshot (42).pngScreenshot (43).pngScreenshot (44).png

this in my lab I deny any prefix redistribute from OSPF to bgp to  advertise to R2 and permit all other prefix 

View solution in original post

8 Replies 8

first redistribute the route from OSPF into BGP 
then use

route-map direction OUT 

with

neighbors

command to deny that route from advertise into other

neighbor

 

Thanks for responding. Do you mind putting the logic into a config format? I have over 2000 routes learned via OSPF. 

Screenshot (33).pngScreenshot (34).pngScreenshot (35).png

check how I config

prefix-list

in this small lab 


ip prefix-list 5.5.5.5 seq 10 deny 5.5.5.5/32 
ip prefix-list 5.5.5.5 seq 20 permit 0.0.0.0/0 le 32 << this will permit all prefix except what we first deny.

If you can not summarize prefixes to use deny prefix list then

Other solution is use community list

Redistribute ospf into bgp using route map add community value,

Whicl later we will use it to match and deny any prefix have this community value.

lab for solution above.

Screenshot (39).pngScreenshot (40).pngScreenshot (41).png

Thank you so much for providing such a detailed answer. One question 

Route-map deny-MHM permit 10

Set community 100:100

—> So this

route-map 

sets all OSPF learned routes with this community 100:100 before it re-distributes into BGP?

Neighbor 100.0.0.2 route-map deny-R2

 

—> & this will block the redistribution of all OSPF learned routes to this specific neighbor due to deny match community 1 but will permit everything else?

--> & other

route-map 

will block 5.5.5.5 but will allow everything else including OSPF learned routes?

I make both solution in one lab, i will share lab for only second solution to make you not confuse.

Screenshot (42).pngScreenshot (43).pngScreenshot (44).png

this in my lab I deny any prefix redistribute from OSPF to bgp to  advertise to R2 and permit all other prefix 

Thank you so much 

Review Cisco Networking for a $25 gift card