cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1101
Views
0
Helpful
5
Replies

Routing protocol preference

olly ahmed
Level 1
Level 1

Hi guys, As far as I know if a router learns a specific route from different routing protocol then it will prefer routes in this sequence eBGP > EIGRP > OSPF > IS-IS > RIP > iBGP. But in my nexus 7k I saw my router is learning routes 10.1.36.0/24 & 10.1.37.0/24 from eBGP as well as from OSPF. But when I see routing table it shows OSPF routes rather eBGP. Can anyone explain why it is happening. Below is FYI.


test# show ip bgp neighbors 172.18.162.81 routes vrf GTR

  

   Network            Next Hop            Metric     LocPrf     Weight Path

* e10.1.36.0/24       172.18.162.81                                  0 4828 ?

* e10.1.37.0/24       172.18.162.81                                  0 4828 ?

*>e10.1.38.0/24       172.18.162.81                                  0 4828 10081 ?


test# show ip route vrf GTR | sec 10.1.3


10.1.36.0/24, ubest/mbest: 1/0
*via 172.18.162.170, Eth2/2.809, [110/1], 6w6d, ospf-1, type-2, tag 4828
10.1.37.0/24, ubest/mbest: 1/0
*via 172.18.162.170, Eth2/2.809, [110/1], 6w6d, ospf-1, type-2, tag 4828
10.1.38.0/24, ubest/mbest: 1/0
*via 172.18.162.81, [20/0], 3w2d, bgp-64511, external, tag 4828
10.1.39.0/24, ubest/mbest: 1/0
*via 172.18.162.170, Eth2/2.809, [110/1], 6w6d, ospf-1, type-2, tag 4828

 

5 Replies 5

Richard Burts
Hall of Fame
Hall of Fame

Would you post the BGP configuration and the OSPF configuration? Also information about the VRFs configured on the router?

HTH

Rick

HTH

Rick

Hi Burts, Thanks for your reply. Please have required configurations below as you asked. Please let me know if you need any other further information.

test# show running-config vrf GTR

vrf context GTR

router ospf 1

  vrf GTR

    default-information originate

    redistribute bgp 64511 route-map Perm-Routes

router bgp 64511

  vrf GTR

    router-id 172.18.255.135

    address-family ipv4 unicast

      redistribute ospf 1 route-map Perm-Routes

    neighbor 172.18.162.81 remote-as 4828

      address-family ipv4 unicast

 

interface Ethernet2/2.809

  vrf member GTR

  ip address 172.18.162.169/30

  ip router ospf 1 area 0.0.0.0

 

interface Ethernet2/6.1104

  vrf member GTR

  ip address 172.18.162.82/30

 

interface Ethernet10/1.1104

  vrf member GTR

 

test# show route-map Perm-Routes

route-map Perm-Routes, permit, sequence 10

  Match clauses:

  Set clauses:

 

Thank you for the requested information. It does show that both BGP and OSPF are running in the VRF and that eliminates a potential source of the problem which might have been that one protocol was learning routes in a different VRF.

Would you post the output of show ip bgp and of show ip route

HTH

Rick

HTH

Rick

Hi Burts, Thanks again for your reply. Please find your requested information below. Please feel free to ask if you need any further information.

show ip bgp

======================

Test# show ip bgp vrf GTR

BGP routing table information for VRF GTR, address family IPv4 Unicast

BGP table version is 2816, local router ID is 172.18.255.135

Status: s-suppressed, x-deleted, S-stale, d-dampened, h-history, *-valid, >-best

Path type: i-internal, e-external, c-confed, l-local, a-aggregate, r-redist

Origin codes: i - IGP, e - EGP, ? - incomplete, | - multipath

 

   Network            Next Hop            Metric     LocPrf     Weight Path

*>r10.1.36.0/24       0.0.0.0                  1        100      32768 ?

* e                   172.18.162.81                                  0 4828?

*>r10.1.37.0/24       0.0.0.0                  1        100      32768 ?

* e                   172.18.162.81                                  0 4828?

*>e10.1.38.0/24       172.18.162.81                                  0 48281008

1 ?

*>r10.1.39.0/24       0.0.0.0                  1        100      32768 ?

*>r10.33.36.0/27      0.0.0.0                  1        100      32768 ?

* e                   172.18.162.81                                  0 48286500

1 ?

*>r10.33.36.32/27     0.0.0.0                  1        100      32768 ?

* e                   172.18.162.81                                  0 48286500

1 ?

*>r10.33.46.0/27      0.0.0.0                  1        100      32768 ?

*>r10.33.46.32/27     0.0.0.0                  1        100      32768 ?

*>r172.16.62.112/28   0.0.0.0                 20        100      32768 ?

*>r172.16.63.112/28   0.0.0.0                 20        100      32768 ?

*>r172.18.115.112/28  0.0.0.0                  1        100      32768 ?

*>r172.18.116.112/28  0.0.0.0                  1        100      32768 ?

*>r172.18.162.172/30  0.0.0.0                 48        100      32768 ?

*>r172.18.164.0/29    0.0.0.0                  1        100      32768 ?

*>r172.18.164.8/29    0.0.0.0                  1        100      32768 ?

*>r172.18.164.16/29   0.0.0.0                  1        100      32768 ?

*>r172.18.164.24/29   0.0.0.0                  1        100      32768 ?

*>r172.29.6.0/29      0.0.0.0                 44        100      32768 ?

