cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1059
Views
15
Helpful
15
Replies

Simple BGP problem

CriscoSystems
Level 5
Level 5

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...

2 Accepted Solutions

Accepted Solutions

justinmitchell
Level 4
Level 4

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)

View solution in original post

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

View solution in original post

15 Replies 15

viyuan700
Level 5
Level 5

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

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.

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
Hall of Fame
Hall of Fame

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

justinmitchell
Level 4
Level 4

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)

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

Hello Toshi,

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

it happens :)

Best Regards

Giuseppe

Giuseppe,

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

Toshi

Hello Justin,

that's absolutely correct.

Best Regards

Giuseppe

Indeed it works now with the mask parameter configured.

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

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

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?

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

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?

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: