8.6 Peering
8.6.1
Configuration example:  building peering sessions
This example demonstrates the different types of BGP peering sessions you will encounter. An IBGP peering session is formed within AS3, between the loopback address of RTA and a physical address of RTF. An EBGP session is also formed between AS3 and AS1 by using the two directly connected IP addresses of RTA and RTC. Another EBGP session is formed between RTF in AS3 and RTD in AS2, using IP addresses that are not on the same segment (multihop).
Lab Activity
  In this lab, you will establish a basic BGP connection between routers and observe differences between internal and external BGP sessions.

It is important to remember that the BGP peers will never become established unless there is IP connectivity between the two peers. We will use OSPF as an IGP to establish the required internal connectivity.

Note: Click on topology to view command outputs.

RTA's configuration shows some syntax that might be unfamiliar to you. All the syntax is explained here generically, as well as in relation to the particular routing scenario of the example. In subsequent examples throughout this chapter, however, the router configuration will be reduced to necessary commands to configure BGP or IGP; for instance, commands that assign IP addresses to interfaces will be omitted in many cases because of space limitations.

  • ip subnet-zero -- This global configuration command is necessary in case you are configuring interfaces that fall in subnet-zero subnets. With the introduction of classless routing, using subnet-zero is very common.
  • interface type slot/port -- This command configures an interface type and number on the router. Any configuration that appears under the command will be specific to that particular interface. Note that RTA has three interface commands, one for each of its three connections. The loopback interface is a software-only interface that is always up.
  • ip address ip-address mask [secondary] -- This command configures an IP address and mask on the interface. The RTA Ethernet IP address, for example, is configured using: IP address 172.16.1.1 255.255.255.0.
  • router process [process-id] - This is a global command that defines a process such as OSPF, RIP, or BGP, and gives the process a process ID. Some processes, such as RIP, do not require a process ID, while others use the process ID as an Autonomous System number.

In the RTA configuration, "router ospf 10," for example, indicates an OSPF process with ID 10, whereas "router bgp 3" indicates a BGP process in AS 3.

  • network -- This command indicates the networks or, in the case of OSPF, the interfaces that will run under a specific router process.
  • wildcard bits -- In the RTA network command, you will notice a representation of the form 0.0.255.255, or basically a number of 0s followed with a number of 1s. These are wildcard bits (sometimes known as an inverse mask). Any place there is a 0 in the wildcard bits, the ip address compared to it match; 1s are do-not-care bits. For example, 172.16.0.0 0.0.255.255 indicates any IP address or network of the form 172.16.x.x. Inverse masks are used when defining access lists as well.
  • area area-number -- This defines which OSPF area any interfaces falling within the range of IP addresses specified in the network statement will be a part of.
  • neighbor -- This command is used to define the BGP neighbor connection parameters and policies between this router and this peer. In the RTA configuration, "neighbor 172.16.1.2 remote-as 3," for example, is an indication that a BGP peer session is to be established between RTA and peer 172.16.1.2 in AS 3.
  • no synchronization -- This command turns the synchronization off between BGP and IGP.
  • no auto-summary -- This command will turn off the BGP automatic summarization at major net boundaries. Without this command, BGP will not send the subnets of a major net that are redistributed into BGP; that is, updates about 172.16.1.0/24, 172.16.2.0/24, and so on will be sent as a single prefix: 172.16.0.0/16. Summarization at the major net boundary should be done only if the AS is the owner of the whole major net.
  • update-source interface -- Specifies the interface to be used as a source IP address of the BGP session with the neighbor. In RTA's configuration, for example, the second neighbor statement indicates that Loopback 0 is to be used as a source interface.
  • remote-as -- Specifies the AS number of the remote BGP peer. In RTA's configuration, the first neighbor statement indicates that the internal BGP neighbor 172.16.1.2 belongs to the AS3, which also happens to be the local AS. The third neighbor statement indicates that the external BGP peer 172.16.20.1 belongs to AS1.

In RTF's configuration, you can see the ebgp-multihop 2 command being used as part of the neighbor configuration. This is an indication that the exterior BGP peer is not directly connected and can be reached at a maximum of two hops away. Remember that ebgp-multihop is applicable only with EBGP, and not with IBGP.

icon4.gif (379 bytes) Lab Activity
  In this lab, you will learn how to establish a BGP connection between routers via a router that is not running BGP.

The example also shows how the peer connection will look after the neighbors are in an established state. From RTF's point of view, neighbor 172.16.2.254 is an internal neighbor that belongs to AS3. The neighbor connection is running BGP Version 4 with a table version of 2. The table version changes every time the BGP table gets updated.

The other RTF neighbor, 192.68.12.1, is also in an established state. This is an external neighbor that belongs to AS2. Note that the display indicates that this neighbor is two hops away (as configured using ebgp-multihop).