cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
757
Views
0
Helpful
1
Replies

Not preferring BGP route over OSPF

Hi Guys,

This is killing me, I am not able to figure it out what is going on...

 

I have attached the "Topology.jpg" diagram.

R5 is the Core router in Active Data center & R3 is the Edge router in Active Data center

R4 is the Core router in Backup Data center & R2 is the Edge router in Backup Data center

R1 is a brance office connecting to Edge routers in Active / Backup Data Centers.

R2 is redistribuing the static route for the subnet 100.100.100.0/24 over OSPF to R4

R3 is redistribuing the static route for the subnet 100.100.100.0/24 over OSPF to R5

R5 is redistributing the OSPF routes into BGP towards R4

R4 is redistributing the OSPF routes into BGP towards R5

 

Normal traffic flow

R5 => R3 => R1

R4 => R5 => R3 => R1

 

When the link between R1 & R3 goes down.

R5 => R4 => R2 => R1

R4 => R2 => R1

 

R2 Config

interface FastEthernet0/0
 ip address 10.10.10.2 255.255.255.0
 speed auto
 duplex auto
!
interface FastEthernet0/1
 ip address 10.128.52.1 255.255.255.0
 speed auto
 duplex auto
!
router ospf 120
 router-id 10.128.52.1
 redistribute static metric 100 subnets route-map static_to_ospf
 passive-interface default
 no passive-interface FastEthernet0/1
 network 10.128.52.0 0.0.0.255 area 0
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
ip route 0.0.0.0 0.0.0.0 10.10.10.1
ip route 100.100.100.0 255.255.255.0 10.10.10.1
!
ip access-list standard static_to_ospf
 permit 100.100.100.0 0.0.0.255 log
!
!
route-map static_to_ospf permit 10
 match ip address static_to_ospf

 

 

R3 Config

interface FastEthernet0/0
 ip address 10.128.4.1 255.255.255.0
 speed auto
 duplex auto
!
interface FastEthernet0/1
 ip address 11.11.11.2 255.255.255.0
 speed auto
 duplex auto
!
router ospf 120
 router-id 10.128.4.1
 redistribute static subnets route-map static_to_ospf
 passive-interface default
 no passive-interface FastEthernet0/0
 network 10.128.4.0 0.0.0.255 area 0
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
ip route 0.0.0.0 0.0.0.0 11.11.11.1
ip route 100.100.100.0 255.255.255.0 11.11.11.1
!
ip access-list standard static_to_ospf
 permit 100.100.100.0 0.0.0.255 log
!
!
route-map static_to_ospf permit 10
 match ip address static_to_ospf

 

 

R4 Config

interface FastEthernet0/0
 ip address 1.1.1.1 255.255.255.0
 speed auto
 duplex auto
!
interface FastEthernet0/1
 ip address 10.128.52.2 255.255.255.0
 speed auto
 duplex auto
!
router ospf 120
 router-id 10.128.52.2
 passive-interface default
 no passive-interface FastEthernet0/1
 network 10.128.52.0 0.0.0.255 area 0
 distance 200 10.128.52.1 0.0.0.0
!
router bgp 100
 bgp log-neighbor-changes
 network 1.1.1.0 mask 255.255.255.0
 redistribute ospf 120 route-map VPN-Net-10-to-BGP
 neighbor 1.1.1.2 remote-as 200
 neighbor 1.1.1.2 next-hop-self all
 neighbor 1.1.1.2 soft-reconfiguration inbound
!
ip access-list standard VPN-Net-10-to-BGP
 permit 100.100.100.0 0.0.0.255
!
!
route-map VPN-Net-10-to-BGP permit 10
 match ip address VPN-Net-10-to-BGP
 

 

R5 Config

interface FastEthernet0/0
 ip address 10.128.4.2 255.255.255.0
 speed auto
 duplex auto
!
interface FastEthernet0/1
 ip address 1.1.1.2 255.255.255.0
 speed auto
 duplex auto
!
router ospf 120
 router-id 10.128.4.2
 passive-interface default
 no passive-interface FastEthernet0/0
 network 10.128.4.0 0.0.0.255 area 0
!
router bgp 200
 bgp log-neighbor-changes
 network 1.1.1.0 mask 255.255.255.0
 redistribute ospf 120 route-map VPN-Net-10-to-BGP
 neighbor 1.1.1.1 remote-as 100
 neighbor 1.1.1.1 next-hop-self all
 neighbor 1.1.1.1 soft-reconfiguration inbound
 default-information originate
 distance 190 1.1.1.1 0.0.0.0
!
ip access-list standard VPN-Net-10-to-BGP
 permit 100.100.100.0 0.0.0.255
!
!
route-map VPN-Net-10-to-BGP permit 10
 match ip address VPN-Net-10-to-BGP

 

R5 is learning the route for 100.100.100.0/24 through R3 over OSPF. When I shutdown the link between R1 & R3, R5 is learning the route via R4 over BGP. Again When I give the command "no shutdown" as expected R5 is learning the route for 100.100.100.0/24 through R3 over OSPF.

As OSPF is having the AD of 110 when compared to BGP AD of 190. No Problem in Active Datacenter.

 

The problem starts in Backup Datacenter.

Even though OSPF is having a higer AD than BGP, I have increated the AD to 200 and metric to 100 for the OSPF routes.

When the link between R3 & R1 comes up, the OSPF route is not getting removed on R4 even though it is receiving BGP route with distance & metric as 20/20. Not sure why?

 

R4#show ip route
 
Gateway of last resort is not set
 
      1.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        1.1.1.0/24 is directly connected, FastEthernet0/0
L        1.1.1.1/32 is directly connected, FastEthernet0/0
      10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        10.128.52.0/24 is directly connected, FastEthernet0/1
L        10.128.52.2/32 is directly connected, FastEthernet0/1
      100.0.0.0/24 is subnetted, 1 subnets
O E2     100.100.100.0 [200/100] via 10.128.52.1, 00:41:43, FastEthernet0/1

 

R4#show ip bgp neighbors 1.1.1.2 received-routes
BGP table version is 4, local router ID is 10.128.52.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
              x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
 
     Network          Next Hop            Metric LocPrf Weight Path
 *   1.1.1.0/24       1.1.1.2                  0             0 200 i
 *   100.100.100.0/24 1.1.1.2                 20             0 200 ?

 

When I shutdown the link between R1 & R2, I am able to see the BGP route for the subnet 100.100.100.0/24 on R4. (Via R5 Active Datacenter)

 

But R5 is working perfectly fine. Please advice. Thanks in Advance.

1 Reply 1

I have figured it out..... It's working!!!

Increased the BGP "Weight" parameter on R4 BGP for the BGP peer F5. It worked.

Made me to refresh the BGP Path selection process....

•    Prefer Highest weight (Local to router)
•    Prefer Highest Local Preference (Global within AS. Default value is 100)
•    Prefer route originated by the local router (Next hop = 0.0.0.0)
•    Prefer shortest AS path
•    Prefer lowest origin code (IGP < EGP < incomplete)
•    Prefer Lowest MED (From other AS. Default value is 0) * CISCO Preparatory
•    Prefer EBGP path over IGP path
•    Prefer the path through the closest IGP neighbor  
•    Prefer oldest route for EBGP paths
•    Prefer the path with the lowest neighbor BGP router ID.

 

Review Cisco Networking products for a $25 gift card