BGP and Static Routes

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

In this scenario, you use static routes to load balance BGP over a dual-path connection between two routers.

BGP chooses only one path to a remote network. To achieve any form of load balancing of two or more network paths, you can use static routes to the remote peer address.

Figure 6-3 displays a simple two-router BGP topology.

Figure 6-3. BGP Topology

Enable BGP on R1 and configure the network command to advertise the Ethernet IP network 131.108.1.0/24. Because you are running EBGP, synchronization is not an issue in this network. Also, to achieve load balancing, you need to peer the BGP neighbors using the Ethernet IP addresses. In the case of R1, the next hop peer address is 161.108.1.1/24, and in the case of R2, the peer address is

131.108.1.1/24.

With BGP, if the next hop address in EBGP is not used, such as in this scenario in which you want to achieve load balancing, you must enable EBGP multihop so that the EBGP peer is established. The IOS command to enable EBGP multihop is

neighbor peer address ebgp-multihop. Also, because the next hop address is not a directly connected address, BGP needs to advertise the update source IP address to EBGP. In the case of R1, it is 131.108.1.1 (Ethernet 0/0), and in the case of R2, it is 161.108.1.0/24 (Ethernet 0/0).

Example 6-36 displays the EBGP configuration (with multihop) on R1.

Example 6-36 EBGP Configuration on R1

R1(config)#router bgp 1

R1(config-router)#network 131.108.1.0 mask 255.255.255.0 R1(config-router)#neighbor 161.108.1.1 remote-as 2

R1(config-router)#neighbor 161.108.1.1 ebgp-multihop

R1(config-router)#neighbor 161.108.1.1 update-source Ethernet0/0

Example 6-37 displays the EBGP configuration on R2.

Example 6-37 EBGP Configuration on R2

R2(config)#router bgp 2

R2(config-router)#network 161.108.1.0 mask 255.255.255.0 R2(config-router)#neighbor 131.108.1.1 remote-as 1

R2(config-router)#neighbor 131.108.1.1 ebgp-multihop

R2(config-router)#neighbor 131.108.1.1 update-source Ethernet0/0

Now that R1 and R2 are configured with EBGP, ensure that BGP peer sessions are up with the show ip bgp neighbor command. Example 6-38 displays the peers on R1.

Example 6-38 show ip bgp neighbors on R1

R1#show ip bgp neighbors

BGP neighbor is 161.108.1.1, remote AS 2, external link Index 1, Offset 0, Mask 0x2

BGP version 4, remote router ID 0.0.0.0 BGP state = Active, table version = 0

Last read 00:03:37, hold time is 180, keepalive interval is 60 seconds

Minimum time between advertisement runs is 30 seconds Received 0 messages, 0 notifications, 0 in queue Sent 0 messages, 0 notifications, 0 in queue Prefix advertised 0, suppressed 0, withdrawn 0 Connections established 0; dropped 0

Last reset never

0 accepted prefixes consume 0 bytes 0 history paths consume 0 bytes

External BGP neighbor may be up to 255 hops away.

No active TCP connection

R1 has no peer relationship to R2. To discover why, display the IP ro uting table on R1. Example 6-39 displays R1's IP routing table.

Example 6-39 show ip route on R1

R1#show ip route

131.108.0.0/16 is variably subnetted, 2 subnets, 2 masks C 131.108.255.0/30 is directly connected, Serial0/0 C 131.108.255.4/30 is directly connected, Serial0/1 C 131.108.1.0/24 is directly connected, Ethernet0/0

R1 does not have any entries for the remote network 161.108.1.0/24 and thereby cannot establish a TCP session to R2. Configure two static routes on R1 pointing to the remote network through Serial 0/0 and Serial 0/1.

Example 6-40 displays the IP static route configuration on R1.

Example 6-40 Static Route Configuration on R1

R1(config)#ip route 161.108.1.0 255.255.255.0 serial 0/0 R1(config)#ip route 161.108.1.0 255.255.255.0 serial 0/1

To ensure that R2 can route to the remote network 131.108.1.0, install two static routes pointing to R1 over Serial 1/0 and Serial 1/1. Example 6-41 displays the IP static route configuration on R2.

Example 6-41 Static Route Configuration on R2

R2(config)#ip route 131.108.1.0 255.255.255.0 serial 1/0 R2(config)#ip route 131.108.1.0 255.255.255.0 serial 1/1

The BGP peers on R1 display the established peer to R1. Example 6-42 shows a truncated display of the peer with R2.

Example 6-42 show ip bgp neighbors on R1

R1#show ip bgp neighbors

BGP neighbor is 161.108.1.1, remote AS 2, external link Index 1, Offset 0, Mask 0x2

