Simple BGP Configurations

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

BGP Configuration Lab Guide

Step 1: Configure the router's AS number and router ID.

Enter the following commands in global configuration mode:

router bgp <as-number>


bgp router-id <router-id>

The AS number is a unique identifier for your autonomous system. The router ID is used
to identify your router to other BGP routers.

Step 2: Configure the BGP neighbor.

Enter the following command in global configuration mode:

neighbor <neighbor-ip-address> remote-as <neighbor-as-number>

The neighbor IP address is the IP address of the other BGP router that you want to
establish a neighbor relationship with. The neighbor AS number is the AS number of the
other BGP router.

Step 3: Configure the networks that you want to advertise.

Enter the following command in BGP configuration mode:

network <network-address> mask <network-mask>

The network address and network mask are the IP address and network mask of the
network that you want to advertise.

Step 4: Verify the BGP configuration.

Enter the following commands in global configuration mode:

show ip bgp summary


show ip bgp neighbors

The show ip bgp summary command will show you a summary of your BGP
configuration, including the AS number, router ID, and networks that you are
advertising. The show ip bgp neighbors command will show you a list of your BGP
neighbors and the status of each neighbor relationship.
Example:

The following is an example of a simple BGP configuration for two routers:

Router 1:

router bgp 1
bgp router-id x.x.y.y
network 172.x.y.0 mask 255.255.255.0
network 173.x.y.0 mask 255.255.255.0
neighbor 10.x.x.0 remote-as 2

Router 2:

router bgp 2
bgp router-id x.x.y
network 172.x.y.0 mask 255.255.255.0
network 173.x.y mask 255.255.255.0
neighbor 10.x.x.0 remote-as 1
neighbor 10.x.x.4 remote-as 3

Router 3:

router bgp 3
bgp router-id x.x.y.y
network 172.x.x.x.x mask 255.255.255.0
network 173.x.y.0 mask 255.255.255.0
neighbor 10.x.x.8 remote-as 2
neighbor 10.x.x.4 remote-as 4
Router 4:

router bgp 4
bgp router-id x.x.y.y
network 172.x.y.0 mask 255.255.255.0
network 173.x.y.x.x mask 255.255.255.0
neighbor 10.x.x.8 remote-as 3

To verify the BGP configuration, you can use the following commands:

Router 1:

show ip bgp summary


show ip bgp neighbors

Router 2:

show ip bgp summary


show ip bgp neighbors

The output of the show ip bgp summary command should look something like this:
BGP router identifier 192.168.1.1, local AS number 1
Neighbor V AS MsgRcvd MsgSent Discarded
192.168.2.1 4 2 1102 1101 0

The output of the show ip bgp neighbors command should look something like this:

BGP neighbor is 192.168.2.1, remote AS 2


BGP neighbor state is Established, hold time is 180 seconds
BGP connection is formed under loopback1
BGP version is 4, remote router ID is 192.168.2.1
BGP local AS is 1, BGP remote AS is 2
BGP negotiation done
BGP session uptime is 0 hours, 4 minutes, 44 seconds
BGP input messages: updates 1102, withdraws 0, keepalives 0
BGP output messages: updates 1101, withdraws 0, keepalives 0
BGP RIB entries: 1

If you see this output, then your BGP configuration is correct. You should now be able
to exchange routes with the other router.

You might also like