5.7. Configuring BGP

Overview

Function Introduction

The Border Gateway Protocol (BGP) is an inter-Autonomous System routing protocol.

The primary function of a BGP speaking system is to exchange network reachability information with other BGP systems. This network reachability information includes information on the list of Autonomous Systems (ASes) that reachability information traverses. This information is sufficient for constructing a graph of AS connectivity for this reachability, from which routing loops may be pruned and, at the AS level, some policy decisions may be enforced.

BGP-4 provides a set of mechanisms for supporting Classless Inter-Domain Routing (CIDR) [RFC1518, RFC1519]. These mechanisms include support for advertising a set of destinations as an IP prefix and eliminating the concept of network “class” within BGP. BGP-4 also introduces mechanisms that allow aggregation of routes, including aggregation of AS paths.

Routing information exchanged via BGP supports only the destination-based forwarding paradigm, which assumes that a router forwards a packet based solely on the destination address carried in the IP header of the packet. This, in turn, reflects the set of policy decisions that can (and cannot) be enforced using BGP. BGP can support only those policies conforming to the destination-based forwarding paradigm.

Principle Description

For more BGP information please reference [RFC 1771, RFC 4271].

Configuration

Configure EBGP

image

Fig. 5.19 EBGP

step 1 Enter the configure mode

Switch# configure terminal

step 2 Enter the interface configure mode and set the attributes

Switch1:

Switch(config)# interface eth-0-13
Switch(config-if)# no shutdown
Switch(config-if)# no switchport
Switch(config-if)# ip address 1.1.1.1/24
Switch(config-if)# exit
Switch(config)# interface eth-0-1
Switch(config-if)# no shutdown
Switch(config-if)# no switchport
Switch(config-if)# ip address 2.2.2.1/24
Switch(config-if)# exit

Switch2:

Switch(config)# interface eth-0-13
Switch(config-if)# no shutdown
Switch(config-if)# no switchport
Switch(config-if)# ip address 1.1.1.2/24
Switch(config-if)# exit

step 3 Configure a static route

Switch1:

Switch(config)# ip route 3.3.3.0/24 2.2.2.2

step 4 Configure the Routing process and set the router id, set the neighbor, associate the network, and set the redistribute attributes

Switch1:

Switch(config)# router bgp 100
Switch(config-router)# bgp router-id 10.10.10.10
Switch(config-router)# neighbor 1.1.1.2 remote-as 200
Switch(config-router)# neighbor 1.1.1.2 ebgp-multihop
Switch(config-router)# network 4.0.0.0/8
Switch(config-router)# redistribute static
Switch(config-router)# redistribute connected
Switch(config-router)# exit

Switch2:

Switch(config)# router bgp 200
Switch(config-router)# bgp router-id 11.11.11.11
Switch(config-router)# neighbor 1.1.1.1 remote-as 100
Switch(config-router)# neighbor 1.1.1.1 ebgp-multihop
Switch(config-router)# redistribute connected
Switch(config-router)# exit

step 5 Exit the configure mode

Switch(config)# end

step 6 Validation

Switch1:

Switch# show ip bgp neighbors
BGP neighbor is 1.1.1.2, remote AS 200, local AS 100, external link
BGP version 4, remote router ID 0.0.0.0
BGP state = Active
Last read 00:26:00, hold time is 180, keepalive interval is 60 seconds
Received 0 messages, 0 notifications, 0 in queue
Sent 0 messages, 0 notifications, 0 in queue
Route refresh request: received 0, sent 0
Minimum time between advertisement runs is 30 seconds
For address family: IPv4 Unicast
BGP table version 1, neighbor version 0
Index 1, Offset 0, Mask 0x2
0 accepted prefixes
0 announced prefixes
Connections established 0; dropped 0
External BGP neighbor may be up to 255 hops away.
Next connect timer due in 87 seconds

Switch2:

SwitchB# show ip bgp neighbors
BGP neighbor is 1.1.1.1, remote AS 100, local AS 200, external link
BGP version 4, remote router ID 0.0.0.0
BGP state = Active
Last read 00:21:39, hold time is 180, keepalive interval is 60 seconds
Received 0 messages, 0 notifications, 0 in queue
Sent 0 messages, 0 notifications, 0 in queue
Route refresh request: received 0, sent 0
Minimum time between advertisement runs is 30 seconds
For address family: IPv4 Unicast
BGP table version 1, neighbor version 0
Index 1, Offset 0, Mask 0x2
0 accepted prefixes
0 announced prefixes
Connections established 0; dropped 0
External BGP neighbor may be up to 255 hops away.
Next connect timer due in 97 seconds

Configure IBGP

image

Fig. 5.20 IBGP

step 1 Enter the configure mode

Switch# configure terminal

step 2 Enter the interface configure mode and set the attributes

Switch1:

Switch(config)# interface eth-0-1
Switch(config-if)# no shutdown
Switch(config-if)# no switchport
Switch(config-if)# ip address 2.2.2.1/24
Switch(config-if)# exit
Switch(config)# interface eth-0-13
Switch(config-if)# no shutdown
Switch(config-if)# no switchport
Switch(config-if)# ip address 1.1.1.1/24
Switch(config-if)# exit
Switch(config)# interface loopback 0
Switch(config-if)# ip address 10.10.10.10/32
Switch(config-if)# exit

Switch2:

Switch(config)# interface eth-0-13
Switch(config-if)# no shutdown
Switch(config-if)# no switchport
Switch(config-if)# ip address 1.1.1.2/24
Switch(config-if)# exit
Switch(config)# interface loopback 0
Switch(config-if)# ip address 11.11.11.11/32
Switch(config-if)# exit

step 3 Configure a static route

Switch1:

Switch(config)# ip route 11.11.11.11/32 1.1.1.2

Switch2:

Switch(config)# ip route 10.10.10.10/32 1.1.1.1

step 4 Configure the Routing process and set the router id, set the neighbor, associate the network, and set the redistribute attributes

Switch1:

Switch(config)# router bgp 100
Switch(config-router)# bgp router-id 10.10.10.10
Switch(config-router)# neighbor 11.11.11.11 remote-as 100
Switch(config-router)# neighbor 11.11.11.11 update-source loopback 0
Switch(config-router)# network 4.0.0.0/8
Switch(config-router)# redistribute static
Switch(config-router)# redistribute connected
Switch(config-router)# exit

Switch2:

Switch(config)# router bgp 100
Switch(config-router)# bgp router-id 11.11.11.11
Switch(config-router)# neighbor 10.10.10.10 remote-as 100
Switch(config-router)# neighbor 10.10.10.10 update-source loopback 0
Switch(config-router)# redistribute connected
Switch(config-router)# exit

step 5 Exit the configure mode

Switch(config)# end

step 6 Validation

Switch1:

Switch# show ip bgp neighbors
BGP neighbor is 11.11.11.11, remote AS 100, local AS 100, internal link

BGP version 4, remote router ID 0.0.0.0
BGP state = Active
Last read 00:02:32, hold time is 180, keepalive interval is 60 seconds
Received 0 messages, 0 notifications, 0 in queue
Sent 0 messages, 0 notifications, 0 in queue
Route refresh request: received 0, sent 0
Minimum time between advertisement runs is 5 seconds
Update source is loopback0
For address family: IPv4 Unicast
BGP table version 1, neighbor version 0
Index 1, Offset 0, Mask 0x2
0 accepted prefixes
0 announced prefixes
Connections established 0; dropped 0
Next connect timer due in 62 seconds

Switch2:

Switch# show ip bgp neighbors
BGP neighbor is 10.10.10.10, remote AS 100, local AS 100, internal link
BGP version 4, remote router ID 0.0.0.0
BGP state = Active
Last read 00:01:58, hold time is 180, keepalive interval is 60 seconds
Received 0 messages, 0 notifications, 0 in queue
Sent 0 messages, 0 notifications, 0 in queue
Route refresh request: received 0, sent 0
Minimum time between advertisement runs is 5 seconds
Update source is loopback0
For address family: IPv4 Unicast
BGP table version 1, neighbor version 0
Index 1, Offset 0, Mask 0x2
0 accepted prefixes
0 announced prefixes
Connections established 0; dropped 0
Next connect timer due in 17 seconds

Application cases

N/A