Configuring Advanced BGP Route Reflectors

Một phần của tài liệu CCNP practical studies routing (Trang 308 - 320)

Figure 7-4 displays a typical dual-homed BGP network and expands upon the network in Scenario 7-1. OSPF is the interior routing protocol used on routers R1 – R5, and each router is assigned a loopback address of the form 131.108.254.1 for R1, 131.108.254.2 for R2, 131.108.253.3 for R3, 131.108.254.4 for R4, and 131.108.254.5 for R5.

Figure 7-4. Scenario 7-2 Physical Topology

Ensure that as long as there is IP connectivity, the IBGP sessions are established to R1 and R2.

The two routers, R1 and R2, have one connection to the Internet through Serial 1/0.

Figure 7-4 displays the physical topology.

Assume the Routers R1–R5 are part of a large company and route reflectors are configured on R1 and R2 for redundancy purposes.

Figure 7-5 displays the IBGP and EBGP connections logically.

Figure 7-5. BGP Logical Connections

The primary path for the edge routers R3, R4, and R5 is through R1; if R1 fails, the primary path is through R2. Hence, R1 and R2 are both configured as router

reflectors to provide redundancy.

Enable OSPF on the IGP routers by enabling all interfaces in area 0, so you can take advantage of loopbacks for the source and destination address for all IBGP peer sessions.

Example 7-17 configures all IP-enabled interfaces on R1 in area 0.

Example 7-17 R1 OSPF Configuration

R1(config)#router ospf 1

R1(config-router)# network 0.0.0.0 255.255.255.255 area 0

Configure the same two commands on R2–R5 to enable OSPF as the IGP.

Next, configure IBGP on R1 and use the loopback addresses as the next hop

addresses because as long as you have IP connectivity, BGP should remain active. In fact, good IBGP design always uses loopbacks so that one routing failure does not result in loss (TCP fails) of IBGP connectivity.

Example 7-18 configures IBGP on R1 to act as a route reflector to R3, R4, and R5 using the loopback interfaces as the source and peer addresses. OSPF is used as the IGP to ensure IP connectivity among all loopback interfaces.

Example 7-18 IBGP on R1

router bgp 333

network 131.108.1.0 mask 255.255.255.0 neighbor 131.108.254.2 remote-as 333

neighbor 131.108.254.2 update-source Loopback0 neighbor 131.108.254.3 remote-as 333

neighbor 131.108.254.3 update-source Loopback0 neighbor 131.108.254.3 route-reflector-client neighbor 131.108.254.4 remote-as 333

neighbor 131.108.254.4 update-source Loopback0 neighbor 131.108.254.4 route-reflector-client neighbor 131.108.254.5 remote-as 333

neighbor 131.108.254.5 update-source Loopback0 neighbor 131.108.254.5 route-reflector-client

Example 7-18 displays the local advertisement of the network 131.108.1.0 on R1 and displays the enabling of R1 to reflect BGP information to R3, R4, and R5. For redundancy purposes, R1 is configured to peer to R2 but not as a route reflector. R1 is configured to peer to the loopback interfaces to ensure that as long as there is IP connectivity, BGP is established.

Example 7-19 displays the configuration of R2 as a backup route reflector to R3, R4, and R5.

Example 7-19 IBGP on R2

router bgp 333

network 131.108.1.0 mask 255.255.255.0 neighbor 131.108.254.1 remote-as 333

neighbor 131.108.254.1 update-source Loopback0 neighbor 131.108.254.3 remote-as 333

neighbor 131.108.254.3 update-source Loopback0 neighbor 131.108.254.3 route-reflector-client neighbor 131.108.254.4 remote-as 333

neighbor 131.108.254.4 update-source Loopback0 neighbor 131.108.254.4 route-reflector-client neighbor 131.108.254.5 remote-as 333

neighbor 131.108.254.5 update-source Loopback0 neighbor 131.108.254.5 route-reflector-client neighbor 131.108.255.2 remote-as 333

neighbor 131.108.255.2 update-source Loopback0

Example 7-19 displays the local advertisement of the network 131.108.1.0 on R2 and the enabling of R2 to reflect BGP information to R3, R4, and R5. R2 is configured to peer to the loopback interfaces to ensure that as long as there is IP connectivity, IBGP is established.

