Enable BGP Routers in the Same Autonomous System
Figure 1-1 shows the minimum configuration required to enable BGP on an interface. R1 and R2 are two routers belonging to the same AS, AS200, connecting to network 10.10.10.0/24. First, define the routing process and the AS number to which the routers belong. Then, define BGP neighbors to start exchanging routing updates.
Topology
Figure 1-1: Routers in the Same Autonomous System
R1
#configure terminal | Enter configure mode. |
---|
(config)#router bgp 200 | Define the routing process. The number 200 specifies the AS number of R1. |
(config-router)#neighbor 10.10.10.11 remote-as 200 | Define BGP neighbors, and establish a TCP session. 10.10.10.11 is the IP address of the neighbor (R2), and 200 is the neighbor’s AS number. |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 10.10.10.11 activate | Activate the neighbor in the Ipv4 address family. |
(config-router-af)# exit-address-family | Exit address-family mode. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
R2
#configure terminal | Enter configure mode. |
(config)#router bgp 200 | Define the routing process. The number 200 specifies the AS number of R2. |
(config-router)#neighbor 10.10.10.10 remote-as 200 | Define BGP neighbors, and establish a TCP session. 10.10.10.10 is the IP address of the neighbor (R1), and 200 is the neighbor’s AS number. |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 10.10.10.10 activate | Activate the neighbor in the Ipv4 address family. |
(config-router-af)# exit-address-family | Exit address-family mode. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
Validation
#show ip bgp summary
BGP router identifier 192.168.52.2, local AS number 200
BGP table version is 1
0 BGP AS-PATH entries
0 BGP community entries
Neighbor V AS MsgRcv MsgSen TblVer InQ OutQ Up/Down State/PfxRcd
10.10.10.11 4 200 387 390 1 0 0 00:00:04 0
Total number of neighbors 1
Total number of Established sessions 1
#show ip bgp neighbors
BGP neighbor is 10.10.10.11, remote AS 200, local AS 200, internal link
BGP version 4, local router ID 192.168.52.2, remote router ID 192.168.52.3
BGP state = Established, up for 00:01:41
Last read 00:00:11, hold time is 90, keepalive interval is 30 seconds
Neighbor capabilities:
Route refresh: advertised and received (old and new)
Address family IPv4 Unicast: advertised and received
Received 5 messages, 0 notifications, 0 in queue
Sent 6 messages, 0 notifications, 0 in queue
Route refresh request: received 0, sent 0
Minimum time between advertisement runs is 5 seconds
For address family: IPv4 Unicast
BGP table version 1, neighbor version 1
Index 1, Offset 0, Mask 0x2
Community attribute sent to this neighbor (both)
0 accepted prefixes
0 announced prefixes
Connections established 1; dropped 0
Local host: 10.10.10.10, Local port: 179
Foreign host: 10.10.10.11, Foreign port: 33931
Nexthop: 10.10.10.10
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
Last modified date: 10/16/2023