Simple BGP problem

Answered Question
Oct 30th, 2009
User Badges:
  • Bronze, 100 points or more

This has to be one of those so-obvious-I-just-can't-see-it problem.


Router R1 (AS 790) is fully peered with R2 (AS 300). R1 has two network statements configured under its BGP process, 172.31.5.0 and 172.31.6.0. These networks are NOT showing up anywhere in R2's routing table (not just not showing up as BGP routes, just plain not showing up).


Since these are loopback networks; could it be there's an unacceptable "NEXT_HOP" attribute, or what? WHAT STUPID THING AM I GETTING WRONG HERE...


Here's the relevant parts of R1's config


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

interface Loopback5

ip address 172.31.5.1 255.255.255.0

!

interface Loopback6

ip address 172.31.6.1 255.255.255.0


!

router bgp 790

no synchronization

bgp log-neighbor-changes

network 172.31.5.0

network 172.31.6.0

neighbor 172.31.1.6 remote-as 300

no auto-summary

!


R1#sh ip bgp summ

BGP router identifier 222.1.1.1, local AS number 790

BGP table version is 1, main routing table version 1


Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd

172.31.1.6 4 300 20 23 1 0 0 00:01:37 0

R1#

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


And relevant output from R2:


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

R2>sh ip bgp sum

BGP router identifier 222.1.5.1, local AS number 300

BGP table version is 1, main routing table version 1


Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd

172.31.1.5 4 790 24 21 1 0 0 00:02:06 0


R2>sh ip route

Codes: C - connected, S - static, I - IGRP, 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, E - EGP

i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default

U - per-user static route, o - ODR


Gateway of last resort is not set


C 222.1.5.0/24 is directly connected, Loopback0

172.31.0.0/16 is variably subnetted, 4 subnets, 2 masks

C 172.31.1.4/30 is directly connected, Serial0

C 172.31.1.5/32 is directly connected, Serial0

C 172.31.1.8/30 is directly connected, Serial1

C 172.31.1.9/32 is directly connected, Serial1

R2>sh ip bgp

R2>

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


Thanks everyone. I look forward to being conked on the head with a saucepan and having something really obvious pointed out to me...

Correct Answer by pkurdziel about 7 years 5 months ago

It's because you have this:

interface Loopback5

ip address 172.31.5.1 255.255.255.0

!

interface Loopback6

ip address 172.31.6.1 255.255.255.0


!

router bgp 790

no synchronization

bgp log-neighbor-changes

network 172.31.5.0

network 172.31.6.0


Your loopbacks are class B address's.

Your routing table on R1 looks like this:


172.31.0.0/24 is subnetted, 2 subnets

C 172.31.6.0 is directly connected, Loopback6

C 172.31.5.0 is directly connected, Loopback5


With these two commands:

network 172.31.5.0

network 172.31.6.0

You are telling BGP to look for 172.31.0.0/16 which is not in the routing table. You have to tell BGP that you are using a /24 with:

network 172.31.5.0 mask 255.255.255.0

network 172.31.6.0 mask 255.255.255.0

Correct Answer by justinmitchell about 7 years 6 months ago

You need to use

network 172.31.5.0 mask 255.255.255.0

network 172.31.6.0 mask 255.255.255.0


Otherwise the routes will not show up.


Here is an example:


RTR1 without mask

Router#sh run | s bgp

router bgp 790

no synchronization

bgp log-neighbor-changes

network 172.16.7.0

network 192.168.5.0

network 192.168.6.0

neighbor 192.168.1.2 remote-as 300

no auto-summary

Router#sh ip bgp | b Network

Network Next Hop Metric LocPrf Weight Path

*> 192.168.5.0 0.0.0.0 0 32768 i

*> 192.168.6.0 0.0.0.0 0 32768 i



With the mask command used

Router#sh run | s bgp

router bgp 790

no synchronization

bgp log-neighbor-changes

network 172.16.7.0 mask 255.255.255.0

network 192.168.5.0

network 192.168.6.0

neighbor 192.168.1.2 remote-as 300

