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.

A simple BGP network

Figure 10-1. A simple BGP network

Here’s the configuration for office-r1:

hostname office-r1
!
interface Ethernet0
 ip address 192.168.1.1 255.255.255.0
!
interface Serial0
 ip address 172.16.1.2 255.255.255.0
!
interface Serial1
 ip address 192.168.3.1 255.255.255.0
!
! 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
 network 192.168.1.0
 network 192.168.3.0
 ! Our EBGP peers
 neighbor 172.16.1.1 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 192.168.3.2 remote-as 3000
 neighbor 192.168.3.2 next-hop-self
 neighbor 192.168.3.2 default-originate
!
! Our iBGP peers expect us to be the default route, so we need a local
! default route
ip route 0.0.0.0 0.0.0.0 172.16.1.1

The configuration for office-r2 is:

hostname office-r2 ! interface Ethernet0 ip address 192.168.2.1 ...

Get CISCO IOS in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.