Enable BGP Between Different Autonomous Systems
This example shows the minimum configuration required for enabling BGP on an interface, when the routers belong to different autonomous systems. R1 and R2 are two routers in different autonomous system, AS200 and AS300, connecting to network 10.10.10.0/24.
Topology
Figure 1-2: Routers in Different Autonomous Systems
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 300 | Define BGP neighbors, and establish a TCP session. 10.10.10.11 is the IP address of the neighbor (R2), and 300 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 300 | Define the routing process. The number 300 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 neighbors
BGP neighbor is 10.10.10.10, remote AS 200, local AS 300, external link
BGP version 4, local router ID 192.168.52.3, remote router ID 192.168.52.2
BGP state = Established, up for 00:00:15
Last read 00:00:15, 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 2 messages, 0 notifications, 0 in queue
Sent 2 messages, 0 notifications, 0 in queue
Route refresh request: received 0, sent 0
Minimum time between advertisement runs is 30 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.11, Local port: 56091
Foreign host: 10.10.10.10, Foreign port: 179
Nexthop: 10.10.10.11
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
#show ip bgp summary
BGP router identifier 192.168.52.3, local AS number 300
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.10 4 200 3 3 1 0 0 00:00:50 0
Total number of neighbors 1
Total number of Established sessions 1
Last modified date: 08/28/2023