9.3 Configuring BGP  
  9.3.3 EBGP and IBGP configuration example  
The example in Figure , RTB speaks EBGP to RTA, which is a different AS, and speaks IBGP to RTC, which resides in the same AS. To start the EBGP process with RTA, use the following commands:

RTB(config)#router bgp 200

Notice that the remote-as value of 100, from the neighbor command, is different from the AS number of 200, specified by the router bgp command. Because the two AS numbers are different, BGP will start an EBGP connection with RTA. Communication will occur between autonomous systems.

The commands to configure IBGP are essentially the same as those to configure EBGP, except for the possible addition of the update-source interface  keyword.

RTB(config)#router bgp 200
RTB(config-router)#neighbor 172.16.1.2 remote-as 200
RTB(config-router)#neighbor 172.16.1.2 update-source loopback 0

The remote-as value, 200, is the same as the AS number for the BGP on RTB. Therefore, BGP recognizes that this connection will occur within AS 200. It attempts to establish an IBGP session. In reality, AS 200 is not a remote AS at all as it is the local AS with both routers residing there. For simplicity, the keyword remote-as is used when configuring both EBGP and IBGP sessions.

Also notice the second neighbor command. This is used to assign an optional parameter to be used when communicating with that neighbor. It is typical to use multiple neighbor commands for the same BGP neighbor, each specifying a particular BGP option.

In this example, the option specified is update-source loopback 0. If multiple pathways to the neighbor exist, then the router can use any IP interface to speak BGP with that neighbor. The update-source loopback 0 command is used to instruct the router to use interface loopback zero (0) for TCP connections. This command is typically used in all IBGP configurations. Without this command, BGP routers can use only the closest IP interface to the peer. The capability to use any operational interface provides BGP with robustness in case the link to the closet interface fails. Because EBGP sessions are typically point-to-point, there is no need to use this command with EBGP.

Returning to the example configuration, assume that the following route appears on the table for RTB:

O 192.168.1.0/24 [110/74] via 10.2.2.1, 00:31:34, Serial2

RTB learned this route by way of an Interior Gateway Protocol, by using OSPF. AS 200 uses OSPF internally to exchange route information. RTB can advertise this network by way of BGP. Redistributing OSPF into BGP will work. However, using the following BGP network command will do the same thing:

RTB(config-router)#network 172.16.1.0 mask 255.255.255.252
RTB(config-router)#network 10.1.1.0 mask 255.255.255.252
RTB(config-router)#network 192.168.1.0

The first two network commands listed include the mask keyword, so only a particular subnet is specified. The third network command results in the OSPF route being advertised by BGP without redistribution. Remember that the BGP network command works differently than the IGP network command.

 

Web Links

Configuring BGP

http://www.cisco.com/en/US/products/ sw/iosswrel/ps1828/products_configuration_ guide_chapter09186a00800ca571.html