Building the BGP Table

Building the BGP Table

The BGP cartography table, additionally alleged the BGP Acquisition Advice Base (RIB), holds the network

layer reachability advice (NLRI) abstruse by BGP, as able-bodied as the associated PAs. An NLRI is

simply an IP prefix and prefix length. This area focuses on the action of how BGP injects

NLRI into a router’s BGP table, followed by how routers acquaint their associated PAs and NLRI

to neighbors.

NOTE Technically, BGP does not acquaint routes; rather, it advertises PAs added a set of NLRI

that shares the aforementioned PA values. However, best bodies artlessly accredit to NLRI as BGP prefixes or

BGP routes. This book uses all three terms. However, because there is a acumen amid a

BGP avenue in the BGP table and an IP avenue in the IP acquisition table, the argument takes affliction to accredit to

the BGP table or IP acquisition table to analyze the two tables.

Injecting Routes/Prefixes into the BGP Table

Unsurprisingly, an alone BGP router adds entries to its bounded BGP table by application the same

general methods acclimated by IGPs: by application the arrangement command, by audition the topology

information via an Update bulletin from a neighbor, or by redistributing from accession routing

protocol. The abutting few sections appearance examples of how a bounded BGP router adds routes to the BGP

table by methods added than acquirements them from a BGP neighbor.

BGP arrangement Command

This section, and the abutting section, assumes the BGP no auto-summary command has been

configured. Agenda that as of the Cisco IOS Software Release 12.3 Mainline, no auto-summary is the

default; beforehand releases defaulted to use auto-summary. Afterward that, the section, “The Appulse of

Building the BGP Table 355

Auto-Summary on Redistributed Routes and the arrangement Command,” discusses the appulse of the

auto-summary command on both the arrangement command and the redistribute command.

The BGP arrangement router subcommand differs decidedly from the arrangement command acclimated by

IGPs. The BGP arrangement command instructs that router’s BGP action to do the following:

Look for a avenue in the router’s accepted IP acquisition table that absolutely matches the

parameters of the arrangement command; if the IP avenue exists, put the agnate NLRI into

the bounded BGP table.

With this logic, affiliated routes, changeless routes, or IGP routes could be taken from the IP routing

table and placed into the BGP table for after advertisement. Back the router removes that route

from its IP acquisition table, BGP again removes the NLRI from the BGP table, and notifies neighbors

that the avenue has been withdrawn.

Note that the IP avenue charge be akin absolutely back the no auto-summary command is

configured or acclimated by default.

Table 11-5 lists a few of the key appearance of the BGP arrangement command, whose all-encompassing syntax is:

network {network-number [mask network-mask]} [route-map map-tag]

*NEXT_HOP is a BGP PA that denotes the next-hop IP abode that should be acclimated to ability the NLRI.

Example 11-4 shows an archetype arrangement command as implemented on R5 of Figure 11-4 (R5’s

BGP neighbors accept been shut bottomward so that the BGP table shows alone BGP table entries created

by the arrangement commands on R5). In Archetype 11-4, R5 uses two arrangement commands to add

21.0.0.0/8 and 22.1.1.0/24 to its BGP table.

Table 11-5 Key Appearance of the BGP arrangement Command

Feature Implication

No affectation is configured Assumes the absence classful mask.

Matching argumentation with no auto-summary

configured

An IP avenue charge bout both the prefix and prefix length

(mask).

Matching argumentation with auto-summary

configured

If the arrangement command lists a classful network, it

matches if any subnets of the classful arrangement exist.

NEXT_HOP of BGP avenue added to the

BGP table*

Uses abutting hop of IP route.

Maximum cardinal injected by the

network command into one BGP process

200

Purpose of the route-map advantage on the

network command

Can be acclimated to clarify routes and dispense PAs, including

NEXT_HOP*.

356 Affiliate 11: BGP

Figure 11-4 Sample BGP Network, with IP Addresses

Example 11-4 Examples of Clearing the BGP Table via the arrangement Command

! On R5, the arrangement commands accurately bout prefixes 21.0.0.0/8 and 22.1.1.0/24. The

! blank of the affectation on the aboriginal command implies the associated classful mask

! of 255.0.0.0, as the IP abode listed (21.0.0.0) is a chic A address.

router bgp 45

no synchronization

bgp log-neighbor-changes

network 21.0.0.0

network 22.1.1.0 affectation 255.255.255.0

! The acquaintance commands are not shown, as they are not pertinent to the topics

