Case Study Peering BGP Routers

A BGP session between routers is configured in two steps:

Step 1 Establish the BGP process and specify the local AS number with the router bgp command.

Step 2 Specify a neighbor and the neighbor's AS number with the neighbor remote-as command.

Figure 3-1 shows two routers in different autonomous systems. The structure of the BGP configuration for these routers differs from EGP configuration. Recall from Chapter 1, "Exterior Gateway Protocol," that the router egp command specifies the remote AS, and the autonomous-system command specifies the local AS. In contrast, router bgp specifies the local AS. Each neighbor's AS is specified with the neighbor remote-as command. This difference is significant. Whereas only core EGP routers can peer with more than one remote AS (with the router egp 0 command), any BGP process can peer with any number of remote autonomous systems. The EGP requirement for stub autonomous systems connected through a core AS is eliminated; autonomous systems can be meshed fully under BGP.

Figure 3-1 An EBGP Session Is Established Between Taos and Vail

Figure 3-1 shows two routers in different autonomous systems. The structure of the BGP configuration for these routers differs from EGP configuration. Recall from Chapter 1, "Exterior Gateway Protocol," that the router egp command specifies the remote AS, and the autonomous-system command specifies the local AS. In contrast, router bgp specifies the local AS. Each neighbor's AS is specified with the neighbor remote-as command. This difference is significant. Whereas only core EGP routers can peer with more than one remote AS (with the router egp 0 command), any BGP process can peer with any number of remote autonomous systems. The EGP requirement for stub autonomous systems connected through a core AS is eliminated; autonomous systems can be meshed fully under BGP.

Example 3-1 shows the EBGP configurations for the Taos and Vail routers in Figure 3-1.

Example 3-1 EBGP Configurations for Routers in Figure 3-1

Example 3-1 shows the EBGP configurations for the Taos and Vail routers in Figure 3-1.

Example 3-1 EBGP Configurations for Routers in Figure 3-1

Taos

router bgp 200

neighbor 192.168.1

.226

remote

-as 100

Vail

router bgp 100

neighbor 192.168.1

.225

remote-

-as 200

I Example 3-2 shows the information Vail has recorded about Taos. Much of the information in this screen is particularly useful for troubleshooting. Appendix A, "The show ip bgp neighbors Display," provides a complete description of all the fields displayed by the show ip bgp neighbors command.

Example * ? show ip bgp neighbors Command Output Contains Details About the Peer Connection with a Neighbor

Vail#show ip bgp neighbors

BGP neighbor is 192,168»1.22$, remote AS 200, external link Index 1, Offset 0, Mask 0x2 BGP version 4, remote router ID 192.163.1.225 BGP state » Established, table version = 1, up for 19:32:02 Last read 00:00:03, hold time is 180, keepalive interval is 60 seconds Minimum time between advertisement runs is 30 seconds Received 1175 messages, 0 notifications, 0 in queue Sent 1175 messages, 0 notifications, 0 in queue Prefix advertised 0, suppressed 0, withdrawn 0 Connections established 1; dropped 0 Last reset never

0 accepted prefixes consume 0 bytes 0 history paths consume 0 bytes Connection state is ESTAB, 1/0 status: 1, mread input bytes: 0 Local host: 192.168.1.226, Local port: 11025 Foreign host: 192.168.1.225, Foreign port: 179

Enqueued packets for retransmit: 0, input: 0 mis-ordered: 0 (0 bytes)

Event Timers (current time is 0X45FDF2C):

Timer

Starts

Wakeups

Next

Retrans

1176

0

0x0

TimeWait

0

0

0x0

AckHold

1175

885

0x0

SendWnd

0

0

0X0

KeepAlive

0

0

0x0

Givellp

0

0

0x0

PmtuAger

0

0

0x0

DeadWait

0

0

0X0

iss: 4072889888 snduna: 4072912224 sndnxt: 4072912224 sndwnd: 16004 irs: 4121607729 rcvnxt: 4121630065 rcvwnd: 16004 delrcvwnd: 380