Next, configure one of the edge routers, R3, for IBGP.

Example 7-20 displays the IBGP configuration on R3 pointing to R1 and R2. Because R3 is locally connected to 131.108.3.0, use the network command to advertise this network to R1 and R2.

Example 7-20 IBGP on R3

router bgp 333

network 131.108.3.0 mask 255.255.255.0 neighbor 131.108.254.1 remote-as 333

neighbor 131.108.254.1 update-source Loopback0 neighbor 131.108.254.2 remote-as 333

neighbor 131.108.254.2 update-source Loopback0

R3 is configured normally for IBGP to R1 and R2. After the BGP peer sessions are established on routers R4 and R5, you can take a look at the BGP tables.

Example 7-21 and Example 7-22 display the IBGP configuration on R4 and R5, respectively.

Example 7-21 IBGP on R4

router bgp 333

network 131.108.4.0 mask 255.255.255.0 neighbor 131.108.254.1 remote-as 333

neighbor 131.108.254.1 update-source Loopback0 neighbor 131.108.254.2 remote-as 333

neighbor 131.108.254.2 update-source Loopback0

Example 7-22 IBGP on R5

router bgp 333

network 131.108.5.0 mask 255.255.255.0 neighbor 131.108.254.1 remote-as 333

neighbor 131.108.254.1 update-source Loopback0 neighbor 131.108.254.2 remote-as 333

neighbor 131.108.254.2 update-source Loopback0

All the routers in Figure 7-5 have IBGP peers configured. Example 7-23 displays the BGP table on the client router R3.

Example 7-23 show ip bgp on R3

R3#show ip bgp

Network Next Hop Metric LocPrf Weight Path

*>i131.108.1.0/24 131.108.254.2 0 100 0 i

* i 131.108.254.1 0 100 0 i

*> 131.108.3.0/24 0.0.0.0 0 32768 i

*>i131.108.4.0/24 131.108.254.4 0 100 0 i

* i 131.108.254.4 0 100 0 i

*>i131.108.5.0/24 131.108.254.5 0 100 0 i

* i 131.108.254.5 0 100 0 i

R3's BGP table has the local network 131.108.3.0/24 (indicated with the next of 0.0.0.0). Also present in the BGP table is the remote network, 131.108.1.0/24, advertised by R1 and R2. R4 advertises 131.108.4.0/24, and R5 advertises

131.108.5.0. To confirm IP connectivity, view the IP routing table on R3. Example 7- 24 displays the IP routing table on R3; remember that you have OSPF configured as the IGP.

Example 7-24 show ip route on R3

R3#show ip route

Codes: C - connected, B - BGP, O - OSPF

131.108.0.0/16 is variably subnetted, 12 subnets, 3 masks O 131.108.255.0/30 [110/1581] via 131.108.255.5, 00:29:59, Serial0

O 131.108.254.1/32 [110/801] via 131.108.255.5, 00:29:59, Serial0 C 131.108.254.3/32 is directly connected, Loopback0

O 131.108.254.2/32 [110/811] via 131.108.255.5, 00:29:59, Serial0 O 131.108.254.5/32 [110/1582] via 131.108.255.5, 00:29:59,

Serial0

C 131.108.255.4/30 is directly connected, Serial0

O 131.108.254.4/32 [110/1582] via 131.108.255.5, 00:29:59, Serial0

O 131.108.255.8/30 [110/1581] via 131.108.255.5, 00:29:59, Serial0

O 131.108.5.0/24 [110/1591] via 131.108.255.5, 00:04:22, Serial0 O 131.108.4.0/24 [110/1591] via 131.108.255.5, 00:04:22, Serial0 C 131.108.3.0/24 is directly connected, Ethernet0

O 131.108.1.0/24 [110/810] via 131.108.255.5, 00:04:10, Serial0 R3's IP routing table displays the remote networks 131.108.4.0/24 and

131.108.5.0/24 discovered by OSPF (indicated by the O on the left side of the IP routing table).

Even though BGP (view the BGP table in Example 7-23) has inserted the remote networks, 131.108.1.0/24, 131.108.4.0/24, and 131.108.5.0/24, as OSPF

