Building Peering Sessions

This example demonstrates the different types of BGP peering sessions you will encounter. Consider Figure 11-1.

Figure 11-1. Building Peering Sessions


An IBGP peering session is formed within AS3, between RTA's loopback address and RTF's physical address. EBGP sessions are 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).

It is important to remember that the BGP TCP connection will not become established unless there is IGP connectivity between the two peers or the two peers are directly connected. We will use OSPF as an IGP to establish the required underlying connectivity internally. Example 11-1 shows the configuration for RTA.

Example 11-1. RTA Configuration
ip subnet-zero

interface Loopback0
 ip address 172.16.2.254 255.255.255.255

interface Ethernet1
 ip address 172.16.1.1 255.255.255.0

interface Serial0
 ip address 172.16.20.2 255.255.255.0

router ospf 10
 network 172.16.0.0 0.0.255.255 area 0

router bgp 3
 no synchronization
 neighbor 172.16.1.2 remote-as 3
 neighbor 172.16.1.2 update-source Loopback0
 neighbor 172.16.20.1 remote-as 1
 no auto-summary

ip classless

The configuration for RTA in Example 11-1 shows some syntax that might be unfamiliar to you. All the syntax is explained in Table 11-1 generically, as well as in relation to the particular routing scenario of Figure 11-1. In subsequent examples throughout this chapter, however, the router's configuration focus on the relevant commands required to configure BGP, the IGP, or static routing. Commands that assign IP addresses to interfaces will be omitted in many instances due to space limitations.

