How To Configure BGP Step By Step Lab

Border Gateway Protocol (BGP) is a complex routing protocol and the configuration of BGP is really complicated. Before configuring BGP protocol, you should have at least the basic idea of BGP, iBGP, and eBGP. Please refer the following link to learn the basics of BGP protocol.

In this post, we will explain how to configure BGP in GNS3 using a simple network topology. To configure BGP routing protocol, we will use the following network topology.Configure BGP Routing

In the preceding topology, we will configure iBGP (routers within an AS) between R1 and R2 while R2 and R3 need to be configured with eBGP (routers between ASs).

Steps to Configure BGP

To configure BGP, you need to perform the following steps:

  1. First, configure the appropriate IP addresses on all the routers.
  2. On R1, execute the following command to enable the BGP process and specify an Autonomous System Number (ASN). For example, 1000.
R1(config)#router bgp 1000
  1. Next, execute the following command to specify the address of the neighbor router and its ASN.
    R1(config-router)#neighbor 10.10.10.2 remote-as 1000 
    R1(config-router)#exit
  2. The following figure shows the BGP configuration of R1.Configure iBGP Routing
  3. Next, move on to R2 and execute the following commands to enable the BGP process and specify its ASN.
    R2(config)#router bgp 1000
  4. Next, execute the following command to specify the address of neighbor router for iBGP.
    R2(config-router)#neighbor 10.10.10.1 remote-as 1000
  5. Next, execute the following command to specify the neighbor router for eBGP.
    R2(config-router)#neighbor 20.20.20.2 remote-as 2000

    Note: It is recommended to use a loopback interface as an update source for stability purpose. Physical interfaces may shut down or cable may be disconnected. However, the loopback interface remains active regardless the status of cable, connector, and link.

  6. Next, execute the following command to specify the update source interface of  the neighbor router.
    R2(config-router)#neighbor 20.20.20.2 update-source loopback0
    R2(config-router)#exit

    The following figure shows the BGP configuration of R2.Configure iBGP and eBGP Routing

  7. Next, move on to R3 and execute the following command to enable BGP process and specify ASN.
    R3(config)#router bgp 2000
  8. Next, execute the following command to specify the neighbor router and its ASN.
    R3(config-router)#neighbor 1.1.1.1 remote-as 1000
  9. Since we have used the loopback0 interface of R2 as an update source interface, it will put R2 two hops away from R3. However, by default, BGP assumes that external peers are only one hop away. You can change this behavior by enabling the eBGP multihop feature. To specify the custom number of hops manually, execute the following command.
    R3(config-router)#neighbor 1.1.1.1 ebgp-multihop 2 
    R3(config-router)#exit
  10. In order to use a loopback interface as an update source interface, R3 must have a route to R2’s loopback in its routing table. This can be done by adding a static route. To do so, execute the following command.
    R3(config)#ip route 1.1.1.0 255.255.255.0 20.20.20.1
  11. The following figure shows the BGP configuration of R3.Configure BGP Routing on Router3
  12. Once you have successfully configured BGP on all the routers, now it’s time to verify your configuration. To do so, execute the following command on any router and examine the output as shown in the following figure.
R3#show ip bgp neighbors

Verify BGP configuration

Configuring BGP Timers

By default, the Keepalive and Hold Down timer values for BGP protocol are 60 and 180 seconds, respectively. However, you can change it globally for all the neighbor routers as per network requirement.

For example, to set the Keepalive BGP timers value as 10 seconds and Hold Down timer value as 30 seconds, you need to execute the following commands.

R3(config)#router bgp 2000
R3(config-router)#timers bgp 10 30

The following figure shows how to change the BGP timers.

Ho To Configure BGP Timers

In this post, we have learned the basic configuration of BGP routing protocol. Hope, it helped you. Please like and share this post if you think it can help others too. Please also subscribe us to get auto alerts of daily new posts.

Posted in Cisco, GNS3 Tutorials, Routing Tagged with: , ,
One comment on “How To Configure BGP Step By Step Lab
  1. khemici Messikh says:

    very userfull thanks

Leave a Reply

Your email address will not be published. Required fields are marked *

*