no auto-summary

Router#sh ip bgp | b Network

Network Next Hop Metric LocPrf Weight Path

*> 172.16.7.0/24 0.0.0.0 0 32768 i

*> 192.168.5.0 0.0.0.0 0 32768 i

*> 192.168.6.0 0.0.0.0 0 32768 i



RTR2 with mask used on RTR1

Router#sh run | s bgp

router bgp 300

no synchronization

bgp log-neighbor-changes

neighbor 192.168.1.1 remote-as 790

no auto-summary

Router#sh ip bgp | b Network

Network Next Hop Metric LocPrf Weight Path

*> 172.16.7.0/24 192.168.1.1 0 0 790 i

*> 192.168.5.0 192.168.1.1 0 0 790 i

*> 192.168.6.0 192.168.1.1 0 0 790 i



(edited to correct IP addressing)

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (5 ratings)
Loading.
viyuan700 Fri, 10/30/2009 - 21:17
User Badges:
  • Silver, 250 points or more

with loopback address you need statements extra under router bgp 790


neighbor 2.2.2.2 (use ur address here) ebgp-multihop 2

neighbor 2.2.2.2 (use ur address here) update-source Loopback0


U need static routes if not using any IGP to reach those loopback address


see the link it has the things u r looking for


http://www.cisco.com/en/US/tech/tk365/technologies_configuration_example09186a0080093f25.shtml#ebgploopconfigloop

chetanmahendroo Fri, 10/30/2009 - 21:29
User Badges:

I dont think ebgp-multihop is required, since bgp is already in established state.


Please check the bgp table of R1. R1 will share/advertise its bgp table to peers.

bgp will match EXACT route in routing table with network statement before advertising to its peers. try to specify mask along with network statements under bgp config.

viyuan700 Fri, 10/30/2009 - 21:35
User Badges:
  • Silver, 250 points or more

bgp is in established state because of this statement


neighbor 172.31.1.6 remote-as 300


but loopback address are not counted as directly connected address so u have to use multihop statement

Giuseppe Larosa Sat, 10/31/2009 - 05:02
User Badges:
  • Super Silver, 17500 points or more
  • Hall of Fame,

    Founding Member

Hello Stuey,


on R1 you have

neigh 172.31.1.6 remote-as 300


but on R2 IP routing table we see:


C 172.31.1.5/32 is directly connected, Serial0

this would make me think you have inverted the ip addresses: it looks like 172.31.1.5 is on the R2 side of serial0


Hope to help

Giuseppe


Correct Answer
justinmitchell Sat, 10/31/2009 - 05:26
User Badges:

You need to use

network 172.31.5.0 mask 255.255.255.0

network 172.31.6.0 mask 255.255.255.0


Otherwise the routes will not show up.


Here is an example:


RTR1 without mask

Router#sh run | s bgp

router bgp 790

no synchronization

bgp log-neighbor-changes

network 172.16.7.0

network 192.168.5.0

network 192.168.6.0

neighbor 192.168.1.2 remote-as 300

no auto-summary

Router#sh ip bgp | b Network

Network Next Hop Metric LocPrf Weight Path

*> 192.168.5.0 0.0.0.0 0 32768 i

*> 192.168.6.0 0.0.0.0 0 32768 i



With the mask command used

Router#sh run | s bgp

router bgp 790

no synchronization

bgp log-neighbor-changes

network 172.16.7.0 mask 255.255.255.0

network 192.168.5.0

network 192.168.6.0

neighbor 192.168.1.2 remote-as 300

no auto-summary

Router#sh ip bgp | b Network

Network Next Hop Metric LocPrf Weight Path

*> 172.16.7.0/24 0.0.0.0 0 32768 i

*> 192.168.5.0 0.0.0.0 0 32768 i

*> 192.168.6.0 0.0.0.0 0 32768 i



RTR2 with mask used on RTR1

Router#sh run | s bgp

router bgp 300

no synchronization

bgp log-neighbor-changes

neighbor 192.168.1.1 remote-as 790

no auto-summary

Router#sh ip bgp | b Network

