A Simple BGP Configuration

In this section, we'll look at a simple BGP configuration that includes both eBGP and iBGP configurations. A realistic example would be much more complex (particularly for the ISP), but this will help you see how things work. Figure 10-1 shows the sample network. There are two office routers (office-r1 and office-r2); office-r1 connects to the Internet via an ISP, whose router is named (logically enough) "ISP".

Figure 10-1. A simple BGP network

Here's the configuration for office-r1:

 hostname office-r1
 interface Ethernet0
 ip address
 interface Serial0
 ip address
 interface Serial1
 ip address
 ! Configure BGP for our local-AS 3000
 router bgp 3000
 ! We disable synchronization for our iBGP peers
 no synchronization
 ! The networks we want to advertise
 ! Our EBGP peers
 neighbor remote-as 100
 ! For our IBGP peers, we'll set us as the default-originate
 ! And we'll set us as the next hop using the next-hop-self command
 neighbor remote-as 3000
 neighbor next-hop-self
 neighbor default-originate
 ! Our iBGP peers expect us to be the default route, so we need a local
 ! default route
 ip route

The configuration for office-r2 is:

 hostname office-r2
 interface Ethernet0
 ip address
 interface Serial0
 ip address
 ! Our BGP 
 router bgp 3000
 ! Once again, no synchronization for iBGP
 no synchronization
 ! Only one network to define
 ! Only one neighbor to define
 neighbor remote-as 3000

The configuration for ISP is:

 ! If this were a real ISP configuration, we would be fired!
 ! But it shows the concepts.
 hostname ISP1
 interface Loopback0
 ip address
 interface Ethernet0
 ip address
 interface Serial1
 ip address
 clockrate 64000
 router bgp 100
 neighbor remote-as 200
 neighbor remote-as 3000

To demonstrate some of the BGP show commands, let's look at the office-r2 router. show ip route gives us a quick look at what's going on:

 office-r2#show ip route
 Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
 D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
 N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
 i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
 U - per-user static route, o - ODR

 Gateway of last resort is to network

 B [200/0] via, 00:03:10
 B [200/0] via, 00:03:15
 C is directly connected, Ethernet0
 C is directly connected, Serial0
 B* [200/0] via, 00:03:16

Everything here should be familiar. The gateway of last resort is set, because we have default-originate set on the office-r1 router ( Note that the route for is via This route is set to office-r1's interface, because we used the next-hop-self option in one of the neighbor commands for on office-r1. Therefore, office-r1 rewrote the BGP route for, making itself the next hop. If we hadn't put that command in, the route would have looked like this:

 B [200/0] via, 00:00:17

In this configuration, this route would work as well as the route to because the default route tells our router how to get to that address. If we didn't have the default route, we would have to add an extra network statement, defining, to office-r1's configuration. next-hop-self makes the configuration a little easier.

Next, let's look at the output of show ip bgp on office-r2:

 Office-r2#show ip bgp
 BGP table version is 7, local router ID is
 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
 Origin codes: i - IGP, e - EGP, ? - incomplete

 Network Next Hop Metric LocPrf Weight Path
 *>i0.0.0.0 100 0 i
 *>i172.16.0.0 0 100 0 100 i
 *>i192.168.1.0 0 100 0 i
 *> 0 32768 i
 *>i192.168.3.0 0 100 0 i

The output from this show command gives us a lot of useful information. The left-hand side lists the known networks with different codes (see Table 10-1), indicating the route's status. > indicates the best route to the given network. Then we have the next-hop address , the metric, the local preference (LocPrf), the weight, and finally the AS path.

Table 10-1. Route status codes


Route status













The Path column is particularly important. Most of the entries in this column have a path of i, which means that the route was learned through an interior protocol and therefore doesn't cross autonomous system boundaries. The only exception is the network, which is in another autonomous system (AS 100). For this route to reach office-r1, BGP must learn the route from some sort of interior protocol. Therefore, the path for this network is 100 i. AS paths can obviously be much more complex. For a slightly more complex example, imagine that network is attached to the ISP router and has an AS number of 200. The route might look like this:

 Office-r2#show ip bgp
 *>i172.30.0.0 100 0 100 200 i

This path shows that to reach, you must cross AS 100, then enter AS 200, which learned the route through an interior protocol such as RIP. Therefore, you don't need to cross any more AS boundaries.

Getting Started

IOS Images and Configuration Files

Basic Router Configuration

Line Commands

Interface Commands

Networking Technologies

Access Lists

IP Routing Topics

Interior Routing Protocols

Border Gateway Protocol

Quality of Service

Dial-on-Demand Routing

Specialized Networking Topics

Switches and VLANs

Router Security

Troubleshooting and Logging

Quick Reference

Appendix A Network Basics


Cisco IOS in a Nutshell
Cisco IOS in a Nutshell (In a Nutshell (OReilly))
ISBN: 0596008694
EAN: 2147483647
Year: 2006
Pages: 1031
Authors: James Boney

Flylib.com © 2008-2020.
If you may any questions please contact us: flylib@qtcs.net