*>r172.29.6.8/29      0.0.0.0                 44        100      32768 ?

*>r172.29.6.16/29     0.0.0.0                 44        100      32768 ?

*>r172.29.6.24/29     0.0.0.0                 44        100      32768 ?

Test#

 

 

 Show ip ospf

======================

Test# show ip route vrf GTR

IP Route Table for VRF "GTR"

 

10.1.36.0/24, ubest/mbest: 1/0

    *via 172.18.162.170, Eth2/2.809, [110/1], 7w0d, ospf-1, type-2, tag 4828

10.1.37.0/24, ubest/mbest: 1/0

    *via 172.18.162.170, Eth2/2.809, [110/1], 7w0d, ospf-1, type-2, tag 4828

10.1.38.0/24, ubest/mbest: 1/0

    *via 172.18.162.81, [20/0], 3w4d, bgp-64511, external, tag 4828

10.1.39.0/24, ubest/mbest: 1/0

    *via 172.18.162.170, Eth2/2.809, [110/1], 7w0d, ospf-1, type-2, tag 4828

10.33.36.0/27, ubest/mbest: 1/0

    *via 172.18.162.170, Eth2/2.809, [110/1], 7w0d, ospf-1, type-2, tag 4828

10.33.36.32/27, ubest/mbest: 1/0

    *via 172.18.162.170, Eth2/2.809, [110/1], 7w0d, ospf-1, type-2, tag 4828

10.33.46.0/27, ubest/mbest: 1/0

    *via 172.18.162.170, Eth2/2.809, [110/1], 7w0d, ospf-1, type-2, tag 4828

10.33.46.32/27, ubest/mbest: 1/0

    *via 172.18.162.170, Eth2/2.809, [110/1], 7w0d, ospf-1, type-2, tag 4828

172.16.62.112/28, ubest/mbest: 1/0

    *via 172.18.162.170, Eth2/2.809, [110/20], 7w0d, ospf-1, type-2

172.16.63.112/28, ubest/mbest: 1/0

    *via 172.18.162.170, Eth2/2.809, [110/20], 7w0d, ospf-1, type-2

172.18.115.112/28, ubest/mbest: 1/0

    *via 172.18.162.170, Eth2/2.809, [110/1], 7w0d, ospf-1, type-2, tag 4828

172.18.116.112/28, ubest/mbest: 1/0

    *via 172.18.162.170, Eth2/2.809, [110/1], 7w0d, ospf-1, type-2, tag 4828

172.18.162.80/30, ubest/mbest: 1/0, attached

    *via 172.18.162.82, Eth2/6.1104, [0/0], 7w0d, direct

172.18.162.82/32, ubest/mbest: 1/0, attached

    *via 172.18.162.82, Eth2/6.1104, [0/0], 7w0d, local

172.18.162.168/30, ubest/mbest: 1/0, attached

    *via 172.18.162.169, Eth2/2.809, [0/0], 7w0d, direct

172.18.162.169/32, ubest/mbest: 1/0, attached

    *via 172.18.162.169, Eth2/2.809, [0/0], 7w0d, local

172.18.162.172/30, ubest/mbest: 1/0

    *via 172.18.162.170, Eth2/2.809, [110/48], 7w0d, ospf-1, intra

172.18.164.0/29, ubest/mbest: 1/0

    *via 172.18.162.170, Eth2/2.809, [110/1], 7w0d, ospf-1, type-2, tag 4828

172.18.164.8/29, ubest/mbest: 1/0

    *via 172.18.162.170, Eth2/2.809, [110/1], 7w0d, ospf-1, type-2, tag 4828

172.18.164.16/29, ubest/mbest: 1/0

    *via 172.18.162.170, Eth2/2.809, [110/1], 7w0d, ospf-1, type-2, tag 4828

172.18.164.24/29, ubest/mbest: 1/0

    *via 172.18.162.170, Eth2/2.809, [110/1], 7w0d, ospf-1, type-2, tag 4828

172.29.6.0/29, ubest/mbest: 1/0

    *via 172.18.162.170, Eth2/2.809, [110/44], 7w0d, ospf-1, intra

172.29.6.8/29, ubest/mbest: 1/0

    *via 172.18.162.170, Eth2/2.809, [110/44], 7w0d, ospf-1, intra

172.29.6.16/29, ubest/mbest: 1/0

    *via 172.18.162.170, Eth2/2.809, [110/44], 7w0d, ospf-1, intra

172.29.6.24/29, ubest/mbest: 1/0

    *via 172.18.162.170, Eth2/2.809, [110/44], 7w0d, ospf-1, intra

Test#

Hi Burts, 

Thanks for your effort to help me.

Please be informed that I guess I got my answer from another discussion in the forum. I guess following things happened here. Please comment if you have any dispute regarding below points.

============================================

Normally the issue you are seeing is -

1) the BGP route received has an AD of 20 and the OPSF route has an AD of 110. So the BGP route is installed into the IP routing table.

An EBGP learned route has a BGP weight of 0

2) the EBGP link goes down. The OSPF route is now installed into the routing table and redistributed into BGP. So that route is now also in the BGP table.

A redistributed route is considered locally generated by BGP and so gets a weight of 32768

3) the EBGP link comes back up and so now the router has to two entries for the same network in it's BGP table. So using the best path selection BGP chooses the one with the higher weight and so sticks with the route learnt from OSPF.

The usual way around this is to simply modify the weight of all EBGP learnt routes to be higher than the locally generated route weight.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card