discovered routes, you need to disable synchronization on all the IBGP routers so

that BGP entries are inserted into the IP routing table to see whether this solves the problem.

Example 7-25 displays the disabling of synchronization on all five routers.

Example 7-25 Disabling Synchronization on R1–R5

R1(config)#router bgp 333

R1(config-router)#no synchronization R2(config)#router bgp 333

R2(config-router)#no synchronization R3(config)#router bgp 333

R3(config-router)#no synchronization R4(config)#router bgp 333

R4(config-router)#no synchronization R5(config)#router bgp 333

R5(config-router)#no synchronization

After you clear all IBGP sessions on R1 and R2 with the clear ip bgp * command, you can expect to see BGP routing entries in the IP routing table on R3. Example 7- 26 displays the IP routing table on R3.

Example 7-26 show ip route on R3

R3#show ip route

131.108.0.0/16 is variably subnetted, 12 subnets, 3 masks O 131.108.255.0/30 [110/1581] via 131.108.255.5, 01:04:33, Serial0

O 131.108.254.1/32 [110/801] via 131.108.255.5, 01:04:33, Serial0 C 131.108.254.3/32 is directly connected, Loopback0

O 131.108.254.2/32 [110/811] via 131.108.255.5, 01:04:33, Serial0 O 131.108.254.5/32 [110/1582] via 131.108.255.5, 01:04:33,

Serial0

C 131.108.255.4/30 is directly connected, Serial0

O 131.108.254.4/32 [110/1582] via 131.108.255.5, 01:04:33, Serial0

O 131.108.255.8/30 [110/1581] via 131.108.255.5, 01:04:33, Serial0

O 131.108.5.0/24 [110/1591] via 131.108.255.5, 00:21:51, Serial0 O 131.108.4.0/24 [110/1591] via 131.108.255.5, 00:21:53, Serial0 C 131.108.3.0/24 is directly connected, Ethernet0

O 131.108.1.0/24 [110/810] via 131.108.255.5, 00:38:44, Serial0 The reason that OSPF is chosen for the preferred path is that OSPF has a lower administrative distance of 110, compared to 200 for IBGP. Change the default administrative distance on all five routers so that internal BGP is the preferred path in this five-router network.

NOTE

The same scenario can be duplicated using EBGP, in which case, you use the concept of a backdoor to ensure that your IGP is the preferred routing method. For example, if EBGP is configured between two routers and OSPF is the interior routing protocol, EBGP administrative distance is 20, far lower than OSPF (AD is 110). By default, a lower AD is always preferred; therefore, the next hop address is the EBGP

connection. To change this default behavior without the changing AD values, use the network <network subnet-mask> backdoor command. Specifying the network allows the router to choose OSPF as the preferred path rather than the EBGP discovered path.

Changing the administrative distance is not always the most desirable method because all routers typically need modification, as in this scenario.

The IOS command to change the default BGP distance is as follows:

distance bgp external-distance internal-distance local-distance

The external distance is for EBGP routes (default is 20); the internal distance is for IBGP routes (default is 200), and the local distance defines the AD for locally connected routes (default is 200).

Example 7-27 displays the distance configuration on R1 and is configured on all five routers. You use the ? tool to display the options as you enter the values.

Example 7-27 Changing Default Distance

R1(config)#router bgp 333 R1(config-router)#distance ?

<1-255> Administrative distance bgp BGP distance

R1(config-router)#distance bgp ?

<1-255> Distance for routes external to the AS R1(config-router)#distance bgp 20 ?

<1-255> Distance for routes internal to the AS R1(config-router)#distance bgp 20 109 ?

<1-255> Distance for local routes R1(config-router)#distance bgp 20 109 109

The internal distance is set to 109 (less than OSPF 110); the external distance is unchanged at 20, and the local distance is also changed to 109. Example 7-28 displays the IP routing table on R3 after the TCP peers are cleared.

Example 7-28 show ip route on R3

R3#sh ip route

131.108.0.0/16 is variably subnetted, 12 subnets, 3 masks O 131.108.255.0/30 [110/1581] via 131.108.255.5, 01:18:33, Serial0