SRTT: 300 ms, RTTO: 607 ms, RTV: 3 ms, KRTT: 0 ms minRTT: 4 ms, maxRTT: 340 ms, ACK hold: 200 ms Flags: higher precedence, nagle

Datagrams (max data segment is 1460 bytes):

Rcvd: 2220 (out of order: 0), with data: 1175, total data bytes: 22335 Sent: 2077 (retransmit: 0), with data: 1175, total data bytes: 22335 Vail#

The first line of output in Example 3-2 shows the address of Taos (192.168.1.225), its AS number (200), and the type of BGP connection to the router (external). The third line displays the BGP version used between Vail and Taos, and Taos' router ID. The fourth line begins by showing the state of the BGP finite state machine. The table version is incremented whenever the BGP routing table changes; in Example 3-2, no changes have taken place since the connection to Taos was established, so the table version is still 1. Uptime shows the time since the present peer connection was established. In Example 3-2, Taos has been peered continuously for 19 hours, 32 minutes, and 2 seconds.

Also of interest are the details of the underlying TCP connection. Example 3-2 highlights these lines. The lines show that the TCP connection state is Established, that Vail is originating BGP messages from TCP port 11025, and that the destination port at Taos is 179. The source port can be especially important when you are capturing packets on a link carrying more than one BGP session.

In Figure 3-2, another router is added to AS 100. Because they are in the same AS, Vail and Aspen are internal neighbors.

Figure 3-2 IBGP Is Spoken Between Vail and Aspen

AS 100 Aspen

Vail

Vail

92.168.1.222/30

192.168.1.221/30

92.168.1.222/30

192.168.1.226/30

192.168.1.226/30

Example 3-3 shows the configuration for Vail.

Example 3-3 Configuration for Vail Router in Figure 3-2

router bgp 100 neighbor 192.168.1.222 remote-as 100 neighbor 192.168.1.225 remote-as 200

Example 3-4 shows Aspen being configured. BGP debugging is used to observe the peer session being created. The figure shows that the time from the creation of the BGP configuration (18:24:13) to the beginning of the BGP peer negotiation (18:24:33) is 20 seconds; the TCP connection is established during this interval. BGP then transitions from Idle to Active, and the entire negotiation lasts approximately 10 seconds.

Example * 4 The debug ip bgp events Command Displays the States of the BGP Finite State Machine as Aspen Peers with Vail

Aspen#«tefeu§ ip Hp events

BGP events debugging is on Aspen#conf t

Enter configuration commands, one per line. End with CNTL/Z. A&pen(conf ig}#roi§ter bgp 10«

Aspen(config-router)Neighbor 192.168.1*221 remote-as 100

Aspen(config- router)#AZ Aspen#

18:24:13: %SYS-5-C0NFIG_I: Configured from console by console Aspen#

18:24:33: BGP: 192.168.1.221 went from Idle to Active

18:24:41: BGP: 192.168.1.221 went from Active to OpenSent

18:24:42: BGP: 192.168.1.221 went from OpenSent to OpenConfirm

18:24:42: BGP: 192.168.1.221 went from OpenConfirm to Established

18:24:43: BGP: 192.168.1.221 computing updates, neighbor version 0, table version n 1, starting at 0.0.0.0

18:24:43: BGP: 192.168.1.221 update run completed, ran for 0ms, neighbor version 0, start version 1, throttled to 1, check point net 0.0.0.0 Aspen#

Example 3-5 shows a portion of Aspen's neighbor information.

Example 3-5 Aspen's Neighbor Information Shows That Vail's Router ID Is from One of Its Physical Interfaces

Aspen#show ip bgp neighbors

BGP neighbor is 192.168.1.221, remote AS 100, internal link Index 1, Offset 0, Mask 0x2 SGP version 4, remote router ID 192.168.1.226 BGP state = Established, table version = 1, up for 00:03:46 Last read 00:00:46, hold time is 180, keepalive interval is 60 seconds Minimum time between advertisement runs is 5 seconds Received 6 messages, 0 notifications, 0 in queue Sent 6 messages, 0 notifications, 0 in queue Prefix advertised 0, suppressed 0, withdrawn 0 Connections established 1; dropped 0 Last reset never