Table 11-1. Example 11-1 Configuration Commands
CommandExplanation
ip subnet-zeroThis global configuration command is necessary in case you are configuring interfaces that fall in subnet-zero subnets (that is, 192.168.1.0/30). With the introduction of classless routing, using subnet-zero is very common and is a recommended default configuration.
interfacetype slot/portThis command configures an interface type and number on the router. Any configuration that appears under the command will be specific to that particular interface. (The actual slot/port syntax might vary slightly across different platforms.) Note that RTA has three interface commands—one for each of its three connections. The loopback interface is a software-only interface that emulates an interface that is always up.
ip addressip-address mask [secondary]This is an interface command that configures an interface with an IP address/mask tuple. RTA's Ethernet IP address, for example, is configured by ip address 172.16.1.1 255.255.255.0.
routerprocess [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. For example, in RTA's configuration, router ospf 10 indicates an OSPF process with ID 10, whereas router bgp 3 indicates a BGP process in autonomous system 3.
networkThis command indicates the networks or, in the case of OSPF, the interfaces that will participate in a specific routing process.
inverse maskIn RTA's network command, you will notice a representation of the form 0.0.255.255—basically, a number of 0s followed by a number of 1s. This is an inverse mask, in which the 0s are an exact match, and the 1s are referred to as 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 can be applied to access lists as well as the network command. Table 11-2 provides a dotted decimal/inverse mask reference chart.
area area-numberThis represents an OSPF area with a specified area number.
neighborThis command is used to define the BGP neighbor connection parameters and policies between this router and its peers. In RTA's configuration, neighbor 172.16.1.2 remote-as 3 indicates that a BGP peer session is to be established between RTA and peer 172.16.1.2 in autonomous system 3.
no synchronizationThis command turns off the synchronization between BGP and IGP, as explained in Chapter 6, "Tuning BGP Capabilities."
no auto-summaryThis command turns off the BGP classful automatic summarization at the major net boundary. Without this command, BGP will not send the subnets of a major net that are redistributed into BGP. In other words, updates about 172.16.1.0/24, 172.16.2.0/24, and so on will be sent as a single major class B 172.16.0.0/16. Summarization at the major net boundary should be done only if the AS owns the whole major net. Unless summarization is explicitly required, the recommended configuration is to disable it.
ip classlessThis command lets the router forward packets that are destined for unrecognized subnets of directly connected networks. By default, when a router receives packets for a subnet that falls numerically within its subnetwork addressing scheme, if there is no such subnet number in the routing table and there is no network default route, the router discards the packets. When the ip classless command is enabled, however, the router forwards those packets to the best supernet route. Unless classful behavior is explicitly required, the recommended configuration is to disable it.
update-source interfaceThis command, when associated with the BGP neighbor statement, 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 IP address.
remote-asThis command, when associated with the BGP neighbor statement, 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 local AS3. The third neighbor statement indicates that the external BGP peer 172.16.20.1 belongs to AS1.

Table 11-2. CIDR-to-Dotted Decimal Notation Chart
CIDRDotted DecimalInverse Dotted Decimal
/1128.0.0.0127.255.255.255
/2192.0.0.063.255.255.255
/3224.0.0.031.255.255.255
/4240.0.0.015.255.255.255
/5248.0.0.07.255.255.255
/6252.0.0.03.255.255.255
/7254.0.0.01.255.255.255
/8255.0.0.00.255.255.255
/9255.128.0.00.127.255.255
/10255.192.0.00.63.255.255
/11255.224.0.00.31.255.255
/12255.240.0.00.15.255.255
/13255.248.0.00.7.255.255
/14255.252.0.00.3.255.255
/15255.254.0.00.1.255.255
/16255.255.0.00.0.255.255
/17255.255.128.00.0.127.255
/18255.255.192.00.0.63.255
/19255.255.224.00.0.31.255
/20255.255.240.00.0.15.255
/21255.255.248.00.0.7.255
/22255.255.252.00.0.3.255
/23255.255.254.00.0.1.255
/24255.255.255.00.0.0.255
/25255.255.255.1280.0.0.127
/26255.255.255.1920.0.0.63
/27255.255.255.2240.0.0.31
/28255.255.255.2400.0.0.15
/29255.255.255.2480.0.0.7
/30255.255.255.2520.0.0.3
/31255.255.255.2540.0.0.1
/32255.255.255.2550.0.0.0

We turn now to RTF's configuration in Example 11-2.

Example 11-2. RTF Configuration
ip subnet-zero

interface Ethernet1/1
 ip address 172.16.1.2 255.255.255.0

interface Serial2/1
 ip address 192.68.5.1 255.255.255.0

router ospf 10
 network 172.16.0.0 0.0.255.255 area 0
 network 192.68.0.0 0.0.255.255 area 0

router bgp 3
no synchronization
 neighbor 172.16.2.254 remote-as 3
 neighbor 192.68.12.1 remote-as 2
 neighbor 192.68.12.1 ebgp-multihop 2
 no auto-summary

ip classless

In RTF's configuration, you can see the ebgp-multihop 2 command being used as part of the neighbor configuration. This indicates 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 with only EBGP, not IBGP. Also, the value at the end (2 in this example) represents the TTL (Time To Live) value to be configured in the IP packet header. Example 11-3 and Example 11-4 show the configurations for RTC and RTD, respectively.

Example 11-3. RTC Configuration
ip subnet-zero

interface Serial2/1
 ip address 172.16.20.1 255.255.255.0

router bgp 1
 neighbor 172.16.20.2 remote-as 3
 no auto-summary

ip classless

Example 11-4. RTD Configuration
ip subnet-zero

interface Serial0/0
 ip address 192.68.12.1 255.255.255.0

router ospf 10
  network 192.68.0.0 0.0.255.255 area 0

    router bgp 2
 neighbor 192.68.5.1 remote-as 3
 neighbor 192.68.5.1 ebgp-multihop 2
 no auto-summary

ip classless

Example 11-5 shows how the peer connection will look after the neighbors are in an established state.

Example 11-5. RTF Peer Connection
RTF#show ip bgp neighbor
BGP neighbor is 172.16.2.254,  remote AS 3, internal link
  BGP version 4, remote router ID 172.16.2.254
  BGP state = Established, table version = 2, up for 22:36:09
  Last read 00:00:10, hold time is 180, keepalive interval is 60 seconds
  Minimum time between advertisement runs is 5 seconds
  Received 1362 messages, 0 notifications, 0 in queue
  Sent 1362 messages, 0 notifications, 0 in queue
  Connections established 2; dropped 1
Connection state is ESTAB, I/O status: 1, unread input bytes: 0
Local host: 172.16.1.2, Local port: 11008
Foreign host: 172.16.2.254, Foreign port: 179

BGP neighbor is 192.68.12.1,  remote AS 2, external link
  BGP version 4, remote router ID 192.68.5.2
  BGP state = Established, table version = 2, up for 22:13:01
  Last read 00:00:00, hold time is 180, keepalive interval is 60 seconds
  Minimum time between advertisement runs is 30 seconds
  Received 1336 messages, 0 notifications, 0 in queue
  Sent 1336 messages, 0 notifications, 0 in queue
  Connections established 1; dropped 0
  External BGP neighbor may be up to 2 hops away.
Connection state is ESTAB, I/O status: 1, unread input bytes: 0
Local host: 192.68.5.1, Local port: 11016
Foreign host: 192.68.12.1, Foreign port: 179

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-4 with a table version of 2. The table version changes every time the BGP table is updated.

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

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.187.233