O 131.108.254.1/32 [110/801] via 131.108.255.5, 01:18:33, Serial0 C 131.108.254.3/32 is directly connected, Loopback0

O 131.108.254.2/32 [110/811] via 131.108.255.5, 01:18:33, Serial0 O 131.108.254.5/32 [110/1582] via 131.108.255.5, 01:18:33,

Serial0

C 131.108.255.4/30 is directly connected, Serial0

O 131.108.254.4/32 [110/1582] via 131.108.255.5, 01:18:33, Serial0

O 131.108.255.8/30 [110/1581] via 131.108.255.5, 01:18:33, Serial0

B 131.108.5.0/24 [109/0] via 131.108.254.5, 00:01:38 B 131.108.4.0/24 [109/0] via 131.108.255.2, 00:01:37 C 131.108.3.0/24 is directly connected, Ethernet0 B 131.108.1.0/24 [109/0] via 131.108.254.1, 00:00:50

R1 now uses BGP with an AD of 109 as the preferred path to the remote networks connected to R1/R2, R4, and R5.

This scenario built a redundant IBGP network. Next, simulate a routing BGP failure to R1 and ensure that R2 becomes the preferred path on all route reflector clients.

Example 7-29 displays the current BGP table on R3.

Example 7-29 show ip bgp on R3

R3#show ip bgp

BGP table version is 84, local router ID is 131.108.254.3

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

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

Network Next Hop Metric LocPrf Weight Path

* i131.108.1.0/24 131.108.254.2 0 100 0 i

*>i 131.108.254.1 0 100 0 i

*> 131.108.3.0/24 0.0.0.0 0 32768 i

*>i131.108.4.0/24 131.108.254.4 0 100 0 i

* i 131.108.254.4 0 100 0 i

*>i131.108.5.0/24 131.108.254.5 0 100 0 i

* i 131.108.254.5 0 100 0 i