0 accepted prefixes consume 0 bytes 0 history paths consume 0 bytes Connection state is ESTAB, 1/0 status: 1, unread input bytes: 0 Local host: 192.168.1.222, Local port: 179 Foreign host: 192.168.1.221, Foreign port: 11000

Notice that Vail's router ID is 192.168.1.226, the address of its interface to Taos. The rule for selecting a BGP router ID are identical to the rules for selecting an OSPF router ID:

• The router chooses the numerically highest IP address on any of its loopback interfaces.

• If no loopback interfaces are configured with IP addresses, the router chooses the numerically highest IP address on any of its physical interfaces. The interface from which the router ID is taken does not have to be running BGP.

Because Vail does not have a loopback interface configured, the router chose the numerically highest IP address on a physical interface. Using addresses associated with loopback interfaces has two advantages:

• The loopback interface is more stable than any physical interface. It is active when the router boots up, and it fails only if the entire router fails.

• The network administrator has more leeway in assigning predictable or recognizable addresses as the router IDs.

Cisco's BGP continues to use a router ID learned from a physical interface, even if the interface subsequently fails or is deleted. Therefore, the stability of a loopback interface is only a minor advantage. The primary benefit is the capability to control the router ID, making it easily distinguishable from other IP addresses.

Example 3-6 shows how to configure Vail with a unique router ID.

Example 3-6 Configuring Vail with a Unique Router ID

interface loopback 0

ip address 192.168.255.

i

.254 255.255.255.255

router bgp 100

neighbor 192.168.1.222

remote-as 100

neighbor 192.168.1.225

remote-as 200

Just configuring a loopback address on a working BGP router does not change the router ID, however. The command clear ip bgp (discussed in more detail in the section "Configuring Routing Policies") must be issued at Vail to clear all of its BGP sessions. A second look at Aspen's neighbor information in Example 3-7 shows that Vail's router ID is now its loopback 0 address.

Another point of interest in Example 3-7, when compared to Example 3-5, is the table version. After Vail's session is reset, the table version is incremented to 2. The change also is reflected in the Connections established; dropped field. These fields should not change often; if they do, it might indicate an unstable neighbor.

Example , j / \/(ljj \s Router ID, After a Loopback Address Is Configured and Its BGP Sessions Are Reset, Is Its I a Ktpback Address

Aspen#show ip bgp neighbors

BGP neighbor is 192.168.1.221, remote AS 100, internal link Index 1, Offset 0, Mask 0x2

BGP version 4, remote router ID 192.168.255.254 BGP state = Established, table version = 2, up for 00:00:42 Last read 00:00:42, hold time is 180, keepalive interval is 60 seconds Minimum time between advertisement runs is 5 seconds Received 37 messages, 0 notifications, 0 in queue Sent 37 messages, 0 notifications, 0 in queue Prefix advertised 0, suppressed 0, withdrawn 0 Connections established 2; dropped 1 Last reset 00:00:51, due to Peer closed the session 0 accepted prefixes consume 0 bytes 0 history paths consume 0 bytes Connection state is ESTAB, I/O status: 1, unread input bytes: 0 Local host: 192.168.1.222, Local port: 179 Foreign host: 192.168.1.221, Foreign port: 11003

You also can set the router ID of a BGP speaker manually, overriding both the physical and loopback interface addresses. The command for doing so is bgp router-id. For example, the configuration in Example 3-8 sets the BGP router ID of Vail to 1.1.3.2.

Example , ;j-8 Setting the BGP Router ID Manually

interface loopback 0

ip address 192.168.255, i

.254 255.255.255.255

router bgp 100

bgp router-id 1.1.3.2

neighbor 192.168.1.222

remote-as 100

neighbor 192.168.1.225

remote-as 200

The bgp router-id command can prove useful in situations where loopback interfaces are needed for other reasons, such as OSPF router IDs or SNMP functions, but the IP addresses on the interfaces differ from what you desire for the BGP router ID.

Continue reading here: Cnse Study Injecting IGP Routes into BGP

Was this article helpful?

0 0