! covered in this example.

! Next, the two routes akin by the arrangement commands are absolutely in the IP

! acquisition table. Agenda that the avenue to 21.0.0.0/8 is a affiliated route, and the

! avenue to 22.1.1.0/24 is a changeless route.

R5# appearance ip avenue | incl 21 | 22

IBGP

IBGP

IBGP

10.1.23.2

10.1.12.2

10.1.23.3

10.1.12.1

EBGP

EBGP

R5

10.1.34.4

10.1.134.4 IBGP

10.1.34.3

10.1.134.3

10.1.45.5

10.1.57.5

10.1.57.7

10.1.78.7

10.1.78.8

10.1.68.8

10.1.68.6

10.1.45.4

172.16.16.6

172.16.16.1

10.1.69.6

10.1.69.9

EIGRP 6

ASN 678

ASN 123 ASN 45

R6

R9

R8 R7

R8: RIP Only

EBGP IBGP

Networks 30 Through 39

Via redistribute eigrp 6 Command

Networks 20 Through 29

Via Arrangement Command

RID

3.3.3.3

RID

4.4.4.4

RID

5.5.5.5

RID

7.7.7.7

RID

8.8.8.8

RID

6.6.6.6

RID

111.111.111.111

RID

2.2.2.2

R3 R4

R2

R1

Building the BGP Table 357

Redistributing from an IGP, Static, or Affiliated Route

The BGP redistribute subcommand can redistribute static, connected, and IGP-learned routes.

The mechanics of the BGP redistribute command assignment actual analogously with redistribution as

covered in Affiliate 10, “IGP Avenue Redistribution, Avenue Summarization, and Absence Routing”;

however, this area covers a few nuances that are different to BGP.

BGP does not use the abstraction of artful a metric for anniversary alternating avenue to ability a particular

prefix. Instead, BGP uses a step-wise accommodation action that examines assorted PAs to actuate the

best route. As a result, redistribution into BGP does not crave any application of setting

metrics. However, a router ability charge to administer a avenue map to the redistribution action to

manipulate PAs, which in about-face affects the BGP accommodation process. If a metric is assigned to a route

injected into BGP, BGP assigns that metric amount to the BGP Multi-Exit Discriminator (MED) PA,

which is frequently referred to as metric.

Example 11-5 shows R6 (from Figure 11-4) bushing its BGP table through avenue redistribution from

Enhanced IGRP (EIGRP) action 6 (as configured in Archetype 11-5 with the router eigrp 6

command) and redistributing a distinct changeless route. EIGRP on R6 learns routes alone for

networks 30 through 39. The goals of this archetype are as follows:

■ Redistribute EIGRP routes for networks 31 and 32

C 21.0.0.0/8 is anon connected, Loopback20

22.0.0.0/24 is subnetted, 1 subnets

S 22.1.1.0 [1/0] via 10.1.5.9

! Below, the prefixes accept been added to the BGP table. Agenda that the NEXT_HOP

! PA has been set to 0.0.0.0 for the avenue (21.0.0.0/8) that was taken from a

! affiliated route, with the NEXT_HOP for 22.1.1.0/24 analogous the IP route.

R5# appearance ip bgp

BGP table adaptation is 38, bounded router ID is 5.5.5.5

Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

r RIB-failure, S Stale

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

Network Abutting Hop Metric LocPrf Weight Path

*> 21.0.0.0 0.0.0.0 0 32768 i

*> 22.1.1.0/24 10.1.5.9 0 32768 i

NOTE Although this point is not different to BGP, accumulate in apperception that redistribution from an IGP

causes two types of routes to be taken from the acquisition table—those abstruse by the routing

protocol, and those affiliated routes for which that acquisition agreement matches with a network

command.

Example 11-4 Examples of Clearing the BGP Table via the arrangement Command (Continued)358 Affiliate 11: BGP

■ Redistribute the changeless avenue to arrangement 34, and set the MED (metric) to 9

■ Do not accidentally redistribute the affiliated routes that are akin by EIGRP’s network

commands

■ Use the Cisco IOS 12.3 absence ambience of no auto-summary

Example 11-5 shows the aberration of accidentally redistributing added routes—the connected

subnets of arrangement 10.0.0.0 akin by EIGRP arrangement commands. After in the example, a route

map is added to anticipate the problem.

Example 11-5 Archetype of Clearing the BGP Table via Redistribution

! R6 redistributes EIGRP 6 routes and changeless routes below, ambience the metric on

