Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
Webcast-Catalyst9k
New Member

BGP ISSUE

Hi ALL,

I am facing a starnge issue ( atleast for me ) ,i am running BGP and OSPF in my network and on one of my BGP router i see the route learned for OSPF while it should be learned from BGP.

R0#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

C    192.168.12.0/24 is directly connected, FastEthernet0/0
     172.16.0.0/24 is subnetted, 4 subnets
C       172.16.4.0 is directly connected, Loopback3
C       172.16.1.0 is directly connected, Loopback0
C       172.16.2.0 is directly connected, Loopback1
C       172.16.3.0 is directly connected, Loopback2
C    192.168.11.0/24 is directly connected, FastEthernet0/0
     10.0.0.0/24 is subnetted, 3 subnets
C       10.10.13.0 is directly connected, Serial0/1
O IA    10.10.24.0 [110/74] via 192.168.12.2, 04:37:31, FastEthernet0/0
O IA    10.10.34.0 [110/128] via 10.10.13.3, 00:13:53, Serial0/1

----->I am not able to figure out why it is showing as internal router from 10.10.13.3 neighbor even though it is a EBGP neighbour and due to this it is not prefering the BGP route from EBGP.

R0#show ip bg
R0#show ip bgp 10.10.34.0
BGP routing table entry for 10.10.34.0/24, version 4
Paths: (2 available, best #1, table Default-IP-Routing-Table)
Flag: 0x820
  Advertised to update-groups:
        1
  Local
    10.10.13.3 from 0.0.0.0 (172.16.4.1)
      Origin IGP, metric 128, localpref 100, weight 32768, valid, sourced, local, best
  11
    10.10.13.3 from 10.10.13.3 (10.10.34.3)
      Origin IGP, metric 0, localpref 100, valid, external


R0#router bgp 10
no synchronization
bgp log-neighbor-changes
network 10.10.24.0 mask 255.255.255.0
network 10.10.34.0 mask 255.255.255.0
network 172.16.1.0 mask 255.255.255.0
network 172.16.1.1 mask 255.255.255.255
network 192.168.11.0
network 192.168.12.0
aggregate-address 172.16.4.0 255.255.252.0
neighbor 10.10.13.2 remote-as 11
neighbor 10.10.13.3 remote-as 11
neighbor 10.10.13.3 prefix-list test in
neighbor 10.10.13.3 route-map med out
neighbor 192.168.12.2 remote-as 10
neighbor 192.168.12.2 next-hop-self

R0#show ip bgp summary
BGP router identifier 172.16.4.1, local AS number 10
BGP table version is 8, main routing table version 8
6 network entries using 720 bytes of memory
9 path entries using 468 bytes of memory
7/4 BGP path/bestpath attribute entries using 868 bytes of memory
1 BGP AS-PATH entries using 24 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
Bitfield cache entries: current 2 (at peak 2) using 64 bytes of memory
BGP using 2144 total bytes of memory
BGP activity 63/57 prefixes, 116/107 paths, scan interval 60 secs

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
10.10.13.3      4    11     498     448        8    0    0 00:16:03        1
192.168.12.2    4    10     458     447        8    0    0 00:16:02        3

Any idea why is this behaviour , i am not  doing any redistribution.

Chao

Vishwa

6 REPLIES
Cisco Employee

Re: BGP ISSUE

Hi Vishwa,

The local generated 10.10.34.0 has weight 32768, so it is prefered over eBGP learned route. To make the eBGP as the prefer path, set weight higher than 32768 for peer 10.10.13.3.

HTH,

Lei Tian

Re: BGP ISSUE

I agree with Lei..

Looking at your config

R0#router bgp 10
no synchronization
bgp log-neighbor-changes
network 10.10.24.0 mask 255.255.255.0
network 10.10.34.0 mask  255.255.255.0
network 172.16.1.0 mask 255.255.255.0
network  172.16.1.1 mask 255.255.255.255
network 192.168.11.0
network  192.168.12.0
aggregate-address 172.16.4.0 255.255.252.0
neighbor  10.10.13.2 remote-as 11
neighbor 10.10.13.3 remote-as 11
neighbor 10.10.13.3 prefix-list test in
neighbor 10.10.13.3  route-map med out
neighbor 192.168.12.2 remote-as 10
neighbor  192.168.12.2 next-hop-self

I don't understand whether you want to advertise 10.10.34.0 network or you want it to learn it.

If that network is supposed to be learned from your EBGP peer, remove network statement or try setting weight higher then default for that network...

Regards,

Smitesh Kharecha

Re: BGP ISSUE

Pondering again over the question and as answered by Lei...

Weights will be taken  into consideration only when routes are learn ed from 2 different BGP speaker, and not when its learned from BGP and secondly from IGP.

I guess to solve the  dilema, we need to look at complete routing scenario. Can you please paste the whole routing config  for the network and not only single router. As that network is learned as O IA route. Definately without looking routing table and routing config, question can't be answred.

Secondl, what i understand is network 10.10.34.0 should be learbed via ur EBGP peer. Hence I assume that network is connected to  ur EBGP peer and as you are not doing any redistribution; I suggest adding network 10.10.34.0 mask  255.255.255.0 to your EBGP peer.

Regards,

Smitesh  Kharecha

Hall of Fame Super Silver

Re: BGP ISSUE

Hello Smitesh,

>> Weights will be taken  into consideration only when routes are learn ed  from 2 different BGP speaker, and not when its learned from BGP and  secondly from IGP.

As we see in first post a locally generated BGP route has weight 32,768 and is preferred to the eBGP advertisement in the BGP table for its higher weight.

Also the weight of locally generated BGP advertisements is considered.

in cases like this as suggested by Lei increasing the weight to a number higher then 32,768 can make the eBGP route preferred in the BGP table.

Then, the eBGP route is proposed to the IP routing table mantainer tagged as eBGP, and so an AD of 20 is associated to it and it will be installed in IP routing table over the O IA route (AD 110)

to be more precise the problem can appear in a second time:

if the eBGP session comes up before then the OSPF neighbor the BGP route is installed in the IP routing table and no local BGP route is generated.

But if the BGP session fails the OSPF route is installed in the IP routing table and a locally generated BGP route is generated.

When the eBGP session recovers the eBGP route is not installed again in the IP routing table for the  reasons described above.

The restore phase shows a problem and it can be solved with simply neigh x.x.x.x weight 40000

I've seen this behaviour some years ago during some lab tests in an MPLS L3 VPN environment.

Hope to help

Giuseppe

New Member

Re: BGP ISSUE

Hi All:

Thanks for the inputs.

I see what is happening ,since i am using the network command with the mask i need a exact match in the routing table to be installed in the BGP table.

Which i am getting from my ospf.

Where i got confused is ----if i am using the network command with a mask and learing the same network through EBGP so the network will be in my routing table and bgp table will in this case the network command generate a network as local since there is match in the routing table.

R0#show run | begin bgp
router bgp 10
no synchronization
bgp log-neighbor-changes
network 10.10.24.0 mask 255.255.255.0
network 10.10.34.0 mask 255.255.255.0--------->>>>will this be generating a local route in the bgp table

R0#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

C    192.168.12.0/24 is directly connected, FastEthernet0/0
     172.16.0.0/24 is subnetted, 4 subnets
C       172.16.4.0 is directly connected, Loopback3
C       172.16.1.0 is directly connected, Loopback0
C       172.16.2.0 is directly connected, Loopback1
C       172.16.3.0 is directly connected, Loopback2
C    192.168.11.0/24 is directly connected, FastEthernet0/0
     10.0.0.0/24 is subnetted, 3 subnets
C       10.10.13.0 is directly connected, Serial0/1
O IA    10.10.24.0 [110/74] via 192.168.12.2, 00:17:11, FastEthernet0/0
B       10.10.34.0 [20/0] via 10.10.13.3, 00:12:38---------->>>matching route is there

Chao

Vishwa

Re: BGP ISSUE

Hi Giuseppe,

Apologies if i caused some confusion in explaining myself.

My point was router is learning "X" networking via OSPF and also the same router is having eBGP. Moreover the same router is also advertising the same network "X" which it should learn from its eBGP peer. So my point was in while BGP route selection process, due to higher weight of advertised route it won't prefer eBGP route; however it will show in BGP table and also won't install that in routing table as BGP route; because now that network "X" is also learned via OSPF, hence it will be installed as OSPF route.

But i still haven't figured out why network 10.10.34.0 mask 255.255.255.0 been advertised locally, when it is supposed to be learned from eBGP peer

Regards,

Smitesh

567
Views
0
Helpful
6
Replies
CreatePlease to create content