BGP
This chapter contains basic Border Gateway Protocol configuration examples.
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
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
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
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
Route-Map
Use route maps to filter incoming updates from a BGP peer. In this example, the prefix-list ABC on R1 is configured to deny entry of any routes with the IP address 1.1.1.0/M (M = 26, 27, 28). To test the filter, R2 is configured to generate network addresses 1.1.1.0/27 and 1.1.2.0/24. To verify, use the show ip bgp command on R1; it displays R1 receiving updates from only 1.1.2.0/24.
Topology
Configure Route-Map
R1
#configure terminal | Enter configure mode. |
(config)#ip prefix-list ABC | Create an entry in the prefix-list. The ABC parameter is the name of the map that is created above. 5 specifies the sequence number or position of this specific route map. deny specifies the packets are to be rejected. 26 and 28 are the minimum and maximum prefix lengths to be matched. |
(config-ip-prefix-list)#seq 5 deny 1.1.1.0/24 ge 26 le 28 | 5 specifies the sequence number or position of this specific route map. deny specifies the packets are to be rejected. 26 and 28 are the minimum and maximum prefix lengths to be matched. |
(config-ip-prefix-list)#seq 10 permit any | 10 specifies the sequence number or position of this specific route map. The permit parameter any specifies accept all packets of any length. |
(config-ip-prefix-list)#exit | Exit the prefix-list mode |
(config)#commit | Commit the candidate configuration to the running configuration. |
(config)#route-map ABC permit 1 | Enter Route-map mode to set the match operation. |
(config-route-map)#match ip address prefix-list ABC | Set the match criteria. In this case, if the route-map name matches ABC, the packets from the first sequence are denied. |
(config-route-map)#exit | Exit Route-map mode, and return to Configure mode. |
(config)#router bgp 10 | Define the routing process, and establish a TCP session. The number 10 specifies the AS number of R1. |
(config-router)#neighbor 192.168.10.11 remote-as 11 | Define BGP neighbors, and establish a TCP session. 192.168.10.11 is the IP address of the neighbor (R2), and 11 is the neighbor's AS number. |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 192.168.10.11 activate | Activate the neighbor in the Ipv4 address family. |
(config-router-af)#neighbor 192.168.10.11 route-map ABC in | Apply a route map to routes. 192.168.10.11 specifies the IP address of BGP neighbor. The ABC parameter is the name of the route map, and in specifies that the access list applies to incoming advertisements. |
(config-router-af)#exit-address-family | Exit address-family mode. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
R2
(config)#interface lo | Enter loopback interface mode. |
(config-if)#ip address 1.1.1.1/27 secondary | Specify the interface address. |
(config-if)#ip address 1.1.2.1/24 secondary | Specify the interface address. |
(config-if)#exit | Exit loopback interface mode. |
(config)#router bgp 11 | Define the routing process, and establish a TCP session. The number 11 specifies the AS number of R2. |
(config-router)#neighbor 192.168.10.10 remote-as 10 | Define BGP neighbors, and establish a TCP session. 192.168.10.10 is the IP address of the neighbor (R1), and 10 is the neighbor’s AS number. |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 192.168.10.10 activate | Activate the neighbor in the Ipv4 address family. |
(config-router-af)#network 1.1.1.0/27 | Specify the network to be advertised by the BGP routing process. |
(config-router-af)#network 1.1.2.0/24 | Specify the network to be advertised by the BGP routing process. |
(config-router-af)#exit-address-family | Exit router mode. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
Validation
#show ip bgp
BGP table version is 2, local router ID is 192.168.52.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
l - labeled, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 1.1.1.0/27 0.0.0.0 0 100 32768 i
*> 1.1.2.0/24 192.168.10.11 0 100 0 11 i
Total number of prefixes 1
Route Reflector
The configurations in this section apply to BGP Route Reflectors (RR).
Reduce the iBGP Mesh Inside an Autonomous System
Use Route Reflectors to reduce the iBGP mesh inside an Autonomous System (AS).
Topology
In this example, R2, R5, and R4 would have to maintain a full mesh among themselves, but by making R5 the Route Reflector, R2 (Client1) has an iBGP session with the RR only, but not with R4 (Client 2). The routes learned from R2 are advertised to the other clients, and to iBGP peers outside the cluster; the iBGP routes learned from iBGP peers outside the cluster are advertised to R2. This reduces the iBGP peer connections in AS1.
BGP Route Reflector
RR (R5)
#configure terminal | Enter configure mode. |
(config)#router bgp 1 | Define the routing process. The number 1 identifies the AS number of R5. |
(config-router)#neighbor 10.10.10.50 remote-as 1 | Define the BGP neighbor, and establish a TCP session. 10.10.10.50 is the IP address of one of the neighbors (R2), and 1 is the neighbor's AS number. |
(config-router)#neighbor 10.10.11.50 remote-as 1 | Define the BGP neighbor, and establish a TCP session. 10.10.11.50 is the IP address of one of the neighbors (R4), and 1 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.50 activate | Activate the neighbor in the Ipv4 address family. |
(config-router-af)#neighbor 10.10.11.50 activate | Activate the neighbor in the Ipv4 address family. |
(config-router-af)#neighbor 10.10.10.50 route-reflector-client | Configure R5 as the Route-Reflector (RR) and neighbor R2 as its client. |
(config-router-af)#neighbor 10.10.11.50 route-reflector-client | Configure R5 as the Route-Reflector (RR) and neighbor R4 as its client. |
(config-router-af)#exit-address-family | Exit address-family mode. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
RR Client 1 (R2)
(config)#router bgp 1 | Define the routing process. The number 1 specifies the AS number of R2. |
(config-router)#neighbor 10.10.10.10 remote-as 1 | Define the BGP neighbor, and establish a TCP session. 10.10.10.10 is the IP address of the neighbor (R5), and 1 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)#exit | Exit router mode. |
(config)#commit | Commit the candidate configuration to the running configuration. |
RR Client 2 (R4)
(config)#router bgp 1 | Define the routing process. The number 1 identifies the AS number of R4. |
(config-router)#neighbor 10.10.11.10 remote-as 1 | Define BGP neighbor, and establish a TCP session. 10.10.11.10 is the IP address of the neighbor (R5), and 1 is the neighbor’s AS number. |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 10.10.11.10 activate | Activate the neighbor in the Ipv4 address family. |
(config-router-af)#exit-address-family | Exit address-family mode. |
(config-router)#exit | Exit router mode. |
(config)#commit | Commit the candidate configuration to the running configuration. |
Validation
R5
#show ip bgp neighbors
BGP neighbor is 10.10.10.50, remote AS 1, local AS 1, internal link
BGP version 4, local router ID 192.160.50.3, remote router ID 10.12.4.152
BGP state = Established, up for 00:01:04
Last read 00:01:04, 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 4 messages, 0 notifications, 0 in queue
Sent 4 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
Route-Reflector Client
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: 47983
Foreign host: 10.10.10.50, Foreign port: 179
Nexthop: 10.10.10.10
Nexthop global: fe80::a00:27ff:fe09:fd25
Nexthop local: ::
BGP connection: non shared network
BGP neighbor is 10.10.11.50, remote AS 1, local AS 1, internal link
BGP version 4, remote router ID 10.12.4.197
local router ID 192.160.50.3
BGP state = Established, up for 00:01:04
Last read 00:01:04, 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 4 messages, 0 notifications, 0 in queue
Sent 4 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 2, Offset 0, Mask 0x4
Route-Reflector Client
Community attribute sent to this neighbor (both)
0 accepted prefixes
0 announced prefixes
Connections established 1; dropped 0
Local host: 10.10.11.10, Local port: 39851
Foreign host: 10.10.11.50, Foreign port: 179
Nexthop: 10.10.11.10
Nexthop global: fe80::a00:27ff:fe52:45f6
Nexthop local: ::
BGP connection: non shared network
R3
#show ip bgp neighbors
BGP neighbor is 10.10.11.10, remote AS 1, local AS 1, internal link
BGP version 4, local router ID 192.160.50.4, remote router ID 10.12.4.185
BGP state = Established, up for 00:00:56
Last read 00:00:56, 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 3 messages, 0 notifications, 0 in queue
Sent 3 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.11.50, Local port: 179
Foreign host: 10.10.11.10, Foreign port: 39851
Nexthop: 10.10.11.50
Nexthop global: fe80::a00:27ff:fe42:fb7a
Nexthop local: ::
BGP connection: non shared network
R2
#show ip bgp neighbors
BGP neighbor is 10.10.10.10, remote AS 1, local AS 1, internal link
BGP version 4, local router ID 192.160.50.2, remote router ID 10.12.4.185
BGP state = Established, up for 00:01:23
Last read 00:01:23, 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 4 messages, 0 notifications, 0 in queue
Sent 4 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.50, Local port: 179
Foreign host: 10.10.10.10, Foreign port: 47983
Nexthop: 10.10.10.50
Nexthop global: fe80::a00:27ff:fe9c:f35d
Nexthop local: ::
BGP connection: non shared network
Multiple Route Reflectors
The basic rule of BGP is that a BGP speaker cannot advertise a route to an iBGP neighbor if that route was learned from another iBGP neighbor. Configuring a route reflector provides a means to circumvent this rule. The entire route reflector process is transparent to the clients, and no configuration is necessary on these clients.
Whenever an iBGP-speaking router receives a route update, it forwards the route to the neighbor without changing the nexthop IP address, thus making it an unreachable route, unless verified by an iGP (for example, neighbor x.x.x.x route-reflector-client).
• A route learned from a non-RR client is advertised to RR clients but not to non-RR clients.
• A route learned from a RR client is advertised to both RR clients and non-RR clients. Even the RR client that advertised the route will receive a copy and discards it because it sees itself as the originator.
• A route learned from an EBGP neighbor is advertised to both RR clients and non-RR clients.
Topology
eBGP and iBGP Route Reflector Topology
R1
#configure terminal | Enter configure mode. |
---|
(config)#interface eth1 | Enter interface mode |
---|
(config-if)#ip addr 1.1.1.1/24 | Specify IP address for the interface. |
---|
(config-if)#exit | Exit interface mode |
---|
(config)#interface lo | Enter loopback interface mode. |
---|
(config-if)#ip address 100.100.100.100/32 secondary | Specify IP address for the interface. |
---|
(config-if)#exit | Exit loopback interface mode. |
---|
(config)#router bgp 100 | Define the routing process with AS number 100. |
(config-router)#neighbor 1.1.1.2 remote-as 200 | Define the eBGP neighbor (R2). |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 1.1.1.2 activate | Activate the neighbor under address family mode |
(config-router-af)#network 100.100.100.100/32 | Advertise a route via eBGP connection to R2. |
(config-router-af)#exit-address-family | Exit router mode. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
R2
#configure terminal | Enter configure mode. |
(config)#interface eth1 | Enter interface mode |
(config-if)#ip address 1.1.1.2/24 | Specify IP address for the interface. |
(config-if)#exit | Exit interface mode |
(config)#interface eth2 | Enter interface mode |
(config-if)#ip address 3.3.3.2/24 | Specify IP address for the interface. |
(config-if)#exit | Exit interface mode |
(config)#interface eth3 | Enter interface mode |
(config-if)#ip address 4.4.4.2/24 | Specify IP address for the interface. |
(config-if)#exit | Exit interface mode |
(config)#router bgp 200 | Define the routing process with AS number 200. |
(config-router)#neighbor 1.1.1.1 remote-as 100 | Define the eBGP neighbor (R1). |
(config-router)#neighbor 4.4.4.1 remote-as 200 | Define the iBGP neighbor (R4). |
(config-router)#neighbor 3.3.3.1 remote-as 200 | Define the iBGP neighbor (R3). |
(config-router)#bgp cluster-id 4 | Define a cluster ID (4) when multiple Route Reflectors exist. |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 1.1.1.1 activate | Activate the neighbor under address family mode |
(config-router-af)# neighbor 4.4.4.1 activate | Activate the neighbor under address family mode |
(config-router-af)# neighbor 3.3.3.1 activate | Activate the neighbor under address family mode |
(config-router-af)#neighbor 3.3.3.1 route-reflector-client | Configure R2 as the Route-Reflector and neighbor R3 as its client. |
(config-router-af)#neighbor 4.4.4.1 route-reflector-client | Configure R2 as the Route-Reflector and neighbor R4 as its client. |
(config-router-af)#exit-address-family | Exit address-family mode. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
R3
#configure terminal | Enter configure mode. |
(config)#interface eth2 | Enter interface mode |
(config-if)#ip address 3.3.3.1/24 | Assign an IP address |
(config-if)#exit | Exit interface mode |
(config)#interface eth1 | Enter interface mode |
(config-if)#ip addr 5.5.5.1/24 | Assign an IP address |
(config-if)#exit | Exit interface mode |
(config)#router bgp 200 | Define the routing process with AS number 200. |
(config-router)#neighbor 3.3.3.2 remote-as 200 | Define the iBGP neighbor (R2). |
(config-router)#neighbor 5.5.5.2 remote-as 200 | Define the iBGP neighbor (R5). |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 3.3.3.2 activate | Activate the neighbor under address family mode |
(config-router-af)# neighbor 5.5.5.2 activate | Activate the neighbor under address family mode |
(config-router-af)#neighbor 5.5.5.2 route-reflector-client | Configure R3 as the Route-Reflector and neighbor R5 as its client. |
(config-router-af)#exit-address-family | Exit address-family mode. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
R4
#configure terminal | Enter configure mode |
---|
(config)#interface eth2 | Enter interface mode |
---|
(config-if)#ip address 6.6.6.1/24 | Specify an IP address for the interface. |
---|
(config-if)#exit | Exit interface mode |
---|
(config)#interface eth4 | Enter interface mode |
---|
(config-if)#ip address 4.4.4.1/24 | Specify an IP address for the interface. |
---|
(config-if)#exit | Exit interface mode |
---|
(config)#router bgp 200 | Define the routing process with AS number 200. |
(config-router)#neighbor 4.4.4.2 remote-as 200 | Define the iBGP neighbor (R2). |
(config-router)#neighbor 6.6.6.2 remote-as 200 | Define the iBGP neighbor (R5). |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 4.4.4.2 activate | Activate the neighbor under address family mode |
(config-router-af)# neighbor 6.6.6.2 activate | Activate the neighbor under address family mode |
(config-router-af)#exit-address-family | Exit address-family mode. |
(config-router)#exit | Exit router mode. |
(config)#commit | Commit the candidate configuration to the running configuration. |
R5
#configure terminal | Enter configure mode |
---|
(config)#interface eth1 | Enter interface mode |
---|
(config-if)#ip address 5.5.5.2/24 | Specify an IP address for the interface. |
---|
(config-if)#exit | Exit interface mode |
---|
(config-if)#interface eth2 | Enter interface mode |
---|
(config-if)#ip address 6.6.6.2/24 | Specify an IP address for the interface. |
---|
(config-if)#exit | Exit interface mode |
---|
(config)#router bgp 200 | Define the routing process with AS number 200. |
(config-router)#neighbor 5.5.5.1 remote-as 200 | Define the iBGP neighbor (R3). |
(config-router)#neighbor 6.6.6.1 remote-as 200 | Define the iBGP neighbor (R4). |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 5.5.5.1 activate | Activate the neighbor under address family mode |
(config-router-af)# neighbor 6.6.6.1 activate | Activate the neighbor under address family mode |
(config-router-af)#exit-address-family | Exit address-family mode. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
Validation
R2
#show ip bgp neighbors
BGP neighbor is 1.1.1.1, remote AS 100, local AS 200, external link
BGP version 4, local router ID 10.12.4.196, remote router ID 192.160.50.2
BGP state = Established, up for 00:14: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 32 messages, 0 notifications, 0 in queue
Sent 31 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 2, neighbor version 2
Index 1, Offset 0, Mask 0x2
Community attribute sent to this neighbor (both)
1 accepted prefixes
0 announced prefixes
Connections established 1; dropped 0
Local host: 1.1.1.2, Local port: 50649
Foreign host: 1.1.1.1, Foreign port: 179
Nexthop: 1.1.1.2
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
BGP neighbor is 3.3.3.1, remote AS 200, local AS 200, internal link
BGP version 4, local router ID 192.160.50.3, remote router ID 192.160.50.4
BGP state = Established, up for 00:04:17
Last read 00:00:17, 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 10 messages, 0 notifications, 0 in queue
Sent 13 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 2, neighbor version 2
Index 3, Offset 0, Mask 0x8
Route-Reflector Client
Community attribute sent to this neighbor (both)
0 accepted prefixes
1 announced prefixes
Connections established 1; dropped 0
Local host: 3.3.3.2, Local port: 179
Foreign host: 3.3.3.1, Foreign port: 32973
Nexthop: 3.3.3.2
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
BGP neighbor is 4.4.4.1, remote AS 200, local AS 200, internal link
BGP version 4, local router ID 192.160.50.3, remote router ID 192.160.50.6
BGP state = Established, up for 00:00:16
Last read 00:00:16, 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 4 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 2, neighbor version 2
Index 2, Offset 0, Mask 0x4
Route-Reflector Client
Community attribute sent to this neighbor (both)
0 accepted prefixes
1 announced prefixes
Connections established 1; dropped 0
Local host: 4.4.4.2, Local port: 179
Foreign host: 4.4.4.1, Foreign port: 60398
Nexthop: 4.4.4.2
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
#show ip route
Codes: K - kernel, C - connected, S - static, R - RIP, B - BGP
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, L1 - IS-IS level-1, L2 - IS-IS level-2,
ia - IS-IS inter area, E - EVPN,
v - vrf leaked
* - candidate default
IP Route Table for VRF "default"
C 1.1.1.0/24 is directly connected, eth1, 00:16:10
C 3.3.3.0/24 is directly connected, eth2, 00:15:59
C 4.4.4.0/24 is directly connected, eth3, 00:15:49
B 100.100.100.100/32 [20/0] via 1.1.1.1, eth1, 00:14:53
C 127.0.0.0/8 is directly connected, lo, 00:32:26
C 192.160.50.0/24 is directly connected, eth0, 00:32:22
Gateway of last resort is not set
#show ip bgp
BGP table version is 2, local router ID is 192.160.50.3
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
l - labeled, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 100.100.100.100/32
1.1.1.1 0 100 0 100 i
Total number of prefixes 1
Total number of neighbors 3
R1
#show bgp neighbors
BGP neighbor is 1.1.1.2, remote AS 200, local AS 100, external link
BGP version 4, local router ID 10.12.4.142, remote router ID 10.12.4.196
BGP state = Established, up for 00:16:11
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 34 messages, 0 notifications, 0 in queue
Sent 36 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
1 announced prefixes
Connections established 1; dropped 0
Local host: 1.1.1.1, Local port: 179
Foreign host: 1.1.1.2, Foreign port: 50649
Nexthop: 1.1.1.1
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
#show ip bgp summary
BGP router identifier 192.160.50.2, local AS number 100
BGP table version is 1
1 BGP AS-PATH entries
0 BGP community entries
Neighbor V AS MsgRcv MsgSen TblVer InQ OutQ Up/Down State/PfxRcd
1.1.1.2 4 200 34 36 1 0 0 00:16:18 0
Total number of neighbors 1
Total number of Established sessions 1
#
R3
#show ip bgp
BGP table version is 1, local router ID is 192.160.50.4
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
l - labeled, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
* i 100.100.100.100/32
1.1.1.1 0 100 0 100 i
Total number of prefixes 1
#
#show ip bgp neighbors
BGP neighbor is 3.3.3.2, remote AS 200, local AS 200, internal link
BGP version 4, local router ID 192.160.50.4, remote router ID 192.160.50.3
BGP state = Established, up for 00:06: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 15 messages, 0 notifications, 0 in queue
Sent 14 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)
1 accepted prefixes
0 announced prefixes
Connections established 1; dropped 0
Local host: 3.3.3.1, Local port: 32973
Foreign host: 3.3.3.2, Foreign port: 179
Nexthop: 3.3.3.1
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
BGP neighbor is 5.5.5.2, remote AS 200, local AS 200, internal link
BGP version 4, local router ID 192.160.50.4, remote router ID 192.160.50.5
BGP state = Established, up for 00:03:35
Last read 00:00:05, 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 9 messages, 0 notifications, 0 in queue
Sent 10 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 2, Offset 0, Mask 0x4
Route-Reflector Client
Community attribute sent to this neighbor (both)
0 accepted prefixes
0 announced prefixes
Connections established 1; dropped 0
Local host: 5.5.5.1, Local port: 179
Foreign host: 5.5.5.2, Foreign port: 39271
Nexthop: 5.5.5.1
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
#
#show ip bgp summary
BGP router identifier 192.160.50.4, local AS number 200
BGP table version is 1
1 BGP AS-PATH entries
0 BGP community entries
Neighbor V AS MsgRcv MsgSen TblVer InQ OutQ Up/Down State/PfxRcd
3.3.3.2 4 200 15 14 1 0 0 00:06:26 1
5.5.5.2 4 200 9 10 1 0 0 00:03:46 0
Total number of neighbors 2
R4
#show ip bgp
BGP table version is 1, local router ID is 192.160.50.6
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
l - labeled, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
* i 100.100.100.100/32
1.1.1.1 0 100 0 100 i
Total number of prefixes 1
#
#sh ip bgp neighbors
BGP neighbor is 4.4.4.2, remote AS 200, local AS 200, internal link
BGP version 4, local router ID 192.160.50.6, remote router ID 192.160.50.3
BGP state = Established, up for 00:03:58
Last read 00:00:28, 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 10 messages, 0 notifications, 0 in queue
Sent 9 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)
1 accepted prefixes
0 announced prefixes
Connections established 1; dropped 0
Local host: 4.4.4.1, Local port: 60398
Foreign host: 4.4.4.2, Foreign port: 179
Nexthop: 4.4.4.1
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
BGP neighbor is 6.6.6.2, remote AS 200, local AS 200, internal link
BGP version 4, local router ID 192.160.50.6, remote router ID 192.160.50.5
BGP state = Established, up for 00:03:52
Last read 00:00:22, 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 9 messages, 0 notifications, 0 in queue
Sent 9 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 2, Offset 0, Mask 0x4
Community attribute sent to this neighbor (both)
0 accepted prefixes
0 announced prefixes
Connections established 1; dropped 0
Local host: 6.6.6.1, Local port: 48257
Foreign host: 6.6.6.2, Foreign port: 179
Nexthop: 6.6.6.1
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
#
#show ip bgp summary
BGP router identifier 192.160.50.6, local AS number 200
BGP table version is 1
1 BGP AS-PATH entries
0 BGP community entries
Neighbor V AS MsgRcv MsgSen TblVer InQ OutQ Up/Down State/PfxRcd
4.4.4.2 4 200 11 10 1 0 0 00:04:09 1
6.6.6.2 4 200 10 10 1 0 0 00:04:03 0
Total number of neighbors 2
Total number of Established sessions 2
R5
#show ip bgp neighbors
BGP neighbor is 5.5.5.1, remote AS 200, local AS 200, internal link
BGP version 4, local router ID 192.160.50.5, remote router ID 192.160.50.4
BGP state = Established, up for 00:09:04
Last read 00:00:04, 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 20 messages, 0 notifications, 0 in queue
Sent 20 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: 5.5.5.2, Local port: 39271
Foreign host: 5.5.5.1, Foreign port: 179
Nexthop: 5.5.5.2
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
BGP neighbor is 6.6.6.1, remote AS 200, local AS 200, internal link
BGP version 4, local router ID 192.160.50.5, remote router ID 192.160.50.6
BGP state = Established, up for 00:07:36
Last read 00:00:06, 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 17 messages, 0 notifications, 0 in queue
Sent 18 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 2, Offset 0, Mask 0x4
Community attribute sent to this neighbor (both)
0 accepted prefixes
0 announced prefixes
Connections established 1; dropped 0
Local host: 6.6.6.2, Local port: 179
Foreign host: 6.6.6.1, Foreign port: 48257
Nexthop: 6.6.6.2
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
#
#sh ip bgp summary
BGP router identifier 192.160.50.5, 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
5.5.5.1 4 200 20 20 1 0 0 00:09:20 0
6.6.6.1 4 200 17 18 1 0 0 00:07:52 0
Total number of neighbors 2
Total number of Established sessions 2
#
BGP Confederations
In BGP, nodes running iBGP protocols must be interconnected forming a full mesh. Confederation solves the iBGP full-mesh network complexity and inefficiency by splitting a large autonomous system domain into smaller autonomous system domains, called member autonomous systems. Member autonomous systems can form eBGP connections among themselves, to prevent full-mesh connections among each iBGP-running node.
The bgp confederation identifier command tells the router that it is a member of a confederation and the confederation ID. The bgp confederation peers command lists the member AS to which the router is connected.
In the following example, R1, R2, and R3 are members of the same confederation with different AS numbers.
Topology
BGP Confederation
R1
#configure terminal | Enter configure mode. |
---|
(config)#router bgp 400 | Assign the ASN value (400) to the router. |
(config-router)#bgp confederation identifier 1000 | Specify the BGP confederation ID, the externally visible autonomous system number that identifies the BGP confederation as a whole. |
(config-router)#bgp confederation peers 7000 | Specify the neighbor ASN value for confederation membership. |
(config-router)#neighbor 10.20.30.2 remote-as 7000 | Specify the neighbor’s IP address (10.20.30.2) and the ASN value of the neighbor (7000). |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 10.20.30.2 activate | Activate the neighbor under address family mode |
(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 7000 | Assign the ASN value (7000) to the router. |
(config-router)#bgp confederation identifier 1000 | Specify the BGP confederation ID. |
(config-router)#bgp confederation peers 400 90 | Specify the neighbor ASN values for confederation membership. |
(config-router)#neighbor 10.20.30.1 remote-as 400 | Specify the neighbor’s IP address (10.20.30.1) and the ASN value of the neighbor (400). |
(config-router)#neighbor 11.20.30.30 remote-as 90 | Specify the neighbor’s IP address (11.20.30.30) and the ASN value of the neighbor (90). |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 10.20.30.1 activate | Activate the neighbor under address family mode |
(config-router-af)# neighbor 11.20.30.30 activate | Activate the neighbor under address family mode |
(config-router-af)#exit-address-family | Exit address-family mode. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
R3
#configure terminal | Enter configure mode. |
---|
(config-router)#router bgp 90 | Assign the ASN value (90) to the router. |
(config-router)#bgp confederation identifier 1000 | Specify the BGP confederation ID. |
(config-router)#bgp confederation peers 7000 | Specify the neighbor ASN value for confederation membership. |
(config-router)#neighbor 11.20.30.20 remote-as 7000 | Specify the neighbor’s IP address (11.20.30.20) and the ASN value of the neighbor (7000). |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 11.20.30.20 activate | Exit address-family mode. |
(config-router-af)#exit-address-family | Exit address-family mode. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
Validation
R2
#sh ip bgp summary
BGP router identifier 192.168.52.3, local AS number 7000
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.20.30.1 4 400 5 5 1 0 0 00:01:36 0
11.20.30.30 4 90 2 3 1 0 0 00:00:24 0
Total number of neighbors 2
Total number of Established sessions 2
#show ip bgp neighbors
BGP neighbor is 10.20.30.1, remote AS 400, local AS 7000, external link
BGP version 4, local router ID 192.168.52.3, remote router ID 192.168.52.2
Neighbor under common administration
BGP state = Established, up for 00:01:25
Last read 00:01:25, 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 4 messages, 0 notifications, 0 in queue
Sent 4 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.20.30.2, Local port: 35108
Foreign host: 10.20.30.1, Foreign port: 179
Nexthop: 10.20.30.2
Nexthop global: fe80::a00:27ff:fe21:7ed2
Nexthop local: ::
BGP connection: non shared network
BGP neighbor is 11.20.30.30, remote AS 90, local AS 7000, external link
BGP version 4, remote router ID 192.168.56.103
Neighbor under common administration
BGP state = Established, up for 00:00:13
Last read 00:00:13, 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 3 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 2, Offset 0, Mask 0x4
Community attribute sent to this neighbor (both)
0 accepted prefixes
0 announced prefixes
Connections established 1; dropped 0
Local host: 11.20.30.20, Local port: 179
Foreign host: 11.20.30.30, Foreign port: 33465
Nexthop: 11.20.30.20
Nexthop global: fe80::a00:27ff:fed0:57d1
Nexthop local: ::
BGP connection: non shared network
R1
#show ip bgp neighbors
BGP neighbor is 10.20.30.2, remote AS 7000, local AS 400, external link
BGP version 4, local router ID 192.168.52.2, remote router ID 192.168.52.3
Neighbor under common administration
BGP state = Established, up for 00:01:51
Last read 00:01:51, 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 30 seconds
For address family: IPv4 Unicast
BGP table version 3, neighbor version 3
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.20.30.1, Local port: 179
Foreign host: 10.20.30.2, Foreign port: 35108
Nexthop: 10.20.30.1
Nexthop global: fe80::a00:27ff:fe50:6a9b
Nexthop local: ::
BGP connection: non shared network
#sh ip bgp summary
BGP router identifier 192.168.52.3, local AS number 400
BGP table version is 3
1 BGP AS-PATH entries
0 BGP community entries
Neighbor V AS MsgRcv MsgSen TblVer InQ OutQ Up/Down State/PfxRcd
10.20.30.2 4 7000 5 6 3 0 0 00:01:57 0
Total number of neighbors 1
Total number of Established sessions 1
R3
#sh ip bgp neighbors
BGP neighbor is 11.20.30.20, remote AS 7000, local AS 90, external link
BGP version 4, local router ID 192.168.52.5, remote router ID 192.168.52.3
Neighbor under common administration
BGP state = Established, up for 00:00:04
Last read 00:00:04, 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: 11.20.30.30, Local port: 33465
Foreign host: 11.20.30.20, Foreign port: 179
Nexthop: 11.20.30.30
Nexthop global: fe80::a00:27ff:fe24:5dc9
Nexthop local: ::
BGP connection: non shared network
#sh ip bgp summary
BGP router identifier 192.168.56.103, local AS number 90
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
11.20.30.20 4 7000 3 3 1 0 0 00:00:55 0
Total number of neighbors 1
Total number of Established sessions 1
Multiple Autonomous Systems
In the following example, R1 and R2 are members of the same confederation with the same AS numbers, and R3 is a member of the same confederation with a different AS number.
Topology
BGP Confederation with Multiple AS
R1
#configure terminal | Enter Configure Mode |
(config)#router bgp 400 | Assign the ASN value (400) to the router. |
(config-router)#bgp confederation identifier 1000 | Specify the BGP confederation ID. |
(config-router)#neighbor 10.20.30.2 remote-as 400 | Specify the neighbor’s IP address (10.20.30.2) and the ASN value of the neighbor (400). |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 10.20.30.2 activate | Activate the neighbor under address family mode |
(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 400 | Assign the ASN value (400) to the router. |
(config-router)#bgp confederation identifier 1000 | Specify the BGP confederation ID. |
(config-router)#bgp confederation peers 90 | Specify the neighbor ASN value for confederation membership. |
(config-router)#neighbor 10.20.30.1 remote-as 400 | Specify the neighbor’s IP address (10.20.30.1) and the ASN value of the neighbor (400). |
(config-router)#neighbor 11.20.30.30 remote-as 90 | Specify the neighbor’s IP address (11.20.30.30) and the ASN value of the neighbor (90). |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 10.20.30.1 activate | Activate the neighbor under address family mode |
(config-router-af)# neighbor 11.20.30.30 activate | Activate the neighbor under address family mode |
(config-router-af)#exit-address-family | Exit address-family mode. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
R3
#configure terminal | Enter configure mode. |
---|
(config)#router bgp 90 | Assign the ASN value (90) to the router. |
(config-router)#bgp confederation identifier 1000 | Specify the BGP confederation ID. |
(config-router)#bgp confederation peers 400 | Specify the neighbor ASN value for confederation membership. |
(config-router)#neighbor 11.20.30.20 remote-as 400 | Specify the neighbor’s IP address (11.20.30.20) and the ASN value of the neighbor (400). |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 11.20.30.20 activate | Activate the neighbor under address family mode |
(config-router-af)#exit-address-family | Exit address-family mode. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
Validation
R2
#show ip bgp summary
BGP router identifier 192.168.52.3, local AS number 400
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.20.30.1 4 400 16 16 1 0 0 00:07:27 0
11.20.30.30 4 90 32 42 1 0 0 00:00:27 0
Total number of neighbors 2
Total number of Established sessions 2
#show ip bgp neighbors
BGP neighbor is 10.20.30.1, remote AS 400, local AS 400, internal link
BGP version 4, local router ID 192.168.52.3, remote router ID 192.168.52.2
BGP state = Established, up for 00:08:10
Last read 00:08:10, 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 18 messages, 0 notifications, 0 in queue
Sent 18 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.20.30.2, Local port: 35214
Foreign host: 10.20.30.1, Foreign port: 179
Nexthop: 10.20.30.2
Nexthop global: fe80::a00:27ff:fe21:7ed2
Nexthop local: ::
BGP connection: non shared network
BGP neighbor is 11.20.30.30, remote AS 90, local AS 400, external link
BGP version 4, remote router ID 192.168.56.103
Neighbor under common administration
BGP state = Established, up for 00:01:10
Last read 00:01:10, 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 20 messages, 14 notifications, 0 in queue
Sent 42 messages, 2 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 2, Offset 0, Mask 0x4
Community attribute sent to this neighbor (both)
0 accepted prefixes
0 announced prefixes
Connections established 1; dropped 0
Local host: 11.20.30.20, Local port: 179
Foreign host: 11.20.30.30, Foreign port: 33623
Nexthop: 11.20.30.20
Nexthop global: fe80::a00:27ff:fed0:57d1
Nexthop local: ::
BGP connection: non shared network
Last Reset: 00:01:36, due to BGP Notification sent
Notification Error Message: (OPEN Message Error/Bad Peer AS.)
R1
#show ip bgp neighbors
BGP neighbor is 10.20.30.2, remote AS 400, local AS 400, 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:08:41
Last read 00:08:41, 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 34 messages, 0 notifications, 0 in queue
Sent 35 messages, 3 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 16, neighbor version 16
Index 1, Offset 0, Mask 0x2
Community attribute sent to this neighbor (both)
0 accepted prefixes
0 announced prefixes
Connections established 2; dropped 1
Local host: 10.20.30.1, Local port: 179
Foreign host: 10.20.30.2, Foreign port: 35214
Nexthop: 10.20.30.1
Nexthop global: fe80::a00:27ff:fe50:6a9b
Nexthop local: ::
BGP connection: non shared network
Last Reset: 00:09:03, due to BGP Notification sent
Notification Error Message: (OPEN Message Error/Bad Peer AS.)
#show ip bgp summary
BGP router identifier 192.168.52.2, local AS number 400
BGP table version is 16
1 BGP AS-PATH entries
0 BGP community entries
Neighbor V AS MsgRcv MsgSen TblVer InQ OutQ Up/Down State/PfxRcd
10.20.30.2 4 400 34 38 16 0 0 00:08:44 0
Total number of neighbors 1
Total number of Established sessions 1
R3
#show ip bgp summary
BGP router identifier 192.168.52.5, local AS number 90
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
11.20.30.20 4 400 2 2 1 0 0 00:00:15 0
Total number of neighbors 1
Total number of Established sessions 1
#show ip bgp neighbors
BGP neighbor is 11.20.30.20, remote AS 400, local AS 90, external link
BGP version 4, local router ID 192.168.52.5, remote router ID 192.168.52.3
Neighbor under common administration
BGP state = Established, up for 00:02:24
Last read 00:02:24, 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 6 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 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: 11.20.30.30, Local port: 33623
Foreign host: 11.20.30.20, Foreign port: 179
Nexthop: 11.20.30.30
Nexthop global: fe80::a00:27ff:fe24:5dc9
Nexthop local: ::
BGP connection: non shared network
Outside Autonomous System
In the following example, R1 and R2 are members of the same confederation with different AS numbers, and R3 is a member outside the confederation.
Topology
Single Confederation with Outside AS
R1
#configure terminal | Enter configure mode. |
---|
(config)#router bgp 400 | Assign the ASN value (400) to the router. |
(config-router)#bgp confederation identifier 1000 | Specify the BGP confederation ID. |
(config-router)#bgp confederation peers 7000 | Specify the neighbor ASN value for confederation membership. |
(config-router)#neighbor 10.20.30.2 remote-as 7000 | Specify the neighbor’s IP address (10.20.30.2) and the ASN value of the neighbor (7000). |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 10.20.30.2 activate | Activate the neighbor under address family mode |
(config-router-af)#exit-address-family | Exit address-family mode. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
R2
(config)#configure terminal | Enter configure mode |
(config)#router bgp 7000 | Assign the ASN value (7000) to the router. |
(config-router)#bgp confederation identifier 1000 | Specify the BGP confederation ID. |
(config-router)#bgp confederation peers 400 | Specify the neighbor ASN value for confederation membership. |
(config-router)#neighbor 10.20.30.1 remote-as 400 | Specify the neighbor’s IP address (10.20.30.1) and the ASN value of the neighbor (400). |
(config-router)#neighbor 11.20.30.30 remote-as 90 | Specify the neighbor’s IP address (11.20.30.30) and the ASN value of the neighbor (90). |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 10.20.30.1 activate | Activate the neighbor under address family mode |
(config-router-af)# neighbor 11.20.30.30 activate | Activate the neighbor under address family mode |
(config-router-af)#exit-address-family | Exit address-family mode. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
R3
#configure terminal | Enter configure mode. |
---|
(config)#router bgp 90 | Assign the ASN value (90) to the router. |
(config-router)#neighbor 11.20.30.20 remote-as 1000 | Specify the neighbor’s IP address (11.20.30.20) and the BGP confederation ID (1000). |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 11.20.30.20 activate | Activate the neighbor under address family mode |
(config-router-af)#exit-address-family | Exit address-family mode. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
Validation
R3
#show ip bgp neighbors
BGP neighbor is 11.20.30.20, remote AS 1000, local AS 90, external link
BGP version 4, local router ID 192.168.52.5, remote router ID 192.168.52.3
BGP state = Established, up for 00:01:10
Last read 00:01:10, 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 112 messages, 1 notifications, 0 in queue
Sent 142 messages, 88 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 2; dropped 1
Local host: 11.20.30.30, Local port: 33951
Foreign host: 11.20.30.20, Foreign port: 179
Nexthop: 11.20.30.30
Nexthop global: fe80::a00:27ff:fe24:5dc9
Nexthop local: ::
BGP connection: non shared network
Last Reset: 00:01:26, due to BGP Notification sent
Notification Error Message: (OPEN Message Error/Bad Peer AS.)
#sh ip bgp summary
BGP router identifier 192.168.52.5, local AS number 90
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
11.20.30.20 4 1000 113 230 1 0 0 00:01:13 0
Total number of neighbors 1
Total number of Established sessions 1
R2
#show ip bgp summary
BGP router identifier 192.168.52.3, local AS number 7000
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.20.30.1 4 400 22 22 1 0 0 00:10:04 0
11.20.30.30 4 90 179 202 1 0 0 00:00:42 0
Total number of neighbors 2
Total number of Established sessions 2
#show ip bgp neighbors
BGP neighbor is 10.20.30.1, remote AS 400, local AS 7000, external link
BGP version 4, local router ID 192.168.52.3, remote router ID 192.168.52.3
Neighbor under common administration
BGP state = Established, up for 00:11:06
Last read 00:11:06, 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 24 messages, 0 notifications, 0 in queue
Sent 24 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.20.30.2, Local port: 35444
Foreign host: 10.20.30.1, Foreign port: 179
Nexthop: 10.20.30.2
Nexthop global: fe80::a00:27ff:fe21:7ed2
Nexthop local: ::
BGP connection: non shared network
BGP neighbor is 11.20.30.30, remote AS 90, local AS 1000, external link
BGP version 4, remote router ID 192.168.56.103
BGP state = Established, up for 00:01:44
Last read 00:01:44, 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 93 messages, 88 notifications, 0 in queue
Sent 204 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 2, Offset 0, Mask 0x4
Community attribute sent to this neighbor (both)
0 accepted prefixes
0 announced prefixes
Connections established 1; dropped 0
Local host: 11.20.30.20, Local port: 179
Foreign host: 11.20.30.30, Foreign port: 33951
Nexthop: 11.20.30.20
Nexthop global: fe80::a00:27ff:fed0:57d1
Nexthop local: ::
BGP connection: non shared network
Last Reset: 00:02:00, due to BGP Notification received
Notification Error Message: (OPEN Message Error/Bad Peer AS.)
R1
#sh ip bgp summary
BGP router identifier 192.168.52.2, local AS number 400
BGP table version is 34
1 BGP AS-PATH entries
0 BGP community entries
Neighbor V AS MsgRcv MsgSen TblVer InQ OutQ Up/Down State/PfxRcd
10.20.30.2 4 7000 77 91 34 0 0 00:10:18 0
Total number of neighbors 1
Total number of Established sessions 1
#sh ip bgp neighbors
BGP neighbor is 10.20.30.2, remote AS 7000, local AS 400, external link
BGP version 4, local router ID 192.168.52.2, remote router ID 192.168.52.3
Neighbor under common administration
BGP state = Established, up for 00:11:40
Last read 00:11:40, 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 80 messages, 0 notifications, 0 in queue
Sent 82 messages, 12 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 35, neighbor version 35
Index 1, Offset 0, Mask 0x2
Community attribute sent to this neighbor (both)
0 accepted prefixes
0 announced prefixes
Connections established 3; dropped 2
Local host: 10.20.30.1, Local port: 179
Foreign host: 10.20.30.2, Foreign port: 35444
Nexthop: 10.20.30.1
Nexthop global: fe80::a00:27ff:fe50:6a9b
Nexthop local: ::
BGP connection: non shared network
Last Reset: 00:12:47, due to BGP Notification sent
Notification Error Message: (OPEN Message Error/Bad Peer AS.)
Dynamic BGP Peering
BGP Dynamic Neighbors is a quick way of setting up BGP on device like a Hub router where user is expecting numerous BGP neighbors. Before dynamic neighbors, user had to provide a large amount of configuration to work with all these neighbors. This new feature dramatically reduces the amount and complexity of CLI configuration on the router and save CPU and memory usage.
BGP dynamic neighbor support allows BGP peering to a group of remote neighbors that are defined by a range of IP addresses. Each range can be configured as a subnet IP address. BGP dynamic neighbors are configured using a range of IP addresses and BGP peer groups.
After a subnet range is configured for a BGP peer group and a TCP session is initiated by another router for an IP address in the subnet range, a new BGP neighbor is dynamically created as a member of that group. After the initial configuration of subnet ranges and activation of the peer group, dynamic BGP neighbor creation does not require any further CLI configuration on the initial router. Other routers can establish a BGP session with the initial router, but the initial router need not establish a BGP session to other routers if the IP address of the remote peer used for the BGP session is not within the configured range.
A dynamic BGP neighbor will inherit any configuration for the peer group. In larger BGP networks, implementing BGP dynamic neighbors can reduce the amount and complexity of CLI configuration and save CPU and memory usage. Both IPv4 and IPV6 peering is supported.
IPv4 IBGP Configuration
Below figure displays the minimum configuration required to enable BGP on an interface. R1 and R2 are two routers belonging to the same AS, AS100, connecting to network 11.11.11.0/24 and 11.11.12.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
IPv4 IBGP Peering
R1
#configure terminal | Enter configure mode. |
(config)#interface lo | Enter interface mode for loopback. |
(config-if)#ip address 33.33.33.33/32 secondary | Assign a secondary IP address. |
(config-if)#exit | Exit interface mode. |
(config)#interface xe1 | Enter interface mode for xe1. |
(config-if)#ip address 11.11.11.1/24 | Assign IP address to the interface. |
(config-if)#exit | Exit interface mode. |
(config)#interface xe2 | Enter interface mode for xe2. |
(config-if)#ip add 11.11.12.1/24 | Assign IP address to the interface. |
(config-if)#exit | Exit interface mode. |
(config)#router bgp 100 | Enter Router BGP mode. |
(config-router)#bgp router-id 1.1.1.1 | Assign a BGP router ID. |
(config-router)#neighbor IPV4_IBGP_PEER peer- group range 11.11.0.0/16 | Create a dynamic peer-group, IPV4_IBGP_PEER with a dynamic range 11.11.0.0/16 |
(config-router)#neighbor IPV4_IBGP_PEER remote-as 100 | Assign a remote AS for the peer-group, IPV4_IBGP_PEER. |
(config-router)#address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor IPV4_IBGP_PEER activate | Activate peer-group in the address family |
(config-router-af)#exit-address-family | Exit from address family mode. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
R2
#configure terminal | Enter configure mode. |
(config)#interface lo | Enter interface mode for loopback. |
(config-if)#ip address 22.22.22.22/32 secondary | Assign a secondary IP address. |
(config-if)#exit | Exit interface mode. |
(config)#interface xe1 | Enter interface mode for xe1. |
(config-if)#ip address 11.11.11.2/24 | Assign IP address to the interface. |
(config-if)#exit | Exit interface mode. |
(config)#interface xe2 | Enter interface mode for xe2. |
(config-if)#ip add 11.11.12.2/24 | Assign IP address to the interface. |
(config-if)#exit | Exit interface mode. |
(config)#router bgp 100 | Enter Router BGP mode. |
(config-router)#bgp router-id 2.2.2.2 | Assign a BGP router ID. |
(config-router)#neighbor 11.11.11.1 remote-as 100 | Create a static BGP neighbor 11.11.11.1 in remote AS 100. |
(config-router)#neighbor 11.11.12.1 remote-as 100 | Create a static BGP neighbor 11.11.12.1 in remote AS 100. |
(config-router)#address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 11.11.12.1 activate | Activate the neighbor under address family mode |
(config-router-af)# neighbor 11.11.12.1 activate | Activate the neighbor under address family mode |
(config-router-af)# network 22.22.22.22/32 | Advertise the loopback network into BGP. |
(config-router-af)#exit-address-family | Exit address-family mode. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
Validation
R1
#show ip bgp summary
BGP router identifier 1.1.1.1, local AS number 100
BGP table version is 2
1 BGP AS-PATH entries
0 BGP community entries
Neighbor V AS MsgRcv MsgSen TblVer InQ OutQ Up/Down State/PfxRcd
*11.11.11.2 4 100 42 43 2 0 0 00:20:25 1
*11.11.12.2 4 100 42 43 2 0 0 00:20:25 1
* Dynamically created based on a listen range command
BGP dynamic peer-group: IPV4_IBGP_PEER
listen range: 11.11.0.0/16
Total number of dynamically created neighbors/limit: 2/(200)
Total number of dynamically created neighbors: 2
Total number of activated dynamic peer-groups for IPv4 Unicast address-family: 1
Total number of neighbors 2
Total number of Established sessions 2
#show ip bgp neighbors
BGP neighbor is 11.11.11.2, remote AS 100, local AS 100, internal link
Member of peer-group IPV4_IBGP_PEER for session parameters
BGP version 4, local router ID 1.1.1.1, remote router ID 2.2.2.2
BGP state = Established, up for 00:21:56
Last read 00:00:27, 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 46 messages, 0 notifications, 0 in queue
Sent 46 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 3, neighbor version 3
Index 0, Offset 0, Mask 0x1
IPV4_IBGP_PEER peer-group member
Community attribute sent to this neighbor (both)
1 accepted prefixes
1 announced prefixes
Connections established 1; dropped 0
Local host: 11.11.11.1, Local port: 40361
Foreign host: 11.11.11.2, Foreign port: 179
Nexthop: 11.11.11.1
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
BGP neighbor is 11.11.12.2, remote AS 100, local AS 100, internal link
Member of peer-group IPV4_IBGP_PEER for session parameters
BGP version 4, local router ID 1.1.1.1, remote router ID 2.2.2.2
BGP state = Established, up for 00:21:56
Last read 00:00:27, 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 46 messages, 0 notifications, 0 in queue
Sent 46 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 3, neighbor version 3
Index 1, Offset 0, Mask 0x2
IPV4_IBGP_PEER peer-group member
Community attribute sent to this neighbor (both)
1 accepted prefixes
1 announced prefixes
Connections established 1; dropped 0
Local host: 11.11.12.1, Local port: 33478
Foreign host: 11.11.12.2, Foreign port: 179
Nexthop: 11.11.12.1
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
#show running-config bgp
router bgp 100
bgp router-id 1.1.1.1 network 33.33.33.33/32
neighbor IPV4_IBGP_PEER peer-group range 11.11.0.0/16 neighbor IPV4_IBGP_PEER remote-as 100
!
address-family ipv4 unicast
neighbor IPV4_IBGP_PEER activate
exit-address-family
#show ip bgp
BGP table version is 2, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
l - labeled, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*>i 22.22.22.22/32 11.11.11.2 0 100 0 i
* i 11.11.12.2 0 100 0 i
*> 33.33.33.33/32 0.0.0.0 0 100 32768 i
Total number of prefixes 2
R2
#show ip bgp summary
BGP router identifier 2.2.2.2, local AS number 100
BGP table version is 3
1 BGP AS-PATH entries
0 BGP community entries
Neighbor V AS MsgRcv MsgSen TblVer InQ OutQ Up/Down State/PfxRcd
11.11.11.1 4 100 55 56 3 0 0 00:26:21 1
11.11.12.1 4 100 55 56 3 0 0 00:26:21 1
Total number of neighbors 2
Total number of Established sessions 2
#show bgp neighbors
BGP neighbor is 11.11.11.1, remote AS 100, local AS 100, internal link
BGP version 4, local router ID 2.2.2.2, remote router ID 1.1.1.1
BGP state = Established, up for 00:26:43
Last read 00:00:14, 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 56 messages, 0 notifications, 0 in queue
Sent 57 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 3, neighbor version 3
Index 0, Offset 0, Mask 0x1
Community attribute sent to this neighbor (both)
1 accepted prefixes
1 announced prefixes
Connections established 1; dropped 0
Local host: 11.11.11.2, Local port: 179
Foreign host: 11.11.11.1, Foreign port: 40361
Nexthop: 11.11.11.2
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
BGP neighbor is 11.11.12.1, remote AS 100, local AS 100, internal link
BGP version 4, local router ID 2.2.2.2, remote router ID 1.1.1.1
BGP state = Established, up for 00:26:43
Last read 00:00:14, 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 56 messages, 0 notifications, 0 in queue
Sent 57 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 3, neighbor version 3
Index 1, Offset 0, Mask 0x2
Community attribute sent to this neighbor (both)
1 accepted prefixes
1 announced prefixes
Connections established 1; dropped 0
Local host: 11.11.12.2, Local port: 179
Foreign host: 11.11.12.1, Foreign port: 33478
Nexthop: 11.11.12.2
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
#show ip bgp
BGP table version is 3, local router ID is 2.2.2.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
l - labeled, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 22.22.22.22/32 0.0.0.0 0 100 32768 i
*>i 33.33.33.33/32 11.11.11.1 0 100 0 i
* i 11.11.12.1 0 100 0 i
Total number of prefixes 2
IPv4 IBGP VRF Configuration
Below figure displays the minimum configuration required to enable BGP on an interface with vrf enabled on the device and interface being part of vrf. R1 and R2 are two routers belonging to the same AS, AS100, connecting to network 11.11.11.0/24 and 11.11.12.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
IPv4 VRF IBGP Peering
R1
#Configure terminal | Enter Configuration mode. |
(config)#ip vrf vrfA | Create a VRF, vrfA on the router. |
(config-vrf)#rd 1:1 | Assign a route distinguisher to VRF. |
(config-if)#exit | Exit VRF mode and return to Configure mode. |
(config)#interface xe1 | Enter interface mode for xe1. |
(config-if)# ip vrf forwarding vrfA | Assign IP address to VRF. |
(config-if)#ip address 11.11.11.1/24 | Assign IP address to the interface. |
(config-if)#exit | Exit interface mode. |
(config)#interface xe2 | Enter interface mode for xe2. |
(config-if)# ip vrf forwarding vrfA | Assign IP address to VRF. |
(config-if)#ip add 11.11.12.1/24 | Assign IP address to the interface. |
(config-if)#exit | Exit interface mode. |
(config)#router bgp 100 | Enter Router BGP mode. |
(config-router)#bgp router-id 1.1.1.1 | Assign a BGP router ID. |
(config-router)#address-family ipv4 vrf vrfA | Enter IPv4 VRF Address Family. |
(config-router-af)#neighbor IPV4_IBGP_PEER peer-group range 11.11.0.0/16 | Create a dynamic peer-group, IPV4_IBGP_PEER with a dynamic range 11.11.0.0/16. |
(config-router-af)#neighbor IPV4_IBGP_PEER remote-as 100 | Assign a remote AS for the peer-group, IPV4_IBGP_PEER. |
(config-router-af)# neighbor IPV4_IBGP_PEER activate | Activate peer-group in the address family |
(config-router-af)#network 33.33.33.33/32 | Advertise the loopback network into BGP |
(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)#ip vrf vrfA | Create a VRF, vrfA on router. |
(config-vrf)#rd 2:1 | Assign a route distinguisher to VRF. |
(config-if)#exit | Exit VRF mode and return to Configure mode. |
(config)#interface xe1 | Enter interface mode for xe1. |
(config-if)# ip vrf forwarding vrfA | Assign IP address to VRF. |
(config-if)#ip address 11.11.11.2/24 | Assign IP address to the interface. |
(config-if)#exit | Exit interface mode. |
(config)#interface xe2 | Enter interface mode for xe2. |
(config-if)# ip vrf forwarding vrfA | Assign IP address to VRF. |
(config-if)#ip add 11.11.12.2/24 | Assign IP address to the interface. |
(config-if)#exit | Exit interface mode. |
(config)#router bgp 100 | Enter Router BGP mode. |
(config-router)#bgp router-id 2.2.2.2 | Assign a BGP router ID. |
(config-router)#address-family ipv4 vrf vrfA | Enter IPv4 VRF Address Family. |
(config-router-af)#neighbor 11.11.11.1 remote-as 100 | Create a static BGP neighbor 11.11.11.1 in remote AS 100. |
(config-router-af)# neighbor 11.11.11.1 activate | Activate neighbor in the address family |
(config-router-af)#neighbor 11.11.12.1 remote-as 100 | Create a static BGP neighbor 11.11.12.1 in remote AS 100 |
(config-router-af)# neighbor 11.11.12.1 activate | Activate neighbor in the address family |
(config-router-af)#network 22.22.22.22/32 | Advertise the loopback network into BGP. |
(config-router-af)#exit-address-family | Exit address-family mode. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
Validation
R1
#show running-config bgp
!
router bgp 100
bgp router-id 1.1.1.1
!
address-family ipv4 vrf vrfA
neighbor IPV4_VRF_IBGP_PEER peer-group range 11.11.0.0/16
neighbor IPV4_VRF_IBGP_PEER remote-as 100
neighbor IPV4_VRF_IBGP_PEER activate
network 33.33.33.33/32
exit-address-family
!
#show ip bgp summary vrf vrfA
BGP router identifier 11.11.11.1, local AS number 100
BGP VRF vrfA Route Distinguisher: 1:1
BGP table version is 1
1 BGP AS-PATH entries
0 BGP community entries
Neighbor V AS MsgRcv MsgSen TblVer InQ OutQ Up/Down State/PfxRcd
*11.11.11.2 4 100 3 3 1 0 0 00:01:00 0
*11.11.12.2 4 100 3 3 1 0 0 00:00:55 0
* Dynamically created based on a listen range command
BGP dynamic peer-group: IPV4_IBGP_PEER
listen range: 11.11.0.0/16
Total number of dynamically created neighbors/limit: 2/(200)
Total number of dynamically created neighbors: 2
Total number of activated dynamic peer-groups for IPv4 Unicast address-family: 1
Total number of neighbors 2
Total number of Established sessions 2
#show bgp neighbors
BGP neighbor is 11.11.11.2, vrf vrfA, remote AS 100, local AS 100, internal link
Member of peer-group IPV4_IBGP_PEER for session parameters
BGP version 4, local router ID 11.11.11.1, remote router ID 11.11.11.2
BGP state = Established, up for 00:07:26
Last read 00:00:26, 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 16 messages, 0 notifications, 0 in queue
Sent 16 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
IPV4_IBGP_PEER peer-group member
Community attribute sent to this neighbor (both)
0 accepted prefixes
0 announced prefixes
Connections established 1; dropped 0
Local host: 11.11.11.1, Local port: 36365
Foreign host: 11.11.11.2, Foreign port: 179
Nexthop: 11.11.11.1
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
BGP neighbor is 11.11.12.2, vrf vrfA, remote AS 100, local AS 100, internal link
Member of peer-group IPV4_IBGP_PEER for session parameters
BGP version 4, local router ID 11.11.11.1, remote router ID 11.11.11.2
BGP state = Established, up for 00:07:21
Last read 00:00:21, 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 16 messages, 0 notifications, 0 in queue
Sent 16 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 2, Offset 0, Mask 0x4
IPV4_IBGP_PEER peer-group member
Community attribute sent to this neighbor (both)
0 accepted prefixes
0 announced prefixes
Connections established 1; dropped 0
Local host: 11.11.12.1, Local port: 38144
Foreign host: 11.11.12.2, Foreign port: 179
Nexthop: 11.11.12.1
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
IPv4 EBGP Configuration
Below figure displays the minimum configuration required to enable BGP on an interface. R1, R2 and R3 are three routers belonging to the different AS, AS100 AS200 and AS300, connecting to network 11.11.11.0/24 and 11.11.12.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
IPv4 EBGP Peering
R1
#configure terminal | Enter configure mode. |
(config)#interface lo | Enter interface mode for loopback. |
(config-if)#ip address 33.33.33.33/32 secondary | Assign a secondary IP address. |
(config-if)#exit | Exit interface mode. |
(config)#interface xe1 | Enter interface mode for xe1. |
(config-if)#ip address 11.11.11.1/24 | Assign IP address to the interface. |
(config-if)#exit | Exit interface mode. |
(config)#router bgp 100 | Enter Router BGP mode. |
(config-router)#bgp router-id 1.1.1.1 | Assign a BGP router ID. |
(config-router)#neighbor 11.11.11.2 remote-as 200 | Create a static neighbor 11.11.11.2 with remote AS 200. |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode. |
(config-router-af)# neighbor 11.11.11.2 activate | Activate the neighbor under address family mode |
(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)#interface lo | Enter interface mode for loopback. |
(config-if)#ip address 22.22.22.22/32 secondary | Assign a secondary IP address. |
(config-if)#exit | Exit interface mode. |
(config)#interface xe1 | Enter interface mode for xe1. |
(config-if)#ip address 11.11.11.2/24 | Assign IP address to the interface. |
(config-if)#exit | Exit interface mode. |
(config)#interface xe2 | Enter interface mode for xe2. |
(config-if)#ip add 11.11.12.2/24 | Assign IP address to the interface. |
(config-if)#exit | Exit interface mode. |
(config)#router bgp 200 | Enter Router BGP mode. |
(config-router)#bgp router-id 2.2.2.2 | Assign a BGP router ID. |
(config-router)#neighbor IPV4_EBGP_PEER peer-group range 11.11.0.0/16 | Create a dynamic peer-group, IPV4_EBGP_PEER. |
(config-router)#neighbor IPV4_EBGP_PEER remote-as 100 | Assign remote AS with the peer-group IPV4_EBGP_PEER. |
(config-router)#neighbor IPV4_EBGP_PEER optional-as 300 | Assign optional AS with the peer-group IPV4_EBGP_PEER |
(config-router)#address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor IPV4_EBGP_PEER activate | Activate the peer-group in address family |
(config-router-af)#network 22.22.22.22/32 | Advertise the loopback network into BGP. |
(config-router-af)#exit-address-family | Exit address-family mode. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
R3
#configure terminal | Enter configure mode. |
(config)#interface lo | Enter interface mode for loopback. |
(config-if)#ip address 44.44.44.44/32 secondary | Assign a secondary IP address. |
(config-if)#exit | Exit interface mode. |
(config)#interface xe2 | Enter interface mode for xe2. |
(config-if)#ip add 11.11.12.3/24 | Assign IP address to the interface. |
(config-if)#exit | Exit interface mode. |
(config)#router bgp 300 | Enter Router BGP mode. |
(config-router)#bgp router-id 3.3.3.3 | Assign a BGP router ID. |
(config-router)#neighbor 11.11.12.2 remote-as 200 | Create a static BGP neighbor 11.11.12.2 with remote AS 200. |
(config-router)#address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 11.11.12.2 activate | Activate the neighbor under address family mode |
(config-router-af)#network 44.44.44.44/32 | Advertise the loopback network into BGP. |
(config-router-af)#exit-address-family | Exit address-family mode. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
Validation
R2
#show ip bgp summary
BGP router identifier 2.2.2.2, local AS number 200
BGP table version is 3
2 BGP AS-PATH entries
0 BGP community entries
Neighbor V AS MsgRcv MsgSen TblVer InQ OutQ Up/Down State/PfxRcd
*11.11.11.1 4 100 29 29 3 0 0 00:13:10 1
*11.11.12.3 4 300 27 27 3 0 0 00:12:20 1
* Dynamically created based on a listen range command
BGP dynamic peer-group: IPV4_EBGP_PEER
listen range: 11.11.0.0/16
Total number of dynamically created neighbors/limit: 2/(200)
Total number of dynamically created neighbors: 2
Total number of activated dynamic peer-groups for IPv4 Unicast address-family: 1
Total number of neighbors 2
Total number of Established sessions 2
#show running-config bgp
!
router bgp 200
bgp router-id 2.2.2.2
neighbor IPV4_EBGP_PEER peer-group range 11.11.0.0/16
neighbor IPV4_EBGP_PEER remote-as 100
neighbor IPV4_EBGP_PEER optional-as 300
!
address-family ipv4 unicast
neighbor IPV4_EBGP_PEER activate
network 22.22.22.22/32
exit-address-family
!
#show bgp neighbors
BGP neighbor is 11.11.11.1, remote AS 100, local AS 200, external link
Member of peer-group IPV4_EBGP_PEER for session parameters
BGP version 4, local router ID 2.2.2.2, remote router ID 1.1.1.1
BGP state = Established, up for 00:17: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 37 messages, 0 notifications, 0 in queue
Sent 38 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 3, neighbor version 3
Index 1, Offset 0, Mask 0x2
IPV4_EBGP_PEER peer-group member
Community attribute sent to this neighbor (both)
1 accepted prefixes
2 announced prefixes
Connections established 1; dropped 0
Local host: 11.11.11.2, Local port: 42252
Foreign host: 11.11.11.1, Foreign port: 179
Nexthop: 11.11.11.2
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
BGP neighbor is 11.11.12.3, remote AS 300, local AS 200, external link
Member of peer-group IPV4_EBGP_PEER for session parameters
BGP version 4, local router ID 2.2.2.2, remote router ID 3.3.3.3
BGP state = Established, up for 00:13:17
Last read 00:00:17, 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 29 messages, 0 notifications, 0 in queue
Sent 30 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 3, neighbor version 3
Index 2, Offset 0, Mask 0x4
IPV4_EBGP_PEER peer-group member
Community attribute sent to this neighbor (both)
1 accepted prefixes
2 announced prefixes
Connections established 1; dropped 0
Local host: 11.11.12.2, Local port: 59839
Foreign host: 11.11.12.3, Foreign port: 179
Nexthop: 11.11.12.2
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
IPv6 IBGP Configuration
Below figure displays the minimum configuration required to enable BGP on an interface. R1 and R2 are two routers belonging to the same AS, AS100, connecting to network 11:11:11::1/64 and 11:11:12::1/64. First, define the routing process and the AS number to which the routers belong. Then, define BGP neighbors to start exchanging routing updates.
Topology
IPv6 IBGP Peering
R1
#Configure terminal | Enter configure mode. |
(config)#interface lo | Enter interface mode for loopback. |
(config-if)#ipv6 address 33::1/128 | Assign an IPv6 address. |
(config-if)#exit | Exit interface mode. |
(config)#interface xe1 | Enter interface mode for xe1. |
(config-if)#ipv6 address 11:11:11::1/64 | Assign an IPv6 address to the interface. |
(config-if)#exit | Exit interface mode. |
(config)#interface xe2 | Enter interface mode for xe2. |
(config-if)#ipv6 address 11:11:12::1/64 | Assign an IPv6 address to the interface. |
(config-if)#exit | Exit interface mode. |
(config)#router bgp 100 | Enter Router BGP mode. |
(config-router)#bgp router-id 1.1.1.1 | Assign a BGP router ID. |
(config-router)#neighbor IPV6_IBGP_PEER peer-group range 11:11::/16 | Create a dynamic peer-group, IPV6_IBGP_PEER with a dynamic range 11:11::/16 |
(config-router)#neighbor IPV6_IBGP_PEER remote-as 100 | Configure a remote AS with the peer group, IPV6_IBGP_PEER. |
(config-router)#neighbor IPV6_IBGP_PEER limit 1 | Set peer group neighbors limit to 1. Only one BGP session will be up. |
(config-router)#address-family ipv6 unicast | Enter the IPv6 Unicast Address Family. |
(config-router-af)#neighbor IPV6_IBGP_PEER activate | Activate the peer group, IPV6_IBGP_PEER in the IPv6 address family. |
(config-router-af)#network 33::1/128 | Advertise the loopback network into the BGP IPv6 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 Configuration mode. |
(config)#interface lo | Enter interface mode for loopback. |
(config-if)#ipv6 address 22::2/128 | Assign an IPv6 address. |
(config-if)#exit | Exit interface mode. |
(config)#interface xe1 | Enter interface mode for xe1. |
(config-if)#ipv6 address 11:11:11::2/64 | Assign an IPv6 address to the interface. |
(config-if)#exit | Exit interface mode. |
(config)#interface xe2 | Enter interface mode for xe2. |
(config-if)#ipv6 address 11:11:12::2/64 | Assign an IPv6 address to the interface. |
(config-if)#exit | Exit interface mode. |
(config)#router bgp 100 | Enter Router BGP mode. |
(config-router)#bgp router-id 2.2.2.2 | Assign a BGP router ID. |
(config-router)#neighbor 11:11:11::1 remote-as 100 | Configure BGP neighbor by specifying the neighbor IP address. |
(config-router)#neighbor 11:11:12::1 remote-as 100 | Configure BGP neighbor by specifying the neighbor IP address. |
(config-router)#address-family ipv4 unicast | Enter the Ipv4 Unicast Address Family. |
(config-router-af)# neighbor 11:11:11::1 activate | Activate the neighbor under address family mode |
(config-router-af)# neighbor 11:11:12::1 activate | Activate the neighbor under address family mode |
(config-router-af)# exit-address-family | Exit address-family mode. |
(config-router)#address-family ipv6 unicast | Enter the IPv6 Unicast Address Family. |
(config-router-af)#network 22::2/128 | Advertise the loopback network into BGP. |
(config-router-af)#neighbor 11:11:12::1 activate | Activate the neighbor in the IPv6 address family. |
(config-router-af)#neighbor 11:11:11::1 activate | Activate the neighbor in the IPv6 address family. |
(config-router-af)#exit-address-family | Exit address-family mode. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
Validation
R1
#show ipv6 bgp summary
BGP router identifier 1.1.1.1, local AS number 100
BGP table version is 2
1 BGP AS-PATH entries
0 BGP community entries
Neighbor V AS MsgRcv MsgSen TblVer InQ OutQ Up/Down State/PfxRcd
*11:11:11::2 4 100 6 6 2 0 0 00:01:41 1
* Dynamically created based on a listen range command
BGP dynamic peer-group: IPV6_IBGP_PEER
listen range: 11::/16
Total number of dynamically created neighbors/limit: 1/(1)
Total number of dynamically created neighbors: 1
Total number of activated dynamic peer-groups for IPv6 Unicast address-family: 1
Total number of neighbors 1
Total number of Established sessions 1
#show ip bgp peer-group IPV6_IBGP_PEER
BGP dynamic peer-group is IPV6_IBGP_PEER, IBGP, remote AS 100
BGP dynamic peer-group IPV6_IBGP_PEER listen range group members:
11::/16
BGP version 4
Minimum time between advertisement runs is 5 seconds
For address family: IPv4 Unicast
Peer-group member:
*11:11:11::2
Index 1, Offset 0, Mask 0x2
0 accepted prefixes, 0 announced prefixes
For address family: IPv6 Unicast
Peer-group member:
*11:11:11::2
Index 0, Offset 0, Mask 0x0
1 accepted prefixes, 1 announced prefixes
#show bgp ipv6
BGP table version is 2, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
l - labeled, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*>i 22::2/128 11:11:11::2(fe80::5054:ff:fe95:85ec)
0 100 0 i
*> 33::1/128 :: 0 100 32768 i
Total number of prefixes 2
#show running-config bgp
!
router bgp 100
bgp router-id 1.1.1.1
neighbor IPV6_IBGP_PEER peer-group range 11::/16
neighbor IPV6_IBGP_PEER remote-as 100
neighbor IPV6_IBGP_PEER limit 1
!
address-family ipv6 unicast
network 33::1/128
neighbor IPV6_IBGP_PEER activate
exit-address-family
#show bgp neighbors
BGP neighbor is 11:11:11::2, remote AS 100, local AS 100, internal link
Member of peer-group IPV6_IBGP_PEER for session parameters
BGP version 4, local router ID 1.1.1.1, remote router ID 2.2.2.2
BGP state = Established, up for 00:04:17
Last read 00:00:18, 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
Address family IPv6 Unicast: advertised and received
Received 11 messages, 0 notifications, 0 in queue
Sent 11 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 0, Offset 0, Mask 0x1
IPV6_IBGP_PEER peer-group member
Community attribute sent to this neighbor (both)
0 accepted prefixes
0 announced prefixes
For address family: IPv6 Unicast
BGP table version 2, neighbor version 2
Index 0, Offset 0, Mask 0x0
IPV6_IBGP_PEER peer-group member
Community attribute sent to this neighbor (both)
1 accepted prefixes
1 announced prefixes
Connections established 1; dropped 0
Local host: 11:11:11::1, Local port: 42410
Foreign host: 11:11:11::2, Foreign port: 179
Nexthop: 1.1.1.1
Nexthop global: 11:11:11::1
Nexthop local: fe80::5054:ff:fe51:f74
BGP connection: shared network
IPV6 IBGP VRF Configuration
Below figure displays the minimum configuration required to enable BGP on an interface with VRF enabled on the device and interface being part of VRF. R1 and R2 are two routers belonging to the same AS, AS100, connecting to network 11:11:11::1 and 11:11:12::1. First, define the routing process and the AS number to which the routers belong. Then, define BGP neighbors to start exchanging routing updates.
Topology
IPv6 VRF IBGP peering
R1
#Configure terminal | Enter Configuration mode. |
(config)#ip vrf vrfA | Configure a VRF, vrfA. |
(config-vrf)#rd 1:1 | Configure a route distinguisher to VRF. |
(config-vrf)#router-id 7.7.7.7 | Configure a router ID. |
(config-vrf)#exit | Exit from VRF mode and return to Configuration mode. |
(config)#interface xe1 | Enter interface mode for xe1. |
(config-if)# ip vrf forwarding vrfA | Assign IP address to VRF. |
(config-if)#ipv6 address 11:11:11::1/64 | Assign an IPv6 address to the interface. |
(config-if)#exit | Exit interface mode. |
(config)#interface xe2 | Enter interface mode for xe2. |
(config-if)# ip vrf forwarding vrfA | Assign IP address to VRF. |
(config-if)#ipv6 address 11:11:12::1/64 | Assign an IPv6 address to the interface. |
(config-if)#exit | Exit interface mode. |
(config)#router bgp 100 | Enter Router BGP mode. |
(config-router)#address-family ipv6 vrf vrfA | Enter IPv6 VRF Address Family. |
(config-router-af)#neighbor IPV6_VRF_IBGP_PEER peer-group range 11:11::1/16 | Configure a dynamic peer group, IPV6_IBGP_PEER with a dynamic range value. |
(config-router-af)#neighbor IPV6_VRF_IBGP_PEER remote-as 100 | Configure a remote AS with the peer group, IPV6_IBGP_PEER. |
(config-router-af)# neighbor IPV6_VRF_IBGP_PEER activate | Activate neighbor in the 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)#ip vrf vrfA | Configure a VRF, vrfA. |
(config-vrf)#rd 2:1 | Configure a route distinguisher to VRF. |
(config-vrf)#router-id 1.1.1.1 | Configure a router ID. |
(config-vrf)#exit | Exit from VRF mode and return to Configuration mode. |
(config)#interface xe1 | Enter interface mode for xe1. |
(config-if)# ip vrf forwarding vrfA | Assign IP address to VRF. |
(config-if)#ipv6 address 11:11:11::2/64 | Assign an IPv6 address to the interface. |
(config-if)#exit | Exit interface mode. |
(config)#interface xe2 | Enter interface mode for xe2. |
(config-if)# ip vrf forwarding vrfA | Assign IP address to vrf. |
(config-if)#ipv6 address 11:11:12::2/64 | Assign an IPv6 address to the interface. |
(config-if)#exit | Exit interface mode. |
(config)#router bgp 100 | Enter Router BGP mode |
(config-router)#address-family ipv6 vrf vrfA | Enter IPv6 VRF Address Family. |
(config-router-af)#neighbor 11:11:12::1 remote-as 100 | Configure BGP neighbor by specifying the neighbor IP address. |
(config-router-af)# neighbor 11:11:12::1 activate | Activate neighbor in the address family |
(config-router-af)#neighbor 11:11:11::1 remote-as 100 | Configure BGP neighbor by specifying the neighbor IP address. |
(config-router-af)# neighbor 11:11:11::1 activate | Activate neighbor in the address family |
(config-router-af)#exit-address-family | Exit address-family mode. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
Validation
R1
#show ipv6 bgp summary vrf vrfA
BGP router identifier 7.7.7.7, local AS number 100
BGP VRF vrfA Route Distinguisher: 1:1
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
*11:11:11::2 4 100 6 6 1 0 0 00:00:17 0
*11:11:12::2 4 100 7 10 1 0 0 00:00:15 0
* Dynamically created based on a listen range command
BGP dynamic peer-group: IPV6_VRF_IBGP_PEER
listen range: 11::/16
Total number of dynamically created neighbors/limit: 2/(200)
Total number of dynamically created neighbors: 2
Total number of activated dynamic peer-groups for IPv6 Unicast address-family: 1
Total number of neighbors 2
Total number of Established sessions 2
#show running-config bgp
!
router bgp 100
!
address-family ipv6 vrf vrfA
neighbor IPV6_VRF_IBGP_PEER peer-group range 11::/16
neighbor IPV6_VRF_IBGP_PEER remote-as 100
neighbor IPV6_VRF_IBGP_PEER activate
exit-address-family
!
#show ip bgp peer-group vrf vrfA
BGP dynamic peer-group is IPV6_VRF_IBGP_PEER, IBGP, remote AS 100
BGP dynamic peer-group IPV6_VRF_IBGP_PEER listen range group members:
11::/16
BGP version 4
Minimum time between advertisement runs is 5 seconds
For address family: IPv6 Unicast
Peer-group member:
*11:11:12::2
Index 1, Offset 0, Mask 0x2
0 accepted prefixes, 0 announced prefixes
Peer-group member:
*11:11:11::2
Index 2, Offset 0, Mask 0x4
0 accepted prefixes, 0 announced prefixes
#show running-config bgp
!
router bgp 100
!
address-family ipv6 vrf vrfA
neighbor IPV6_VRF_IBGP_PEER peer-group range 11::/16
neighbor IPV6_VRF_IBGP_PEER remote-as 100
neighbor IPV6_VRF_IBGP_PEER activate
exit-address-family
!
#show bgp ipv6 neighbors
BGP neighbor is 11:11:11::2, vrf vrfA, remote AS 100, local AS 100, internal link
Member of peer-group IPV6_VRF_IBGP_PEER for session parameters
BGP version 4, local router ID 7.7.7.7, remote router ID 1.1.1.1
BGP state = Established, up for 00:02:13
Last read 00:00:14, hold time is 90, keepalive interval is 30 seconds
Neighbor capabilities:
Route refresh: advertised and received (old and new)
Address family IPv6 Unicast: advertised and received
Received 8 messages, 2 notifications, 0 in queue
Sent 10 messages, 0 notifications, 0 in queue
Route refresh request: received 0, sent 0
Minimum time between advertisement runs is 5 seconds
For address family: IPv6 Unicast
BGP table version 1, neighbor version 1
Index 2, Offset 0, Mask 0x4
IPV6_VRF_IBGP_PEER peer-group member
Community attribute sent to this neighbor (both)
0 accepted prefixes
0 announced prefixes
Connections established 1; dropped 0
Local host: 11:11:11::1, Local port: 179
Foreign host: 11:11:11::2, Foreign port: 48206
Nexthop: 7.7.7.7
Nexthop global: 11:11:11::1
Nexthop local: fe80::5054:ff:fe51:f74
BGP connection: shared network
Last Reset: 00:02:18, due to BGP Notification received
Notification Error Message: (OPEN Message Error/Bad BGP Identifier.)
BGP neighbor is 11:11:12::2, vrf vrfA, remote AS 100, local AS 100, internal link
Member of peer-group IPV6_VRF_IBGP_PEER for session parameters
BGP version 4, local router ID 7.7.7.7, remote router ID 1.1.1.1
BGP state = Established, up for 00:02:11
Last read 00:00:12, hold time is 90, keepalive interval is 30 seconds
Neighbor capabilities:
Route refresh: advertised and received (old and new)
Address family IPv6 Unicast: advertised and received
Received 8 messages, 3 notifications, 0 in queue
Sent 13 messages, 1 notifications, 0 in queue
Route refresh request: received 0, sent 0
Minimum time between advertisement runs is 5 seconds
For address family: IPv6 Unicast
BGP table version 1, neighbor version 1
Index 1, Offset 0, Mask 0x2
IPV6_VRF_IBGP_PEER peer-group member
Community attribute sent to this neighbor (both)
0 accepted prefixes
0 announced prefixes
Connections established 1; dropped 0
Local host: 11:11:12::1, Local port: 179
Foreign host: 11:11:12::2, Foreign port: 49010
Nexthop: 7.7.7.7
Nexthop global: 11:11:12::1
Nexthop local: fe80::5054:ff:fe8b:8f5c
BGP connection: shared network
Last Reset: 00:02:16, due to BGP Notification received
Notification Error Message: (OPEN Message Error/Bad BGP Identifier.)
IPv6 EBGP Configuration
Below figure displays the minimum configuration required to enable BGP on an interface. R1, R2 and R3 are three routers belonging to the different AS, AS100 AS200 and AS300, connecting to network 11:11:11::/64 and 11:11:12::/64. First, define the routing process and the AS number to which the routers belong. Then, define BGP neighbors to start exchanging routing updates.
Topology
IPv6 EBGP peering
R1
#configure terminal | Enter Configuration mode. |
(config)#interface lo | Enter interface mode for loopback. |
(config-if)#ipv6 address 33::1/128 | Assign an IPv6 address. |
(config-if)#exit | Exit interface mode. |
(config)#interface xe1 | Enter interface mode for xe1. |
(config-if)#ipv6 address 11:11:11::1/64 | Assign an IPv6 address to the interface. |
(config-if)#exit | Exit interface mode. |
(config)#router bgp 100 | Enter Router BGP mode. |
(config-router)#bgp router-id 1.1.1.1 | Assign a BGP router ID. |
(config-router)#neighbor 11:11:11::2 remote-as 200 | Configure BGP neighbor by specifying the neighbor IP address. |
(config-router)#address-family ipv6 unicast | Enter the IPv6 Unicast Address Family. |
(config-router-af)#neighbor 11:11:11::2 activate | Activate the neighbor in the address family. |
(config-router-af)#network 33::1/128 | Advertise the loopback network into BGP. |
(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 Configuration mode. |
(config)#interface lo | Enter interface mode for loopback. |
(config-if)#ipv6 address 22::1/128 | Assign an IPv6 address. |
(config-if)#exit | Exit interface mode. |
(config)#interface xe1 | Enter interface mode for xe1 |
(config-if)#ipv6 address 11:11:11::2/64 | Assign an IPv6 address to the interface. |
(config-if)#exit | Exit interface mode. |
(config)#interface xe2 | Enter interface mode for xe2. |
(config-if)#ipv6 address 11:11:12::2/64 | Assign an IPv6 address to the interface. |
(config-if)#exit | Exit interface mode. |
(config)#router bgp 200 | Enter Router BGP mode. |
(config-router)#bgp router-id 2.2.2.2 | Assign a BGP router ID. |
(config-router)#neighbor IPV6_EBGP_PEER peer-group range 11::1/16 | Configure a dynamic peer group, IPV6_EBGP_PEER. |
(config-router)#neighbor IPV6_EBGP_PEER remote-as 100 | Configure remote AS with peer group, IPV6_EBGP_PEER. |
(config-router)#neighbor IPV6_EBGP_PEER optional-as 300 | Configure optional AS with peer group, IPV6_EBGP_PEER. |
(config-router)#address-family ipv6 unicast | Enter IPv6 Unicast Address Family. |
(config-router-af)#neighbor IPV6_EBGP_PEER activate | Activate peer group in the address family. |
(config-router-af)#network 22::1/128 | Advertise the loopback network into BGP. |
(config-router-af)#exit-address-family | Exit address-family mode. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
R3
#Configure terminal | Enter Configuration mode. |
(config)#interface lo | Enter interface mode for loopback. |
(config-if)#ipv6 address 44::1/128 | Assign an IPv6 address. |
(config-if)#exit | Exit interface mode. |
(config)#interface xe2 | Enter interface mode for xe2 |
(config-if)#ipv6 address 11:11:12::3/64 | Assign an IPv6 address. |
(config-if)#exit | Exit interface mode. |
(config)#router bgp 300 | Enter Router BGP mode. |
(config-router)#bgp router-id 3.3.3.3 | Assign a BGP router ID. |
(config-router)#neighbor 11:11:12::2 remote-as 200 | Configure the BGP neighbor by specifying the neighbor IP address. |
(config-router)#address-family ipv6 unicast | Enter the IPv6 Unicast Address Family. |
(config-router-af)#neighbor 11:11:12::2 activate | Activate the neighbor in address family. |
(config-router-af)#network 44::1/128 | Advertise the loopback network into BGP. |
(config-router-af)#exit-address-family | Exit address-family mode. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
Validation
R2
#show ipv6 bgp sum
BGP router identifier 2.2.2.2, local AS number 200
BGP table version is 5
3 BGP AS-PATH entries
0 BGP community entries
Neighbor V AS MsgRcv MsgSen TblVer InQ OutQ Up/Down State/PfxRcd
*11:11:11::1 4 100 9 11 5 0 0 00:01:28 1
*11:11:12::3 4 300 6 6 5 0 0 00:01:14 1
* Dynamically created based on a listen range command
BGP dynamic peer-group: IPV6_EBGP_PEER
listen range: 11::/16
Total number of dynamically created neighbors/limit: 2/(200)
Total number of dynamically created neighbors: 2
Total number of activated dynamic peer-groups for IPv6 Unicast address-family: 1
Total number of neighbors 2
Total number of Established sessions 2
#show running-config bgp
!
router bgp 200
bgp router-id 2.2.2.2
neighbor IPV6_EBGP_PEER peer-group range 11::/16
neighbor IPV6_EBGP_PEER remote-as 100
neighbor IPV6_EBGP_PEER optional-as 300
!
address-family ipv6 unicast
network 22::1/128
neighbor IPV6_EBGP_PEER activate
exit-address-family
!
#show bgp ipv6 neighbors
BGP neighbor is 11:11:11::1, remote AS 100, local AS 200, external link
Member of peer-group IPV6_EBGP_PEER for session parameters
BGP version 4, local router ID 2.2.2.2, remote router ID 1.1.1.1
BGP state = Established, up for 00:02:15
Last read 00:00:16, 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
Address family IPv6 Unicast: advertised and received
Received 11 messages, 0 notifications, 0 in queue
Sent 12 messages, 1 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 0, Offset 0, Mask 0x1
IPV6_EBGP_PEER peer-group member
Community attribute sent to this neighbor (both)
0 accepted prefixes
0 announced prefixes
For address family: IPv6 Unicast
BGP table version 5, neighbor version 5
Index 0, Offset 0, Mask 0x0
IPV6_EBGP_PEER peer-group member
Community attribute sent to this neighbor (both)
1 accepted prefixes
2 announced prefixes
Connections established 2; dropped 1
Local host: 11:11:11::2, Local port: 53043
Foreign host: 11:11:11::1, Foreign port: 179
Nexthop: 2.2.2.2
Nexthop global: 11:11:11::2
Nexthop local: fe80::5054:ff:fe95:85ec
BGP connection: shared network
Last Reset: 00:02:20, due to BGP Notification sent
Notification Error Message: (Cease/Other Configuration Change.)
BGP neighbor is 11:11:12::3, remote AS 300, local AS 200, external link
Member of peer-group IPV6_EBGP_PEER for session parameters
BGP version 4, local router ID 2.2.2.2, remote router ID 3.3.3.3
BGP state = Established, up for 00:02:01
Last read 00:00:02, 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
Address family IPv6 Unicast: advertised and received
Received 8 messages, 0 notifications, 0 in queue
Sent 8 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 0, Offset 0, Mask 0x1
IPV6_EBGP_PEER peer-group member
Community attribute sent to this neighbor (both)
0 accepted prefixes
0 announced prefixes
For address family: IPv6 Unicast
BGP table version 5, neighbor version 5
Index 0, Offset 0, Mask 0x0
IPV6_EBGP_PEER peer-group member
Community attribute sent to this neighbor (both)
1 accepted prefixes
2 announced prefixes
Connections established 1; dropped 0
Local host: 11:11:12::2, Local port: 47743
Foreign host: 11:11:12::3, Foreign port: 179
Nexthop: 2.2.2.2
Nexthop global: 11:11:12::2
Nexthop local: fe80::5054:ff:fee5:b088
BGP connection: shared network
VPNV4 Configuration
Below mentioned topology displays bgp vpnv4 configuration on PE nodes, R1 and R3. IBGP peering will be formed on the loopback interface of R1 and R3; also IGP is running between all the routers.
Topology
IPv4 IBGP VPNv4 Configuration
R1
#Configure terminal | Enter Configuration mode. |
(config)#ip vrf vrf1 | Create a VRF, vrf1. |
(config-vrf)#rd 100:1 | Configure a route distinguisher value. |
(config-vrf)#route-target export 100:1 | Configure a route target export value to VRF. |
(config-vrf)#route-target import 200:1 | Configure a route target import value to VRF. |
(config-vrf)#exit | Exit from VRF configuration mode. |
(config)#router ldp | Enter Router LDP mode. |
(config-router)#router-id 3.3.3.3 | Configure an LDP router ID. |
(config-router)#exit | Exit from Router LDP mode. |
(config)#interface xe5 | Enter Interface configuration mode. |
(config-if)#ip vrf forwarding vrf1 | Configure the interface to a VRF. |
(config-if)#ip address 1.1.1.1/24 | Assign an IP address to the interface. |
(config-if)#exit | Exit from Interface configuration mode. |
(config-if)#interface xe1 | Enter another interface. |
(config-if)#ip address 11.11.11.1/24 | Assign an IP address to the interface. |
(config-if)#label-switching | Enable label switching on interface. |
(config-if)#enable-ldp ipv4 | Enable IPv4 LDP configuration on interface. |
(config-if)#exit | Exit from Interface configuration mode. |
(config-if)#interface lo | Enter the loopback interface. |
(config-if)#ip address 20.20.20.20/32 secondary | Assign a secondary IP address to the interface. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
(config-if)#exit | Exit from Interface Configuration mode. |
(config)#router ospf 100 | Enter Router OSPF mode. |
(config-router)#network 11.11.11.0/24 area 0 | Configure the interface on which OSPF runs, and associate the area ID. |
(config-router)#network 20.20.20.20/32 area 0 | Configure the interface on which OSPF runs, and associate the area ID. |
(config-router)#exit | Exit from Router OSPF mode. |
(config)#router ospf 200 vrf1 | Create an OSPF process on VRF. |
(config-router)#network 1.1.1.1/24 area 0 | Configure the interface on which OSPF runs, and associate the area ID. |
(config-router)#redistribute bgp | Redistribute BGP into OSPF. |
(config-router)#exit | Exit from Router OSPF mode. |
(config)#router bgp 100 | Create a BGP process. |
(config-router)#neighbor lo_peer peer-group range 30.30.30.30/32 | Configure a dynamic peer group with the range command. |
(config-router)#neighbor lo_peer remote-as 100 | Configure remote AS to the peer group. |
(config-router)#neighbor lo_peer update-source lo | Configure BGP neighbors to update the source routes. |
(config-router)#address-family vpnv4 unicast | Enter the VPNv4 Address Family. |
(config-router-af)#neighbor lo_peer activate | Activate the peer group in VPNv4 address family. |
(config-router-af)#exit-address-family | Exit from VPNv4 address family. |
(config-router)#address-family ipv4 vrf vrf1 | Enter IPv4 VRF address family. |
(config-router-af)#redistribute ospf 200 | Redistribute OSPF into the IPv4 VRF 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 Configuration mode. |
(config)#router ldp | Enter Router LDP mode. |
(config-router)#router-id 4.4.4.4 | Configure an LDP router ID. |
(config-router)#exit | Exit from Router LDP mode. |
(config-if)#interface xe2 | Enter Interface Configuration mode. |
(config-if)#ip address 12.12.12.2/24 | Assign an IP address to the interface. |
(config-if)#label-switching | Enable label switching on the interface. |
(config-if)#enable-ldp ipv4 | Enable IPv4 LDP configuration on the interface. |
(config-if)#exit | Exit from Interface configuration mode. |
(config-if)#interface xe1 | Enter another Interface. |
(config-if)#ip address 11.11.11.2/24 | Assign an IP address to the interface. |
(config-if)#label-switching | Enable label switching on the interface. |
(config-if)#enable-ldp ipv4 | Enable IPv4 LDP configuration on the interface. |
(config-if)#exit | Exit from Interface mode. |
(config)#commit | Commit the candidate configuration to the running configuration. |
(config)#router ospf 100 | Create an OSPF process. |
(config-router)#network 11.11.11.0/24 area 0 | Define the interface on which OSPF runs, and associate the area ID |
(config-router)#network 12.12.12.0/24 area 0 | Define the interface on which OSPF runs, and associate the area ID |
(config-router)#exit | Exit from Router BGP mode. |
(config)#commit | Commit the candidate configuration to the running configuration. |
R3
#Configure terminal | Enter Configuration mode. |
(config)#router ldp | Enter Router LDP mode. |
(config-router)#router-id 5.5.5.5 | Configure an LDP router ID. |
(config-router)#exit | Exit from Router LDP mode. |
(config)#ip vrf vrf2 | Create a VRF, vrf2. |
(config-vrf)#rd 200:1 | Configure a route distinguisher value. |
(config-vrf)#route-target export 200:1 | Configure a route target export value to VRF. |
(config-vrf)#route-target import 100:1 | Configure a route target import value to VRF. |
(config-vrf)#exit | Exit from VRF configuration mode. |
(config)#interface xe1 | Enter Interface configuration mode. |
(config-if)#ip vrf forwarding vrf2 | Configure an interface to a VRF. |
(config-if)#ip address 2.2.2.3/24 | Assign an IP address to the interface. |
(config-if)#exit | Exit from Interface configuration mode. |
(config-if)#interface xe2 | Enter another interface. |
(config-if)#ip address 12.12.12.3/24 | Assign an IP address to the interface. |
(config-if)#label-switching | Enable label switching on interface. |
(config-if)#enable-ldp ipv4 | Enable IPv4 LDP configuration on the interface. |
(config-if)#exit | Exit from Interface configuration mode. |
(config-if)#interface lo | Enter loopback interface. |
(config-if)#ip address 30.30.30.30/32 se | Assign a secondary IP address to the interface. |
(config-if)#exit | Exit from Interface mode. |
(config)#commit | Commit the candidate configuration to the running configuration. |
(config)#router ospf 100 | Enter Router OSPF mode. |
(config-router)#network 12.12.12.0/24 area 0 | Define the interface on which OSPF runs, and associate the area ID |
(config-router)#network 30.30.30.30/32 area 0 | Define the interface on which OSPF runs, and associate the area ID |
(config-router)#exit | Exit from Router OSPF mode. |
(config)#router ospf 200 vrf2 | Create an OSPF process on VRF. |
(config-router)#network 2.2.2.3/24 area 0 | Define the interface on which OSPF runs, and associate the area ID. |
(config-router)#redistribute bgp | Redistribute BGP into OSPF. |
(config-router)#exit | Exit from Router OSPF mode. |
(config)#commit | Commit the candidate configuration to the running configuration. |
(config)#router bgp 100 | Create a BGP process. |
(config-router)#neighbor 20.20.20.20 remote-as 100 | Configure BGP neighbor by specifying a neighbor IP address. |
(config-router)#neighbor 20.20.20.20 update-s lo | Define the BGP neighbors to update the source routes. |
(config-router)#address-family vpnv4 unicast | Enter VPNv4 Address Family. |
(config-router-af)#neighbor 20.20.20.20 activate | Activate the neighbor in VPNv4 address family. |
(config-router-af)#exit-address-family | Exit from VPNv4 address family. |
(config-router)#address-family ipv4 vrf vrf2 | Enter IPv4 VRF address family. |
(config-router-af)#redistribute ospf 200 | Redistribute OSPF into 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
R1
#show running-config router bgp
router bgp 100
neighbor lo_peer peer-group range 30.30.30.30/32
neighbor lo_peer remote-as 100
neighbor lo_peer update-source lo
!
address-family vpnv4 unicast
neighbor lo_peer activate
exit-address-family
!
address-family ipv4 vrf vrf1
redistribute ospf 200
exit-address-family
!
#show ip bgp vpnv4 all summary
BGP router identifier 192.168.52.3, local AS number 100
BGP table version is 2
1 BGP AS-PATH entries
0 BGP community entries
Neighbor V AS MsgRcv MsgSen TblVer InQ OutQ Up/Down State/PfxRcd
*30.30.30.30 4 100 4 4 2 0 0 00:00:37 1
* Dynamically created based on a listen range command
BGP dynamic peer-group: lo_peer
listen range: 30.30.30.30/32
Total number of dynamically created neighbors/limit: 1/(200)
Total number of dynamically created neighbors: 1
Total number of activated dynamic peer-groups for VPNv4 Unicast address-family: 1
Total number of neighbors 1
Total number of Established sessions 1
#show ip bgp vpnv4 all
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, l - labeled
S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
Route Distinguisher: 100:1 (Default for VRF vrf1)
*> 1.1.1.0/24 0.0.0.0 1 100 32768 ?
*>i 2.2.2.0/24 30.30.30.30 1 100 0 ?
Announced routes count = 1
Accepted routes count = 1
Route Distinguisher: 200:1
*>i 2.2.2.0/24 30.30.30.30 1 100 0 ?
Announced routes count = 0
Accepted routes count = 1
#show ip bgp vpnv4 all 1.1.1.0
Route Distinguisher: 100:1
Local
20.20.20.20 (metric 12) from 20.20.20.20 (192.178.50.2)
Origin incomplete, metric 1, localpref 100, label 24960, valid, internal, best
Extended Community: RT:100:1 0:0 OSPF-Route-type:0.0.0.0 :3:0
Last update: Tue Apr 23 10:29:10 2019
Route Distinguisher: 200:1 (Default for VRF vrf2)
Local
20.20.20.20 from 20.20.20.20 (192.178.50.2)
Origin incomplete, metric 1, localpref 100, label 24960, valid, internal, best
Extended Community: RT:100:1 0:0 OSPF-Route-type:0.0.0.0 :3:0
Last update: Tue Apr 23 10:29:10 2019
#show ip bgp peer-group
BGP dynamic peer-group is lo_peer, IBGP, remote AS 100
BGP dynamic peer-group lo_peer listen range group members:
30.30.30.30/32
BGP version 4
Minimum time between advertisement runs is 5 seconds
For address family: IPv4 Unicast
Peer-group member:
*30.30.30.30
Index 1, Offset 0, Mask 0x2
0 accepted prefixes, 0 announced prefixes
For address family: VPNv4 Unicast
Peer-group member:
*30.30.30.30
Index 0, Offset 0, Mask 0x0
1 accepted prefixes, 1 announced prefixes
R2
R2#show ip bgp vpnv4 all
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, l - labeled
S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
Route Distinguisher: 100:1 (Default for VRF vrf1)
*> 1.1.1.0/24 0.0.0.0 1 100 32768 ?
*>i 2.2.2.0/24 30.30.30.30 1 100 0 ?
Announced routes count = 1
Accepted routes count = 1
Route Distinguisher: 200:1
*>i 2.2.2.0/24 30.30.30.30 1 100 0 ?
Announced routes count = 0
Accepted routes count = 1
R2#
R3
R3#show ip bgp vpnv4 all 1.1.1.0
Route Distinguisher: 100:1
Local
20.20.20.20 (metric 12) from 20.20.20.20 (192.178.50.2)
Origin incomplete, metric 1, localpref 100, label 24960, valid, internal, best
Extended Community: RT:100:1 0:0 OSPF-Route-type:0.0.0.0 :3:0
Last update: Tue Apr 23 10:29:10 2019
Route Distinguisher: 200:1 (Default for VRF vrf2)
Local
20.20.20.20 from 20.20.20.20 (192.178.50.2)
Origin incomplete, metric 1, localpref 100, label 24960, valid, internal, best
Extended Community: RT:100:1 0:0 OSPF-Route-type:0.0.0.0 :3:0
Last update: Tue Apr 23 10:29:10 2019
R3#
Enable eBGP Multihop
This example shows the minimum configuration required for enabling eBGP multihop on peers speaking BGP. eBGP multihop is used for routers that are not directly connected to each other. Typically, eBGP peers are directly connected, but if there is a requirement that necessitates this scenario, this configuration can be used.
Note: The IP addresses used in the configuration should be accessible through an IGP or static routing.
Topology
eBGP Multihop Connection
R1
#configure terminal | Enter configure mode. |
(config)#interface lo | Enter loopback interface mode. |
(config-if)#ip address 100.100.100.1/24 secondary | Specify IP address to the interface. |
(config-if)#exit | Exit loopback interface mode. |
(config)#ip route 200.200.200.0/24 1.1.1.2 | Specify route IP address. |
(config)#router bgp 1 | Define the routing process. The number 1 specifies the AS number of R1. |
(config-router)#neighbor 200.200.200.1 remote-as 2 | Define BGP neighbors, and establish a TCP session. 200.200.200.1 is the IP address of the neighbor (R2), and 2 is the neighbor’s AS number. |
(config-router)#neighbor 200.200.200.1 update-source lo | Define BGP neighbors, to update the source routes. |
(config-router)#neighbor 200.200.200.1 ebgp-multihop | Define the neighbor 200.200.200.1 for eBGP multihops. |
(config-router)#address-family ipv4 unicast | Enter the Ipv4 Unicast Address Family. |
(config-router-af)# neighbor 200.200.200.1 activate | Activate the neighbor under address family mode |
(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)#interface lo | Enter loopback interface mode. |
(config-if)#ip address 200.200.200.1/24 secondary | Specify IP address to the interface. |
(config-if)#exit | Exit loopback interface mode. |
(config)#ip route 100.100.100.0/24 1.1.1.1 | Specify route IP address. |
(config)#router bgp 2 | Define the routing process. The number 2 specifies the AS number of R1. |
(config-router)#neighbor 100.100.100.1 remote-as 1 | Define BGP neighbors, and establish a TCP session. 100.100.100.1 is the IP address of the neighbor (R2), and 1 is the neighbor's AS number. |
(config-router)#neighbor 100.100.100.1 update-source lo | Define BGP neighbors, to update the source routes. |
(config-router)#neighbor 100.100.100.1 ebgp-multihop | Define the neighbor 100.100.100.1 for eBGP multihops. |
(config-router)#address-family ipv4 unicast | Config redistribute under address-family |
(config-router-af)# neighbor 100.100.100.1 activate | Activate the neighbor under address family mode |
(config-router-af)#redistribute static | Redistribute static route |
(config-router-af)#exit-address-family | Exit address-family mode |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
Validation
R1
#show ip bgp neighbors
BGP neighbor is 200.200.200.1, remote AS 2, local AS 1, external link
BGP version 4, local router ID 192.168.52.2, remote router ID 192.168.52.3
BGP state = Established, up for 00:00:22
Last read 00:00:22, 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 3 messages, 0 notifications, 0 in queue
Route refresh request: received 0, sent 0
Minimum time between advertisement runs is 30 seconds
Update source is lo
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
External BGP neighbor may be up to 255 hops away.
Local host: 100.100.100.1, Local port: 179
Foreign host: 200.200.200.1, Foreign port: 59458
Nexthop: 100.100.100.1
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
#show ip bgp
BGP table version is 4, local router ID is 192.168.52.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
l - labeled, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 100.100.100.0/24 200.200.200.1 0 100 0 2 ?
Total number of prefixes 1
#show ip bgp neighbors
BGP neighbor is 200.200.200.1, remote AS 2, local AS 1, external link
BGP version 4, local router ID 192.168.52.2, remote router ID 192.168.52.3
BGP state = Established, up for 00:00:26
Last read 00:00:26, 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, 1 notifications, 0 in queue
Route refresh request: received 0, sent 0
Minimum time between advertisement runs is 30 seconds
Update source is lo
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 2; dropped 1
External BGP neighbor may be up to 255 hops away.
Local host: 100.100.100.1, Local port: 57260
Foreign host: 200.200.200.1, Foreign port: 179
Nexthop: 100.100.100.1
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
Last Reset: 00:00:31, due to BGP Notification sent
Notification Error Message: (Cease/Administratively Reset.)
R2
#sh ip bgp neighbors
BGP neighbor is 100.100.100.1, remote AS 1, local AS 2, 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:35
Last read 00:00:05, 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 6 messages, 1 notifications, 0 in queue
Sent 7 messages, 0 notifications, 0 in queue
Route refresh request: received 0, sent 0
Minimum time between advertisement runs is 30 seconds
Update source is lo
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 2; dropped 1
External BGP neighbor may be up to 255 hops away.
Local host: 200.200.200.1, Local port: 179
Foreign host: 100.100.100.1, Foreign port: 57260
Nexthop: 200.200.200.1
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
Last Reset: 00:00:40, due to BGP Notification received
Notification Error Message: (Cease/Administratively Reset.)
#show ip bgp
BGP table version is 4, local router ID is 192.168.52.3
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
l - labeled, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 100.100.100.0/24 1.1.1.1 0 100 32768 ?
Total number of prefixes 1
TCP MSS configuration for BGP neighbors
The manual configuration between the routing devices establishes the BGP peer that creates a Transmission Control Protocol (TCP) session. This feature enables the configuration of TCP Maximum Segment Size (MSS) that defines the maximum segment size in a single TCP segment during a communication session. A TCP segment is a unit of data transmitted in a TCP connection.
TCP MSS configuration per BGP neighbor adjusts the BGP Update Packet Size according to the configured value, which prevents the BGP update packet from getting dropped in transit. The configurable MSS range is from 40-1440. Configure TCP MSS per BGP neighbor using the CLI or NetConf interface.
For more information, refer to the TCP MSS configuration for BGP neighbors section in the OcNOS Key Feature document, Release 6.4.1.
Enable Peer Groups
A BGP speaker might have the same update policies for a set of its peers. This is very useful if you have to change the update policies for all of the peers: Changing individual routers for separate policies can be very time-consuming, thus, peer groups play an important role in creating and assigning policies to a group of routers.
The peer group can be created dynamically or statically.
For dynamic peer groups all configuration can be done at group level only.
The static peer group configuration falls into two categories:
• Attributes that can be configured only at group level. Attempt to configure at member peer level will return error.
• Attributes that allow member peer level configuration. The member peer configuration has precedence.
Category A: Neighbor configuration allowed only at peer-group level
The outbound update impacting configurations of peer group will replace peer member configurations of same attributes when a peer becomes member of peer group. Outbound attribute modifications to group members are not allowed.
Following are the commands which are allowed at peer-group level.
Category: Neighbor configuration allowed at peer-group member level; precedence based
For the below configuration, member level configurations will take precedence over peer group configuration.
Following are the commands which are allowed at member level also.
BGP Peer Groups for Address-Family IPv4 Unicast
In the following scenario, R1, R2, and R3 belong to the same peer group ABC. R1, R2 and R3 are in AS 200 and R1 is the route reflector.R4 and R1 are eBGP peers. R4 is in AS 100.
Topology
BGP Peer Groups with IPv4 Unicast Members
R1
#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 ABC peer-group | Configuring ABC peer-group |
(config-router)#neighbor ABC remote-as 200 | Assign options to the peer group named ABC. |
(config-router)#neighbor 2.2.2.2 peer-group ABC | Define neighbor 2.2.2.2 (R2) as a peer group member. |
(config-router)#neighbor 3.3.3.3 peer-group ABC | Define neighbor 3.3.3.3 (R3) as a peer group member. |
(config-router)#neighbor 4.4.4.4 remote-as 100 | Define neighbor 4.4.4.4 (R4) is the IP address of R4 and 100 is the AS number. |
(config-router)#address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor ABC activate | Activate neighbor under address family mode |
(config-router-af)# neighbor 4.4.4.4 activate | Activate neighbor under address family mode |
(config-router-af)# neighbor ABC route-reflector-client | Configure the peer-group ABC to be route-reflector-client |
(config-router-af)#network 1.1.1.1/32 | Advertise the network 1.1.1.1/32 |
(config-router-af)#network 11.11.11.11/32 | Advertise the network 11.11.11.11/32 |
(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 2.2.2.1 remote-as 200 | Create a TCP connection with neighbor 2.2.2.1 of AS 200. |
(config-router)#address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 2.2.2.1 activate | Activate neighbor under address family mode |
(config-router-af)#exit-address-family | Exit address family mode |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
R3
#configure terminal | Enter configure mode. |
(config)#router bgp 200 | Define the routing process. The number 200 specifies the AS number of R3. |
(config-router)#neighbor 3.3.3.1 remote-as 200 | Create a TCP connection with neighbor 3.3.3.1 of AS 200. |
(config-router)#address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 3.3.3.1 activate | Activate neighbor under address family mode |
(config-router-af)#exit-address-family | Exit address family mode |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
R4
#configure terminal | Enter configure mode. |
(config)#router bgp 100 | Define the routing process. The number 100 specifies the AS number of R4. |
(config-router)#neighbor 4.4.4.1 remote-as 200 | Create a TCP connection with neighbor 4.4.4.1 of AS 200. |
(config-router)#address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 4.4.4.1 activate | Activate neighbor under address family mode |
(config-router-af)#exit-address-family | Exit address family mode |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
Validation
R1
R1#show ip bgp neighbors
BGP neighbor is 2.2.2.2, remote AS 200, local AS 200, internal link
Member of peer-group ABC for session parameters
BGP version 4, local router ID 192.168.52.2, remote router ID 10.12.7.155
BGP state = Established, up for 00:04:55
Last read 00:04:55, 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 11 messages, 0 notifications, 0 in queue
Sent 11 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
ABC peer-group member
Route-Reflector Client
Community attribute sent to this neighbor (both)
0 accepted prefixes
2 announced prefixes
Connections established 1; dropped 0
Local host: 2.2.2.1, Local port: 33865
Foreign host: 2.2.2.2, Foreign port: 179
Nexthop: 2.2.2.1
Nexthop global: 1111::1
Nexthop local: fe80::a00:27ff:fecc:47a6
BGP connection: non shared network
BGP neighbor is 3.3.3.3, remote AS 200, local AS 200, internal link
Member of peer-group ABC for session parameters
BGP version 4, local router ID 192.168.52.2, remote router ID 10.12.7.153
BGP state = Established, up for 00:04:55
Last read 00:04:55, 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 11 messages, 0 notifications, 0 in queue
Sent 11 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 2, Offset 0, Mask 0x4
ABC peer-group member
Route-Reflector Client
Community attribute sent to this neighbor (both)
0 accepted prefixes
2 announced prefixes
Connections established 1; dropped 0
Local host: 3.3.3.1, Local port: 44280
Foreign host: 3.3.3.3, Foreign port: 179
Nexthop: 3.3.3.1
Nexthop global: fe80::a00:27ff:fe85:25d4
Nexthop local: ::
BGP connection: non shared network
BGP neighbor is 4.4.4.4, remote AS 100, local AS 200, external link
BGP version 4, remote router ID 10.12.7.120
BGP state = Established, up for 00:04:55
Last read 00:04:55, 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 11 messages, 0 notifications, 0 in queue
Sent 11 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 3, Offset 0, Mask 0x8
Community attribute sent to this neighbor (both)
0 accepted prefixes
2 announced prefixes
Connections established 1; dropped 0
Local host: 4.4.4.1, Local port: 55493
Foreign host: 4.4.4.4, Foreign port: 179 Nexthop: 4.4.4.1
Nexthop global: fe80::a00:27ff:fe7e:674a
Nexthop local: ::
BGP connection: non shared network
R1#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
2.2.2.2 4 200 12 12 1 0 0 00:05:02 0
3.3.3.3 4 200 12 12 1 0 0 00:05:02 0
4.4.4.4 4 100 12 12 1 0 0 00:05:02 0
Total number of neighbors 3
Total number of Established sessions 3
R2
R2#show ip bgp
BGP table version is 4, local router ID is 10.12.65.123
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
l - labeled, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*>i 1.1.1.1/32 2.2.2.1 0 100 0 i
*>i 11.11.11.11/32 2.2.2.1 0 100 0 i
Total number of prefixes 2
R2#
R3
R3#show ip bgp
BGP table version is 8, local router ID is 10.12.65.121
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
l - labeled, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*>i 1.1.1.1/32 3.3.3.1 0 100 0 i
*>i 11.11.11.11/32 3.3.3.1 0 100 0 i
Total number of prefixes 2
R3#
Peer-group can have either iBGP or eBGP peers but not both.
Validation
The configuration above fails with an appropriate error:
R1(config)#router bgp 200
R1(config-router)#neighbor 4.4.4.4 peer-group ABC
%% Peer with AS 100 cannot be in this peer-group, members must be all internal or all external
R1(config-router)#
Peer group members inherit the properties of Outbound Policies configured for Peer-group.
R1
#configure terminal | Enter configure mode. |
(config)# ip access-list permit-1 | Configure access-list to permit 1.1.1.1/32 |
(config-ip-acl)# permit any 1.1.1.1/32 any | Configure a permit statement in the acl to permit 1.1.1.1/32 |
(config-ip-acl)#exit | Exit ip access-list mode |
(config)# route-map permit-only-1 | Configure route-map |
(config-route-map)# match ip address permit-1 | Configure a match statement in the route-map to match the access-list permit-1 |
(config-route-map)#set local-preference 250 | Set local preference as 250 |
(config-route-map)#exit | Exit route-map mode |
(config)#router bgp 200 | Define the routing process. The number 200 specifies the AS number of R1. |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor ABC route-map permit-only-1 out | Configure the peer-group ABC with route-map in the outbound direction |
(config-router-af)#exit | Exit router BGP mode |
(config-router)#exit | Exit router mode. |
(config)#commit | Commit the candidate configuration to the running configuration. |
(config)# exit | Exit configure terminal mode |
#clear ip bgp peer-group ABC soft out | Do outbound soft reset for the peer-group ABC for the policy to take affect for the peer-group members |
Validation
R1
R1#show bgp neighbors 2.2.2.2
BGP neighbor is 2.2.2.2, remote AS 200, local AS 200, internal link
Member of peer-group ABC for session parameters
BGP version 4, local router ID 10.12.65.126, remote router ID 10.12.65.123
BGP state = Established, up for 00:07:01
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 20 messages, 0 notifications, 0 in queue
Sent 28 messages, 1 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
ABC peer-group member
Route-Reflector Client
Community attribute sent to this neighbor (both)
Outbound path policy configured
Route map for outgoing advertisements is *permit-only-1
0 accepted prefixes
1 announced prefixes
Connections established 2; dropped 1
Local host: 2.2.2.1, Local port: 179
Foreign host: 2.2.2.2, Foreign port: 42657
Nexthop: 2.2.2.1
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
Last Reset: 00:08:39, due to Hold Timer Expired (Notification sent)
Notification Error Message: (Hold Timer Expired/No sub-error code)
R1#show bgp neighbors 3.3.3.3
BGP neighbor is 3.3.3.3, remote AS 200, local AS 200, internal link
Member of peer-group ABC for session parameters
BGP version 4, local router ID 10.12.65.126, remote router ID 10.12.65.121
BGP state = Established, up for 00:11:46
Last read 00:00:18, 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 29 messages, 0 notifications, 0 in queue
Sent 32 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 2, Offset 0, Mask 0x4
ABC peer-group member
Route-Reflector Client
Community attribute sent to this neighbor (both)
Outbound path policy configured
Route map for outgoing advertisements is *permit-only-1
0 accepted prefixes
1 announced prefixes
Connections established 1; dropped 0
Local host: 3.3.3.1, Local port: 179
Foreign host: 3.3.3.3, Foreign port: 48008
Nexthop: 3.3.3.1
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
R2
R2#show ip bgp
BGP table version is 3, local router ID is 10.12.65.123
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
l - labeled, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*>i 1.1.1.1/32 2.2.2.1 0 250 0 i
Total number of prefixes 1
R3
R3#show ip bgp
BGP table version is 7, local router ID is 10.12.65.121
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
l - labeled, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*>i 1.1.1.1/32 3.3.3.1 0 250 0 i
Total number of prefixes 1
Peer-group-members cannot be configured with Outbound Policies.
Validation
The above configuration fails with an appropriate error:
R1(config)#router bgp 200
R1(config)#address-family ipv4 unicast
R1(config-router-af)#neighbor 2.2.2.2 route-map permit-only-11 out
%% Invalid command for a peer-group member
Peer-group-members inherit the properties of Inbound Policies configured for Peer-group.
R2
#configure terminal | Enter configure mode. |
(config)# interface lo | Enter interface mode for Loopback interface |
(config-if)#ip address 100.1.1.1/24 secondary | Configure IP address for Loopback interaface |
(config-if)#interface eth3 | Enter interface mode for interface eth3 |
(config-if)#ip address 22.1.1.1/24 | Configure IP address for interface eth3 |
(config-if)#exit | Exit interface mode |
(config)#router bgp 200 | Enter router bgp mode |
(config-router)#address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)#network 22.1.1.0/24 | Advertise the network of eth3 in BGP |
(config-router-af)#network 100.1.1.0/24 | Advertise the network of Loopback in BGP |
(config-router-af)#exit-address-family | Exit address family mode. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
R3
#configure terminal | Enter configure mode. |
(config)# interface lo | Enter interface mode for Loopback interface |
(config-if)#ip address 100.1.1.2/24 secondary | Configure IP address for Loopback interaface |
(config-if)#interface eth3 | Enter interface mode for interface eth3 |
(config-if)#ip address 22.1.1.2/24 | Configure IP address for interface eth3 |
(config-if)#exit | Exit interface mode |
(config)#router bgp 200 | Enter router bgp mode |
(config-router)#address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)#network 22.1.1.0/24 | Advertise the network of eth3 in BGP |
(config-router-af)#network 100.1.1.0/24 | Advertise the network of Loopback in BGP |
(config-router-af)#exit-address-family | Exit address family mode. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
R1
#configure terminal | Enter configure mode. |
(config)#ip access-list permit-22 | Configure access-list to permit 22.1.1.0/24 |
(config-ip-acl)# permit any 22.1.1.0/24 any | Configure a permit statement to permit 22.1.1.0/24 |
(config-ip-acl)#exit | Exit ip access-list mode |
(config)#route-map permit-only-22 | Configure route-map |
(config-route-map)#match ip address permit- 22 | Configure match statement in route-map to match the access- list permit-22 |
(config-route-map)#exit | Exit route-map mode |
(config)#router bgp 200 | Enter BGP router mode |
(config)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor ABC activate | Activate peer-group in the address family |
(config-router-af)#neighbor ABC route-map permit-only-22 in | Configure the peer-group ABC with route-map in the inbound direction |
(config-router)#exit | Exit router bgp mode |
(config)#commit | Commit the candidate configuration to the running configuration. |
(config)# exit | Exit configure terminal mode |
#clear ip bgp peer-group ABC soft in | Do inbound soft reset for the peer-group ABC for the policy to take affect for the peer-group members |
Validation
R1
R1#show ip bgp
BGP table version is 7, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, a add-path, g group-best, * valid, > best, i - internal, l - labeled
S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 1.1.1.1/32 0.0.0.0 0 100 32768 i
*> 11.11.11.11/32 0.0.0.0 0 100 32768 i
*>i 22.1.1.0/24 2.2.2.2 0 100 0 i
* i 3.3.3.3 0 100 0 i
Total number of prefixes 3
Peer group members can be configured with Inbound Policies
R1
#configure terminal | Enter configure mode. |
(config)#ip access-list permit-100 | Configure access-list to permit 100.1.1.0/24 |
(config-ip-acl)# permit any 100.1.1.0/24 any | Configure a permit statement to permit 100.1.1.0/24 |
(config-ip-acl)#exit | Exit ip access-list mode |
(config)#route-map permit-only-100 | Configure route-map |
(config-route-map)#match ip address permit- 100 | Configure match statement in route-map to match the access- list permit-100 |
(config-route-map)#exit | Exit route-map mode |
(config)#router bgp 200 | Enter BGP router mode |
(config)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 2.2.2.2 activate | Activate neighbor in the address family |
(config-router-af)#neighbor 2.2.2.2 route- map permit-only-100 in | Configure the peer-group-member R2(2.2.2.2) with route-map in the inbound direction |
(config-router-af)#exit | Exit address-family mode |
(config-router)#exit | Exit router bgp mode |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
(config)# exit | Exit configure terminal mode |
#clear ip bgp peer-group ABC soft in | Do inbound soft reset for the peer-group ABC for the policy to take affect for the peer-group members |
Validation
R1
R1#show ip bgp
BGP table version is 4, local router ID is 10.12.65.126
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
l - labeled, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 1.1.1.1/32 0.0.0.0 0 100 32768 i
*> 11.11.11.11/32 0.0.0.0 0 100 32768 i
*>i 22.1.1.0/24 3.3.3.3 0 100 0 i
*>i 100.1.1.0/24 2.2.2.2 0 100 0 i
Total number of prefixes 4
R1#
Route Redistribution in BGP
If there are routers that run both OSPF and BGP, certain OSPF routes might have to be sent to other eBGP peers. This can be achieved using the redistribution feature. Consider the following topology, in which R1 and R2 are eBGP peers, and R2 and R3 are OSPF peers. R2 is redistributing OSPF routes into BGP. The OSPF routes are sent to the R1 BGP routing table. This configuration assumes that all OSPF and eBGP sessions are up and running, and that only the redistribution must be configured.
Topology
Redistribute with OSPF
R2
#configure terminal | Enter configure mode. |
---|
(config)#router bgp 100 | Define the routing process. The number 100 specifies the AS number of R2. |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)#redistribute ospf | Redistribute OSPF routes in the R2 routing table into the R1 BGP routing table. |
(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
BGP table version is 3, local router ID is 192.168.52.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
l - labeled, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 3.3.3.3/32 10.10.10.2 11 100 0 100 ?
*> 11.11.11.0/24 10.10.10.2 1 100 0 100 ?
Total number of prefixes 2
Add Multiple Instances of the Same Autonomous System
BGP supports adding the same AS number multiple times to influence the route selection process. This can be done using route maps, as described below.
Under normal circumstances, any route advertised by R1 is sent to R4 via two different routes, and then R4 selects the path from R2. This decision can be influenced by adding multiple instances of AS number 200 at R2.
Topology
Multiple Instances of Same AS
R1
#configure terminal | Enter configure mode. |
(config)#interface lo | Enter loopback interface mode. |
(config-if)#ip address 44.44.44.1/24 secondary | Specify the IP address for the interface. |
(config-if)#exit | Exit loopback interface mode. |
(config)#router bgp 100 | Define the routing process with AS number 100. |
(config-router)#neighbor 172.1.2.112 remote- | |
as 200 | Define neighbor R2. 172.1.2.112 is the IP address of R2, and 200 is the AS number. |
(config-router)#neighbor 172.1.3.113 remote- | |
as 300 | Define neighbor R3. 172.1.3.113 is the IP address of R2, and 300 is the AS number. |
(config-router)#address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 172.1.2.112 activate | Activate neighbor under address family mode |
(config-router-af)# neighbor 172.1.2.113 activate | Activate neighbor under address family mode |
(config-router-af)#network 44.44.44.0/24 | Advertise network 44.44.44.0/24 through BGP. This route reaches R4 via R2 and R3. |
(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)#route-map mul_inst permit 10 | Define the route-map multiple instance with permit definition sequence number 10. |
(config-route-map)#set as-path prepend 200 200 | Prepend AS number 200 two times to the AS_PATH attribute in the BGP Update message. |
(config-route-map)#exit | Exit Route-map mode, and return to Configure mode. |
(config)#router bgp 200 | Define the routing process with AS number 200. |
(config-router)#neighbor 172.1.2.111 remote-as 100 | Define neighbor R1. 172.1.2.111 is the IP address of R1, and 100 is the AS number. |
(config-router)#neighbor 172.2.4.114 remote-as 400 | Define neighbor R4. 172.2.4.114 is the IP address of R2, and 400 is the AS number. |
(config-router)#address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 172.2.4.114 activate | Activate neighbor under address family mode |
(config-router-af)# neighbor 172.1.2.111 activate | Activate neighbor under address family mode |
(config-router-af)#neighbor 172.2.4.114 route-map mul_inst out | Apply route-map multi_inst to all outbound routes to R4 |
(config-router-af)# exit-address-family | Exit address-family mode. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
R3
#configure terminal | Enter configure mode. |
(config)#router bgp 300 | Define the routing process with AS number 300. |
(config-router)#neighbor 172.1.3.111 remote-as 100 | Define neighbor R1. 172.1.3.111 is the IP address of R1, and 100 is the AS number. |
(config-router)#neighbor 172.3.4.114 remote-as 400 | Define neighbor R4. 172.3.4.114 is the IP address of R4, and 400 is the AS number. |
(config-router)#address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 172.3.4.114 activate | Activate neighbor under address family mode |
(config-router-af)# neighbor 172.1.3.111 activate | Activate neighbor under address family mode |
(config-router-af)# exit-address-family | Exit address-family mode. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
R4
#configure terminal | Enter configure mode. |
(config)#router bgp 400 | Define the routing process with AS number 400. |
(config-router)#neighbor 172.2.4.112 remote-as 200 | Define neighbor R2. 172.2.4.112 is the IP address of R2, and 200 is the AS number. |
(config-router)#neighbor 172.3.4.113 remote-as 300 | Define neighbor R3. 172.3.4.113 is the IP address of R3, and 300 is the AS number. |
(config-router)#address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 172.2.4.112 activate | Activate neighbor under address family mode |
(config-router-af)# neighbor 172.3.4.113 activate | Activate neighbor under address family mode |
(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
BGP table version is 1, local router ID is 44.44.44.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, l - labeled, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 44.44.44.0/24 0.0.0.0 0 100 32768 i
Total number of prefixes 1
Remove the Multi-Exit Disc Attribute from Update Messages
You can remove the Multi-Exit Disc (MED) attribute values from received update messages.
Topology
Remove MED Attribute
R1
#configure terminal | Enter configure mode. |
(config)#route-map med permit 1 | Define the route-map MED with permit definition sequence number 1. |
(config-route-map)#set metric 400 | Set the metric value. |
(config-route-map)#exit | Exit Route-map mode, and return to Configure mode. |
(config)#router bgp 100 | Define the routing process with AS number 100. |
(config-router)#neighbor 1.1.1.2 remote-as 200 | Define neighbor R2. 1.1.1.2 is the IP address of R2, and 200 is the AS number. |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 1.1.1.2 activate | Activate neighbor under address family mode |
(config-router-af)# exit-address-family | Exit address family mode |
(config-router)#exit | Exit router BGP mode |
(config)#interface xe2 | Enter interface mode |
(config-if)#ip ad 10.10.10.1/24 | Assign IP address |
(config-if)#no shutdown | Make interface administratively up |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
(config-if)#exit | Exit interface mode |
(config)#ip route 100.0.0.0/8 10.10.10.2 | Configure the static route with the nexthop address. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
R3
#configure terminal | Enter configure mode. |
(config)#router bgp 200 | Define the routing process with AS number 200. |
(config-router)#neighbor 2.2.2.1 remote-as 200 | Define neighbor R2. 2.2.2.1 is the IP address of R2, and 200 is the AS number. |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 2.2.2.1 activate | Activate neighbor under address family mode |
(config-router-af)# exit-address-family | Exit address family mode |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
Removing Sent and Received MED values
The following describes how to remove the received and sent MED values, respectively.
R2 - Remove Received MED Value
#configure terminal | Enter configure mode. |
(config)#router bgp 200 | Define the routing process with AS number 200. |
(config-router)#neighbor 1.1.1.1 remote-as 100 | Define neighbor R1. 1.1.1.1 is the IP address of R1, and 100 is the AS number. |
(config-router)#neighbor 2.2.2.2 remote-as 200 | Define neighbor R3. 2.2.2.2 is the IP address of R3, and 200 is the AS number. |
(config-router)#bgp bestpath med remove-recv- med | Enable the remove received MED value option. |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 1.1.1.1 activate | Activate neighbor under address family mode |
(config-router-af)# neighbor 2.2.2.2 activate | Activate neighbor under address family mode |
(config-router-af)# exit-address-family | Exit address family mode |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
R1 - Add Static Route
(config)#router bgp 100 | Enter to router bgp mode |
(config)#address-family ipv4 unicast | Config redistribute under address-family |
(config-router-af)#redistribute static | Redistribute the static routes |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
R2 - Remove Send MED Value
#configure terminal | Enter configure mode. |
(config)#router bgp 200 | Define the routing process with AS number 200. |
(config-router)#neighbor 1.1.1.1 remote-as 100 | Define neighbor R1. 1.1.1.1 is the IP address of R1, and 100 is the AS number. |
| |
(config-router)#neighbor 2.2.2.2 remote-as 200 | Define neighbor R3. 2.2.2.2 is the IP address of R3, and 200 is the AS number. |
(config-router)#bgp bestpath med remove-send- med | Enable the remove sent MED value option. |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 1.1.1.1 activate | Activate neighbor under address family mode |
(config-router-af)# neighbor 2.2.2.2 activate | Activate neighbor under address family mode |
(config-router-af)# exit-address-family | Exit address family mode |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
Validation
R2#show ip bgp
BGP table version is 2, local router ID is 192.168.52.3
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
l - labeled, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 100.0.0.0 1.1.1.1 removed 100 0 100 ?
Total number of prefixes 1
R3#show ip bgp
BGP table version is 1, local router ID is 192.168.52.4
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
l - labeled, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
* i 100.0.0.0 1.1.1.1 400 100 0 100 ?
Total number of prefixes 1
BGP Four-Byte Autonomous System
Extended AS numbers can be mapped to 2-byte AS numbers if the value is less than, or equal to, 65535. If the AS number is higher than 65535, it cannot be mapped to a 2-byte AS number. Therefore, if a BGP speaker is configured with a non-mappable AS number, it must enable the BGP extended ASN capability in OcNOS.
Note: Autonomous System number 23456 is a reserved IANA number for AS transition; thus, it is recommended that no system be configured with 23456 as its AS number.
The extended ASN capability is disabled by default. However, when it is enabled, it is able to interoperate with a 2-byte AS-numbered speaker, in compliance with RFC 4893.
If a 4-byte AS number is configured in the provider’s network using BGP MPLS VPN or standard IPv4/IPv6 BGP, it is recommended that the PE routers be 4-byte AS-enabled before connecting to 4-byte AS-enabled customer networks. For implications related to AS number transition issues, refer to RFC 4893.
You can also set up 4-byte AS-specific extended communities and route distinguishers (RDs) with limited capabilities. However, it is recommended that 2-byte AS-specific RDs and extended communities be used for regular deployment.
BGP encodes an ASN into four octets, so that more autonomous systems can be supported. Extended ASN capability is advertised in the Open message capabilities when the 4-octet ASN capability is enabled. When the 4-octet ASN capability is enabled, the valid ASN value range is <1-4294967295>, with the exception discussed in the first Note, above.
Note: Four-octet capability is disabled by default.
4-Octet ASN Capability Enabled on R1 and R2
In this example, 4-Octet ASN capability is enabled on BGP speakers R1 and R2.
Topology
4-Octet ASN on Both Routers
R1
#configure terminal | Enter configure mode. |
(config)#bgp extended-asn-cap | Enable 4-octet ASN capability. |
(config)#router bgp 400000 | Assign the ASN value (400000) to the router. |
(config-router)#neighbor 10.20.30.2 remote-as 7000 | Specify the neighbor's IP address (10.20.30.2) and the ASN value of the neighbor (7000). |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 10.20.30.2 activate | Activate neighbor under address family mode |
(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)#bgp extended-asn-cap | Enable 4-octet ASN capability. |
(config)#router bgp 7000 | Assign the ASN value (7000) to the router. |
(config-router)#neighbor 10.20.30.1 remote-as 400000 | Specify the neighbor's IP address (10.20.30.1) and the ASN value of the neighbor (400000). |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 10.20.30.1 activate | Activate neighbor under address family mode |
(config-router-af)# exit-address-family | Exit address family mode |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
4-Octet ASN Capability Enabled on R1 and Disabled on R2
In the following two examples, 4-Octet ASN capability is enabled on BGP speaker R1 and disabled on R2.
Topology
4-Octet ASN on One Router
R1
#configure terminal | Enter configure mode. |
(config)#bgp extended-asn-cap | Enable 4-octet ASN capability. |
(config)#router bgp 70000 | Assign the ASN value (70000) to the router. |
(config-router)#neighbor 172.20.30.20 remote-as 800 | Specify the neighbor's IP address (172.20.30.20) and the ASN value of the neighbor (800). |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 172.20.30.20 activate | Activate neighbor under address family mode |
(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)#no bgp extended-asn-cap | Disable 4-octet ASN capability. |
(config)#router bgp 800 | Assign the ASN value (800) to the router. |
(config-router)#neighbor 172.20.30.10 remote-as 70000 | Specify the neighbor's IP address (172.20.30.10) and the ASN value of the neighbor (70000). |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 172.20.30.10 activate | Activate neighbor under address family mode |
(config-router-af)# exit-address-family | Exit address family mode |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
Topology
4-Octet ASN
R1
#configure terminal | Enter configure mode. |
(config)#bgp extended-asn-cap | Enable 4-octet ASN capability. |
(config)#router bgp 700 | Assign the ASN value (700) to the router. |
(config-router)#neighbor 172.20.30.20 remote-as 800 | Specify the neighbor's IP address (172.20.30.20) and the ASN value of the neighbor (800). |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 172.20.30.20 activate | Activate neighbor under address family mode |
(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)#no bgp extended-asn-cap | Disable 4-octet ASN capability. |
(config)#router bgp 800 | Assign the ASN value (800) to the router. |
(config-router)#neighbor 172.20.30.10 remote-as 700 | Specify the neighbor's IP address (172.20.30.10) and the ASN value of the neighbor (700). |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 172.20.30.10 activate | Activate neighbor under address family mode |
(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 400000
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.20.30.2 4 7000 2 3 1 0 0 00:00:08 0
Total number of neighbors 1
Total number of Established sessions 1
#show ip bgp neighbors
BGP neighbor is 10.20.30.1, remote AS 400000, local AS 7000, 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:02:20
Last read 00:00:20, hold time is 90, keepalive interval is 30 seconds
Neighbor capabilities:
Route refresh: advertised and received (old and new)
4-Octet ASN Capability: advertised and received
Address family IPv4 Unicast: advertised and received
Received 6 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 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.20.30.2, Local port: 49434
Foreign host: 10.20.30.1, Foreign port: 179
Nexthop: 10.20.30.2
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
BGP Extended Community Attribute
The Extended Community Attribute provides a mechanism for labeling information carried in BGP.
Extended Community with a 2-Byte ASN
In the following example, CE1, PE1, PE2, and CE2 are 2-byte-ASN capable, and do not support 4-byte-ASN capability.
Topology
Extended Communities — 2-Byte ASN
CE1
#configure terminal | Enter configure mode. |
(config)#interface eth1 | Enter interface mode. |
(config-if)#ip address 172.4.5.115/24 | Configure the IP address on this interface |
(config-if)#exit | Exit interface mode. |
(config)#router bgp 100 | Assign the ASN value (100) to the router. The ASN range is <1-65535>. |
(config-router)#neighbor 172.4.5.116 remote-as 200 | Specify the neighbor's IP address (172.4.5.116) and the ASN value of the neighbor (200). |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 172.4.5.116 activate | Activate neighbor under address family mode |
(config-router-af)# exit-address-family | Exit address family mode |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
CE2
#configure terminal | Enter configure mode. |
(config)#interface eth1 | Enter interface mode. |
(config-if)#ip address 172.3.4.114/24 | Configure the IP address on this interface |
(config-if)#exit | Exit interface mode. |
(config)#router bgp 300 | Assign the ASN value (300) to the router. The ASN range is <1-65535>. |
(config-router)#neighbor 172.3.4.117 remote-as 200 | Specify the neighbor's IP address (172.3.4.117) and the ASN value of the neighbor (200). |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 172.3.4.117 activate | Activate neighbor under address family mode |
(config-router-af)# exit-address-family | Exit address family mode |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
PE1
#configure terminal | Enter configure mode. |
---|
(config)#ip vrf VRF1 | Specify the name of the VRF (VRF1) to be created. |
---|
(config-vrf)#rd 100:10 | Assign a route distinguisher (RD) for the VRF, which is a unique value on the router. The RD value can be in ASN:NN or A.B.C.D:NN format. |
---|
(config-vrf)#route-target both 100:10 | Specify the 2-Octet AS specific or IPv4 specific Transitive Route-Target extended community attribute. |
---|
(config-vrf)#exit | Exit VRF mode, and return to Configure mode. |
---|
(config)#interface eth1 | Enter interface mode. |
---|
(config-if)#ip vrf forwarding VRF1 | Bind the interface (eth1) to the VRF (VRF1). |
---|
(config-if)#ip address 172.4.5.116/24 | Configure the IP address on this interface |
---|
(config-if)#exit | Exit interface mode. |
---|
(config)#ip route vrf VRF1 75.1.1.0/24 eth1 | Create a VRF static route. |
---|
(config)#interface eth2 | Enter interface mode. |
---|
(config-if)#ip address 172.6.7.116/24 | Configure the IP address on this interface |
---|
(config-if)#exit | Exit interface mode. |
---|
(config)#router bgp 200 | Assign the ASN value (200) to the router. |
(config-router)#neighbor 172.6.7.117 remote-as 200 | Specify the neighbor’s (PE2) IP address (172.6.7.117) and the ASN value of the neighbor (200). In this case, it is an iBGP connection, so both PE1 and PE2 are in the same AS. |
(config-router)#address-family vpnv4 unicast | Enable the exchange of VPNv4 routing information among ISP PE-routers, and enter Address-Family-VPNv4 mode. |
(config-router-af)#neighbor 172.6.7.117 activate | Activate the neighbor in address-family. |
(config-router-af)#exit | Exit Address-Family-VPNv4 mode. |
(config-router)#address-family ipv4 vrf VRF1 | Enable the exchange of VRF routing information among ISP PE-routers, and enter Address-Family-VRF mode. |
(config-router-af)#neighbor 172.4.5.115 remote-as 100 | Specify the neighbor’s (CE1) IP address and ASN value. |
(config-router-af)#neighbor 172.4.5.115 activate | Activate the neighbor in address-family |
(config-router-af)#neighbor 172.4.5.115 send-community both | Enable extended community attribute for the neighbor. |
(config-router-af)#redistribute static | Configure static redistribution. |
(config-router-af)# exit-address-family | Exit address family mode |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
PE2
#configure terminal | Enter configure mode. |
(config)#ip vrf VRF1 | Specify the name of the VRF (VRF1) tobe created. |
(config-vrf)#rd 100:10 | Assign a route distinguisher (RD) for the VRF. |
(config-vrf)#route-target both 100:10 | Specify the 2-Octet AS specific or IPv4 specific Transitive Route-Target extended community attribute. |
(config-vrf)#exit | Exit VRF mode, and return to Configure mode. |
(config)#interface eth1 | Enter interface mode. |
(config-if)#ip vrf forwarding VRF1 | Bind the interface (eth1) to the VRF (VRF1). |
(config-if)#ip address 172.3.4.117/24 | Configure the IP address on this interface |
(config-if)#exit | Exit interface mode. |
(config)#ip route vrf VRF1 100.1.1.0/24 eth1 | Create a VRF static route. |
(config)#interface eth2 | Enter interface mode. |
|