! redistributed changeless routes to 9. Agenda that EIGRP 6 matches subnets 10.1.68.0/24

! and 10.1.69.0/24 with its arrangement command.

router bgp 678

redistribute changeless metric 9

redistribute eigrp 6

!

router eigrp 6

network 10.0.0.0

!

ip avenue 34.0.0.0 255.0.0.0 null0

! Commands different to clearing the bounded BGP table are omitted.

! R6 has met the ambition of injecting 31 and 32 from EIGRP, and 34 from static.

! It additionally accidentally best up two subnets of 10.0.0.0/8 because EIGRP’s network

! 10.0.0.0 command akin these affiliated subnets.

R6# appearance ip bgp

BGP table adaptation is 1, bounded router ID is 6.6.6.6

Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

r RIB-failure, S Stale

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

Network Abutting Hop Metric LocPrf Weight Path

*> 10.1.68.0/24 0.0.0.0 0 32768 ?

*> 10.1.69.0/24 0.0.0.0 0 32768 ?

*> 31.0.0.0 10.1.69.9 156160 32768 ?

*> 32.1.1.0/24 10.1.69.9 156160 32768 ?

*> 34.0.0.0/24 0.0.0.0 9 32768 ?

! Below, agenda the metrics for the two EIGRP routes. The appearance ip bgp command output

! aloft shows how BGP assigned the MED (metric) that aforementioned value.

R6# appearance ip avenue eigrp

32.0.0.0/24 is subnetted, 1 subnets

D 32.1.1.0 [90/156160] via 10.1.69.9, 00:12:17, FastEthernet0/0

D 31.0.0.0/8 [90/156160] via 10.1.69.9, 00:12:17, FastEthernet0/0

! Below, the redistribute eigrp command has been afflicted to the following, using

! a avenue map to alone acquiesce routes in networks in the 30s.

redist eigrp 6 route-map just-30-something

Building the BGP Table 359

Also agenda that the NEXT_HOP PA for anniversary avenue either matches the abutting hop of the redistributed

route or is 0.0.0.0 for affiliated routes and routes to null0.

Impact of Auto-Summary on Redistributed Routes and the arrangement Command

As it does with IGPs, the BGP auto-summary command causes a classful arbitrary avenue to be

created if any basic subnet of that arbitrary exists. However, clashing IGPs, the BGP autosummary

router subcommand causes BGP to abridge alone those routes injected due to

redistribution on that router. BGP auto-summary does not attending for classful arrangement boundaries

in the topology, and it does not attending at routes already in the BGP table. It artlessly looks for routes

injected into the BGP due to the redistribute and arrangement commands on that aforementioned router.

The argumentation differs hardly based on whether the avenue is injected with the redistribute command

or the arrangement command. The argumentation for the two commands is abbreviated as follows:

■ redistribute—When the redistribution action would commonly inject subnets of a classful

network, do not inject the subnets into the acquisition table, but instead inject the classful

network.

■ network—For arrangement commands that account a classful arrangement cardinal and no mask

parameter, inject the classful arrangement if at atomic one subnet of that classful arrangement exists in

the IP acquisition table.

While the above-mentioned definitions are abridged for abstraction purposes, a few credibility deserve further

emphasis and explanation. First, for redistribution, the auto-summary command causes the

redistribution action to inject alone classful networks into the bounded BGP table, and no subnets.

The arrangement command, with auto-summary configured, still injects subnets based on the same

logic already declared in this chapter. In accession to that logic, if a arrangement command matches

the classful arrangement number, BGP injects the classful network, as continued as at atomic any one subnet

of that classful arrangement exists in the IP acquisition table.

! The avenue map and ACLs acclimated for the clarification are apparent next. As a result, the

! two subnets of 10.0.0.0/8 will not be redistributed into the BGP table.

R6# appearance route-map

route-map just-30-something, permit, arrangement 10

Match clauses:

ip abode (access-lists): permit-30-39

Set clauses:

Policy acquisition matches: 0 packets, 0 bytes

R6# appearance access-list

Standard IP admission account permit-30-39

10 admittance 32.0.0.0, wildcard $.25 7.255.255.255 (1538 matches)

20 admittance 30.0.0.0, wildcard $.25 1.255.255.255 (1130 matches)

Example 11-5 Archetype of Clearing the BGP Table via Redistribution (Continued)

360 Affiliate 11: BGP

Example 11-6 shows an archetype that credibility out the appulse of the auto-summary command. The

example follows these accomplish on router R5 from Figure 11-2:

1. 10.15.0.0/16 is injected into BGP due to the redistribute command.

2. Auto-summary is configured, BGP is cleared, and now alone 10.0.0.0/8 is in the BGP table.

3. Auto-summary and redistribution are disabled.

4. The arrangement 10.0.0.0 command, arrangement 10.12.0.0 affectation 255.254.0.0 command, and

network 10.14.0.0 affectation 255.255.0.0 command are configured. Alone the aftermost of these three

commands absolutely matches a accepted route, so alone that avenue is injected into BGP.

5. Auto-summary is enabled, causing 10.0.0.0/8 to be injected, as able-bodied as the aboriginal 10.14.0.0/

16 route.

Example 11-6 Auto-Summary Appulse on Acquisition Tables

! R5 has shut bottomward all acquaintance connections, so the achievement of appearance ip bgp alone shows

! routes injected on R5.

! Footfall 1 is below. Alone 10.15.0.0/16 is injected by the accepted configuration. Agenda that

! the different curve of achievement accept been removed, and route-map only15 only

! matches 10.15.0.0/16.

R5# appearance run | be router bgp

router bgp 5

no synchronization

redistribute affiliated route-map only15

no auto-summary

! Below, agenda the absence of 10.0.0.0/8 as a route, and the attendance of 10.15.0.0/16,

! as able-bodied as the blow of the routes acclimated in the accessible steps.

R5# appearance ip avenue 10.0.0.0

Routing access for 10.0.0.0/8, 4 accepted subnets

Attached (4 connections)

Redistributing via eigrp 99, bgp 5

Advertised by bgp 5 route-map only15

C 10.14.0.0/16 is anon connected, Loopback10

C 10.15.0.0/16 is anon connected, Loopback10

C 10.12.0.0/16 is anon connected, Loopback10

C 10.13.0.0/16 is anon connected, Loopback10

! Alone 10.15.0.0/16 is injected into BGP.

R5# appearance ip bgp

BGP table adaptation is 2, bounded router ID is 5.5.5.5

Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

r RIB-failure, S Stale

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

Network Abutting Hop Metric LocPrf Weight Path

*> 10.15.0.0/16 0.0.0.0 0 32768 ?

! Next, footfall 2, area auto-summary is enabled. Now, 10.15.0.0/16 is no longer

Building the BGP Table 361

! injected into BGP, but classful 10.0.0.0/8 is.

R5# conf t

Enter agreement commands, one per line. End with CNTL/Z.

R5(config)# router bgp 5

R5(config-router)# auto-summary

R5(config-router)# ^Z

R5# bright ip bgp *

R5# appearance ip bgp

BGP table adaptation is 2, bounded router ID is 5.5.5.5

Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

r RIB-failure, S Stale

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

Network Abutting Hop Metric LocPrf Weight Path

*> 10.0.0.0 0.0.0.0 0 32768 ?

! Now, at footfall 3, no auto-summary disables automated summarization, redistribution is

! disabled, and at footfall 4, the arrangement commands are added. Agenda that 10.12.0.0/15 is

! not injected, as there is no exact match, nor is 10.0.0.0/8, as there is no exact

! match. However, 10.14.0.0/16 is injected due to the exact bout of the prefix and

! prefix length.

R5# conf t

Enter agreement commands, one per line. End with CNTL/Z.

R5(config)# router bgp 5

R5(config-router)# no auto-summary

R5(config-router)# no redist conn route-map only15

R5(config-router)# no redist connected

R5(config-router)# arrangement 10.0.0.0

R5(config-router)# arrangement 10.12.0.0 affectation 255.254.0.0

R5(config-router)# arrangement 10.14.0.0 affectation 255.255.0.0

R5(config-router)# ^Z

R5# bright ip bgp *

R5# sh ip bgp | activate network

Network Abutting Hop Metric LocPrf Weight Path

*> 10.14.0.0/16 0.0.0.0 0 32768 i

! Finally, auto-summary is re-enabled (not apparent in the example).

! 10.14.0.0/16 is still an exact match, so it is

! still injected. 10.0.0.0/8 is additionally injected because of the arrangement 10.0.0.0 command.

R5# sh ip bgp | activate network

Network Abutting Hop Metric LocPrf Weight Path

* 10.0.0.0 0.0.0.0 0 32768 i

* 10.14.0.0/16 0.0.0.0 0 32768 i

Example 11-6 Auto-Summary Appulse on Acquisition Tables (Continued)