Home‎ > ‎Routing Theory‎ > ‎BGPv4‎ > ‎

Basic BGP Routing

Lab #1: Basic BGP Routing

In this lab we will be looking at the most basic BGP setup, showing BGP sending routing information between routers.

Table of Contents

  1. Lab Goals
  2. Network Layout
  3. Lab Procedures
  4. Solutions
    1. Clear Previous Configs
    2. Configure Local Interfaces
    3. Configure Loopback Interfaces
    4. Configure BGP
  5. Final Router Configs

1. Lab Goals

In this lab, you will want to do the following:

  • configure the interfaces with the ip's that match the diagram
  • configure bgp on all three routers, using the AS's noted in the diagrem
  • configure bgp such that all bgp routes are sent between routers

2. Network Layout

In this lab we will be working with three routers. The routers will need to have two local /24 networks, as well as the /30 networks linking the routers together.

The eaisest way to configure the router with the two local /24 networks is by creating loopback interfaces for each of the networks. This allows the /24's to be directly connected to the router, and prevents you from having to rely on a router with two extra interfaces.

For the /30 interconnect networks, I suggest using fast Ethernet subinterface's, thus allowing you to only use one interface per router.

The routers should be configured as such:

  • Router A
    • int fa0/1.10
    • int loopback0
    • int loopback1
    • BGP AS10
  • Router B
    • int fa0/1.10
    • int fa0/1.30
    • int loopback0
    • int loopback1
    • BGP AS20
  • Router C
    • int fa0/1.30
    • int loopback0
    • int loopback1
    • BGP AS30

3. Lab Procedures

These are the following procedures you should complete to finish this lab.

  1. Clear any configurations that might be currently on the routers.
  2. First configure the routers interfaces and make sure that the routers can ping their peers local interfaces, but not their peers remote interfaces. The local interfaces should use the /30 networks.
    • Q2.1 How do you configure the local interfaces?
    • Q2.2 How do you configure interfaces with /30 networks
  3. Create loopback with /24 networks. Make sure that you can ping each routers local loopback networks, but not remote loopback networks.
    • Q3.2 How do you create loopback networks?
  4. Configure BGP on all three routers and advertise all loopback networks to BGP. The interface networks should only be advertised by the Stub routers (Router A and Router C). View the BGP routing tables to ensure that all routers can see all the other networks and AS's. Make sure that you can ping all the networks on all the routers.
    • Q4.1 How do you configure BGP on your router?
    • Q4.2 How do you advertise networks in BGP?
    • Q4.3 What command should you use to all the routes in the BGP route table?
    • Q4.4 What command would you use to clear all the routes in the BGP routing table?

4. Solutions

These are the following configs and tests you should do to solve this lab.

4.1 Clear Previous Configs

There are two ways to clear the config on your router. The first method is from the exec prompt, and the second is from the rmon(?) prompt.

Clearing the router configs from the exec prompt
erase startup-config

Clearing the router configs from the rmon(?) prompt
o/r 0x2142

4.2 Configure Local Interfaces

These basic steps create local subinterfaces on a single fast ethernet interface. The routers should be connected to a switch that can handle VLANing. This is how I like running a test network, if you configure the interfaces differently, it will not change anything (as long as you can ping everything).

Router A config (adding local interfaces)
4c01  conf t
4c02 hostname routerA
4c02 int fa0/1.10
4c03 ip address
4c04 encap dot1q 10
4c05 no shut
4c06 exit
4c07 exit

Router B config (adding local interfaces)
4d01  conf t
4d02 hostname routerB
4d02 int fa0/1.10
4d03 ip address
4d04 encap dot1q 10
4d05 no shut
4d06 exit
4d07 int fa0/1.30
4d08 ip address
4d09 encap dot1q 30
4d10 no shut
4d11 exit
4d12 exit

Router C config (adding local interfaces)
4e01  conf t
4e02 hostname routerC
4e02 int fa0/1.30
4e03 ip address
4e04 encap dot1q 30
4e05 no shut
4e06 exit
4e07 exit

Note that you should only be able to ping local interfaces to the router. There should not be any other routing protocols available.

Example of pinging (with only connected routes) from Router A
show ip route

4.3 Configure Loopback Interfaces

Creating loopback interfaces allows us to hang many netwroks directly off the router for the purposes of this experiment. You will need to know how to create loopbacks for other situations with BGP, so this is a great way to introduce this concept.

Router A config (adding loopback networks)
4g01  conf t
4g01 int loopback 0
4g01 ip address
4g01 exit
4g01 int loopback 1
4g01 ip address
4g01 exit
4g01 exit

Router B config (adding loopback networks)
4h01  conf t
4h01 int loopback 0
4h01 ip address
4h01 exit
4h01 int loopback 1
4h01 ip address
4h01 exit
4h01 exit

Router C config (adding loopback networks)
4i01  conf t
4i01 int loopback 0
4i01 ip address
4i01 exit
4i01 int loopback 1
4i01 ip address
4i01 exit
4i01 exit

And now to test connectivity, from router A, ping the two local loopback networks.

Testing loopback networks
sh ip route

4.4 Configure BGP

To configure BGP, we will need to enable the BGP route process, give it an AS number, define it's BGP neighors, and specify what networks to advertise.

Router A config (config bgp)
4k01  conf t
4k02 router bgp 10
4k03 network mask
4k04 network
4k05 network
4k06 neighbor remote-as 20
4k07 exit
4k08 exit

Router B config (config bgp)
4l01  conf t
4l02 router bgp 20
4l03 network
4l04 network
4l05 neighbor remote-as 10
4l06 neighbor remote-as 30
4l07 exit
4l08 exit

Router C config (config bgp)
4m01  conf t
4m02 router bgp 30
4m03 network mask
4m04 network
4m05 network
4m06 neighbor remote-as 20
4m07 exit
4m08 exit

And now to test BGP and make sure that you can recieve all the routes, we can do the following from Router A.

Testing BGP from Router A
sh ip route
clear ip bgp
sh ip bgp

5. Final Router Configs

When it's all said and done, these are the basic configs for each of the routers.

Router A's complete config
5a02 hostname routerA
5a03 !
5a04 int loopback 0
5a05 ip address
5a06 int loopback 1
5a07 ip address
5a08 !
5a09 int fa0/1.10
5a10 ip address
5a11 encap dot1q 10
5a12 no shut
5a13 !
5a14 router bgp 10
5a15 network mask
5a16 network
5a17 network
5a18 neighbor remote-as 20

Router B's complete config
5b02 hostname routerB
5b03 !
5b04 int loopback 0
5b05 ip address
5b06 int loopback 1
5b07 ip address
5b08 !
5b09 int fa0/1.10
5b10 ip address
5b11 encap dot1q 10
5b12 no shut
5b13 int fa0/1.30
5b14 ip address
5b15 encap dot1q 30
5b16 no shut
5b17 !
5b18 router bgp 20
5b19 network
5b20 network
5b21 neighbor remote-as 10
5b22 neighbor remote-as 30

Router C's complete config
5c01  hostname routerC
5c02 !
5c03 int loopback 0
5c04 ip address
5c05 int loopback 1
5c06 ip address
5c07 !
5c08 int fa0/1.30
5c09 ip address
5c10 encap dot1q 30
5c11 no shut
5c12 !
5c13 router bgp 30
5c14 network mask
5c15 network
5c16 network
5c17 neighbor remote-as 20