01-25-2023 07:30 AM - edited 01-25-2023 07:49 AM
Hello,
Someone know how to Set Route preference from two same redistributed routes from BGP through different vrfs.
I have two ISPs and learning default route from them. I want ISP1's default route choose as a priority.
I am having two vrfs for them 1) ISP1_VRF 2) ISP2_VRF
I am creating 3rd vrf INTERNAL_VRF and created VASI interfaces to communicate with these different vrf.
Anything i can use for redistribute command so it choose ISP1's default route and use ISP2's default route for backup on INTERNAL_VRF's routing table?
-------------------------
router ospf 1 vrf INTERNAL_VRF
capability vrf-lite
area 0 authentication message-digest
redistribute bgp 512 subnets route-map ISP1-BGP-TO-OSPF
----------------------------------------------------------
ip prefix-list ISP1-BGP-TO-OSPF seq 10 permit 0.0.0.0/0
route-map ISP1-BGP-TO-OSPF permit 10
match ip address prefix-list ISP1-BGP-TO-OSPF
01-25-2023 12:18 PM
Hi @MHM Cisco World ,
I do not see anything in you configuration to make sure that ISP1 will be selected as the bgp best path. The bottom line is that the path received from ISP1 and ISP2 will be compared to one another once they are imported in VRF INTERNAL and you can't let the bgp best path be selected randomly. Also, it not useful to have a separate metric for ISP1 and ISP2 on the edge device, as the route from edge router 1 will always be preferred over the one received from edge router 2.
Regards,
01-25-2023 12:27 PM
Hi @MHM Cisco World ,
The simplified config would look something like this:
ip vrf INTER
rd 3:100
route-target import 1:100
route-target import 2:100
!
ip vrf ISP1
rd 1:100
route-target export 1:100
!
ip vrf ISP2
rd 2:100
route-target export 2:100
!
!
router ospf 10 vrf INTER
! Set metric to 1 for edge router 1 and to 2 for edge router 2
redistribute bgp 100 subnets metric 2
network 10.0.0.0 0.0.0.255 area 0
!
router bgp 100
bgp router-id 1.1.1.1
bgp log-neighbor-changes
!
address-family ipv4 vrf ISP1
neighbor 100.0.0.2 remote-as 200
neighbor 100.0.0.2 weight 65535
neighbor 100.0.0.2 activate
exit-address-family
!
address-family ipv4 vrf ISP2
neighbor 110.0.0.3 remote-as 300
neighbor 110.0.0.3 activate
exit-address-family
!
Regards,
01-25-2023 12:46 PM
@Mark1110 mention this
***
Primary edge router
redistribute bgp 512 subnets metric 50 route-map ISP1-BGP-TO-OSPF
redistribute bgp 512 subnets metric 60 route-map ISP2-BGP-TO-OSPF
secondary edge router
redistribute bgp 512 subnets metric 70 route-map ISP1-BGP-TO-OSPF
redistribute bgp 512 subnets metric 80 route-map ISP2-BGP-TO-OSPF
***
this what I was try to solve,
using
redistribute bgp 100 subnets metric 2
will make the subnet from other ISP have same metric.
01-25-2023 01:11 PM - edited 01-25-2023 01:13 PM
Hi @MHM Cisco World ,
I think his thought was that the two local default route from ISP1 and ISP2 would be injected in ospf, but as I mentioned, bgp will only select one of the two default routes on each edge router and the one from ISP1 should be preferred (done with the bgp weight). So there is no need to inject with 4 different metrics. We only need to redistribute with a higher metric on edge router 2, so the route learnt from edge router 1 is always preferred.
Regards,
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