The preferred path on R3 to 131.108.1.0/24 is through R1; the peer address is 131.108.254.1 (R1's loopback address). When the TCP peer to R1 fails on R3, the preferred path is through R2 (a route reflector).

Example 7-30 displays the BGP table on R3 after the BGP failure.

Example 7-30 show ip bgp on R3 after R1 Failure

R3#show ip bgp

BGP table version is 86, local router ID is 131.108.254.3

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

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

Network Next Hop Metric LocPrf Weight Path

*>i131.108.1.0/24 131.108.254.2 0 100 0 i

*> 131.108.3.0/24 0.0.0.0 0 32768 i

*>i131.108.4.0/24 131.108.254.4 0 100 0 i

*>i131.108.5.0/24 131.108.254.5 0 100 0 i The path to 131.108.1.0/24 is now through R2.

Before you build upon this scenario and add the EBGP connections to the two different ISP routers, view the full working configurations of R1 –R5.

Example 7-31 displays R1's full working configuration.

Example 7-31 R1's Full Working Configuration

hostname R1

!

enable password cisco

!

ip subnet-zero no ip domain-lookup

!

interface Loopback0

ip address 131.108.254.1 255.255.255.255

!

interface Ethernet0/0

ip address 131.108.1.1 255.255.255.0

!

interface Serial1/0

ip address 131.108.255.5 255.255.255.252 clockrate 128000

!

interface Serial1/1

ip address 131.108.255.1 255.255.255.252

!

interface Serial1/2

ip address 131.108.255.9 255.255.255.252 clockrate 128000

!

interface Serial1/3 shutdown

!

router ospf 1

network 0.0.0.0 255.255.255.255 area 0

!

router bgp 333 no synchronization

network 131.108.1.0 mask 255.255.255.0 neighbor 131.108.254.2 remote-as 333

neighbor 131.108.254.2 update-source Loopback0 neighbor 131.108.254.3 remote-as 333

neighbor 131.108.254.3 update-source Loopback0 neighbor 131.108.254.3 route-reflector-client neighbor 131.108.254.4 remote-as 333

neighbor 131.108.254.4 update-source Loopback0 neighbor 131.108.254.4 route-reflector-client neighbor 131.108.254.5 remote-as 333

neighbor 131.108.254.5 update-source Loopback0 neighbor 131.108.254.5 route-reflector-client distance bgp 20 109 109

!

line con 0 line aux 0 line vty 0 4

end

Example 7-32 displays R2's full working configuration.

Example 7-32 R2's Full Working Configuration

hostname R2

!

enable password cisco

!

ip subnet-zero no ip domain-lookup interface Loopback0

ip address 131.108.254.2 255.255.255.255

!

interface Ethernet0/0

ip address 131.108.1.2 255.255.255.0

!

router ospf 1

network 0.0.0.0 255.255.255.255 area 0

!

router bgp 333 no synchronization

network 131.108.1.0 mask 255.255.255.0 neighbor 131.108.254.1 remote-as 333

neighbor 131.108.254.1 update-source Loopback0 neighbor 131.108.254.3 remote-as 333

neighbor 131.108.254.3 update-source Loopback0 neighbor 131.108.254.3 route-reflector-client neighbor 131.108.254.4 remote-as 333

neighbor 131.108.254.4 update-source Loopback0 neighbor 131.108.254.4 route-reflector-client neighbor 131.108.254.5 remote-as 333

neighbor 131.108.254.5 update-source Loopback0 neighbor 131.108.254.5 route-reflector-client neighbor 131.108.255.2 remote-as 333

neighbor 131.108.255.2 update-source Loopback0 distance bgp 20 109 109

!

line con 0 line aux 0 line vty 0 4

! end

Example 7-33 displays R3's full working configuration.

Example 7-33 R3's Full Working Configuration

hostname R3

!

enable password cisco

!

no ip domain-lookup

!

interface Loopback0

ip address 131.108.254.3 255.255.255.255

!

interface Ethernet0

ip address 131.108.3.1 255.255.255.0

!

interface Serial0

ip address 131.108.255.6 255.255.255.252 bandwidth 125

!

interface Serial1 shutdown

!

router ospf 1

network 0.0.0.0 255.255.255.255 area 0

!

router bgp 333 no synchronization

network 131.108.3.0 mask 255.255.255.0 neighbor 131.108.254.1 remote-as 333

neighbor 131.108.254.1 update-source Loopback0 neighbor 131.108.254.2 remote-as 333

neighbor 131.108.254.2 update-source Loopback0 distance bgp 20 109 109

!

line con 0 line aux 0 line vty 0 4

! end

Examp le 7-34 displays R4's full working configuration.

Example 7-34 R4's Full Working Configuration

hostname R4

!

enable password cisco

!

ip subnet-zero no ip domain-lookup interface Loopback0

ip address 131.108.254.4 255.255.255.255

!

interface Ethernet0

ip address 131.108.4.1 255.255.255.0

!

interface Serial0

ip address 131.108.255.2 255.255.255.252 clockrate 125000

!

interface Serial1 shutdown

!

router ospf 1

network 0.0.0.0 255.255.255.255 area 0

!

router bgp 333 no synchronization

network 131.108.4.0 mask 255.255.255.0 neighbor 131.108.254.1 remote-as 333

neighbor 131.108.254.1 update-source Loopback0 neighbor 131.108.254.2 remote-as 333

neighbor 131.108.254.2 update-source Loopback0 distance bgp 20 109 109

line con 0 line aux 0 line vty 0 4

! end

Example 7-35 displays R5's full working configuration.

Example 7-35 R5's Full Working Configuration

hostname R5

!

enable password cisco

!

ip subnet-zero interface Loopback0

ip address 131.108.254.5 255.255.255.255

!

interface Ethernet0

ip address 131.108.5.1 255.255.255.0

!

interface Serial0

ip address 131.108.255.10 255.255.255.252

!

interface Serial1 shutdown

!

router ospf 1

network 0.0.0.0 255.255.255.255 area 0

!

router bgp 333 no synchronization

network 131.108.5.0 mask 255.255.255.0 neighbor 131.108.254.1 remote-as 333

neighbor 131.108.254.1 update-source Loopback0 neighbor 131.108.254.2 remote-as 333

neighbor 131.108.254.2 update-source Loopback0 distance bgp 20 109 109

line con 0 line aux 0 line vty 0 4

! end

Một phần của tài liệu CCNP practical studies routing (Trang 308 - 320)

Tải bản đầy đủ (PDF)

(498 trang)