BGP Neighbors
A BGP neighbor is a router used to exchange BGP updated TCP connections, also known as BGP peers or BGP speakers. There are two types of BGP neighbor relationship. SPOTO will introduce the BGP Neighbors that may be helpful to you.
IBGP (internal BGP)
EBGP (external BGP)
Firstly, BGP will set up a neighbor relationship with BGP speakers (peer). Then it learns information from its peer, BGP places that information in its BGP table and analyzes the table to choose the best working route for each subnet in the BGP table, placing those routes into the IP routing table.
There are several requirements for forming BGP neighbors:-
A local router’s autonomous system number must match the neighboring router’s ASN.
The BGP router ID of the two routers must not be the same.
Each router must be a part of a TCP connection.
Authentication must be passing if it’s configured
BGP message types
·Open- it’s used to establish a neighbor relationship and exchange its parameter, its include ASN and authentication values.
·Keepalive it’s used to maintain the neighbor relationship and it’s sent periodically
·Update- it's used to exchange path attribute.
·Notification- it’s used error signals. It does occur in a neighbor relationship reset.
BGP neighbor states
Idle – it’s a downstate by administratively down or waiting for the next retry attempt.
R1# show ip BGP summary
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
1.1.1.2 4 501 11 9 8 0 0 00:04:28 4
4.1.1.1 4 501 0 0 1 0 0 never Idle
Connect- this state means its waiting for the TCP connection to be completed.
·Active- this state means the TCP connection has been completed but there are no BGP messages sent yet to its peer.
·Opensent- this state means the TCP connection has been established and BGP open message is sent to its BGP speakers but the matching Open message is not received yet from the peer router.
·Openconfirm- this state means the open message has been sent and received from BGP speaker router. But it’s waiting for keepalive message.
·Established- this state means the entire neighbor parameters match and the neighbor relationship has been established. Now BGP speakers (peers) can exchange update messages.
Configuration:-
Topology:
GOAL:
·configure the topology as per the diagram
·configure IBGP peering AS 501 as per our topology using directly connected interfaces.
·ensure the connectivity and make sure all BGP routers should be able to exchange the routes through BGP.
R1#show ip interface brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 10.1.1.1 YES manual up up
Serial3/0 1.1.1.1 YES manual up up
Serial3/3 4.1.1.2 YES manual up up
Loopback0 11.0.0.1 YES manual up up
Loopback1 11.0.1.1 YES manual up up
Loopback2 11.0.2.1 YES manual up up
Loopback3 11.0.3.1 YES manual up up
R2#show ip interface brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 20.1.1.1 YES manual up up
Serial3/0 1.1.1.2 YES manual up up
Serial3/1 2.1.1.1 YES manual up up
Loopback0 12.0.0.1 YES manual up up
Loopback1 12.0.1.1 YES manual up up
Loopback2 12.0.2.1 YES manual up up
Loopback3 12.0.3.1 YES manual up up
R3(config-if)#do sh ip int br
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 30.1.1.1 YES manual up up
Serial3/1 2.1.1.2 YES manual up up
Serial3/2 3.1.1.1 YES manual up up
Loopback0 13.0.0.1 YES manual up up
Loopback1 13.0.1.1 YES manual up up
Loopback2 13.0.2.1 YES manual up up
Loopback3 13.0.3.1 YES manual up up
R4#show ip interface brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 40.1.1.1 YES manual up up
Serial3/2 3.1.1.2 YES manual up up
Serial3/3 4.1.1.1 YES manual up up
Loopback0 14.0.0.1 YES manual up up
Loopback1 14.0.1.1 YES manual up up
Loopback2 14.0.2.1 YES manual up up
Loopback3 14.0.3.1 YES manual up up
R1(config)#router bgp 501
R1(config-router)#neighbor 1.1.1.2 remote-as 501
R1(config-router)#neighbor 4.1.1.1 remote-as 501
R1(config-router)#network 11.0.0.0 mask 255.255.255.0
R1(config-router)#network 10.0.0.0
R1(config-router)#network 1.0.0.0
R1(config-router)#network 4.0.0.0
R1(config-router)#no auto-summary
R1(config-router)#no synchronization
R1(config-router)#end
R2(config)#router bgp 501
R2(config-router)#neighbor 1.1.1.1 remote-as 501
R2(config-router)#neighbor 2.1.1.2 remote-as 501
R2(config-router)#network 12.0.0.0 mask 255.255.255.0
R2(config-router)#network 20.0.0.0
R2(config-router)#network 2.0.0.0
R2(config-router)#network 1.0.0.0
R2(config-router)#no auto-summary
R2(config-router)#no synchronization
R2(config-router)#end
R3(config)#router bgp 501
R3(config-router)#neighbor 2.1.1.1 remote-as 501
R3(config-router)#neighbor 3.1.1.2 remote-as 501
R3(config-router)#network 13.0.0.0 mask 255.255.255.0
R3(config-router)#network 30.0.0.0
R3(config-router)#network 3.0.0.0
R3(config-router)#network 2.0.0.0
R3(config-router)#no auto-summary
R3(config-router)#no synchronization
R3(config-router)#end
R4(config)#router bgp 501
R4(config-router)#neighbor 4.1.1.2 remote-as 501
R4(config-router)#neighbor 3.1.1.1 remote-as 501
R4(config-router)#network 14.0.0.0 mask 255.255.255.0
R4(config-router)#network 3.0.0.0
R4(config-router)#network 4.0.0.0
R4(config-router)#no auto-summary
R4(config-router)#no synchronization
R4(config-router)#end
R1#show ip bgp summary
BGP router identifier 11.0.3.1, local AS number 501
BGP table version is 10, main routing table version 10
9 network entries using 1296 bytes of memory
11 path entries using 880 bytes of memory
2/2 BGP path/bestpath attribute entries using 272 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 2448 total bytes of memory
BGP activity 9/0 prefixes, 12/1 paths, scan interval 60 secs
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
1.1.1.2 4 501 25 22 10 0 0 00:15:30 4
4.1.1.1 4 501 12 12 10 0 0 00:05:01 3
R3#show ip bgp summary
BGP router identifier 13.0.3.1, local AS number 501
BGP table version is 13, main routing table version 13
9 network entries using 1296 bytes of memory
11 path entries using 880 bytes of memory
2/2 BGP path/bestpath attribute entries using 272 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 2448 total bytes of memory
BGP activity 10/1 prefixes, 12/1 paths, scan interval 60 secs
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
2.1.1.1 4 501 21 17 13 0 0 00:09:25 4
3.1.1.2 4 501 14 12 13 0 0 00:05:25 3
R1#show ip route bgp
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
+ - replicated route, % - next hop override
Gateway of last resort is not set
B 2.0.0.0/8 [200/0] via 1.1.1.2, 00:05:09
B 3.0.0.0/8 [200/0] via 4.1.1.1, 00:05:09
12.0.0.0/24 is subnetted, 1 subnets
B 12.0.0.0 [200/0] via 1.1.1.2, 00:05:09
14.0.0.0/24 is subnetted, 1 subnets
B 14.0.0.0 [200/0] via 4.1.1.1, 00:05:09
B 20.0.0.0/8 [200/0] via 1.1.1.2, 00:05:09
R3#show ip route bgp
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
+ - replicated route, % - next hop override
Gateway of last resort is not set
B 1.0.0.0/8 [200/0] via 2.1.1.1, 00:06:43
B 4.0.0.0/8 [200/0] via 3.1.1.2, 00:10:41
12.0.0.0/24 is subnetted, 1 subnets
B 12.0.0.0 [200/0] via 2.1.1.1, 00:15:08
14.0.0.0/24 is subnetted, 1 subnets
B 14.0.0.0 [200/0] via 3.1.1.2, 00:10:53
B 20.0.0.0/8 [200/0] via 2.1.1.1, 00:15:08