Social Icons

Wednesday, April 23, 2014

CCNP ROUTE: 2. External BGP - eBGP Neighbor Configuration

At a minimum, a router participating in BGP needs to configure the following settings:
- The router’s own ASN (router bgp asn global command)
- The IP address of each neighbor and that neighbor’s ASN (neighbor ip-address remote-as remote-asn BGP subcommand)

Routers must meet several requirements to become BGP neighbors:
- A local router’s ASN (on the router bgp asn command) must match the neighboring router’s reference to that ASN with its neighbor remote-as asn command.
- The BGP router IDs of the two routers must not be the same.
- If configured, MD5 authentication must pass.
- Each router must be part of a TCP connection with the other router, with the remote router’s IP address used in that TCP connection matching what the local router configures in a BGP neighbor remote-as command.

Like EIGRP and OSPF, BGP defines a 32-bit router ID, written in dotted-decimal notation. And like EIGRP and OSPF, BGP on a router chooses its RID the same general way, by using the following steps, in order, until a BGP RID has been chosen:
- Configured: Use the setting of the bgp router-id rid router subcommand.
- Highest Loopback: Choose the highest numeric IP address of any up/up loopback interface, at the time the BGP process initializes.
- Highest other interface: Choose the highest numeric IP address of any up/up nonloopback interface, at the time the BGP process initializes.

A BGP router creates the TCP connection by trying to establish a TCP connection to the address configured in the neighbor neighbor-ip remote-as command.
However, IOS does not require the BGP configuration to explicitly state the source address that router uses when establishing this TCP connection, and if not explicitly configured, IOS picks an IP address on the local router.
By default, IOS chooses its BGP source IP address for a given neighbor as the interface IP address of the outgoing interface of the route used to forward packets to that neighbor.

Let's consider routers R1, R101 and R102 and form a BGP neighborship between R1 and the other two routers:

R1(config)#router bgp 100
R1(config-router)#neighbor 201.1.1.2 remote-as 101
R1(config-router)#neighbor 202.2.2.2 remote-as 102

R101(config)#router bgp 101
R101(config-router)#neighbor 201.1.1.1 remote-as 100

R102(config)#router bgp 102
R102(config-router)#neighbor 202.2.2.1 remote-as 100


R1(config-router)#
*Mar  1 05:31:35.982: %BGP-5-ADJCHANGE: neighbor 201.1.1.2 Up
R1(config-router)#
*Mar  1 05:31:43.286: %BGP-5-ADJCHANGE: neighbor 202.2.2.2 Up

R1#show ip bgp summary
BGP router identifier 202.2.2.1, local AS number 100
BGP table version is 1, main routing table version 1

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
201.1.1.2       4   101       3       3        1    0    0 00:00:55        0
202.2.2.2       4   102       3       3        1    0    0 00:00:48        0

Having no router ID configured or any loopback interfaces, R1 chose its highest physical interface ID as the BGP router ID ("BGP router identifier 202.2.2.1"):
R1#show ip interface brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            202.2.2.1       YES NVRAM  up                    up     
Serial0/0                  10.1.0.14       YES NVRAM  up                    up     
FastEthernet0/1            201.1.1.1       YES NVRAM  up                    up     
Serial0/1                  10.1.0.29       YES NVRAM  up                    up     
Serial0/2                  10.1.0.25       YES NVRAM  up                    up     
Serial0/3                  unassigned      YES NVRAM  administratively down down

We can further see that BGP uses TCP port 179 as a destination port and chooses its BGP source IP address for a given neighbor as the interface IP address of the outgoing interface of the route used to forward packets to that neighbor.

R1#show ip bgp neighbors
...
Connection state is ESTAB, I/O status: 1, unread input bytes: 0           
Connection is ECN Disabled, Mininum incoming TTL 0, Outgoing TTL 1
Local host: 201.1.1.1, Local port: 20094
Foreign host: 201.1.1.2, Foreign port: 179
...

No comments:

Post a Comment