12-05-2022 03:13 PM - last edited on 12-07-2022 10:46 PM by Translator
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?
Solved! Go to Solution.
12-06-2022 01:10 PM
this in my lab I deny any prefix redistribute from OSPF to bgp to advertise to R2 and permit all other prefix
12-05-2022 03:25 PM - last edited on 12-07-2022 10:49 PM by Translator
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
12-05-2022 03:31 PM - edited 12-05-2022 03:32 PM
Thanks for responding. Do you mind putting the logic into a config format? I have over 2000 routes learned via OSPF.
12-05-2022 03:50 PM - last edited on 12-07-2022 10:50 PM by Translator
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.
12-05-2022 06:16 PM - edited 12-06-2022 01:15 AM
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.
12-06-2022 09:35 AM - last edited on 12-07-2022 10:52 PM by Translator
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?
12-06-2022 09:39 AM
I make both solution in one lab, i will share lab for only second solution to make you not confuse.
12-06-2022 01:10 PM
this in my lab I deny any prefix redistribute from OSPF to bgp to advertise to R2 and permit all other prefix
12-06-2022 01:15 PM
Thank you so much
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide