Configuring and Verifying EBGP
If you’re configuring BGP between a customer network and an ISP, this process is called external BGP (EBGP). If you’re configuring BGP peers between two routers in the same AS, it’s not considered EBGP.
You must have the basic information to configure EBGP:
AS numbers (your own, and all remote AS numbers, which must be different)
All the neighbors (peers) that are involved in BGP, and IP addressing that is used among the BGP neighbors
Networks that need to be advertised into BGP
For an example of configuring EBGP, here’sExample of EBGP lay layout
There are three main steps to configure basic BGP:
1. Define the BGP process.
2. Establish one or more neighbor relationships.
3. Advertise the local networks into BGP.
Define the BGP Process
To start the BGP process on a router, use the router bgp AS command. Each process must be assigned a local AS number. There can only be
one BGP process in a router, which means that each router can only be in one AS at any given time.
Here is an example:
ISP# config t
ISP(config)# router bgp ?
<1-65535> Autonomous system number
ISP(config)# router bgp 1
displays the BGP routing configuration for the R1 and R2Notice the AS number can be from 1 to 65,535.
Establish One or More Neighbor Relationships
Since BGP does not automatically discover neighbors like other routing protocols do, you have to explicitly configure them using the neighbor peer-ip-address remote-as peer-as-number command. Here is an example of configuring the ISP router in
ISP(config-router)# neighbor 192.168.1.2 remote-as 100
ISP(config-router)# neighbor 192.168.2.2 remote-as 200
Be sure to understand that the above command is the neighbor’s IP address and neighbor’s AS number.
Advertise the Local Networks Into BGP
To specify your local networks and advertise them into BGP, you use the network command with the mask keyword and then the subnet mask:
ISP(config-router)# network 10.0.0.0 mask 255.255.255.0
These network numbers must match what is found on the local router’s forwarding table exactly, which can be seen with the show ip route or show ip int brief command. For other routing protocols, the network command has a different meaning. For OSPF and EIGRP, for example, the network command indicates the interfaces for which the routing protocol will send and receive route updates. In BGP, the network command indicates which routes should be injected into the BGP table on the local router.
R1# config t
R1(config)# router bgp 100
R1(config-router)# neighbor 192.168.1.1 remote-as 1
R1(config-router)# network 10.0.1.0 mask 255.255.255.0
R2# config t
R2(config)# router bgp 200
R2(config-router)# neighbor 192.168.2.1 remote-as 1
R2(config-router)# network 10.0.2.0 mask 255.255.255.0
That’s it! Pretty simple. Now let’s verify our configuration.
We’ll use the following commands to verify our little EBGP network.
show ip bgp summary
show ip bgp
show ip bgp neighbors
The show ip bgp summary Command
The show ip bgp summary command gives you an overview of the BGP status. Each configured neighbor is listed in the output of the command. The output will display the IP address and AS number of the neighbor, along with the status of the session. You can use this information to verify that BGP sessions are up and established, or to verify the IP address and AS number of the configured BGP neighbor.
ISP# sh ip bgp summary
BGP router identifier 10.0.0.1, local AS number 1
BGP table version is 4, main routing table version 6
3 network entries using 396 bytes of memory
3 path entries using 156 bytes of memory
2/2 BGP path/bestpath attribute entries using 368 bytes of memory
3 BGP AS-PATH entries using 72 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
Bitfield cache entries: current 1 (at peak 1) using 32 bytes of
BGP using 1024 total bytes of memory
BGP activity 3/0 prefixes, 3/0 paths, scan interval 60 secs
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ
192.168.1.2 4 100 56 55 4 0 0
192.168.2.2 4 200 47 46 4 0 0
The first section of the show ip bgp summary command output describes the BGP table and its content:
The router ID of the router and local AS number.
The BGP table version is the version number of the local BGP table. This number is increased every time the table is changed.
The second section of the show ip bgp summary command output is a table in which the current neighbor statuses are shown. Here’s information about what you see displayed in the output of this command:
IP address of the neighbor.
BGP version number that is used by the router when communicating with the neighbor (v4).
AS number of the remote neighbor.
Number of messages and updates that have been received from the neighbor since the session was established.
Number of messages and updates that have been sent to the neighbor since the session was established.
Version number of the local BGP table that has been included in the most recent update to the neighbor.
Number of messages that are waiting to be processed in the incoming queue from this neighbor.
Number of messages that are waiting in the outgoing queue for transmission to the neighbor.
How long the neighbor has been in the current state and the name of the current state. Interestingly, notice there is no state listed, which is actually what you want because that means the peers are established.
Number of received prefixes from the neighbor.
ISP1 has two established sessions with the following neighbors:
192.168.1.2, which is the IP address of R1 router and is in AS 100
192.168.2.2, which is the IP address of R2 router and is in AS 200
From each of the neighbors, ISP1 has received one prefix (one network).
Now, for the CCNA objectives, remember that if you see this type of output at the end of the show ip bgp summary command, that the BGP session is not established between peers:
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down
192.168.1.2 4 64 0 0 0 0 0 never
Notice the state of Active. Remember, seeing no state output is good! Active means we’re actively trying to establish with the peer.