BGP
This chapter contains basic Border Gateway Protocol configuration examples.
Enable BGP Routers in the Same Autonomous System
Figure 10-66 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. |
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. |
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. |
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. |
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)#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. |
R2
#configure terminal | Enter configure mode. |
(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. |
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.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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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 | 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. |
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. |
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)#network 33.33.33.33/32 | Advertise the loopback network into BGP. |
(config-router-af)#end | Exit from Router BGP mode. |
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. |
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)#end | Exit from Router BGP mode. |
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)#end | Exit from Router BGP mode. |
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. |
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)#end | Exit from address family mode. |
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. |
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
network 22.22.22.22/32
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 33.33.33.33/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)#end | Exit from address family mode. |
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)#end | Exit from address family mode. |
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)#end | Exit from address family mode. |
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:11::1 remote-as 100 | Configure BGP neighbor by specifying the neighbor IP address. |
(config-router-af)#end | Exit from address family mode.. |
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)#end | Exit from Router BGP mode. |
R2
#configure terminal | Enter configure 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)#end | Exit from Router BGP mode. |
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)#end | Exit from Router BGP mode. |
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-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)#address-family ipv4 unicast | Enter address-family ipv4 unicast mode. |
(config-router-af)#redistribute bgp | Redistribute BGP into OSPF. |
(config-router-af)#exit-address-family | Exit from address-family mode. |
(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)#end | Exit from the Router BGP mode. |
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)#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)#end | Exit from Router BGP mode. |
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)#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)#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)#end | Exit from Router BGP mode. |
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. |
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 |
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 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.
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. |
OcNOS(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 |
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 |
OcNOS(config-router-af)#exit-address-family | Exit address family mode |
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 |
OcNOS(config-router-af)#exit-address-family | Exit address family mode |
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 |
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# 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 router bgp mode |
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 | Exit router bgp mode |
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)# 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)# 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. |
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. |
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 |
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 |
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 |
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-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. |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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)#end | Exit Address-Family mode |
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. |
(config-if)#ip address 172.6.7.117/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.116 remote-as 200 | Specify the neighbor's (PE1) IP address (172.6.7.116) 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.116 activate | Enable the exchange of routing information with a peer router. |
(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.3.4.114 | |
remote-as 300 | Specify the neighbor's (CE2) IP address and ASN value. |
(config-router-af)# neighbor 17.3.4.114 activate | Activate the neighbor in address family mode |
(config-router-af)#neighbor 172.3.4.114 send- community both | Enable extended community attribute for the neighbor. |
(config-router-af)#redistribute static | Configure static redistribution. |
(config-router-af)#end | Exit Address-Family mode |
Validation
CE1
#show running-config
!
no service password-encryption
!
logging monitor 7
!
ip vrf management
!
ip domain-lookup feature telnet feature ssh
snmp-server enable snmp
snmp-server view all .1 included feature ntp
ntp enable
username ocnos role network-admin password encrypted $1$AUeGhbf0$HCHhxemCQ39LPYOjC.Kb7/ feature rsyslog
!
interface lo
ip address 127.0.0.1/8 ipv6 address ::1/128 mtu 65536
!
interface eth0
ip address 192.168.52.2/24
!
interface eth1
ip address 172.4.5.115/24
!
interface eth2 shutdown
!
interface eth3 shutdown
!
interface eth4 shutdown
!
interface eth5 shutdown
!
router bgp 100
neighbor 172.4.5.116 remote-as 200
!
address-family ipv4 unicast
neighbor 172.4.5.116 activate
exit-address-family
!
line con 0 login
line vty 0 39 login
!
end
#
#show ip bgp
BGP table version is 8, 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
*> 75.1.1.0/24 172.4.5.116 0 100 0 200 ?
*> 100.1.1.0/24 172.4.5.116 0 100 0 200 ?
Total number of prefixes 2 #
#show ip bgp neighbors
BGP neighbor is 172.4.5.116, remote AS 200, local AS 100, external link
BGP version 4, local router ID 192.168.52.2, remote router ID 172.4.5.116 BGP state = Established, up for 00:04: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 131 messages, 1 notifications, 0 in queue
Sent 129 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 8, neighbor version 8 Index 1, Offset 0, Mask 0x2
Community attribute sent to this neighbor (both)
2 accepted prefixes
0 announced prefixes
Connections established 2; dropped 1
Local host: 172.4.5.115, Local port: 179
Foreign host: 172.4.5.116, Foreign port: 37982
Nexthop: 172.4.5.115 Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
Last Reset: 00:04:54, due to BGP Notification received Notification Error Message: (Cease/Peer Unconfigured.)
#show ip bgp vrf all
BGP table version is 8, 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
*> 75.1.1.0/24 172.4.5.116 0 100 0 200 ?
*> 100.1.1.0/24 172.4.5.116 0 100 0 200 ?
Total number of prefixes 2 #
#show ip bgp summary vrf all
BGP router identifier 192.168.52.2, local AS number 100 BGP table version is 8
1 BGP AS-PATH entries
0 BGP community entries
Neighbor V AS MsgRcv MsgSen TblVer InQ OutQ Up/Down State/ PfxRcd
172.4.5.116 4 200 168 165 8 0 0 00:22:04
2
Total number of neighbors 1
Total number of Established sessions 1
PE1
#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:10 (Default for VRF VRF1)
*> 75.1.1.0/24 0.0.0.0 0 100 32768 ?
*>i 100.1.1.0/24 172.6.7.117 0 100 0 ?
Announced routes count = 1
Accepted routes count = 1
Route Distinguisher: 100:10
*>i 100.1.1.0/24 172.6.7.117 0 100 0 ?
Announced routes count = 0
Accepted routes count = 1
#show ip bgp vrf all
BGP table version is 2, local router ID is 172.4.5.116
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
BGP Route Table for VRF VRF1
*> 75.1.1.0/24 0.0.0.0 0 100 32768 ?
*>i 100.1.1.0/24 172.6.7.117 0 100 0 ?
Total number of prefixes 2
#show ip bgp summary vrf all
BGP router identifier 172.4.5.116, local AS number 200
BGP VRF VRF1 Route Distinguisher: 100:10
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
172.4.5.115 4 100 55 60 2 0 0 00:26:54 0
Total number of neighbors 1
Total number of Established sessions 1
BGP router identifier 192.168.52.3, 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
172.6.7.117 4 200 80 101 1 0 0 00:37:47 0
Total number of neighbors 1
Total number of Established sessions 1
#show ip bgp neighbors
BGP neighbor is 172.6.7.117, remote AS 200, local AS 200, internal link
BGP version 4, local router ID 192.168.52.3, remote router ID 192.168.52.5
BGP state = Established, up for 00:38:33
Last read 00:00:03, 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 VPNv4 Unicast: advertised and received
Received 82 messages, 0 notifications, 0 in queue
Sent 103 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
For address family: VPNv4 Unicast
BGP table version 4, neighbor version 4
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: 172.6.7.116, Local port: 179
Foreign host: 172.6.7.117, Foreign port: 57743
Nexthop: 172.6.7.116
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
BGP neighbor is 172.4.5.115, vrf VRF1, remote AS 100, local AS 200, external link
BGP version 4, local router ID 172.4.5.116, remote router ID 192.168.52.2
BGP state = Established, up for 00:27:40
Last read 00:00: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 57 messages, 0 notifications, 0 in queue
Sent 62 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)
0 accepted prefixes
2 announced prefixes
Connections established 1; dropped 0
Local host: 172.4.5.116, Local port: 37982
Foreign host: 172.4.5.115, Foreign port: 179
Nexthop: 172.4.5.116
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
#show ip bgp vrf all
BGP table version is 2, local router ID is 172.4.5.116
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
BGP Route Table for VRF VRF1
*> 75.1.1.0/24 0.0.0.0 0 100 32768 ?
*>i 100.1.1.0/24 172.6.7.117 0 100 0 ?
Total number of prefixes 2
PE2
#show ip bgp vrf all
BGP table version is 1, local router ID is 172.3.4.117
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
BGP Route Table for VRF VRF1
*>i 75.1.1.0/24 172.6.7.116 0 100 0 ?
*> 100.1.1.0/24 0.0.0.0 0 100 32768 ?
Total number of prefixes 2
#show ip bgp summary vrf all
BGP router identifier 172.3.4.117, local AS number 200
BGP VRF VRF1 Route Distinguisher: 100:10
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
172.3.4.114 4 300 82 85 1 0 0 00:40:05 0
Total number of neighbors 1
Total number of Established sessions 1
BGP router identifier 192.168.52.5, 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
172.6.7.116 4 200 113 113 1 0 0 00:54:07 0
Total number of neighbors 1
Total number of Established sessions 1#
#show ip bgp neighbors
BGP neighbor is 172.6.7.116, remote AS 200, local AS 200, internal link
BGP version 4, local router ID 192.168.52.5, remote router ID 192.168.52.3
BGP state = Established, up for 00:56:09
Last read 00:00:09, 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 VPNv4 Unicast: advertised and received
Received 117 messages, 0 notifications, 0 in queue
Sent 117 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
For address family: VPNv4 Unicast
BGP table version 5, neighbor version 5
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: 172.6.7.117, Local port: 57743
Foreign host: 172.6.7.116, Foreign port: 179
Nexthop: 172.6.7.117
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
BGP neighbor is 172.3.4.114, vrf VRF1, remote AS 300, local AS 200, external link
BGP version 4, local router ID 172.3.4.117, remote router ID 192.168.52.4
BGP state = Established, up for 00:42:07
Last read 00:00:07, 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 86 messages, 0 notifications, 0 in queue
Sent 89 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
Community attribute sent to this neighbor (both)
0 accepted prefixes
2 announced prefixes
Connections established 1; dropped 0
Local host: 172.3.4.117, Local port: 54753
Foreign host: 172.3.4.114, Foreign port: 179
Nexthop: 172.3.4.117
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
CE2
#show ip bgp vpnv4 all
#show ip bgp
BGP table version is 3, 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
*> 75.1.1.0/24 172.3.4.117 0 100 0 200 ?
*> 100.1.1.0/24 172.3.4.117 0 100 0 200 ?
Total number of prefixes 2
#
#
#show ip bgp vrf all
BGP table version is 3, 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
*> 75.1.1.0/24 172.3.4.117 0 100 0 200 ?
*> 100.1.1.0/24 172.3.4.117 0 100 0 200 ?
Total number of prefixes 2
#
#
#show ip bgp summary vrf all
BGP router identifier 192.168.52.4, local AS number 300
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
172.3.4.117 4 200 382 414 3 0 0 00:42:54 2
Total number of neighbors 1
Total number of Established sessions 1
#
#
#show ip bgp neighbors
BGP neighbor is 172.3.4.117, remote AS 200, local AS 300, external link
BGP version 4, local router ID 192.168.52.4, remote router ID 172.3.4.117
BGP state = Established, up for 00:43: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 236 messages, 147 notifications, 0 in queue
Sent 415 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)
2 accepted prefixes
0 announced prefixes
Connections established 1; dropped 0
Local host: 172.3.4.114, Local port: 179
Foreign host: 172.3.4.117, Foreign port: 54753
Nexthop: 172.3.4.114
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
Last Reset: 00:43:32, due to BGP Notification received
Notification Error Message: (OPEN Message Error/Bad Peer AS.)
#
Extended Community with a 4-Byte ASN
In the following example, CE1, PE1, PE2, and CE2 support 4-byte ASN capability.
Note: PE1 and PE2 should both either be 4-byte-ASN capable or 2-byte-ASN capable. Support for the combination of one 4-byte-ASN capable PE with one 2-byte-ASN-capable PE is currently unavailable.
Topology
Extended Communities — 4-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)#bgp extended-asn-cap | Enable 4-octet ASN capability. |
(config)#router bgp 100000 | Assign the ASN value (100000) to the router. The ASN range is <1-4294967295>. |
(config-router)#neighbor 172.4.5.116 remote-as 200000 | Specify the neighbor's IP address (172.4.5.116) and the ASN value of the neighbor (200000). |
(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 |
PE1
#configure terminal | Enter configure mode. |
(config)#bgp extended-asn-cap | Enable 4-octet ASN capability. Dynamic change from 2- byte to 4-byte capability, or vice versa, is not allowed, unless the VRF is removed. |
(config)#ip vrf VRF1 | Specify the name of the VRF (VRF1) to be created. |
(config-vrf)#rd 1.1.1.1:200 | Assign a 4-byte route distinguisher (RD) for the VRF, which is a unique value on the router. The RD value can be in A.B.C.D:NN format. |
(config-vrf)#route-target both 1.1.1.1:200 | Specify the 4-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 50.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 200000 | Assign the ASN value (200000) to the router. |
(config-router)#neighbor 172.6.7.117 remote-as 200000 | Specify the neighbor's (PE2) IP address (172.6.7.117) and the ASN value of the neighbor (200000). 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 | Enable the exchange of routing information with a peer router. |
(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 100000 | Specify the neighbor's (CE1) IP address and ASN value. |
(config-router-af)# neighbor 172.4.5.115 activate | Activate neighbor in address family mode |
(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)#end | Exit Address-Family mode |
PE2
#configure terminal | Enter configure mode. |
(config)#bgp extended-asn-cap | Enable 4-octet ASN capability. Dynamic change from 2- byte to 4-byte capability, or vice versa, is not allowed, unless the VRF is removed. |
(config)#ip vrf VRF1 | Specify the name of the VRF (VRF1) to be created. |
(config-vrf)#rd 1.1.1.1:200 | Assign a 4-byte route distinguisher (RD) for the VRF. |
(config-vrf)#route-target both 1.1.1.1:200 | Specify the 4-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 200.1.1.0/24 eth1 | Create a VRF static route. |
(config)#interface eth2 | Enter interface mode. |
(config-if)#ip address 172.6.7.117/24 | Configure the IP address on this interface |
(config-if)#exit | Exit interface mode. |
(config)#router bgp 200000 | Assign the ASN value (200000) to the router. |
(config-router)#neighbor 172.6.7.116 remote-as 200000 | Specify the neighbor's (PE2) IP address (172.6.7.116) and the ASN value of the neighbor (200000). 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.116 activate | Enable the exchange of routing information with a peer router. |
(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.3.4.114 | |
remote-as 300000 | Specify the neighbor's (CE1) IP address and ASN value. |
(config-router-af)# neighbor 172.3.4.114 activate | Activate neighbor under address family mode |
(config-router-af)#neighbor 172.3.4.114 send- community both | Enable extended community attribute for the neighbor. |
(config-router-af)#redistribute static | Configure static redistribution. |
(config-router-af)#end | Exit Address-Family mode |
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)#bgp extended-asn-cap | Enable 4-octet ASN capability. |
(config)#router bgp 300000 | Assign the ASN value (300000) to the router. |
(config-router)#neighbor 172.3.4.117 remote-as 200000 | Specify the neighbor's IP address (172.3.4.117) and the ASN value of the neighbor (200000). |
(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 |
Validation
CE1
#show ip bgp neighbors
BGP neighbor is 172.4.5.116, remote AS 200000, local AS 100000, external link
BGP version 4, local router ID 192.168.52.2, remote router ID 172.4.5.116
BGP state = Established, up for 00:20: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)
4-Octet ASN Capability: advertised and received
Address family IPv4 Unicast: advertised and received
Received 45 messages, 0 notifications, 0 in queue
Sent 47 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)
2 accepted prefixes
0 announced prefixes
Connections established 1; dropped 0
Local host: 172.4.5.115, Local port: 179
Foreign host: 172.4.5.116, Foreign port: 58251
Nexthop: 172.4.5.115
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
#show ip bgp vrf all
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
*> 50.1.1.0/24 172.4.5.116 0 100 0 200000 ?
*> 200.1.1.0 172.4.5.116 0 100 0 200000 ?
Total number of prefixes 2
#show ip bgp summary vrf all
BGP router identifier 192.168.52.2, local AS number 100000
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
172.4.5.116 4 200000 46 48 3 0 0 00:21:12 2
Total number of neighbors 1
Total number of Established sessions 1
PE1
#show ip bgp neighbors
BGP neighbor is 172.4.5.116, remote AS 200000, local AS 100000, external link
BGP version 4, local router ID 192.168.52.2, remote router ID 172.4.5.116
BGP state = Established, up for 00:20: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)
4-Octet ASN Capability: advertised and received
Address family IPv4 Unicast: advertised and received
Received 45 messages, 0 notifications, 0 in queue
Sent 47 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)
2 accepted prefixes
0 announced prefixes
Connections established 1; dropped 0
Local host: 172.4.5.115, Local port: 179
Foreign host: 172.4.5.116, Foreign port: 58251
Nexthop: 172.4.5.115
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
#show ip bgp vrf all
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
*> 50.1.1.0/24 172.4.5.116 0 100 0 200000 ?
*> 200.1.1.0 172.4.5.116 0 100 0 200000 ?
Total number of prefixes 2
#show ip bgp summary vrf all
BGP router identifier 192.168.52.2, local AS number 100000
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
172.4.5.116 4 200000 46 48 3 0 0 00:21:12 2
Total number of neighbors 1
Total number of Established sessions 1
#clear bgp *
2019 Mar 22 06:16:56.414 : NOS : BGP : CRITI : [BGP_OPR_NEIGH_STATE_DOWN_2]: Neighbour [172.4.5.116] Session down due to peer clear
PE2
#show ip bgp neighbors
BGP neighbor is 172.4.5.116, remote AS 200000, local AS 100000, external link
BGP version 4, local router ID 192.168.52.2, remote router ID 172.4.5.116
BGP state = Established, up for 00:20: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)
4-Octet ASN Capability: advertised and received
Address family IPv4 Unicast: advertised and received
Received 45 messages, 0 notifications, 0 in queue
Sent 47 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)
2 accepted prefixes
0 announced prefixes
Connections established 1; dropped 0
Local host: 172.4.5.115, Local port: 179
Foreign host: 172.4.5.116, Foreign port: 58251
Nexthop: 172.4.5.115
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
#show ip bgp vrf all
BGP table version is 1, local router ID is 172.3.4.117
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
BGP Route Table for VRF VRF1
*>i 50.1.1.0/24 172.6.7.116 0 100 0 ?
*> 200.1.1.0 0.0.0.0 0 100 32768 ?
Total number of prefixes 2
#show ip bgp summary vrf all
BGP router identifier 192.168.52.2, local AS number 100000
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
172.4.5.116 4 200000 46 48 3 0 0 00:21:12 2
Total number of neighbors 1
Total number of Established sessions 1
#clear bgp *
2019 Mar 22 06:16:56.414 : NOS : BGP : CRITI : [BGP_OPR_NEIGH_STATE_DOWN_2]: Neighbour [172.4.5.116] Session down due to peer clear
CE2
#show ip bgp vrf all
BGP table version is 4, 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
*> 50.1.1.0/24 172.3.4.117 0 100 0 200000 ?
*> 200.1.1.0 172.3.4.117 0 100 0 200000 ?
Total number of prefixes 2
#show ip bgp summary vrf all
BGP router identifier 192.168.52.4, local AS number 300000
BGP table version is 4
1 BGP AS-PATH entries
0 BGP community entries
Neighbor V AS MsgRcv MsgSen TblVer InQ OutQ Up/Down State/PfxRcd
172.3.4.117 4 200000 33 30 4 0 0 00:04:34 2
Total number of neighbors 1
Total number of Established sessions 1
#show ip bgp neighbors
BGP neighbor is 172.3.4.117, remote AS 200000, local AS 300000, external link
BGP version 4, local router ID 192.168.52.4, remote router ID 172.3.4.117
BGP state = Established, up for 00:04:40
Last read 00:00:10, 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 33 messages, 0 notifications, 0 in queue
Sent 29 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 4, neighbor version 4
Index 1, Offset 0, Mask 0x2
Community attribute sent to this neighbor (both)
2 accepted prefixes
0 announced prefixes
Connections established 2; dropped 1
Local host: 172.3.4.114, Local port: 179
Foreign host: 172.3.4.117, Foreign port: 49361
Nexthop: 172.3.4.114
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
Last Reset: 00:04:40, due to BGP Notification sent
Notification Error Message: (Cease/Administratively Reset.)
Nexthop Tracking
Nexthop tracking is used to notify the BGP process asynchronously whenever there is any change in the IGP routes. It reduces the convergence time of BGP routes when IGP routes are changed.
Topology
BGP Nexthop Tracking
R1
#configure terminal | Enter configure mode. |
(config)#interface lo | Specify the loopback interface, and enter Interface mode. |
(config-if)#ip address 100.100.100.100/32 secondary | 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. The ASN range is <1-65535>. |
(config-router)#neighbor 200.200.200.200 remote-as 200 | Specify the neighbor's IP address (200.200.200.200) and the ASN value of the neighbor (200). |
(config-router)#neighbor 200.200.200.200 update-source lo | Specify the routing update source. |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 200.200.200.200 activate | Activate neighbor under address family mode |
(config-router-af)# exit-address-family | Exit address family mode |
(config-router)#exit | Exit Router mode, and return to Configure mode. |
(config)#router ospf 1 | Configure the OSPF process (1). |
(config-router)#network 172.4.5.0/24 area 0 | Advertise the network in Area 0. |
(config-router)#redistribute connected | Redistribute the connected routes. |
R2
#configure terminal | Enter configure mode. |
---|
(config)#router ospf 1 | Configure the OSPF process (1). |
(config-router)#network 172.4.5.0/24 area 0 | Advertise the network in Area 0. |
(config-router)#network 172.6.7.0/24 area 0 | Advertise the network in Area 0. |
R3
#configure terminal | Enter configure mode. |
(config)#interface lo | Specify the loopback interface, and enter Interface mode. |
(config-if) #ip address 150.150.150.150/32 secondary | Configure the IP address on this interface. |
(config-if)#ip address 200.200.200.200/32 secondary | 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 100.100.100.100 remote-as 200 | Specify the neighbor's IP address (100.100.100.100) and the ASN value of the neighbor (200). |
(config-router)#neighbor 100.100.100.100 update-source 200.200.200.200 | Specify the routing update source. |
(config-router)#neighbor 220.220.220.220 remote-as 200 | Specify the neighbor's IP address (220.220.220.220) and the ASN value of the neighbor (200). |
(config-router)#neighbor 220.220.220.220 update-source 150.150.150.150 | Specify the routing update source. |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 100.100.100.100 activate | Activate neighbor under address family mode |
(config-router-af)# neighbor 220.220.220.220 activate | Activate neighbor under address family mode |
(config-router-af)# exit-address-family | Exit address family mode |
(config-router)#exit | Exit Router mode, and return to Configure mode. |
(config)#router ospf 1 | Configure the OSPF process (1). |
(config-router)#network 172.6.7.0/24 area 0 | Advertise the network in Area 0. |
(config-router)#network 172.1.2.0/24 area 0 | Advertise the network in Area 0. |
(config-router)#redistribute connected | Redistribute the connected routes. |
(config-router)#exit | Exit Router mode, and return to Configure mode. |
(config)#bgp nexthop-trigger enable | Enable Nexthop tracking. |
(config)#bgp nexthop-trigger delay 20 | Configure the nexthop trigger-delay time interval. |
R4
#configure terminal | Enter configure mode. |
---|
(config)#router ospf 1 | Configure the OSPF process (1). |
(config-router)#network 172.1.2.0/24 area 0 | Advertise the network in Area 0. |
(config-router)#network 172.3.4.0/24 area 0 | Advertise the network in Area 0. |
R5
#configure terminal | Enter configure mode. |
(config)#interface lo | Specify the loopback interface, and enter Interface mode. |
(config-if)#ip address 220.220.220.220/32 secondary | 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 150.150.150.150 remote-as 200 | Specify the neighbor's IP address (150.150.150.150) and the ASN value of the neighbor (200). |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 150.150.150.150 activate | Activate neighbor under address family mode |
(config-router-af)# exit-address-family | Exit address family mode |
#configure terminal | Enter configure mode. |
(config)#interface lo | Specify the loopback interface, and enter Interface mode. |
(config-if)#ip address 220.220.220.220/32 secondary | Configure the IP address on this interface. |
(config-if)#exit | Exit interface mode. |
(config-router)#neighbor 150.150.150.150 update-source lo | Specify the routing update source. |
(config-router)#exit | Exit Router mode, and return to Configure mode. |
(config)#router ospf 1 | Configure the OSPF process (1). |
(config-router)#network 172.3.4.0/24 area 0 | Advertise the network in Area 0. |
(config-router)#redistribute connected | Redistribute the connected routes. |
Validation
show ip bgp summary, show ip bgp neighbors, show bgp nexthop-tracking, show ip bgp scan
Nexthop Tracking Delay Timer
The delay interval between routing table walks can be configured for nexthop delay tracking. This time determines how long BGP waits before it starts walking the full BGP routing table after receiving notification from NSM about a next-hop change.
Topology
Topology for Nexthop Tracking Delay Timer
R1
#configure terminal | Enter configure mode. |
(config)#interface lo | Specify the loopback interface, and enter Interface mode. |
(config-if)#ip address 150.150.150.150/32 secondary | Configure the IP address on this interface. |
(config-if)#ip address 100.100.100.100/32 secondary | 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. The ASN range is <1-65535>. |
(config-router)#neighbor 200.200.200.200 remote-as 200 | Specify the neighbor's IP address (200.200.200.200) and the ASN value of the neighbor (200). |
(config-router)#neighbor 200.200.200.200 update-source lo | Specify the routing update source. |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 200.200.200.200 activate | Activate neighbor under address family mode |
(config-router-af)# exit-address-family | Exit address family mode |
#configure terminal | Enter configure mode. |
(config)#interface lo | Specify the loopback interface, and enter Interface mode. |
(config-if)#ip address 150.150.150.150/32 secondary | Configure the IP address on this interface. |
(config-if)#ip address 100.100.100.100/32 secondary | Configure the IP address on this interface. |
(config-if)#exit | Exit interface mode. |
(config)#router ospf 1 | Configure the OSPF process (1). |
(config-router)#network 172.4.5.0/24 area 0 | Advertise the network in Area 0. |
(config-router)#redistribute connected | Redistribute the connected routes. |
R2
#configure terminal | Enter configure mode. |
---|
(config)#router ospf 1 | Configure the OSPF process (1). |
(config-router)#network 172.4.5.0/24 area 0 | Advertise the network in Area 0. |
(config-router)#network 172.6.7.0/24 area 0 | Advertise the network in Area 0. |
R3
#configure terminal | Enter configure mode. |
(config)#interface lo | Specify the loopback interface, and enter Interface mode. |
(config-if)#ip address 200.200.200.200/32 | 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 100.100.100.100 remote-as 200 | Specify the neighbor's IP address (100.100.100.100) and the ASN value of the neighbor (200). |
(config-router)#neighbor 100.100.100.100 update-source 200.200.200.200 | Specify the routing update source. |
(config-router)#neighbor 220.220.220.220 remote-as 200 | Specify the neighbor's IP address (220.220.220.220) and the ASN value of the neighbor (200). |
(config-router)#neighbor 220.220.220.220 update-source 150.150.150.150 | Specify the routing update source. |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 100.100.100.100 activate | Activate neighbor under address family mode |
(config-router-af)# neighbor 220.220.220.220 activate | Activate neighbor under address family mode |
(config-router-af)# exit-address-family | Exit address family mode |
(config-router)#exit | Exit Router mode, and return to Configure mode. |
(config)#router ospf 1 | Configure the OSPF process (1). |
(config-router)#network 172.6.7.0/24 area 0 | Advertise the network in Area 0. |
(config-router)#network 172.1.2.0/24 area 0 | Advertise the network in Area 0. |
(config-router)#redistribute connected | Redistribute the connected routes. |
(config-router)#exit | Exit Router mode, and return to Configure mode. |
(config)#bgp nexthop-trigger enable | Enable nexthop tracking. |
(config)#bgp nexthop-trigger delay 20 | Configure the nexthop trigger-delay time interval. |
R4
#configure terminal | Enter configure mode. |
---|
(config)#router ospf 1 | Configure the OSPF process (1). |
(config-router)#network 172.1.2.0/24 area 0 | Advertise the network in Area 0. |
(config-router)#network 172.3.4.0/24 area 0 | Advertise the network in Area 0. |
R5
#configure terminal | Enter configure mode. |
(config)#interface lo | Specify the loopback interface, and enter Interface mode. |
(config-if)#ip address 220.220.220.220/32 | 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 150.150.150.150 remote-as 200 | Specify the neighbor's IP address (150.150.150.150) and the ASN value of the neighbor (200). |
(config-router)#neighbor 150.150.150.150 update-source lo | Specify the routing update source. |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 150.150.150.150 activate | Activate neighbor under address family mode |
(config-router-af)# exit-address-family | Exit address family mode |
(config-router)#exit | Exit Router mode, and return to Configure mode. |
(config)#router ospf 1 | Configure the OSPF process (1). |
(config-router)#network 172.3.4.0/24 area 0 | Advertise the network in Area 0. |
(config-router)#redistribute connected | Redistribute the connected routes. |
Validation
R1
#show ip bgp summary
BGP router identifier 10.12.20.71, 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
200.200.200.200 4 200 15 16 1 0 0 00:06:37 0
Total number of neighbors 1
Total number of Established sessions 1
#show ip bgp neighbors
BGP neighbor is 200.200.200.200, remote AS 200, local AS 200, internal link
BGP version 4, local router ID 10.12.20.71, remote router ID 200.200.200.200
BGP state = Established, up for 00:06:40
Last read 00:06: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 15 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
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
Local host: 100.100.100.100, Local port: 37676
Foreign host: 200.200.200.200, Foreign port: 179
Nexthop: 100.100.100.100
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
#show bgp nexthop-tracking
Configured NHT: DISABLED
NHT Delay time-interval : 5
BGP VRF: (Default) VRF_ID 0
BGP Instance: (Default), AS: 200, router-id 10.12.20.71
#show ip bgp scan
BGP VRF: (Default) VRF_ID 0
BGP scan interval is 60
scan remain-time: 38
Current BGP nexthop cache:
R3
#show ip bgp summary
BGP router identifier 200.200.200.200, 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
100.100.100.100 4 200 17 19 1 0 0 00:07:41 0
220.220.220.220 4 200 95 101 1 0 0 00:07:12 0
Total number of neighbors 2
Total number of Established sessions 2
#show ip bgp neighbors
BGP neighbor is 100.100.100.100, remote AS 200, local AS 200, internal link
BGP version 4, local router ID 200.200.200.200, remote router ID 10.12.20.71
BGP state = Established, up for 00:07:46
Last read 00:07:46, 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 19 messages, 0 notifications, 0 in queue
Route refresh request: received 0, sent 0
Minimum time between advertisement runs is 5 seconds
Update source is 200.200.200.200
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: 200.200.200.200, Local port: 179
Foreign host: 100.100.100.100, Foreign port: 37676
Nexthop: 200.200.200.200
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
BGP neighbor is 220.220.220.220, remote AS 200, local AS 200, internal link
BGP version 4, remote router ID 220.220.220.220
local router ID 200.200.200.200
BGP state = Established, up for 00:07:17
Last read 00:07: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 94 messages, 1 notifications, 0 in queue
Sent 97 messages, 4 notifications, 0 in queue
Route refresh request: received 0, sent 0
Minimum time between advertisement runs is 5 seconds
Update source is 150.150.150.150
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 6; dropped 5
Local host: 150.150.150.150, Local port: 39831
Foreign host: 220.220.220.220, Foreign port: 179
Nexthop: 150.150.150.150
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
Last Reset: 00:07:22, due to BGP Notification received
Notification Error Message: (Cease/Other Configuration Change.)
#show bgp nexthop-tracking
Configured NHT: ENABLED
NHT Delay time-interval : 20
BGP VRF: (Default) VRF_ID 0
BGP Instance: (Default), AS: 200, router-id 200.200.200.200
NHT is Enabled
Recvd Msg count from RIB: 0
NHT delay-timer remaining seconds: 0
BGP nexthop(s):
Total number of IPV4 nexthops : 0
Total number of IPV6 nexthops : 0
#show ip bgp scan
BGP VRF: (Default) VRF_ID 0
BGP scan interval is 60
scan remain-time: 11
Current BGP nexthop cache:
R5
#show ip bgp summary
BGP router identifier 220.220.220.220, 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
150.150.150.150 4 200 99 101 1 0 0 00:08:26 0
Total number of neighbors 1
Total number of Established sessions 1
#show ip bgp neighbors
BGP neighbor is 150.150.150.150, remote AS 200, local AS 200, internal link
BGP version 4, local router ID 220.220.220.220, remote router ID 200.200.200.200
BGP state = Established, up for 00:08:29
Last read 00:08:29, 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 96 messages, 3 notifications, 0 in queue
Sent 99 messages, 2 notifications, 0 in queue
Route refresh request: received 0, sent 0
Minimum time between advertisement runs is 5 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 6; dropped 5
Local host: 220.220.220.220, Local port: 179
Foreign host: 150.150.150.150, Foreign port: 39831
Nexthop: 220.220.220.220
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
Last Reset: 00:08:34, due to BGP Notification sent
Notification Error Message: (Cease/Other Configuration Change.)
#show bgp nexthop-tracking
Configured NHT: DISABLED
NHT Delay time-interval : 5
BGP VRF: (Default) VRF_ID 0
BGP Instance: (Default), AS: 200, router-id 220.220.220.220
#show ip bgp scan
BGP VRF: (Default) VRF_ID 0
BGP scan interval is 60
scan remain-time: 22
Current BGP nexthop cache:
BGP Distance
Administrative distance in BGP can be configured for a specific address family.
Topology
Administrative Distance for IPv4 BGP
R1
#configure terminal | Enter configure mode. |
(config)#interface lo | Enter loopback interface mode. |
(config-if)#ip address 150.1.1.1/24 secondary | Specify IP address for the interface. |
(config-if)#exit | Exit loopback interface mode. |
(config)#router bgp 100 | Assign the ASN value (100) to the router. |
(config-router)#neighbor 1.1.1.2 remote-as 100 | Specify the neighbor's IP address and ASN value. |
(config-router)#address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)#neighbor 1.1.1.2 activate | Activate the neighbor in address family mode |
(config-router-af)#network 150.1.1.0/24 | Specify the network to be advertised by the BGP routing process. |
(config-router-af)#exit-address-family | Exit address-family ipv4 unicast mode |
R2
#configure terminal | Enter configure mode. |
(config)#router bgp 100 | Assign the ASN value (100) to the router. |
(config-router)#neighbor 2.2.2.2 remote-as 200 | Specify the neighbor's IP address and ASN value. |
(config-router)#neighbor 1.1.1.1 remote-as 100 | Specify the neighbor's IP address and the ASN value of another neighbor. |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)#distance bgp 12 13 120 | Configure the administrative distance for external, internal, and local routes received. |
(config-router-af)#aggregate-address 150.1.0.0/16 summary-only | Configure a non-AS-set aggregate route on R2. The local distance is applied to this route. |
(config-router-af)#neighbor 1.1.1.1 activate | Activate the neighbor in address family mode |
(config-router-af)#neighbor 2.2.2.2 activate | Activate the neighbor in address family mode |
(config-router-af)#exit-address-family | Exit address-family ipv4 unicast mode |
R3
#configure terminal | Enter configure mode. |
(config)#interface lo | Enter loopback interface mode. |
(config-if)#ip address 88.88.1.2/32 secondary | Specify IP address for the interface. |
(config-if)#exit | Exit loopback interface mode. |
(config)#router bgp 200 | Assign the ASN value (200) to the router. |
(config-router)#neighbor 2.2.2.1 remote-as 100 | Specify the neighbor's IP address and ASN value. |
(config-router)#address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)#network 88.88.1.2/32 | Specify the network to be advertised by the BGP routing process. |
(config-router-af)#neighbor 2.2.2.1 activate | Activate the neighbor in address family mode |
(config-router-af)#exit-address-family | Exitr address-family ipv4 unicast mode |
Validation
#show ip bgp summary
BGP router identifier 192.168.56.102, local AS number 100
BGP table version is 7
2 BGP AS-PATH entries
0 BGP community entries
Neighbor V AS MsgRcv MsgSen TblVer InQ OutQ Up/Down State/PfxRcd
1.1.1.1 4 100 8 9 7 0 0 00:02:39 1
2.2.2.2 4 200 4 4 7 0 0 00:00:38 1
Total number of neighbors 2
Total number of Established sessions 2
#show ip bgp neighbors
BGP neighbor is 1.1.1.1, remote AS 100, local AS 100, internal link
BGP version 4, local router ID 192.168.52.3, remote router ID 150.1.1.1
BGP state = Established, up for 00:02:54
Last read 00:02:54, 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 8 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 7, neighbor version 7
Index 2, Offset 0, Mask 0x4
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: 49238
Foreign host: 1.1.1.1, Foreign port: 179
Nexthop: 1.1.1.2
Nexthop global: fe80::a00:27ff:fea6:6e3
Nexthop local: ::
BGP connection: non shared network
BGP neighbor is 2.2.2.2, remote AS 200, local AS 100, external link
BGP version 4, remote router ID 88.88.1.2
local router ID 192.168.52.3
BGP state = Established, up for 00:00:53
Last read 00:00:53, 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 7, neighbor version 7
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: 2.2.2.1, Local port: 179
Foreign host: 2.2.2.2, Foreign port: 50072
Nexthop: 2.2.2.1
Nexthop global: fe80::a00:27ff:fe77:264e
Nexthop local: ::
BGP connection: non shared network
#show ip route database bgp
IP Route Table for VRF "default"
B *> 88.88.1.2/32 [12/0] via 2.2.2.2, eth2, 00:01:19
B *> 150.1.0.0/16 [120/0] is a summary, Null, 00:02:49
B *> 150.1.1.0/24 [200/0] via 1.1.1.1, eth1, 00:02:49
Gateway of last resort is not set
#show ip route database
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
> - selected route, * - FIB route, p - stale info
IP Route Table for VRF "default"
C *> 1.1.1.0/24 is directly connected, eth1, 00:13:39
C *> 2.2.2.0/24 is directly connected, eth3, 00:13:04
B *> 88.88.1.2/32 [12/0] via 2.2.2.2, eth3, 00:06:37
C *> 127.0.0.0/8 is directly connected, lo, 00:22:15
B *> 150.1.0.0/16 [120/0] is a summary, Null, 00:11:19
B *> 150.1.1.0/24 [200/0] via 1.1.1.1, eth1, 00:11:19
C *> 192.168.52.0/24 is directly connected, eth0, 00:22:13
Gateway of last resort is not set
#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:17:38
C 2.2.2.0/24 is directly connected, eth3, 00:17:03
B 88.88.1.2/32 [12/0] via 2.2.2.2, eth3, 00:10:36
C 127.0.0.0/8 is directly connected, lo, 00:26:14
B 150.1.0.0/16 [120/0] is a summary, Null, 00:15:18
B 150.1.1.0/24 [200/0] via 1.1.1.1, eth1, 00:15:18
C 192.168.52.0/24 is directly connected, eth0, 00:26:12
Gateway of last resort is not set
#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
*> 88.88.1.2/32 2.2.2.2 0 100 0 200 i
*> 150.1.0.0 0.0.0.0 0 100 32768 i
s>i 150.1.1.0/24 1.1.1.1 0 100 0 i
Total number of prefixes 3
BGP Weight per Peer
A different weight can be assigned per address family of a peer. For example, a system can be configured to prefer VPN4 routes from peer A and IPv4 routes from peer B.
If the neighbor weight command is given under a specific address-family mode, the peer weight is set for that specific address family. If the address family is not specifically set, the weight is updated for the default address-family.
Topology
BGP Weight Per Peer
R1
#configure terminal | Enter configure mode. |
(config)#router bgp 100 | Assign the ASN value (100) to the router. |
(config-router)#neighbor 1.1.1.2 remote-as 200 | Specify the neighbor's IP address and ASN value. |
(config-router)#address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)#neighbor 1.1.1.2 activate | Activate the neighbor in address family mode |
(config-router-af)#exit-address-family | Exit address-family ipv4 unicast mode |
R2
#configure terminal | Enter configure mode. |
(config)#router bgp 200 | Assign the ASN value (200) to the router. |
(config-router)#neighbor 1.1.1.1 remote-as 100 | Specify the neighbor's IP address and ASN value. |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)#neighbor 1.1.1.1 weight 500 | Add a weight of 500 to all the routes coming from the neighbor, 1.1.1.1 (only IPv4 routes). |
(config-router-af)#neighbor 1.1.1.1 activate | Activate the neighbor in address family mode |
(config-router-af)#exit-address-family | Exit address-family ipv4 unicast mode |
Validation
R1
#show ip bgp summary
BGP router identifier 192.168.56.101, local AS number 100
BGP table version is 1
0 BGP AS-PATH entries
0 BGP community entries
Neighbor V AS MsgRcv MsgSen TblVer InQ OutQ Up/Dow
n State/PfxRcd
1.1.1.2 4 200 6 7 1 0 0 00:02:00
0
Total number of neighbors 1
Total number of Established sessions 1
#show ip bgp neighbors
BGP neighbor is 1.1.1.2, remote AS 200, local AS 100, 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:01: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 4 messages, 0 notifications, 0 in queue
Sent 5 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: 1.1.1.1, Local port: 179
Foreign host: 1.1.1.2, Foreign port: 34619
Nexthop: 1.1.1.1
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:09:10
C 127.0.0.0/8 is directly connected, lo, 00:15:56
C 192.168.52.0/24 is directly connected, eth0, 00:15:52
Gateway of last resort is not set
R2
#show ip bgp summary
BGP router identifier 192.168.56.102, 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/Dow
n State/PfxRcd
1.1.1.1 4 100 3 3 1 0 0 00:00:34
0
Total number of neighbors 1
Total number of Established sessions 1
#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 192.168.52.3, remote router ID 192.168.52.2
BGP state = Established, up for 00:07:14
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 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 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)
Weight500
0 accepted prefixes
0 announced prefixes
Connections established 1; dropped 0
Local host: 1.1.1.2, Local port: 34619
Foreign host: 1.1.1.1, Foreign port: 179
Nexthop: 1.1.1.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:11:26
C 127.0.0.0/8 is directly connected, lo, 00:21:36
C 192.168.52.0/24 is directly connected, eth0, 00:21:32
Gateway of last resort is not set
OSPF as PE-CE Protocol for VPNs
In an MPLS VPN environment, customer networks are connected to an MPLS VPN-enabled provider backbone. As shown in
Figure 10-95, Customer A areas, Areas 0 and 1, are connected to an MPLS VPN–enabled provider network. Area 0 and Area 1 have routers CE1 and CE2 running OSPF. MP-iBGP is used between PE1 and PE2 to propagate routes between Site 1 (Area 0) and Site 2 (Area 1). Traditional OSPF-BGP redistribution is performed at PE routers, PE1 and PE2. In this case, routes distributed by CE1 into the MP-iBGP cloud are sent to CE2 as external routes, even though both CE1 and CE2 belong to the same customer.
This behavior can be changed with the additional domain ID configuration. Each VRF should be configured a domain ID on the PE routers. If a PE router gets a route through the MP-iBGP cloud and has to send to any customer site, it checks the domain ID value against the list of stored domain ID values. If the incoming domain ID matches any of the stored IDs, that route is inserted into the customer site with the same type, as it was inserted into the MP-BGP cloud; otherwise, it is inserted as external route.
Topology
OSPF as PE-CE Protocol
Configuration
CE1
#configure terminal | Enter configure mode |
(config)#interface lo | Enter loopback interface mode |
(config-if)#ip address 60.1.1.1/24 secondary | Specify IP address for the interface |
(config-if)#exit | Exit loopback interface mode |
(config)#router ospf 1 | Configure the routing process and specify the Process ID (1). |
(config-router)#network 10.10.10.0/24 area 0 | Advertise the network in OSPF |
(config-router)#network 60.1.1.0/24 area 0 | Advertise the loopback IP address in area 0 of router OSPF 1. |
PE1
#configure terminal | Enter configure mode. |
(config)#ip vrf ABC | Specify the name of the VRF (ABC) to be created. |
(config-vrf)#rd 10:100 | 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 10:100 | 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 ABC | Associate interface eth1 to vrf ABC. |
(config-if)#exit | Exit interface mode. |
(config)#router ospf 1 ABC | Configure OSPF for VRF. |
(config-router)#network 10.10.10.0/24 area 0 | Advertise the network for OSPF adjacency with CE1. |
(config-router)#domain-id 1.1.1.1 | Configure the primary domain ID. |
(config-router)#domain-id 2.2.2.2 secondary | Configure a secondary domain ID. |
(config-router)#domain-id 3.3.3.3 secondary | Configure a secondary domain ID. |
(config-router)#exit | Exit Router mode and return to Configure mode. |
(config)#router bgp 100 | Assign the ASN value (100) to the BGP router. |
(config-router)#neighbor 30.30.30.2 remote-as 100 | Configure neighbor 30.30.30.2 for iBGP. |
(config-router)#address-family vpnv4 unicast | Enter Address-Family-VPNv4 mode. |
(config-router-af)#neighbor 30.30.30.2 activate | Activate neighbor 30.30.30.2. |
(config-router-af)#exit-address-family | Exit Address Family mode and return to Router mode. |
(config-router)#address-family ipv4 vrf ABC | Enter Address-Family-VRF mode. |
(config-router-af)#redistribute ospf | Specify redistributing routes from OSPF into BGP. |
(config-router-af)#exit-address-family | Exit Address Family mode and return to Router mode. |
PE2
#configure terminal | Enter configure mode. |
(config)#ip vrf ABC | Specify the name of the VRF (ABC) to be created. |
(config-vrf)#rd 10:100 | 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 10:100 | 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 ABC | Associate interface eth1 to vrf ABC. |
(config-if)#exit | Exit interface mode. |
(config)#router ospf 1 ABC | Configure OSPF for VRF. |
(config-router)#network 20.20.20.0/24 area 0 | Advertise the network for OSPF adjacency with CE1. |
(config-router)#domain-id 1.1.1.1 | Configure the primary domain ID. |
(config-router)#domain-id 2.2.2.2 secondary | Configure a secondary domain ID. |
(config-router)#domain-id 3.3.3.3 secondary | Configure a secondary domain ID. |
(config-router)#exit | Exit Router mode and return to Configure mode. |
(config)#router bgp 100 | Assign the ASN value (100) to the BGP router. |
(config-router)#neighbor 30.30.30.1 remote-as 100 | Configure neighbor 30.30.30.1 for iBGP. |
(config-router)#address-family vpnv4 unicast | Enter Address-Family-VPNv4 mode. |
(config-router-af)#neighbor 30.30.30.1 activate | Activate neighbor 30.30.30.1. |
(config-router-af)#exit-address-family | Exit Address Family mode and return to Router mode. |
(config-router)#address-family ipv4 vrf ABC | Enter Address-Family-VRF mode. |
(config-router-af)#redistribute ospf | Specify redistributing routes from OSPF into BGP. |
(config-router-af)#exit-address-family | Exit Address Family mode and return to Router mode. |
CE2
#configure terminal | Enter configure mode. |
(config)#router ospf 1 | Configure the routing process, and specify the Process ID (1). |
(config-router)#network 20.20.20.0/24 area 0 | Advertise the network in OSPF. |
Validation
#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: 10:100 (Default for VRF ABC)
*> 10.10.10.0/24 0.0.0.0 2 100 32768 ?
*> 60.1.1.1/32 10.10.10.1 12 100 32768 ?
Announced routes count = 2
Accepted routes count = 0
#
BGP Multipath for IPv4
BGP supports multipath for IPv4 prefixes. BGP Multipath allows load-balancing traffic among multiple BGP routes. It supports both iBGP and eBGP routes. In case of eBGP, the routes should arrive from same AS number.
Topology
Multipath iBGP for IPv4
Configuration
Rtr1
#configure terminal | Enter the Configure mode. |
(config)#router bgp 100 | Assign the ASN value (100) to the BGP router. |
(config-router)#bgp router-id 2.2.2.2 | Configure a fixed Router ID (2.2.2.2). |
(config-router)#neighbor 30.30.30.9 remote-as 100 | Configure neighbor 30.30.30.9 for iBGP. |
(config-router)# address-family ipv4 unicast | .Under address family, Redistribute the static routes. |
(config-router-af)#redistribute static | Redistribute the static routes. |
config-router-af)# neighbor 30.30.30.9 activate | Activate the neighbor |
(config-router-af)#exit-address-family | Exit address-family mode. |
(config-router)#exit | Exit the BGP Router mode and return to the Configure mode. |
(config)#ip route 88.88.0.0/16 Null | Configure static route. |
Rtr3
#configure terminal | Enter the Configure mode. |
(config)#router bgp 100 | Assign the ASN value (100) to the BGP router. |
(config-router)#bgp router-id 4.4.4.4 | Configure a fixed Router ID (4.4.4.4). |
(config-router)#neighbor 40.40.40.9 remote-as 100 | Configure neighbor 40.40.40.9 for iBGP. |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)#redistribute static | Redistribute the static routes. |
config-router-af)# neighbor 40.40.40.9 activate | Activate the neighbor |
(config-router-af)#exit-address-family | Exit address-family mode |
(config-router)#exit | Exit the BGP Router mode and return to the Configure mode. |
(config)#ip route 88.88.0.0/16 Null | Configure static route. |
Rtr4
#configure terminal | Enter the Configure mode. |
(config)#router bgp 100 | Assign the ASN value (100) to the BGP router. |
(config-router)#bgp router-id 6.6.6.6 | Configure a fixed Router ID (6.6.6.6). |
(config-router)#neighbor 50.50.50.9 remote-as 100 | Configure neighbor 50.50.50.9 for iBGP. |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)#redistribute static | Redistribute the static routes. |
config-router-af)# neighbor 50.50.50.9 activate | Activate the neighbor |
(config-router-af)#exit-address-family | Exit address-family mode |
(config-router)#exit | Exit the BGP Router mode and return to the Configure mode. |
(config)#ip route 88.88.0.0/16 Null | Configure static route. |
Rtr2
#configure terminal | Enter the Configure mode. |
(config)#router bgp 100 | Assign the ASN value (100) to the BGP router. |
(config)#bgp router-id 9.9.9.9 | Configure a fixed Router ID (9.9.9.9). |
(config-router)#neighbor 30.30.30.2 remote-as 100 | Configure neighbor 30.30.30.2 for iBGP. |
(config-router)#neighbor 40.40.40.4 remote-as 100 | Configure neighbor 40.40.40.4 for iBGP. |
(config-router)#neighbor 50.50.50.6 remote-as 100 | Configure neighbor 50.50.50.6 for iBGP. |
(config-router)#address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
config-router-af)# neighbor 30.30.30.2 activate | Activate the neighbor |
config-router-af)# neighbor 40.40.40.4 activate | Activate the neighbor |
config-router-af)# neighbor 50.50.50.6 activate | Activate the neighbor |
config-router-af)# max-paths ibgp 2 | Configure iBGP max-paths (2). |
(config-router-af)#exit-address-family | Exit address-family mode |
Validation
#show ip bgp 88.88.0.0
BGP routing table entry for 88.88.0.0/16
Paths: (3 available, best #1, table Default-IP-Routing-Table) Not advertised to any peer
Local
30.30.30.2 from 30.30.30.2 (2.2.2.2)
Origin incomplete, metric 0, localpref 100, valid, internal, multipath- candidate, installed, best
Last update: Wed Mar 2 15:17:38 2016
Local
50.50.50.6 from 50.50.50.6 (6.6.6.6)
Origin incomplete, metric 0, localpref 100, valid, internal, multipath- candidate
Last update: Wed Mar 2 15:23:58 2016
Local
40.40.40.4 from 40.40.40.4 (4.4.4.4)
Origin incomplete, metric 0, localpref 100, valid, internal, multipath- candidate, installed
Last update: Wed Mar 2 15:21:45 2016
#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 30.30.30.0/24 is directly connected, eth1, 00:15:04 C 40.40.40.0/24 is directly connected, eth6, 00:14:30 C 50.50.50.0/24 is directly connected, eth3, 00:14:46 B 88.88.0.0/16 [200/0] via 40.40.40.4, eth6, 00:02:58
[200/0] via 30.30.30.2, eth1
C 127.0.0.0/8 is directly connected, lo, 00:19:21
C 192.168.52.0/24 is directly connected, eth0, 00:19:16 Gateway of last resort is not set
Gateway of last resort is not set
#show running-config router bgp
!
router bgp 100
bgp router-id 9.9.9.9
max-paths ibgp 2
neighbor 30.30.30.2 remote-as 100
neighbor 40.40.40.4 remote-as 100
neighbor 50.50.50.6 remote-as 100
!
address-family ipv4 unicast
max-paths ibgp 2
neighbor 30.30.30.2 activate
neighbor 40.40.40.4 activate
neighbor 50.50.50.6 activate
exit-address-family
!
Multipath eBGP
Topology
Multipath eBGP for IPv4
Configuration
Rtr1
#configure terminal | Enter the Configure mode. |
(config)#router bgp 200 | Assign the ASN value (200) to the BGP router. |
(config-router)#bgp router-id 2.2.2.2 | Configure a fixed Router ID (2.2.2.2). |
(config-router)#neighbor 30.30.30.9 remote-as 100 | Configure neighbor 30.30.30.9 for eBGP. |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)#redistribute static | Redistribute the static routes. |
config-router-af)# neighbor 30.30.30.9 activate | Activate the neighbor |
(config-router-af)#exit-address-family | Exit address-family mode |
(config-router)#exit | Exit the BGP Router mode and return to the Configure mode. |
(config)#ip route 88.88.0.0/16 Null | Configure static route. |
Rtr3
#configure terminal | Enter the Configure mode. |
(config)#router bgp 200 | Assign the ASN value (200) to the BGP router. |
(config-router)#bgp router-id 4.4.4.4 | Configure a fixed Router ID (4.4.4.4). |
(config-router)#neighbor 40.40.40.9 remote-as 100 | Configure neighbor 40.40.40.9 for eBGP. |
(config-router)#address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)#redistribute static | Redistribute the static routes. |
config-router-af)# neighbor 40.40.40.9 activate | Activate the neighbor |
(config-router-af)#exit-address-family | Exit address-family mode |
(config-router)#exit | Exit the BGP Router mode and return to the Configure mode. |
(config)#ip route 88.88.0.0/16 Null | Configure static route. |
Rtr4
#configure terminal | Enter the Configure mode. |
(config)#router bgp 200 | Assign the ASN value (200) to the BGP router. |
(config-router)#bgp router-id 6.6.6.6 | Configure a fixed Router ID (6.6.6.6). |
(config-router)#neighbor 50.50.50.9 remote-as 100 | Configure neighbor 50.50.50.9 for eBGP. |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)#redistribute static | Redistribute the static routes. |
config-router-af)# neighbor 50.50.50.9 activate | Activate the neighbor |
(config-router-af)#exit-address-family | Exit address-family mode |
(config)#exit | Exit the BGP Router mode and return to the Configure mode. |
(config)#ip route 88.88.0.0/16 Null | Configure static route. |
Rtr2
#configure terminal | Enter the Configure mode. |
(config)#router bgp 100 | Assign the ASN value (100) to the BGP router. |
(config)#bgp router-id 9.9.9.9 | Configure a fixed Router ID (9.9.9.9). |
(config-router)#neighbor 30.30.30.2 remote-as 200 | Configure neighbor 30.30.30.2 for eBGP. |
(config-router)#neighbor 40.40.40.4 remote-as 200 | Configure neighbor 40.40.40.4 for eBGP. |
(config-router)#neighbor 50.50.50.6 remote-as 200 | Configure neighbor 50.50.50.6 for eBGP. |
(config-router)#address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
config-router-af)# neighbor 30.30.30.2 activate | Activate the neighbor |
config-router-af)# neighbor 40.40.40.4 activate | Activate the neighbor |
config-router-af)# neighbor 50.50.50.6 activate | Activate the neighbor |
config-router-af)# max-paths ebgp 2 | Configure eBGP max-paths (2). |
(config-router-af)#exit-address-family | Exit address-family mode |
(config-router)#exit | Exit the Router mode and return to Configure mode. |
Validation
#show ip bgp 88.88.0.0
BGP routing table entry for 88.88.0.0/16
Paths: (3 available, best #3, table Default-IP-Routing-Table) Advertised to non peer-group peers:
30.30.30.2 50.50.50.6
200
30.30.30.2 from 30.30.30.2 (2.2.2.2)
Origin incomplete metric 0, localpref 100, valid, external, multipath-candidate, installed
Last update: Sat Jan 3 02:06:25 1970
200
50.50.50.6 from 50.50.50.6 (6.6.6.6)
Origin incomplete metric 0, localpref 100, valid, external, multipath-candidate Last update: Sat Jan 3 02:05:39 1970
200
40.40.40.4 from 40.40.40.4 (4.4.4.4)
Origin incomplete metric 0, localpref 100, valid, external, multipath-candidate, installed, best
Last update: Sat Jan 3 02:05:11 1970
#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 30.30.30.0/24 is directly connected, eth1, 05:26:26
C 40.40.40.0/24 is directly connected, eth6, 05:25:52
C 50.50.50.0/24 is directly connected, eth3, 05:26:08
B 88.88.0.0/16 [20/0] via 40.40.40.4, eth6, 00:01:38
[20/0] via 30.30.30.2, eth1
C 127.0.0.0/8 is directly connected, lo, 05:30:43
C 192.168.52.0/24 is directly connected, eth0, 05:30:38
Gateway of last resort is not set #show running-config router bgp
!
router bgp 100
bgp router-id 9.9.9.9
max-paths ebgp 2
neighbor 30.30.30.2 remote-as 200
neighbor 40.40.40.4 remote-as 200
neighbor 50.50.50.6 remote-as 200
!
address-family ipv4 unicast
neighbor 30.30.30.2 activate
neighbor 40.40.40.4 activate
neighbor 50.50.50.6 activate
exit-address-family
!
Multipath eiBGP
Use this command to set the number of equal-cost multi-path (ECMP) routes for both eBGP and iBGP. This feature allows to configure multipath load balancing with both external BGP (eBGP) and internal BGP (iBGP) paths in Border Gateway Protocol.
When enabled, this feature can perform load balancing on eBGP and/or iBGP paths. With multiple eBGP and iBGP paths, selection is per all paths sorted according to BGP rules and hence either of all eBGP or iBGP or both will be marked as candidates for multipath programming i.e., it is possible either all eBGP paths or all iBGP paths or both eBGP and iBGP are programmed as multipaths.
Exceptions during path selections when eiBGP is enabled:
• AS Path length check is ignored.
• Origin Check is ignored.
• Peer type check is ignored.
IGP Metric check is ignored.
Topology
Multipath eiBGP topology
Configuration
RTR1
#configure terminal | Enter Configure mode. |
(config)#interface lo | Enter Interface mode |
(config-if)# ip address 41.41.41.41/32 sec-ondary | Assign IP address to interface |
(config-if)#exit | Exit interface mode |
(config)#interface xe27 | Enter Interface mode |
(config-if)# ip address 21.1.1.1/24 | Assign IP address to interface |
(config-if)#exit | Exit interface mode |
(config)#interface xe1 | Enter Interface mode |
(config-if)# ip address 22.1.1.1/24 | Assign IP address to interface |
(config-if)#exit | Exit interface mode |
(config)#interface xe7 | Enter Interface mode |
(config-if)# ip address 23.1.1.1/24 | Assign IP address to interface |
(config-if)#exit | Exit interface mode |
(config)#interface xe20 | Enter Interface mode |
(config-if)# ip address 100.1.1.1/24 | Assign IP address to interface |
(config-if)#exit | Exit interface mode |
(config)# router bgp 100 | Enter Router BGP mode |
(config-router)# neighbor 21.1.1.2 remote-as 200 | Define BGP neighbors. 21.1.1.2 is the IP address of the neighbor (RTR2) and 200 is the neighbors AS number |
(config-router)# neighbor 22.1.1.2 remote-as 300 | Define BGP neighbors. 22.1.1.2 is the IP address of the neighbor (RTR3) and 300 is the neighbors AS number |
(config-router)# neighbor 23.1.1.2 remote-as 100 | Define BGP neighbors. 23.1.1.2 is the IP address of the neighbor (RTR4) and 100 is the neighbors AS number |
(config-router)# address-family ipv4 unicast | Enter into BGP address family IPv4 |
(config-router-af)#max-paths eibgp 4 | Configure eiBGP max-paths (4). |
(config-router-af)#redistribute connected | Redistribute connected routes into BGP |
(config-router-af)#neighbor 21.1.1.2 acti-vate | Activate the neighbor |
(config-router-af)#neighbor 22.1.1.2 acti-vate | Activate the neighbor |
(config-router-af)#neighbor 23.1.1.2 acti-vate | Activate the neighbor |
(config-router-af)# commit | Commit the configurations |
(config-router-af)# end | Return to privilege mode |
RTR2
#configure terminal | Enter Configure mode. |
(config)#interface lo | Enter Interface mode |
(config-if)# ip address 45.45.45.45/32 sec-ondary | Assign IP address to interface |
(config-if)#exit | Exit interface mode |
(config)#interface xe7 | Enter Interface mode |
(config-if)# ip address 21.1.1.2/24 | Assign IP address to interface |
(config-if)#exit | Exit interface mode |
(config)#interface xe6 | Enter Interface mode |
(config-if)# ip address 111.1.1.11/24 | Assign IP address to interface |
(config-if)#exit | Exit interface mode |
(config)# router bgp 200 | Enter Router BGP mode |
(config-router)# neighbor 21.1.1.1 remote-as 100 | Define BGP neighbors. 21.1.1.1 is the IP address of the neighbor (RTR1) and 100 is the neighbors AS number |
(config-router)# address-family ipv4 unicast | Enter into BGP address family IPv4 |
(config-router-af)#redistribute connected | Redistribute connected routes |
(config-router-af)#neighbor 21.1.1.1 acti-vate | Activate the neighbor |
(config-router-af)# commit | Commit the configurations |
(config-router-af)# end | Return to privilege mode |
RTR3
#configure terminal | Enter Configure mode. |
(config)#interface lo | Enter Interface mode |
(config-if)# ip address 42.42.42.42/32 sec-ondary | Assign IP address to interface |
(config-if)#exit | Exit interface mode |
(config)#interface xe0 | Enter Interface mode |
(config-if)# ip address 111.1.1.42/24 | Assign IP address to interface |
(config-if)#exit | Exit interface mode |
(config)#interface xe1 | Enter Interface mode |
(config-if)# ip address 22.1.1.2/24 | Assign IP address to interface |
(config-if)#exit | Exit interface mode |
(config)# router bgp 300 | Enter Router BGP mode |
(config-router)# neighbor 22.1.1.1 remote-as 100 | Define BGP neighbors. 22.1.1.1 is the IP address of the neighbor (RTR1) and 100 is the neighbors AS number |
(config-router)# address-family ipv4 unicast | Enter into BGP address family IPv4 |
(config-router-af)#redistribute connected | Redistribute connected routes |
(config-router-af)#neighbor 22.1.1.1 acti-vate | Activate the neighbor |
(config-router-af)# commit | Commit the configurations |
(config-router-af)# end | Return to privilege mode |
RTR4
#configure terminal | Enter Configure mode. |
(config)#interface lo | Enter Interface mode |
(config-if)# ip address 43.43.43.43/32 sec-ondary | Assign IP address to interface |
(config-if)#exit | Exit interface mode |
(config)#interface xe7 | Enter Interface mode |
(config-if)# ip address 23.1.1.2/24 | Assign IP address to interface |
(config-if)#exit | Exit interface mode |
(config)#interface xe18 | Enter Interface mode |
(config-if)# ip address 111.1.1.43/24 | Assign IP address to interface |
(config-if)#exit | Exit interface mode |
(config)# router bgp 100 | Enter Router BGP mode |
(config-router)# neighbor 23.1.1.1 remote-as 100 | Define BGP neighbors. 23.1.1.1 is the IP address of the neighbor (RTR1) and 100 is the neighbors AS number |
(config-router)# address-family ipv4 unicast | Enter into BGP address family IPv4 |
(config-router-af)#redistribute connected | Redistribute connected routes |
(config-router-af)#neighbor 23.1.1.1 acti-vate | Activate the neighbor |
(config-router-af)# commit | Commit the configurations |
(config-router-af)# end | Return to privilege mode |
Validation
RTR1
# sh ip bgp summary
BGP router identifier 15.1.1.2, local AS number 100
BGP table version is 4
3 BGP AS-PATH entries
0 BGP community entries
4 Configured ebgp ECMP multipath: Currently set at 4
Neighbor V AS MsgRcv MsgSen TblVer InQ OutQ Up/Down State/PfxRcd
21.1.1.2 4 200 13 16 4 0 0 00:04:28 3
22.1.1.2 4 300 10 14 4 0 0 00:03:05 4
23.1.1.2 4 100 7 9 4 0 0 00:01:49 4
Total number of neighbors 3
Total number of Established sessions 3
#sh 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"
B 11.1.1.0/24 [200/0] via 23.1.1.2, xe7, 00:11:26
B 11.11.11.11/32 [20/0] via 21.1.1.2, xe27, 00:10:14
B 17.1.1.0/24 [20/0] via 22.1.1.2, xe1, 00:10:54
C 21.1.1.0/24 is directly connected, xe27, 00:47:36
C 22.1.1.0/24 is directly connected, xe1, 00:49:33
C 23.1.1.0/24 is directly connected, xe7, 00:49:11
C 41.41.41.41/32 is directly connected, lo, 01:30:34
B 42.42.42.42/32 [20/0] via 22.1.1.2, xe1, 00:10:54
B 43.43.43.43/32 [200/0] via 23.1.1.2, xe7, 00:11:26
B 45.45.45.45/32 [20/0] via 21.1.1.2, xe27, 00:10:56
C 100.1.1.0/24 is directly connected, xe20, 00:08:31
B 111.1.1.0/24 [200/0] via 23.1.1.2, xe7, 00:11:26
[200/0] via 22.1.1.2, xe1,
[200/0] Via 21.1.1.2, xe27
C 127.0.0.0/8 is directly connected, lo, 01:39:19
Gateway of last resort is not set
#sh interface counters rate mbps
-------------------------------------------------------------------------
Interface
Rx mbps
Rx pps
Tx mbps
Tx pps
-------------------------------------------------------------------------
xe1 0.00 0 264.30 22024
xe7 0.00 0 254.86 21238
xe20 822.35 68529 0.02 3
xe27 0.00 0 215.04 17920
6BGP AS-PATH Multipath-relax
BGP will not load balance across multiple paths by default. We can configure it to do so with the max-paths ebgp <no-of-multipaths> command. The criterion of this command is that all attributes must match (Weight, Local preference, AS Path, etc). This is acceptable if we are multi-homed to a single AS, but what if we are multi-homed to different AS.
BGP AS PATH multipath relax effectively allows for ECMP to be done across different neighboring ASN’s.
Topology
Below topology explains about BGP AS PATH multipath relax functionality.
BGP AS-PATH Multipath-relax Topology
Configuration
R1
#configure terminal | Enter the Configure mode. |
(config)#interface lo | Enter Interface loopback |
(config-if)#ip address 100.1.1.1/24 secondary | Configure IP address for interface |
(config-if)#exit | Exit interface mode |
(config)#interface ge47 | Enter Interface loopback |
(config-if)#ip address 47.47.47.1/24 | Configure IP address for interface |
(config-if)#exit | Exit from interface mode and enter the Configure mode |
(config)#router bgp 1 | Assign the ASN value (1) to the BGP router |
(config-router)#neighbor 47.47.47.2 remote-as 2 | Configure eBGP neighbor. |
(config-router)#address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)#neighbor 47.47.47.2 activate | Activate neighbor |
(config-router-af)#network 100.1.1.0/24 | Advertise the loopback network into BGP. |
(config-router-af)#end | Exit from router BGP and address-family config mode |
R2
#configure terminal | Enter the Configure mode. |
(config)#interface ge33 | Enter interface mode |
(config-if)#ip address 33.33.33.2/24 | Configure IP address for interface |
(config-if)#exit | Exit from interface mode and enter the Configure mode |
(config)#interface ge47 | Enter interface mode |
(config-if)#ip address 47.47.47.2/24 | Configure IP address for interface. |
(config-if)#exit | Exit from interface mode and enter the Configure mode |
(config)#router bgp 2 | Assign the ASN value (2) to the BGP router. |
(config-router)#neighbor 33.33.33.3 remote-as 3 | Configure eBGP neighbor. |
(config-router)#neighbor 47.47.47.1 remote-as 1 | Configure eBGP neighbor. |
(config-router)#address-family ipv4 unicast | Enter the address family IPv4 unicast mode |
(config-router-af)# neighbor 33.33.33.3 activate | Activate the neighbor |
config-router-af)# neighbor 47.47.47.1 activate | Activate the neighbor |
(config-router-af)# max-paths ebgp 8 | Configure eBGP Multipath. |
(config-router-af)#exit | Exit from address family mode and enter the Router configure mode |
(config-router)# bgp bestpath as-path multipath-relax | Configure BGP AS PATH Multipath relax. |
(config-router-af)#end | End the address family mode. |
R3
#configure terminal | Enter the Configure mode. |
(config)#interface lo | Enter Interface loopback. |
(config-if)#ip address 100.1.1.1/24 secondary | Configure IP address for interface. |
(config-if)#exit | Exit from interface mode and enter the Configure mode. |
(config)#interface ge33 | Enter Interface loopback. |
(config-if)#ip address 33.33.33.3/24 | Configure IP address for interface. |
(config-if)#exit | Exit from interface mode and enter the Configure mode. |
(config)#router bgp 3 | Assign the ASN value (3) to the BGP router. |
(config-router)#neighbor 33.33.33.2 remote- | |
as 2 | Configure eBGP neighbor. |
(config-router)#address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 33.33.33.2 activate | Activate the neighbor |
(config-router-af)#network 100.1.1.0/24 | Advertise the loopback network into BGP. |
(config-router-af)#end | Exit from router BGP and address-family config mode |
Validation
R2#show running-config bgp
!
router bgp 2
bgp bestpath as-path multipath-relax max-paths ebgp 8
neighbor 33.33.33.3 remote-as 3
neighbor 47.47.47.1 remote-as 1
!
address-family ipv4 unicast
neighbor 33.33.33.3 activate
neighbor 47.47.47.1 activate
max-paths ebgp 8
bgp bestpath as-path multipath-relax
exit-address-family
!
R2#show ip bgp 100.1.1.0
BGP routing table entry for 100.1.1.0/24
Paths: (2 available, best #1, table Default-IP-Routing-Table) Advertised to non peer-group peers:
47.47.47.1
3
33.33.33.3 from 33.33.33.3 (33.33.33.3)
Origin IGP, metric 0, localpref 100, valid, external, multipath- candidate, installed, best
Last update: Tue Feb 23 03:13:14 2016
1
47.47.47.1 from 47.47.47.1 (62.57.1.1)
Origin IGP, metric 0, localpref 100, valid, external, multipath-
candidate, installed
Last update: Tue Feb 23 03:13:15 2016
R2#show ip bgp summary
BGP router identifier 192.168.52.3, local AS number 2 BGP table version is 2
2 BGP AS-PATH entries
0 BGP community entries
8 Configured ebgp ECMP multipath: Currently set at 8
1 Configured ibgp ECMP multipath: Currently set at 1
1 Configured eibgp ECMP multipath: Currently set at 1
Neighbor V AS MsgRcv MsgSen TblVer InQ OutQ Up/ Down State/PfxRcd
33.33.33.3
00:01:10 1
47.47.47.1
00:06:33 1
Total number of neighbors 2
Total number of Established sessions 2
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.1.1.0/24 47.47.47.1 0 100 0 1 i
* 33.33.33.3 0 100 0 3 i
Total number of prefixes 1
BGP FIB Install (Selective Route Download)
The BGP—Selective Route Download feature allows a network administrator to selectively download some or none of the BGP routes into the Routing Information Base (RIB). The primary application for this feature is to suppress the unnecessary downloading of certain BGP routes to the RIB or Forwarding Information Base (FIB) on a dedicated route reflector, which propagates BGP updates without carrying transit traffic. The feature thereby helps to maximize resources available and to improve routing scalability and convergence on the dedicated route reflector.
With RFC 4456, the concept of route reflection was defined; this would allow configuring designated one or more BGP routers in iBGP network as route reflectors. BGP relaxes the re-advertising restriction on these route reflectors, allowing them to accept and propagate IBGP routes to their clients.
The role of a dedicated route reflector (RR) is to propagate BGP updates without participating in the actual forwarding of transit traffic. That means the RR does not need to have all BGP routes downloaded into its RIB or FIB. It is beneficial for the RR to preserve its resources by not processing and storing those routes.
By default, BGP routes are downloaded to the RIB. To save resources on a dedicated route reflector, such downloading can be reduced or prevented by configuring a table map. A table map is so named because it controls what is put into the BGP routing table.
By reducing the route installation in the dedicated route reflectors, we can maximize availability of resources and improve routing scalability and convergence.
A new command ‘table map’ is being introduced to achieve this. A table map controls what is put into the BGP routing table. When configured it would reduce or prevent downloading routes to RIB.
Table map command references ‘route map’ rules available in BGP to control the routes going into the BGP routing table.
Table-map command can be used in two ways:
• When a simple table-map command is given (without filter option), the route map referenced in the table-map command shall be used to set certain properties (such as the traffic index) of the routes for installation into the RIB. The route is always downloaded, regardless of whether it is permitted or denied by the route map.
• When the option ‘filter’ is given in the table map command, the route map referenced is used to control whether a BGP route is to be downloaded to the IP RIB (hence the filter). A BGP route is not downloaded to the RIB if it is denied by the route map.
Topology
Below topology explains about BGP FIB Install functionality
BFP FIB Install Topology
Configuration
R1
#configure terminal | Enter the Configure mode. |
(config)#interface xe3/1 | Enter interface mode. |
(config-if)#ip address 20.1.1.1/24 | Configure IP address for interface |
(config-if)#exit | Exit interface mode |
(config)# router bgp 100 | Assign the ASN value (100) to the BGP router. |
(config-router)#neighbor 20.1.1.2 remote-as 100 | Configure neighbor in IBGP |
(config-router)#address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)#redistribute static | Redistribute static routes to advertise to its neighbor |
(config-router-af)#neighbor 20.1.1.2 activate | Activate the neighbor |
(config-router-af)#exit-address-family | Exit address-family mode |
(config-router)#exit | Exit Router mode and enter Configure mode |
(config)#ip route 1.1.1.0/24 xe3/1 | Configure static route. |
(config)#ip route 2.2.2.0/24 xe3/1 | Configure static route. |
(config)#ip route 3.3.3.0/24 xe3/1 | Configure static route. |
(config)#ip route 4.4.4.0/24 xe3/1 | Configure static route. |
(config)#ip route 5.5.5.0/24 xe3/1 | Configure static route. |
(config)#ip route 6.6.6.0/24 xe3/1 | Configure static route. |
R2
#configure terminal | Enter the Configure mode. |
(config)#interface xe3/1 | Configure IP address for interface |
(config-if)#ip address 20.1.1.2/24 | Configure IP address for interface |
(config-if)#exit | Exit from interface mode and enter into Configure mode |
(config)#router bgp 100 | Assign the ASN value (100) to the BGP router. |
(config-router)#neighbor 20.1.1.1 remote-as 100 | Configure neighbor iBGP. |
(config-router)#address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)#redistribute static | Redistribute the static routes. |
(config-router-af)#neighbor 20.1.1.1 activate | Activate the neighbor |
(config-router-af)#exit-address-family | Exit address-family mode |
(config-router)#exit | Exit the BGP Router mode and return to the Configure mode. |
(config)#ip access-list 1 | Login to Configure access-list parameters |
(config-ip-acl)#permit ipip 2.2.2.0 0.0.0.225 any | Configure access-list by allowing only one route to install in FIB table. |
(config-ip-acl)#exit | Exit assess list mode |
(config)# route-map test permit 1 | Configure route-map to match access-list |
(config-route-map)# match ip address 1 | Match the above configured access-list 1 |
(config-route-map)#exit | Exit from route-map Configure mode and enter into Configure mode |
(config)#router bgp 100 | Enter into BGP router mode |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# table-map test filter | Apply table-map with route-map created and with filter option |
(config-router-af)#end | Exit from router and Configure mode |
Validation
Table-map with Filter Option
Verify BGP neighborship is up between R1 and R2. Before applying table-map in R2, all routes will be installed in FIB table, as in below output.
R1
#show ip bgp summary
BGP router identifier 20.1.1.1, local AS BGP table version is 3
1 BGP AS-PATH entries
0 BGP community entries
number 100
Neighbor V AS MsgRcv MsgSen TblVer InQ OutQ Up/Dow
n State/PfxRcd
20.1.1.2 4 100 5
6 3
0
0
00:01:31
0
Total number of neighbors 1
Total number of Established sessions 1
#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
*> 1.1.1.0/24 0.0.0.0 0 100 32768 ?
*> 2.2.2.0/24 0.0.0.0 0 100 32768 ?
*> 3.3.3.0/24 0.0.0.0 0 100 32768 ?
*> 4.4.4.0/24 0.0.0.0 0 100 32768 ?
*> 5.5.5.0/24 0.0.0.0 0 100 32768 ?
*> 6.6.6.0/24 0.0.0.0 0 100 32768 ?
Total number of prefixes 6 #
#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"
S 1.1.1.0/24 [1/0] is directly connected, eth1, 00:06:54
S 2.2.2.0/24 [1/0] is directly connected, eth1, 00:06:35
S 3.3.3.0/24 [1/0] is directly connected, eth1, 00:06:26
S 4.4.4.0/24 [1/0] is directly connected, eth1, 00:06:17
S 5.5.5.0/24 [1/0] is directly connected, eth1, 00:06:09
S 6.6.6.0/24 [1/0] is directly connected, eth1, 00:06:01
C 20.1.1.0/24 is directly connected, eth1, 00:07:32 C 127.0.0.0/8 is directly connected, lo, 00:08:21
C 192.168.52.0/24 is directly connected, eth0, 00:08:17
Gateway of last resort is not set #
R2
#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
*> 1.1.1.0/24 0.0.0.0 0 100 32768 ?
*> 2.2.2.0/24 0.0.0.0 0 100 32768 ?
*> 3.3.3.0/24 0.0.0.0 0 100 32768 ?
*> 4.4.4.0/24 0.0.0.0 0 100 32768 ?
*> 5.5.5.0/24 0.0.0.0 0 100 32768 ?
*> 6.6.6.0/24 0.0.0.0 0 100 32768 ?
Total number of prefixes 6 #
#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"
B 1.1.1.0/24 [200/0] via 20.1.1.1, eth1, 00:13:44
B 2.2.2.0/24 [200/0] via 20.1.1.1, eth1, 00:13:44
B 3.3.3.0/24 [200/0] via 20.1.1.1, eth1, 00:13:44
B 4.4.4.0/24 [200/0] via 20.1.1.1, eth1, 00:13:44
B 5.5.5.0/24 [200/0] via 20.1.1.1, eth1, 00:13:44
B 6.6.6.0/24 [200/0] via 20.1.1.1, eth1, 00:13:44
C 20.1.1.0/24 is directly connected, eth1, 00:14:12 C 127.0.0.0/8 is directly connected, lo, 00:25:26
C 192.168.52.0/24 is directly connected, eth0, 00:25:23
Gateway of last resort is not set #
Table-map With Filter Option
Now verify after applying table-map with filter option, only one route will be installed in FIB table according to route-map and access-list configured, BGP table remains same, table-map effect will be seen only for FIB table.
After applying table-map, clear BGP with "clear ip bgp table-map."
(config)#router bgp 100
(config-router)#address-family ipv4-unicast (config-router-af)#table-map test filter (config-router-af)#end
#clear ip bgp table-map
#show ip bgp
BGP table version is 2, local router ID is 192.168.52.5
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.0/24 20.1.1.1 0 100 0 ?
*>i 2.2.2.0/24 20.1.1.1 0 100 0 ?
*>i 3.3.3.0/24 20.1.1.1 0 100 0 ?
*>i 4.4.4.0/24 20.1.1.1 0 100 0 ?
*>i 5.5.5.0/24 20.1.1.1 0 100 0 ?
*>i 6.6.6.0/24 20.1.1.1 0 100 0 ?
Total number of prefixes 6 #
#show ip bgp summary
BGP router identifier 192.168.52.5, 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
20.1.1.1 4 100 40 39 2 0 0 00:18:33
6
Total number of neighbors 1
Total number of Established sessions 1 #
#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"
B 2.2.2.0/24 [200/0] via 20.1.1.1, eth1, 00:00:26
C 20.1.1.0/24 is directly connected, eth1, 00:19:01 C 127.0.0.0/8 is directly connected, lo, 00:30:15
C 192.168.52.0/24 is directly connected, eth0, 00:30:12
Gateway of last resort is not set
Table-map Without Filter Option
Remove filter option while applying table-map as below in R2
#configure terminal | Enter the Configure mode. |
(config)#router bgp 100 | Enter into BGP router mode |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# table-map test | Apply table-map with route-map created and with filter option |
(config-router-af)#end | Exit from router and configure mode |
#show running-config bgp
!
router bgp 100 redistribute static
neighbor 20.1.1.1 remote-as 100 table-map test
!
address-family ipv4 unicast
neighbor 20.1.1.1 activate
exit-address-family
!
#clear ip bgp table-map
#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"
B 1.1.1.0/24 [200/0] via 20.1.1.1, eth1, 00:00:04
B 2.2.2.0/24 [200/0] via 20.1.1.1, eth1, 00:00:04
B 3.3.3.0/24 [200/0] via 20.1.1.1, eth1, 00:00:04
B 4.4.4.0/24 [200/0] via 20.1.1.1, eth1, 00:00:04
B 5.5.5.0/24 [200/0] via 20.1.1.1, eth1, 00:00:04
B 6.6.6.0/24 [200/0] via 20.1.1.1, eth1, 00:00:04
C 20.1.1.0/24 is directly connected, eth1, 00:31:16 C 127.0.0.0/8 is directly connected, lo, 00:42:30
C 192.168.52.0/24 is directly connected, eth0, 00:42:27
Gateway of last resort is not set #
Note: Same can be tried with IPV6 VRF–v4 and VRF–v6 address-families and this feature is not supported for VPNV4 address-family
Route Target Constraint
BGP/MPLS IP VPNs use PE routers to Route Target (RT) extended communities and control the distribution of routes into the VRFs. Within a given iBGP mesh, PE routers hold routes marked with RouteTargets pertaining to VRFs that have local CE attachments.
BGP RT Constrained Route Distribution is a feature that can be used by service providers in Multiprotocol Label Switching (MPLS) Layer 3 VPNs to reduce the number of unnecessary routing updates that route reflectors (RRs) send to Provider Edge (PE) routers. The reduction in “routing updates” saves resources by allowing RRs, Autonomous System Boundary Routers (ASBRs), and PEs to carry fewer routes. Route targets are used to constrain routing updates.
With (MPLS)VPNs, the (iBGP) peers or Route Reflectors send all VPN4 and/or VPN6 prefixes to the PE routers. The PE routers drop the VPN4/6 prefixes for which there is no importing VPN route forwarding (VRF).
Topology
The topology below shows Route-target filtering in an L3VPN—with Route Target Constraint (RTC), the RR sends only wanted VPN4/6 prefixes to the PE; wanted” means that the PEs have the VRFs importing the specific prefixes.
Route-target Filter Topology
Configuration
CE1
#configure terminal | Enter configure mode. |
(config)#interface eth1 | Enter interface mode |
(config-if)#ip address 80.1.1.1/24 | Configure IP address for interface |
(config-if)#exit | Exit from interface mode and enter into Configure mode |
(config)#interface eth3 | Enter interface mode |
(config-if)#ip address 90.1.1.1/24 | Configure IP address for interface |
(config-if)#exit | Exit from interface mode and enter into Configure mode |
(config)# router bgp 200 | Assign the ASN value (100) to the BGP router |
(config-router)#neighbor 80.1.1.2 remote-as 100 | Configure neighbor (RR) in IBGP |
(config-router)#neighbor 90.1.1.2 remote-as 100 | Configure neighbor (RR) in IBGP |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)#redistribute static | Redistribute static routes into BGP |
(config-router-af)#neighbor 80.1.1.2 activate | Activate neighbor |
(config-router-af)#neighbor 90.1.1.2 activate | Activate neighbor |
(config-router-af)#exit-address-family | Exit address-family mode |
(config-router)#exit | Exit from router mode and enter configure mode |
(config)#ip route vrf 1 1.1.1.0/24 eth1 | Configure static route with VRF 1 instance |
(config)#ip route vrf 2 3.3.3.0/24 eth3 | Configure static route with VRF 2 instance |
(config)#ip route vrf 2 4.4.4.0/24 eth3 | Configure static route with VRF 2 instance |
CE2
#configure terminal | Enter configure mode. |
(config)#interface eth1 | Enter interface mode |
(config-if)#ip address 101.1.1.1/24 | Configure IP address for interface |
(config-if)#exit | Exit from interface mode and enter into Configure mode |
(config)#interface eth3 | Enter interface mode |
(config-if)#ip address 100.1.1.1/24 | Configure IP address for interface |
(config-if)#exit | Exit from interface mode and enter into Configure mode |
(config)# router bgp 200 | Assign the ASN value (100) to the BGP router |
(config-router)#neighbor 100.1.1.2 remote-as 100 | Configure neighbor (RR) in IBGP |
(config-router)#neighbor 101.1.1.2 remote-as 100 | Configure neighbor (RR) in IBGP |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)#neighbor 100.1.1.2 activate | Activate neighbor |
(config-router-af)#neighbor 101.1.1.2 activate | Activate neighbor |
(config-router-af)#exit-address-family | Exit from address family ipv4 unicast mode |
(config-router)#end | Exit from router and configure mode |
PE1
#configure terminal | Enter configure mode. |
(config)#ip vrf 1 | Create a VRF instance 1 |
(config-vrf)#rd 1:100 | Configure unique RD value for VRF to identify VRF instance |
(config-vrf)#route-target export 1:200 | Configure route-target (rt) value for exporting routes into other VRFs (for other PE’s) |
(config-vrf)#exit | Exit VRF mode and enter Configure mode |
(config)#ip vrf 2 | Create a VRF instance 2 |
(config-vrf)#rd 1:300 | Configure unique RD value for VRF to identify VRF instance |
(config-vrf)#route-target both 1:400 | Configure route-target (rt) value for exporting routes into other VRFs (for other PE’s) |
(config-vrf)#exit | Exit VRF mode and enter Configure mode |
(config)#router ldp | Enable LDP. |
(config-router)#exit | Exit router LDP mode |
(config)#interface lo | Enter loopback interface mode |
(config-if)#ip address 11.11.11.11/32 secondary | Configure IP address for loopback interface |
(config-if)# enable-ldp ipv4 | Enable LDP on loopback interface |
(config-if)#exit | Exit interface mode |
(config)#interface eth1 | Enter interface mode |
(config-if)#ip vrf forwarding 1 | Bind interface to VRF 1 |
(config-if)#ip address 80.1.1.2/24 | Configure IP address for VRF binded interface |
(config-if)#exit | Exit interface mode |
(config)#interface eth2 | Enter interface mode |
(config-if)#ip address 40.1.1.1/24 | Configure an IP address for interface |
(config-if)#label-switching | Enable label-switching on interface |
(config-if)# enable-ldp ipv4 | Enable LDP on connected interface between PE1 and RR |
(config-if)#exit | Exit interface mode |
(config)#interface eth3 | Enter interface mode |
(config-if)#ip vrf forwarding 2 | Bind interface to VRF 1 |
(config-if)#ip address 90.1.1.2/24 | Configure IP address for VRF binded interface |
(config-if)#exit | Exit interface mode |
(config)#router ospf | Enable OSPF process between PE1 and RR |
(config-router)#network 11.11.11.11/32 area 0.0.0.0 (config-router)#network 40.1.1.0/24 area 0.0.0.0 | Advertise loopback network in OSPF area 0 |
(config-router)#exit | Exit router OSPF mode |
(config)# router bgp 100 | Assign the ASN value (100) to the BGP router |
(config-router)#neighbor 22.22.22.22 remote-as 100 | Configure neighbor (RR) in IBGP |
(config-router)#neighbor 22.22.22.22 update-source lo | Enable neighbor with loopback interface. |
(config-router)#address-family vpnv4 unicast | Enter Address-Family-VPNv4 mode. |
(config-router-af)#neighbor 22.22.22.22 activate | Activate RR neighbor |
(config-router-af)#exit-address-family | Exit Address Family mode and return to Router mode. |
(config-router)#address-family rtfilter unicast | Enable RT filter address-family mode |
(config-router-af)#neighbor 22.22.22.22 activate | Activate neighbor |
(config-router-af)#exit-address-family | Exit RTfilter Address Family mode and return to Router mode. |
(config-router)#address-family ipv4 vrf 1 | Enter Address-Family-VRF mode. |
(config-router-af)#neighbor 80.1.1.1 remote-as 200 | Configure CE neighbor in VRF mode |
(config-router-af)#neighbor 80.1.1.1 activate | Activate neighbor in VRF |
(config-router-af)#exit-address-family | Exit Address Family mode and return to Router mode. |
(config-router)#address-family ipv4 vrf 2 | Enter Address-Family-VRF mode. |
(config-router-af)#neighbor 90.1.1.1 remote-as 200 | Configure CE neighbor in VRF mode |
(config-router-af)#neighbor 90.1.1.1 activate | Activate neighbor in VRF |
(config-router-af)#exit-address-family | Exit Address Family mode and return to Router mode. |
(config-router)#end | Exit from router mode and configure mode |
RR
(config)#router ldp | Enable LDP |
(config-router)#exit | Exit router LDP mode |
(config)#interface lo | Enter loopback interface |
(config-if)#ip address 22.22.22.22/32 secondary (config-if)#ip address 44.44.44.44/32 secondary | Configure IP address for loopback interface |
(config-if)# enable-ldp ipv4 | Enable LDP on loopback interface |
(config-if)#exit | Exit interface mode |
(config)#interface eth2 | Enter interface mode |
(config-if)#ip address 40.1.1.2/24 | Configure IP address for interface connecting to PE2 |
(config-if)#label-switching | Enable label-switching on interface |
(config-if)# enable-ldp ipv4 | Enable LDP on connected interface between PE1 and RR |
(config-if)#exit | Exit interface mode |
(config)#interface eth4 | Enter into interface mode |
(config-if)#ip address 50.1.1.1/24 | Configure an IP address for interface connecting to PE1 |
(config-if)#label-switching | Enable label-switching on interface |
(config-if)# enable-ldp ipv4 | Enable LDP on connected interface between PE1 and RR |
(config-if)#exit | Exit interface mode |
(config)#router ospf | Enable OSPF process between PE1 and RR |
(config-router)#network 22.22.22.22/32 area 0.0.0.0 | Advertise loopback network in OSPF area 0 |
(config-router)#network 40.1.1.0/24 area 0 (config-router)#network 44.44.44.44/32 area 0.0.0.0 (config-router)#network 50.1.1.0/24 area 0.0.0.0 | Advertise PE1 to RR connected network in OSPF |
(config-router)#exit | Exit from router OSPF mode |
(config)# router bgp 100 | Assign the ASN value (100) to the BGP router |
(config-router)#neighbor 11.11.11.11 remote-as 100 | Configure neighbor (PE1) in IBGP |
(config-router)#neighbor 11.11.11.11 update-source 22.22.22.22 | Enable neighbor with loopback interface |
(config-router)#neighbor 33.33.33.33 remote-as 100 | Configure neighbor (PE2) in IBGP |
(config-router)#neighbor 33.33.33.33 update-source 44.44.44.44 | Enable neighbor with loopback interface |
(config-router)#address-family vpnv4 unicast | Enter Address-Family-VPNv4 mode. |
(config-router-af)#neighbor 11.11.11.11 activate | Activate PE1 neighbor |
(config-router-af)#neighbor 33.33.33.33 activate | Activate PE2 neighbor |
(config-router-af)#neighbor 11.11.11.11 route-reflector-client | Configure PE1 as Route Reflector client |
(config-router-af)#neighbor 33.33.33.33 route-reflector-client | Configure PE2 as Route Reflector client |
(config-router-af)#exit-address-family | Exit Address Family mode and return to Router mode. |
(config-router)#address-family rtfilter unicast | Enable RT filter address-family mode |
(config-router-af)#neighbor 11.11.11.11 activate | Activate PE1 neighbor in RTfilter family |
(config-router-af)#neighbor 33.33.33.33 activate | Activate PE2 neighbor in RTfilter family |
(config-router-af)#neighbor 33.33.33.33 route-reflector-client | Configure PE2 as Route Reflector client |
(config-router-af)#neighbor 11.11.11.11 route-reflector-client | Configure PE1 as Route Reflector client |
(config-router-af)#exit-address-family | Exit RTfilter Address-Family mode |
(config-router)#end | Exit from Address-Family, Router and Configure mode. |
PE2
#configure terminal | Enter configure mode. |
(config)#ip vrf 3 | Create a VRF instance 3 |
(config-vrf)#rd 1:600 | Configure unique RD value for VRF to identify VRF instance |
(config-vrf)#route-target export 1:200 | Configure route-target (rt) value for exporting routes into other VRFs (for other PE’s) |
(config-vrf)#exit | Exit VRF mode and enter Configure mode |
(config)#ip vrf 4 | Create a VRF instance 4 |
(config-vrf)#rd 1:900 | Configure unique RD value for VRF to identify VRF instance |
(config-vrf)#route-target both 1:400 | Configure route-target (rt) value for exporting routes into other VRFs (for other PE’s) |
(config-vrf)#exit | Exit VRF mode and enter Configure mode |
(config)#router ldp | Enable LDP. |
(config-router)#exit | Exit router LDP mode |
(config)#interface lo | Enter loopback interface mode |
(config-if)#ip address 33.33.33.33/32 secondary | Configure IP address for loopback interface |
(config-if)# enable-ldp ipv4 | Enable LDP on loopback interface |
(config-if)#exit | Exit interface mode |
(config)#interface eth1 | Enter interface mode |
(config-if)#ip vrf forwarding 3 | Bind interface to VRF 3 |
(config-if)#ip address 101.1.1.2/24 | Configure IP address for VRF binded interface |
(config-if)#exit | Exit interface mode |
(config)#interface eth3 | Enter interface mode |
(config-if)#ip vrf forwarding 4 | Bind interface to VRF 3 |
(config-if)#ip address 100.1.1.2/24 | Configure IP address for VRF binded interface |
(config-if)#exit | Exit interface mode |
(config)#interface eth4 | Enter interface mode |
(config-if)#ip address 50.1.1.2/24 | Configure an IP address for interface |
(config-if)#label-switching | Enable label-switching on interface |
(config-if)# enable-ldp ipv4 | Enable LDP on connected interface between PE2 and RR |
(config-if)#exit | Exit interface mode |
(config)#router ospf | Enable OSPF process between PE2 and RR |
(config-router)#network 33.33.33.33/32 area 0.0.0.0 | Advertise loopback network in OSPF area 0 |
(config-router)#network 50.1.1.0/24 area 0 | Advertise PE2 to RR connected network in OSPF |
(config-router)#exit | Exit router OSPF mode |
(config)# router bgp 100 | Assign the ASN value (100) to the BGP router |
(config-router)#neighbor 44.44.44.44 remote-as 100 | Configure neighbor (RR) in IBGP |
(config-router)#neighbor 44.44.44.44 update-source 33.33.33.33 | Enable neighbor with loopback interface. |
(config-router)#address-family vpnv4 unicast | Enter Address-Family-VPNv4 mode. |
(config-router-af)#neighbor 44.44.44.44 activate | Activate RR neighbor |
(config-router-af)#exit-address-family | Exit Address Family mode and return to Router mode. |
(config-router)#address-family rtfilter unicast | Enable RT filter address-family mode |
(config-router-af)#neighbor 44.44.44.44 activate | Activate neighbor |
(config-router-af)#exit-address-family | Exit RTfilter Address Family mode and return to Router mode. |
(config-router)#address-family ipv4 vrf 3 | Enter Address-Family-VRF mode. |
(config-router-af)#neighbor 101.1.1.1 remote-as 200 | Configure CE neighbor in VRF mode |
(config-router-af)#neighbor 101.1.1.1 activate | Activate neighbor in VRF |
(config-router-af)#exit-address-family | Exit Address Family mode and return to Router mode. |
(config-router)#address-family ipv4 vrf 4 | Enter Address-Family-VRF mode. |
(config-router-af)#neighbor 100.1.1.1 remote-as 200 | Configure CE neighbor in VRF mode |
(config-router-af)#neighbor 100.1.1.1 activate | Activate neighbor in VRF |
(config-router-af)#exit-address-family | Exit Address Family mode and return to Router mode. |
(config-router-af)#end | Exit router and configure mode |
Validation
Through RTfilter address-family RT values will be exchanged between RR and PE’s. Neighbors are activated under this address-family and configured clients as well in this. RR will learn routes from PE’s and send to other PE’s if it has any peer requesting for that particular routes based on their RT import values
Below outputs shows the routes sent and learned in PE’s and installed in VRF’s and display’s RT filter values exchanged between them.
CE1
CE1#show ip bgp
BGP table version is 6, local router ID is 192.160.50.5
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/24 0.0.0.0 0 100 32768 ?
*> 3.3.3.0/24 0.0.0.0 0 100 32768 ?
*> 4.4.4.0/24 0.0.0.0 0 100 32768 ?
Total number of prefixes 3
PE1
PE1#sh 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: 1:100 (Default for VRF 1)
*> 1.1.1.0/24 80.1.1.1 0 100 0 200 ?
*> 3.3.3.0/24 80.1.1.1 0 100 0 200 ?
*> 4.4.4.0/24 80.1.1.1 0 100 0 200 ?
Announced routes count = 3
Accepted routes count = 0
Route Distinguisher: 1:300 (Default for VRF 2)
*> 1.1.1.0/24 90.1.1.1 0 100 0 200 ?
*> 3.3.3.0/24 90.1.1.1 0 100 0 200 ?
*> 4.4.4.0/24 90.1.1.1 0 100 0 200 ?
Announced routes count = 3
Accepted routes count = 0
PE1#
PE1#show ip bgp rtfilter all
RTFilter's Received
*******************
peer-ip 22.22.22.22
100:2:1:400
RTFilter's Sent
*******************
peer-ip 22.22.22.22
100:2:1:400
PE1#
RR
RR#sh 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: 1:300
*>i 1.1.1.0/24 11.11.11.11 0 100 0 200 ?
*>i 3.3.3.0/24 11.11.11.11 0 100 0 200 ?
*>i 4.4.4.0/24 11.11.11.11 0 100 0 200 ?
Announced routes count = 0
Accepted routes count = 3
RR#
RR#show ip bgp rtfilter all
RTFilter's Received
*******************
peer-ip 11.11.11.11
100:2:1:400
peer-ip 33.33.33.33
100:2:1:400
RTFilter's Sent
*******************
peer-ip 11.11.11.11
100:2:1:400
peer-ip 33.33.33.33
100:2:1:400
PE2
PE2#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: 1:300
*>i 1.1.1.0/24 11.11.11.11 0 100 0 200 ?
*>i 3.3.3.0/24 11.11.11.11 0 100 0 200 ?
*>i 4.4.4.0/24 11.11.11.11 0 100 0 200 ?
Announced routes count = 0
Accepted routes count = 3
Route Distinguisher: 1:900 (Default for VRF 4)
*>i 1.1.1.0/24 11.11.11.11 0 100 0 200 ?
*>i 3.3.3.0/24 11.11.11.11 0 100 0 200 ?
*>i 4.4.4.0/24 11.11.11.11 0 100 0 200 ?
Announced routes count = 0
Accepted routes count = 3
PE2#
PE2#show ip bgp rtfilter all
RTFilter's Received
*******************
peer-ip 44.44.44.44
100:2:1:400
RTFilter's Sent
*******************
peer-ip 44.44.44.44
100:2:1:400
PE2#
BGP Best Path Selection Process
BGP assigns the first valid path as the current best path. BGP then compares the best path with the next path in the list, until BGP reaches the end of the list of valid paths. Below steps provides the rules that are used to determine the best path:
1. Prefer the path with the highest WEIGHT.
2. Prefer the path with the highest LOCAL_PREF.
3. Prefer the path that was locally originated via a network or aggregate BGP subcommand or through redistribution from an IGP.
4. Prefer the path with the shortest AS_PATH.
Note: Beware of these items:
• This step is skipped if user has configured the bgp bestpath as-path ignore command.
• If bgp bestpath compare-confed-aspath is configured then Prefer the path with the shortest AS_CONFED path.
5. Prefer the path with the lowest ORIGIN type.
Note: Beware of below listed items:
• IGP is lower than Exterior Gateway Protocol (EGP), and EGP is lower than INCOMPLETE.
6. Prefer the path with the lowest multi-exit discriminator (MED).
Note: Beware of these items:
• By default, MED is compared in these cases:
• MEDs are compared only if the first AS in the AS_SEQUENCE is the same for multiple paths
• If both the paths are internal as routes
• If paths have confederation as-path then MEDs are compared only if the first AS in the BGP_AS_CONFED_SEQUENCE is the same for multiple paths
• To override all above checks, user can configure bgp always-compare-med command
7. Prefer eBGP over iBGP paths.
Note: Beware of below listed item:
• EBGP is preferred over IGBP or EBGP is preferred over CONFED.
8. Path learned from LU Address-family is preferred over IPv4 Unicast Address-family.
Note: Beware of these items:
• This is Exception Rule for IPv4 Labeled-Unicast Address-family.
• This rule applicable only for IPv4 Labeled-Unicast/Unicast routes over default VRF.
9. Prefer the path with the lowest IGP metric to the BGP next hop.
10. Determine if multiple paths require installation in the routing table for BGP Multipath and mark the ECMP candidate.
11. When both paths are external, prefer the path that was received first (the oldest one). This step minimizes route-flap, since a newer path won't displace an older one, even if it was the preferred route based on the additional decision criteria below. This has to be enabled by BGP command bestpath tie-break-on-age
Note: Beware of these items:
• Skip this step if any of these items are true:
• If bgp bestpath compare-routerid is configured in addition to bestpath tie-break-on-age, then this step will be skipped.
• If the router ID is same for multiple paths, because the routes were received from the same router, then this step will be skipped.
12. Router ID and Originator Id:
• If bgp bestpath compare-routerid is configured, then prefer the route that comes from the BGP router with the lowest Router ID.
• If bgp bestpath dont-compare-originator-id is not configured, prefer the route that comes from the BGP router with the lowest Router ID.
Note: Beware of the below listed item:
• If a path contains Route Reflector (RR) attributes, the Originator ID is substituted for the Router ID in the path selection process.
• If bgp bestpath dont-compare-originator-id is configured, prefer the route that comes from the BGP router with the lowest router ID. In this case, Originator ID is not compared even if the RR attribute is present.
13. If the originator or Router ID is the same for multiple paths, prefer the path with the minimum cluster list length.
Prefer the path that comes from the lowest neighbor address.
BGP Dampening
BGP supports route dampening for IPv4 and IPv6 prefixes. Route dampening minimizes the instability caused by route flapping. A penalty is added for every flap in a flapping route. As soon as the total penalty reaches the suppress limit, the advertisement of the route is suppressed. This penalty is decayed according to the configured half time value. Once the penalty is lower than the reuse limit, the route advertisement is unsuppressed. The dampening information is purged from the router once the penalty becomes less than half of the reuse limit.
Topology
In this example, a successful TCP connection is being established between the routers.
BGP dampening
IPv4 Configuration
R1
#configure terminal | Enter configure mode |
(config)#interface lo | Enter loopback interface mode |
(config-if)#ip address 1.1.1.1/32 secondary | Configure the secondary loopback address |
(config-if)#exit | Exit interface mode |
(config)#interface eth2 | Enter interface mode |
(config-if)#ip address 10.1.1.1/24 | Configure the IP address of the interface |
(config-if)#exit | Exit interface mode |
(config)#interface eth1 | Enter interface mode |
(config-if)#ip address 101.1.0.1/24 | Configure the IP address of the interface |
(config-if)#exit | Exit interface mode |
(config)#router bgp 100 | Configure BGP with the AS number 100 |
(config-router)#neighbor 10.1.1.2 remote-as 200 | Define the BGP neighbor, and establish a TCP session. 10.1.1.2 is the IP address of one of the neighbors (R2), and 200 is the neighbor's AS number. |
(config-router)#neighbor 100.1.0.2 remote-as 300 | Define the BGP neighbor, and establish a TCP session. 100.1.0.2 is the IP address of one of the neighbors on interface eth1, and 300 is the neighbor's AS number. |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)#redistribute connected | Enable redistribute connected |
(config-router-af)#neighbor 10.1.1.2 activate | Activate the neighbor |
(config-router-af)#neighbor 100.1.0.2 activate | Activate the neighbor |
(config-router-af)#exit-address-family | Exit address-family mode |
R2
#configure terminal | Enter configure mode |
(config)#interface lo | Enter loopback interface mode |
(config-if)# ip address 2.2.2.2/32 secondary | Configure the secondary loopback address |
(config-if)#exit | Exit interface mode |
(config)#interface eth1 | Enter interface mode |
(config-if)#ip address 10.1.1.2/24 | Configure the IP address of the interface |
(config-if)#exit | Exit interface mode |
(config)#interface eth2 | Enter interface mode |
(config-if)#ip address 101.1.0.1/24 | Configure the IP address of the interface |
(config-if)#exit | Exit interface mode |
(config)#router bgp 200 | Configure BGP with the AS number 100 |
(config-router)#neighbor 10.1.1.1 remote-as 100 | Define the BGP neighbor, and establish a TCP session. 10.1.1.1 is the IP address of one of the neighbors (R1), and 100 is the neighbor's AS number. |
(config-router)#neighbor 101.1.0.2 remote-as 400 | Define the BGP neighbor, and establish a TCP session.101.1.0.2 is the IP address of one of the neighbors on eth2 interface, and 400 is the neighbor's AS number. |
(config-router)#neighbor 100.1.0.2 remote-as 300 | Define the BGP neighbor, and establish a TCP session. 100.1.0.2 is the IP address of one of the neighbors of router R1 on eth1 interface, and 300 is the neighbor's AS number. |
(config-router)#neighbor 100.1.0.2 ebgp-multihop 2 | Increase BGP neighbors with ebgp-multihop value |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)#neighbor 10.1.1.1 activate | Activate BGP neighbor |
(config-router-af)#neighbor 101.1.0.2 activate | Activate BGP neighbor |
(config-router-af)#redistribute connected | Enable redistribute connected |
(config-router-af)#bgp dampening | Enable BGP dampening with default values: • Reachability half-life is 15 minutes • Reuse limit is 750: • Suppress limit is 2000 • Max-suppress value is 60 minutes • Un-reachability half-life is 15 minutes |
Validation
R2
Verify the BGP dampening parameters.
#show ip bgp dampening parameters
dampening 15 750 2000 60 15 Dampening Control Block(s):
Reachability Half-Life time : 15 min Reuse penalty : 750
Suppress penalty : 2000
Max suppress time : 60 min Un-reachability Half-Life time : 15 min Max penalty (ceil) : 11999
Min penalty (floor) : 375
Verify BGP dampened paths for flapping networks.
#show ip bgp dampening dampened-paths
BGP table version is 21, local router ID is 4.4.4.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 From Reuse Path
d 200.1.0.0 10.1.1.1 00:29:00 100 300 i
d 200.2.0.0 10.1.1.1 00:28:20 100 300 i
d 200.3.0.0 10.1.1.1 00:28:20 100 300 i
d 200.4.0.0 10.1.1.1 00:28:20 100 300 i
d 200.5.0.0 10.1.1.1 00:28:20 100 300 i
d 200.6.0.0 10.1.1.1 00:28:20 100 300 i
d 200.7.0.0 10.1.1.1 00:28:20 100 300 i
d 200.8.0.0 10.1.1.1 00:28:20 100 300 i
d 200.9.0.0 10.1.1.1 00:28:20 100 300 i
d 200.10.0.0 10.1.1.1 00:28:20 100 300 i
Verify BGP dampening flap statistics for flapping networks.
#show ip bgp dampening flap-statistics
BGP table version is 21, local router ID is 4.4.4.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 From Flaps Duration Reuse Path
d 200.1.0.0 10.1.1.1 8 00:18:37 00:29:10 100 300 i
d 200.2.0.0 10.1.1.1 7 00:14:22 00:29:00 100 300 i
d 200.3.0.0 10.1.1.1 7 00:14:22 00:29:00 100 300 i
d 200.4.0.0 10.1.1.1 7 00:14:22 00:29:00 100 300 i
d 200.5.0.0 10.1.1.1 7 00:14:22 00:29:00 100 300 i
d 200.6.0.0 10.1.1.1 7 00:14:22 00:29:00 100 300 i
d 200.7.0.0 10.1.1.1 7 00:14:22 00:29:00 100 300 i
d 200.8.0.0 10.1.1.1 7 00:14:22 00:29:00 100 300 i
d 200.9.0.0 10.1.1.1 7 00:14:22 00:29:00 100 300 i
d 200.10.0.0 10.1.1.1 7 00:14:22 00:29:00 100 300 i
IPv6 Configuration
R1
#configure terminal | Enter configure mode |
(config)#interface eth1 | Enter interface mode |
(config-if)#ipv6 address 2000:0:0:1::1/64 | Configure the IPv6 address of the interface |
(config-if)#exit | Exit interface mode |
(config)#interface eth2 | Enter interface mode |
(config-if)#ip address 2000:0:2:1::1/64 | Configure the IPv6 address of the interface |
(config-if)#exit | Exit interface mode |
(config)#router bgp 100 | Configure BGP with the AS number 100 |
(config-router)#neighbor 2000:0:0:1::2 remote-as 300 | Define the BGP neighbor, and establish a TCP session. 2000:0:0:1::2 is the IP address of one of the neighbors on interface eth1, and 300 is the neighbor's AS number. |
(config-router)#neighbor 2000:0:2:1::2 remote-as 200 | Define the BGP neighbor, and establish a TCP session. 2000:0:2:1::2 is the IP address of one of the neighbors (R2), and 200 is the neighbor's AS number. |
(config-router)#address-family ipv6 unicast | Enter IPv6 address family |
(config-router)#redistribute connected | Enable redistribute connected |
(config-router-af)neighbor 2000:0:0:1::2 activate | Activate BGP neighbor |
(config-router-af)neighbor 2000:0:2:1::2 activate | Activate BGP neighbor |
R2
#configure terminal | Enter configure mode |
(config)#interface eth1 | Enter interface mode |
(config-if)#ip address 2000:0:2:1::2/64 | Configure the IPv6 address of the interface |
(config-if)#exit | Exit interface mode |
(config)#interface eth2 | Enter interface mode |
(config-if)#ip address 2000:0:1:1::1/64 | Configure the IPv6 address of the interface |
(config-if)#exit | Exit interface mode |
(config)#router bgp 200 | Configure BGP with the AS number 200 |
(config-router)#address-family ipv6 unicast | Enter IPv6 address family |
(config-router-af)#redistribute connected | Enable redistribute connected |
(config-router-af)#exit-address-family | Exit address-family mode. |
(config-router)#neighbor 2000:0:1:1::2 remote-as 400 | Define the BGP neighbor, and establish a TCP session. 2000:0:1:1::2 is the IP address of one of the neighbors on interface eth2, and 400 is the neighbor's AS number. |
(config-router)#neighbor 2000:0:2:1::1 remote-as 100 | Define the BGP neighbor, and establish a TCP session. 2000:0:2:1::1 is the IP address of one of the neighbors (R1), and 100 is the neighbor's AS number. |
(config-router)#address-family ipv6 unicast | Enter IPv6 address-family |
(config-router-af)#bgp dampening | Enable BGP dampening with default values: • Reachability half-life is 15 minutes • Reuse limit is 750 • Suppress limit is 2000 • Max-suppress value is 60 minutes • Un-reachability half-life is 15 minutes |
(config-router-af)#neighbor 2000:0:1:1::2 activate | Activate BGP neighbor |
(config-router-af)#neighbor 2000:0:2:1::1 activate | Activate BGP neighbor |
Validation
R2
Verify the IPv6 BGP dampening parameters.
#sh bgp dampening parameters
dampening 15 750 2000 60 15
Dampening Control Block(s):
Reachability Half-Life time : 15 min
Reuse penalty : 750
Suppress penalty : 2000
Max suppress time : 60 min
Un-reachability Half-Life time : 15 min
Max penalty (ceil) : 11999
Min penalty (floor) : 375
Verify IPv6 BGP dampened paths for flapping networks.
#sh bgp dampening dampened-paths
BGP table version is 7, local router ID is 4.4.4.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 From Reuse Path
*d 3000:0:1:1::/64 2000:0:2:1::1(fe80::ba6a:97ff:fed6:23d4)
00:18:30 100 300 i
*d 3000:0:2:1::/64 2000:0:2:1::1(fe80::ba6a:97ff:fed6:23d4)
00:18:30 100 300 i
*d 3000:0:3:1::/64 2000:0:2:1::1(fe80::ba6a:97ff:fed6:23d4)
00:18:30 100 300 i
*d 3000:0:4:1::/64 2000:0:2:1::1(fe80::ba6a:97ff:fed6:23d4)
00:18:30 100 300 i
*d 3000:0:5:1::/64 2000:0:2:1::1(fe80::ba6a:97ff:fed6:23d4)
00:18:30 100 300 i
*d 3000:0:6:1::/64 2000:0:2:1::1(fe80::ba6a:97ff:fed6:23d4)
00:18:30 100 300 i
*d 3000:0:7:1::/64 2000:0:2:1::1(fe80::ba6a:97ff:fed6:23d4)
00:18:30 100 300 i
*d 3000:0:8:1::/64 2000:0:2:1::1(fe80::ba6a:97ff:fed6:23d4)
00:18:30 100 300 i
*d 3000:0:9:1::/64 2000:0:2:1::1(fe80::ba6a:97ff:fed6:23d4)
00:18:30 100 300 i
*d 3000:0:a:1::/64 2000:0:2:1::1(fe80::ba6a:97ff:fed6:23d4)
00:18:30 100 300 i
Verify IPv6 BGP dampening flap statistics for flapping networks.
#sh bgp dampening flap-statistics
BGP table version is 7, local router ID is 4.4.4.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 From Flaps Duration Reuse Path
*d 3000:0:1:1::/64 2000:0:2:1::1(fe80::ba6a:97ff:fed6:23d4)
4 00:05:19 00:18:30 100 300 i
*d 3000:0:2:1::/64 2000:0:2:1::1(fe80::ba6a:97ff:fed6:23d4)
4 00:05:19 00:18:30 100 300 i
*d 3000:0:3:1::/64 2000:0:2:1::1(fe80::ba6a:97ff:fed6:23d4)
4 00:05:19 00:18:30 100 300 i
*d 3000:0:4:1::/64 2000:0:2:1::1(fe80::ba6a:97ff:fed6:23d4)
4 00:05:19 00:18:30 100 300 i
*d 3000:0:5:1::/64 2000:0:2:1::1(fe80::ba6a:97ff:fed6:23d4)
4 00:05:19 00:18:30 100 300 i
*d 3000:0:6:1::/64 2000:0:2:1::1(fe80::ba6a:97ff:fed6:23d4)
4 00:05:19 00:18:30 100 300 i
*d 3000:0:7:1::/64 2000:0:2:1::1(fe80::ba6a:97ff:fed6:23d4)
4 00:05:19 00:18:30 100 300 i
*d 3000:0:8:1::/64 2000:0:2:1::1(fe80::ba6a:97ff:fed6:23d4)
4 00:05:19 00:18:30 100 300 i
*d 3000:0:9:1::/64 2000:0:2:1::1(fe80::ba6a:97ff:fed6:23d4)
4 00:05:19 00:18:30 100 300 i
*d 3000:0:a:1::/64 2000:0:2:1::1(fe80::ba6a:97ff:fed6:23d4)
4 00:05:19 00:18:30 100 300 i
BGP Authentication
BGP authentication allows users to receive selected routing information, enhancing security of their network traffic. When BGP authentication is enabled on a router, the router verifies routing packets it receives by exchanging a password that is configured on both the sending and receiving routers.
In this example, both R1 and R2 have ABC as the password. Configure the same password on all routers that are to communicate using BGP in a network.
Topology
BGP Authentication
Configuration
R1
#configure terminal | Enter configure mode |
(config)#interface xe0 | Enter interface mode |
(config-if)#ip address 10.10.10.10/24 | Assign ip address |
(config-if)#exit | Exit interface mode |
(config)#router bgp 200 | Enter BGP router mode |
(config-router)#neighbor 10.10.10.11 remote-as 300 | Configure neighborship |
(config-router)#neighbor 10.10.10.11 authentication-key 0 ABC | Configure authentication for BGP neighbors |
(config-router)#address-family ipv4 unicast | Enter ipv4 address family |
(config-router-af)#neighbor 10.10.10.11 activate | Activate neighborship |
(config-router-af)#exit-address-family | Exit address family |
(config-router)#end | End config mode |
R2
#configure terminal | Enter configure mode |
(config)#interface ce2/1 | Enter interface mode |
(config-if)#ip address 10.10.10.11/24 | Assign ip address |
(config-if)#exit | Exit interface mode |
(config)#router bgp 200 | Enter BGP router mode |
(config-router)#neighbor 10.10.10.10 remote-as 200 | Configure neighborship |
(config-router)#neighbor 10.10.10.10 authentication-key 0 ABC | Configure authentication for BGP neighbors |
(config-router)#address-family ipv4 unicast | Enter ipv4 address family |
(config-router-af)#neighbor 10.10.10.10 activate | Activate neighborship |
(config-router-af)#exit-address-family | Exit address family |
(config-router)#end | End config mode |
Validation
R1
#show running-config bgp
!
router bgp 200
neighbor 10.10.10.11 remote-as 300
neighbor 10.10.10.11 authentication-key 0x624ac41428f81e33
!
address-family ipv4 unicast
neighbor 10.10.10.11 activate
exit-address-family
!
#show ip bgp neighbors
BGP neighbor is 10.10.10.11, remote AS 300, local AS 200, external link
BGP version 4, local router ID 22.22.22.22, remote router ID 2.2.2.2
BGP state = Established, up for 00:09:14
Last read 00:00:19, 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 23 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.10.10.10, Local port: 179
Foreign host: 10.10.10.11, Foreign port: 37590
Nexthop: 10.10.10.10
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
R2
#show running-config bgp
!
router bgp 300
neighbor 10.10.10.10 remote-as 200
neighbor 10.10.10.10 authentication-key 0x624ac41428f81e33
!
address-family ipv4 unicast
neighbor 10.10.10.10 activate
exit-address-family
!
#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 2.2.2.2, remote router ID 22.22.22.22
BGP state = Established, up for 00:13:57
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 33 messages, 0 notifications, 0 in queue
Sent 34 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: 37590
Foreign host: 10.10.10.10, Foreign port: 179
Nexthop: 10.10.10.11
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
BGP Unnumbered
This chapter contains configurations for BGP unnumbered interface which provides BGP peering with minimal configuration.
Overview
BGP protocol is used to exchange IP prefixes between AS. For BGP neighbor ship to be established, IPv4 address configuration on peer is pre-requisite. In a large network, this can consume a lot of your address space, requiring a separate IP address for each peer-facing interface apart from administrator effort in configuration. When a BGP peer advertises an IPv4 prefix, it must include an IPv4 next hop address, which is usually the address of the advertising router; for this each BGP peer should have an IPv4 address. This feature is to enable BGP peering with minimal configuration, less IPv4 address-space.
For DC use-case, where hundreds of switches can be connected in CLOS topology, configuring each neighbor is both time consuming and (IPv4) address hungry.
To minimize this, BGP unnumbered can, avoid the need for an IP address on each BGP interface and by removing the need to configure the IP address and ASN of each neighbor. This feature uses link local ipv6 address of interface as per RFC-5549.
Topology
BGP-Unnumbered
Configuration
Spine 1
configure terminal | Enter configure mode |
(config)#interface lo | Enter interface mode for loopback interface |
(config-if)#ip add 1.1.1.1/32 secondary | Assign secondary interface to loopback |
(config-if)#exit | Exit interface mode |
(config)#interface xe12 | Enter interface mode |
(config-if)# ipv6 nd ra-interval 4 | Assign the IPv6 Router Advertisements interval |
(config-if)#exit | Exit interface mode |
(config)#interface xe10 | Enter interface mode |
(config-if)# ip address 10.10.10.2/31 | Assign IP address to the interface in /31 subnet |
(config-if)#exit | Exit interface mode |
(config)#router bgp 100 | Enter bgp router mode |
(config-router)#bgp router-id 1.1.1.1 | Assign router id for BGP |
(config-router)#bgp unnumbered-mode | Enter bgp unnumbered mode |
(config-router-unnum)#neighbor xe12 remote-as internal | Configure iBGP neighborship |
(config-router-unnum)#neighbor xe10 remote-as internal | Configure iBGP neighborship |
(config-router-unnum)# exit-unnumbered-mode | Exit unnumbered mode |
(config-router)#address-family ipv4 unicast | Enter address family mode for IPv4 unicast |
(config-router-af)# bgp v4-unnumbered-mode | Enter unnumbered mode under ipv4 unicast af |
(config-router-v4-unnum)# neighbor xe10 activate | Activate the neighbor |
(config-router-v4-unnum)# neighbor xe12 activate | Activate the neighbor |
(config-router-v4-unnum)# exit-v4-unnumbered-mode | Exit unnumbered mode under ipv4 unicast af |
(config-router-af)# exit-address-family | Exit address family mode for IPv4 unicast |
(config-router)#end | End Config mode |
Spine 2
configure terminal | Enter configure mode |
(config)#interface lo | Enter interface mode for loopback interface |
(config-if)# ip address 2.2.2.2/32 secondary | Assign secondary interface to loopback |
(config-if)#exit | Exit interface mode |
(config)# interface ce6/1 | Enter interface mode |
(config-if)# ipv6 nd ra-interval 4 | Assign the IPv6 Router Advertisements interval |
(config-if)#exit | Exit interface mode |
(config)# interface ce3/1 | Enter interface mode |
(config-if)# ip address 20.20.20.2/31 | Assign IP address to the interface in /31 subnet |
(config-if)#exit | Exit interface mode |
(config)#router bgp 100 | Enter bgp router mode |
(config-router)#bgp router-id 2.2.2.2 | Assign router id for BGP |
(config-router)#bgp unnumbered-mode | Enter bgp unnumbered mode |
(config-router-unnum)#neighbor ce3/1 remote-as internal | Configure iBGP neighborship |
(config-router-unnum)#neighbor ce6/1 remote-as internal | Configure iBGP neighborship |
(config-router-unnum)# exit-unnumbered-mode | Exit unnumbered mode |
(config-router)#address-family ipv4 unicast | Enter address family mode for IPv4 unicast |
(config-router-af)# bgp v4-unnumbered-mode | Enter unnumbered mode under ipv4 unicast af |
(config-router-v4-unnum)# neighbor ce3/1 activate | Activate the neighbor |
(config-router-v4-unnum)# neighbor ce6/1 activate | Activate the neighbor |
(config-router-v4-unnum)# exit-v4-unnumbered-mode | Exit unnumbered mode under ipv4 unicast af |
(config-router-af)# exit-address-family | Exit address family mode for IPv4 unicast |
(config-router)#end | End Config mode |
Leaf 1
configure terminal | Enter configure mode |
(config)#interface lo | Enter interface mode for loopback interface |
(config-if)# ip address 3.3.3.3/32 secondary | Assign secondary interface to loopback |
(config-if)#exit | Exit interface mode |
(config)#interface xe12 | Enter interface mode |
(config-if)# ipv6 nd ra-interval 4 | Assign the IPv6 Router Advertisements interval |
(config-if)#exit | Exit interface mode |
(config)#interface ge4 | Enter interface mode |
(config-if)# ip address 10.10.10.3/31 | Assign IP address to the interface in /31 subnet |
(config-if)#exit | Exit interface mode |
(config)#router bgp 100 | Enter bgp router mode |
(config-router)#bgp router-id 3.3.3.3 | Assign router id for BGP |
(config-router)#bgp unnumbered-mode | Enter bgp unnumbered mode |
(config-router-unnum)#neighbor xe12 remote-as internal | Configure iBGP neighborship |
(config-router-unnum)#neighbor ge4 remote-as internal | Configure iBGP neighborship |
(config-router-unnum)# exit-unnumbered-mode | Exit unnumbered mode |
(config-router)#address-family ipv4 unicast | Enter address family mode for IPv4 unicast |
(config-router-af)# bgp v4-unnumbered-mode | Enter unnumbered mode under ipv4 unicast af |
(config-router-v4-unnum)# neighbor ge4 activate | Activate the neighbor |
(config-router-v4-unnum)# neighbor xe12 activate | Activate the neighbor |
(config-router-v4-unnum)# exit-v4-unnumbered-mode | Exit unnumbered mode under ipv4 unicast af |
(config-router-af)# exit-address-family | Exit address family mode for IPv4 unicast |
(config-router)#end | End Config mode |
Leaf 2
configure terminal | Enter configure mode |
(config)#interface lo | Enter interface mode for loopback interface |
(config-if)#ip address 4.4.4.4/32 secondary | Assign secondary interface to loopback |
(config-if)#exit | Exit interface mode |
(config)#interface xe4 | Enter interface mode |
(config-if)# ipv6 nd ra-interval 4 | Assign the IPv6 Router Advertisements interval |
(config-if)#exit | Exit interface mode |
(config)#interface ge7 | Enter interface mode |
(config-if)# ip address 10.10.10.2/31 | Assign IP address to the interface in /31 subnet |
(config-if)#exit | Exit interface mode |
(config)#router bgp 100 | Enter bgp router mode |
(config-router)#bgp router-id 4.4.4.4 | Assign router id for BGP |
(config-router)#bgp unnumbered-mode | Enter bgp unnumbered mode |
(config-router-unnum)#neighbor xe4 remote-as internal | Configure iBGP neighborship |
(config-router-unnum)#neighbor ge7 remote-as internal | Configure iBGP neighborship |
(config-router-unnum)# exit-unnumbered-mode | Exit unnumbered mode |
(config-router)#address-family ipv4 unicast | Enter address family mode for IPv4 unicast |
(config-router-af)# bgp v4-unnumbered-mode | Enter unnumbered mode under ipv4 unicast af |
(config-router-v4-unnum)# neighbor ge7 activate | Activate the neighbor |
(config-router-v4-unnum)# neighbor xe4 activate | Activate the neighbor |
(config-router-v4-unnum)# exit-v4-unnumbered-mode | Exit unnumbered mode under ipv4 unicast af |
(config-router-af)# exit-address-family | Exit address family mode for IPv4 unicast |
(config-router)#end | End Config mode |
Validation
Spine 1:
Spine1#show ip bgp neighbors
BGP neighbor is 10.10.10.3, remote AS 100, local AS 100, internal link
BGP version 4, local router ID 1.1.1.1, remote router ID 4.4.4.4
BGP state = Established, up for 00:22:12
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 54 messages, 0 notifications, 0 in queue
Sent 54 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: 10.10.10.2, Local port: 179
Foreign host: 10.10.10.3, Foreign port: 49242
Nexthop: 10.10.10.2
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
BGP neighbor is fe80::eac5:7aff:fefe:97e0, remote AS 100, local AS 100, internal link
BGP version 4, local router ID 1.1.1.1, remote router ID 3.3.3.3
BGP state = Established, up for 00:29:54
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 IPv4 Unicast: advertised and received
Received 71 messages, 0 notifications, 0 in queue
Sent 74 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: fe80::eac5:7aff:fe8b:a82a, Local port: 179
Foreign host: fe80::eac5:7aff:fefe:97e0, Foreign port: 37116
Nexthop: 1.1.1.1
Nexthop global: fe80::eac5:7aff:fe8b:a82a
Nexthop local: fe80::eac5:7aff:fe8b:a82a
BGP connection: shared network
Spine 2:
Spine2#show ip bgp neighbors
BGP neighbor is 20.20.20.3, remote AS 100, local AS 100, internal link
BGP version 4, local router ID 2.2.2.2, remote router ID 3.3.3.3
BGP state = Established, up for 00:21:15
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 IPv4 Unicast: advertised and received
Received 52 messages, 0 notifications, 0 in queue
Sent 51 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: 20.20.20.2, Local port: 59380
Foreign host: 20.20.20.3, Foreign port: 179
Nexthop: 20.20.20.2
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
BGP neighbor is fe80::36ef:b6ff:fe31:dd3f, remote AS 100, local AS 100, internal link
BGP version 4, local router ID 2.2.2.2, remote router ID 4.4.4.4
BGP state = Established, up for 00:29:31
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 70 messages, 0 notifications, 0 in queue
Sent 72 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: fe80::ce37:abff:fe3f:9f63, Local port: 179
Foreign host: fe80::36ef:b6ff:fe31:dd3f, Foreign port: 33368
Nexthop: 2.2.2.2
Nexthop global: fe80::ce37:abff:fe3f:9f63
Nexthop local: fe80::ce37:abff:fe3f:9f63
BGP connection: shared network
Leaf 1
Leaf1#show ip bgp neighbors
BGP neighbor is 20.20.20.2, remote AS 100, local AS 100, internal link
BGP version 4, local router ID 3.3.3.3, remote router ID 2.2.2.2
BGP state = Established, up for 00:21:32
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 52 messages, 0 notifications, 0 in queue
Sent 54 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: 20.20.20.3, Local port: 179
Foreign host: 20.20.20.2, Foreign port: 59380
Nexthop: 20.20.20.3
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
BGP neighbor is fe80::eac5:7aff:fe8b:a82a, remote AS 100, local AS 100, internal
link
BGP version 4, local router ID 3.3.3.3, remote router ID 1.1.1.1
BGP state = Established, up for 00:30:46
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 74 messages, 0 notifications, 0 in queue
Sent 73 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: fe80::eac5:7aff:fefe:97e0, Local port: 37116
Foreign host: fe80::eac5:7aff:fe8b:a82a, Foreign port: 179
Nexthop: 3.3.3.3
Nexthop global: fe80::eac5:7aff:fefe:97e0
Nexthop local: fe80::eac5:7aff:fefe:97e0
BGP connection: shared network
Leaf 2
Leaf2#show ip bgp neighbors
BGP neighbor is 10.10.10.2, remote AS 100, local AS 100, internal link
BGP version 4, local router ID 4.4.4.4, remote router ID 1.1.1.1
BGP state = Established, up for 00:23:24
Last read 00:00:09, 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 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: 10.10.10.3, Local port: 49242
Foreign host: 10.10.10.2, Foreign port: 179
Nexthop: 10.10.10.3
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
BGP neighbor is fe80::ce37:abff:fe3f:9f63, remote AS 100, local AS 100, internal
link
BGP version 4, local router ID 4.4.4.4, remote router ID 2.2.2.2
BGP state = Established, up for 00:30:09
Last read 00:00:08, 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 72 messages, 0 notifications, 0 in queue
Sent 72 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: fe80::36ef:b6ff:fe31:dd3f, Local port: 33368
Foreign host: fe80::ce37:abff:fe3f:9f63, Foreign port: 179
Nexthop: 4.4.4.4
Nexthop global: fe80::36ef:b6ff:fe31:dd3f
Nexthop local: fe80::36ef:b6ff:fe31:dd3f
BGP connection: shared network
BGP Blackhole Community Attribute
A blackhole route is used to forward unwanted or undesirable traffic into a black hole. In other words, a special logical interface called a null interface, is used to create the black hole. Static routes are created for destinations that are not desirable, and the static route configuration points to the null interface. Any traffic that has a destination address that has a best match of the black hole static route automatically will be dropped.
Note: 65535:666 is reserved for Blackhole community.
Topology
BGP Blackhole Community Attribute topology
Configuration
R1
#configure terminal | Enter Configure mode. |
(config)#interface xe5 | Enter Interface mode |
(config-if)# ip address 5.5.5.1/24 | Assign IP address to interface |
(config-if)#exit | Exit interface mode |
(config)#interface xe20 | Enter Interface mode |
(config-if)# ip address 20.1.1.1/24 | Assign IP address to interface |
(config-if)#exit | Exit interface mode |
(config)# router bgp 100 | Enter Router BGP mode |
(config-router)# neighbor 5.5.5.2 remote-as 200 | Define BGP neighbors. 5.5.5.2 is the IP address of the neighbor (R2) and 200 is the neighbors AS number |
(config-router)# address-family ipv4 unicast | Enter into BGP address family IPv4 |
(config-router-af)#neighbor 5.5.5.2 activate | Activate the neighbor |
(config-router-af)#network 20.1.1.0/24 | Advertise networks with prefix |
(config-router-af)# commit | Commit the configurations |
(config-router-af)# end | Return to privilege mode |
R2
#configure terminal | Enter Configure mode. |
(config)#interface xe5 | Enter Interface mode |
(config-if)# ip address 5.5.5.2/24 | Assign IP address to interface |
(config-if)#exit | Exit interface mode |
(config)#interface xe1 | Enter Interface mode |
(config-if)# ip address 1.1.1.2/24 | Assign IP address to interface |
(config-if)#exit | Exit interface mode |
(config)# router bgp 200 | Enter Router BGP mode |
(config-router)# neighbor 5.5.5.1 remote-as 100 | Define BGP neighbors. 5.5.5.1 is the IP address of the neighbor (R1) and 100 is the neighbors AS number |
(config-router)# neighbor 1.1.1.1 remote-as 300 | Define BGP neighbors. 1.1.1.1 is the IP address of the neighbor (R3) and 100 is the neighbors AS number |
(config-router)# address-family ipv4 unicast | Enter into BGP address family IPv4 |
(config-router-af)#neighbor 5.5.5.1 activate | Activate the neighbor |
(config-router-af)#neighbor 1.1.1.1 activate | Activate the neighbor |
(config-router-af)# commit | Commit the configurations |
(config-router-af)# end | Return to privilege mode |
R3
#configure terminal | Enter Configure mode. |
(config)#interface xe1 | Enter Interface mode |
(config-if)# ip address 1.1.1.1/24 | Assign IP address to interface |
(config-if)#exit | Exit interface mode |
(config)#interface xe18 | Enter Interface mode |
(config-if)# ip address 18.1.1.1/24 | Assign IP address to interface |
(config-if)#exit | Exit interface mode |
(config)# router bgp 300 | Enter Router BGP mode |
(config-router)# neighbor 1.1.1.2 remote-as 200 | Define BGP neighbors. 1.1.1.2 is the IP address of the neighbor (R2) and 200 is the neighbors AS number |
(config-router)# address-family ipv4 unicast | Enter into BGP address family IPv4 |
(config-router-af)#neighbor 1.1.1.2 activate | Activate the neighbor |
(config-router-af)#network 18.1.1.0/24 | Advertise networks with prefix |
(config-router-af)# commit | Commit the configurations |
(config-router-af)# end | Return to privilege mode |
Black Hole configuration on R3
#configure terminal | Enter Configure mode. |
(config)#route-map D permit 10 | Enter Route-map mode to set the match operation |
(config-route-map)#set community no-export 65535:666 additive | Configure Reserved Black hole community in Route-map mode |
(config-route-map)#commit | Commit the configuration |
(config-route-map)#exit | Return to configuration mode |
(config)#router bgp 300 | Enter Router BGP mode |
(config-router)#address-family ipv4 unicast | Enter into BGP address family IPv4 |
(config-router-af)#neighbor 1.1.1.2 route-map D out | Apply Route-map for the neighbor 1.1.1.2 in out direction |
(config-router-af)#commit | Commit the configurations |
(config-router-af)#end | Return to privilege mode |
#clear ip bgp * soft out | Soft reset after applying Route-map |
Validation
R2
# show ip bgp community
BGP table version is 4, local router ID is 5.5.5.2
Status codes: s suppressed, d damped, h history, a add-path, * valid, > best, i - internal,
l - labeled, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 18.1.1.0/24 1.1.1.1 0 100 0 300 i
Total number of prefixes 1
#show ip bgp 18.1.1.0/24
BGP routing table entry for 18.1.1.0/24
Paths: (1 available, best #1, table Default-IP-Routing-Table, not advertised to EBGP peer)
Not advertised to any peer
AS path:300
Nexthop:1.1.1.1 from 1.1.1.1 (Remote Id:1.1.1.1)
Origin IGP, metric 0, localpref 100 valid, external, best, source safi: 1
Community: 65535:666 no-export
Not advertised to any peer
Last update: Tue Apr 16 21:48:01 2019
#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, xe1, 00:10:22
C 5.5.5.0/24 is directly connected, xe5, 00:10:49
B 18.1.1.0/24 [20/0] is a summary, Null, 00:02:00
B 20.1.1.0/24 [20/0] via 5.5.5.1, xe5, 00:05:46
C 127.0.0.0/8 is directly connected, lo, 00:35:31
Gateway of last resort is not set
R1
#sh 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 5.5.5.0/24 is directly connected, xe5, 00:15:41
C 20.1.1.0/24 is directly connected, xe20, 00:14:06
C 127.0.0.0/8 is directly connected, lo, 00:37:28
Gateway of last resort is not set
BGP Additional Path
The Border Gateway Protocol (BGP) ADDPATH allows the advertisement of multiple paths through the same peer
session for a given prefix without the new paths implicitly replacing any previous paths. This behavior promotes path
diversity and reduces the severity of a network failure, thereby improving the control plane convergence in case of
network failures.
For more information, refer to the
BGP Additional Path, refer to
OcNOS Key Feature Release 6.4.1.