Network Next Hop Metric LocPrf Weight Path

*> 172.16.7.0/24 192.168.1.1 0 0 790 i

*> 192.168.5.0 192.168.1.1 0 0 790 i

*> 192.168.6.0 192.168.1.1 0 0 790 i



(edited to correct IP addressing)

thotsaphon Sat, 10/31/2009 - 05:32
User Badges:
  • Gold, 750 points or more

Justin,

You're right. I was typing slowly in this thread. hehehe. 5-Point for ya!


Giuseppe: I thought that would be a peer-neighbor route advertised by a neighbor when using PPP. R1 should use 172.31.1.5. (grin)


Toshi

Giuseppe Larosa Sat, 10/31/2009 - 05:37
User Badges:
  • Super Silver, 17500 points or more
  • Hall of Fame,

    Founding Member

Hello Toshi,

you're right I wrote my post just after lunch without much thought.


it happens :)


Best Regards

Giuseppe


thotsaphon Sat, 10/31/2009 - 05:42
User Badges:
  • Gold, 750 points or more

Giuseppe,

That's fine. To freshen you up. 5-Point for ya!


Toshi

Giuseppe Larosa Sat, 10/31/2009 - 05:33
User Badges:
  • Super Silver, 17500 points or more
  • Hall of Fame,

    Founding Member

Hello Justin,

that's absolutely correct.



Best Regards

Giuseppe


CriscoSystems Tue, 11/03/2009 - 14:12
User Badges:
  • Bronze, 100 points or more

Indeed it works now with the mask parameter configured.


So why does IOS let us declare a network WITHOUT that parameter?

justinmitchell Tue, 11/03/2009 - 14:43
User Badges:

Not sure, but you can use other config options such as route-map and backdoor.

CriscoSystems Tue, 11/03/2009 - 15:28
User Badges:
  • Bronze, 100 points or more

Well this is actually ridiculous now. I did a bit of research elsewhere on this site, and I found out that, with the network command configured WITHOUT a mask:


(from http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a00800945ff.shtml#topic1)


BGP introduces the classful network 75.0.0.0 in the BGP table if these conditions are met:


(1) The subnet in the routing table is 75.75.75.0 mask 255.255.255.0.

(2) You configure network 75.0.0.0 under the router bgp command.

(3) Auto-summary is enabled.


If these conditions are not all met, BGP does not install an entry in the BGP table unless there is an exact match in the IP routing table.


In the case of my original config, conditions 2 and 3 aren't met. But it says BGP won't install the route UNLESS there's an exact match in the IP table. There was! The loopbacks are directly connected and appear as such in the table!!


So what happened in this case?



Correct Answer
pkurdziel Tue, 11/03/2009 - 16:37
User Badges:

It's because you have this:

interface Loopback5

ip address 172.31.5.1 255.255.255.0

!

interface Loopback6

ip address 172.31.6.1 255.255.255.0


!

router bgp 790

no synchronization

bgp log-neighbor-changes

network 172.31.5.0

network 172.31.6.0


Your loopbacks are class B address's.

Your routing table on R1 looks like this:


172.31.0.0/24 is subnetted, 2 subnets

C 172.31.6.0 is directly connected, Loopback6

C 172.31.5.0 is directly connected, Loopback5


With these two commands:

network 172.31.5.0

network 172.31.6.0

You are telling BGP to look for 172.31.0.0/16 which is not in the routing table. You have to tell BGP that you are using a /24 with:

network 172.31.5.0 mask 255.255.255.0

network 172.31.6.0 mask 255.255.255.0

CriscoSystems Tue, 11/03/2009 - 16:40
User Badges:
  • Bronze, 100 points or more

Ahhhh... even though auto-summary was disabled?


BGP will summarize a declared network to the classful address boundary if no "mask" parameter is declared; even IF auto-summary is disabled, is what you're saying?


justinmitchell Tue, 11/03/2009 - 16:45
User Badges:

That is what I thought, but didn't have the chance to verify. Thank you for the explanation.

Actions

This Discussion