BGP version 4, remote router ID 161.108.1.1

BGP state = Established, table version = 3, up for 00:03:51 Last read 00:00:51, hold time is 180, keepalive interval is 60 seconds

Minimum time between advertisement runs is 30 seconds Received 7 messages, 0 notifications, 0 in queue Sent 7 messages, 0 notifications, 0 in queue Prefix advertised 1, suppressed 0, withdrawn 0 Connections established 1; dropped 0

Last reset 00:04:21, due to User reset 1 accepted prefixes consume 32 bytes 0 history paths consume 0 bytes

External BGP neighbor may be up to 255 hops away.

..[truncated display]

Ensure that load balancing is taking place by pinging the remote network 161.108.1.1/24 from R1. Turn on debug ip packet, so you can see on which outbound interface the ping request is sent. Example 6-43 shows the ping request after the debug ip packet command is enabled. This command enables you to view where IP packets are sent to and received from.

Example 6-43 Debug Output on R1

R1#debug ip packet

IP packet debugging is on R1#ping 161.108.1.1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 161.108.1.1, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 16/17/20 ms 00:09:27: IP: s=131.108.255.1 (local), d=161.108.1.1 (Serial0/0), len 100,

sending

00:09:27: IP: s=161.108.1.1 (Serial0/0), d=131.108.255.1 (Serial0/0), len 100,

rcvd 3

00:09:27: IP: s=131.108.255.5 (local), d=161.108.1.1 (Serial0/1), len 100,

sending

00:09:27: IP: s=161.108.1.1 (Serial0/1), d=131.108.255.5 (Serial0/1), len 100,

rcvd 3

00:09:27: IP: s=131.108.255.1 (local), d=161.108.1.1 (Serial0/0), len 100,

sending

00:09:27: IP: s=161.108.1.1 (Serial0/0), d=131.108.255.1 (Serial0/0), len 100,

rcvd 3

00:09:27: IP: s=131.108.255.5 (local), d=161.108.1.1 (Serial0/1), len 100,

sending

00:09:27: IP: s=161.108.1.1 (Serial0/1), d=131.108.255.5 (Serial0/1), len 100,

rcvd 3

00:09:27: IP: s=131.108.255.1 (local), d=161.108.1.1 (Serial0/0), len 100,

sending

00:09:27: IP: s=161.108.1.1 (Serial0/0), d=131.108.255.1 (Serial0/0), len 100,

rcvd 3

You can see from Example 6-43 that the first ping request is sent through Serial 0/0 and the reply is received through Serial 0/0. The second ping request is sent through Serial 0/1, and the reply is received through Serial 0/1; therefore, load balancing is occurring. It is important to note that BGP still only sends packets through one path, but because IP at Layer 3 is load balancing, in effect you are load balancing BGP by using static routes.

Example 6-44 displays the full working configuration of R1. Take note of the shaded sections, which contain the critical commands used to achieve load balancing

between R1 and R2.

Example 6-44 R1's Full Working Configuration

hostname R1

enable password cisco

!

ip subnet-zero no ip domain-lookup

!

interface Ethernet0/0

ip address 131.108.1.1 255.255.255.0 no ip directed-broadcast

!

interface Serial0/0

ip address 131.108.255.1 255.255.255.252 clockrate 125000

!

interface Serial0/1

ip address 131.108.255.5 255.255.255.252 clockrate 125000

!

router bgp 1

network 131.108.1.0 mask 255.255.255.0 neighbor 161.108.1.1 remote-as 2

neighbor 161.108.1.1 ebgp-multihop 255

neighbor 161.108.1.1 update-source Ethernet0/0

!

ip route 161.108.1.0 255.255.255.0 Serial0/0 ip route 161.108.1.0 255.255.255.0 Serial0/1

!

line con 0 line aux 0 line vty 0 4 end

Example 6-45 displays R2's full working configuration.

Example 6-45 R2's Full Working Configuration

hostname R2

!

enable password cisco

!

ip subnet-zero no ip domain-lookup

!

interface Ethernet0/0

ip address 161.108.1.1 255.255.255.0

!

interface Serial1/0

ip address 131.108.255.2 255.255.255.252 interface Serial1/1

ip address 131.108.255.6 255.255.255.252

!

router bgp 2

network 161.108.1.0 mask 255.255.255.0 neighbor 131.108.1.1 remote-as 1

neighbor 131.108.1.1 ebgp-multihop 255

neighbor 131.108.1.1 update-source Ethernet0/0

!

ip route 131.108.1.0 255.255.255.0 Serial1/0 ip route 131.108.1.0 255.255.255.0 Serial1/1

!

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 264 - 269)

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

(498 trang)