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
Figure 1-9: IPv4 IBGP Peering
R1
#configure terminal | Enter configure mode. |
(config)#interface lo | Enter interface mode for loopback. |
(config-if)#ip address 33.33.33.33/32 secondary | Assign a secondary IP address. |
(config-if)#exit | Exit interface mode. |
(config)#interface xe1 | Enter interface mode for xe1. |
(config-if)#ip address 11.11.11.1/24 | Assign IP address to the interface. |
(config-if)#exit | Exit interface mode. |
(config)#interface xe2 | Enter interface mode for xe2. |
(config-if)#ip add 11.11.12.1/24 | Assign IP address to the interface. |
(config-if)#exit | Exit interface mode. |
(config)#router bgp 100 | Enter Router BGP mode. |
(config-router)#bgp router-id 1.1.1.1 | Assign a BGP router ID. |
(config-router)#neighbor IPV4_IBGP_PEER peer- group range 11.11.0.0/16 | Create a dynamic peer-group, IPV4_IBGP_PEER with a dynamic range 11.11.0.0/16 |
(config-router)#neighbor IPV4_IBGP_PEER remote-as 100 | Assign a remote AS for the peer-group, IPV4_IBGP_PEER. |
(config-router)#address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor IPV4_IBGP_PEER activate | Activate peer-group in the address family |
(config-router-af)#exit-address-family | Exit from address family mode. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
R2
#configure terminal | Enter configure mode. |
(config)#interface lo | Enter interface mode for loopback. |
(config-if)#ip address 22.22.22.22/32 secondary | Assign a secondary IP address. |
(config-if)#exit | Exit interface mode. |
(config)#interface xe1 | Enter interface mode for xe1. |
(config-if)#ip address 11.11.11.2/24 | Assign IP address to the interface. |
(config-if)#exit | Exit interface mode. |
(config)#interface xe2 | Enter interface mode for xe2. |
(config-if)#ip add 11.11.12.2/24 | Assign IP address to the interface. |
(config-if)#exit | Exit interface mode. |
(config)#router bgp 100 | Enter Router BGP mode. |
(config-router)#bgp router-id 2.2.2.2 | Assign a BGP router ID. |
(config-router)#neighbor 11.11.11.1 remote-as 100 | Create a static BGP neighbor 11.11.11.1 in remote AS 100. |
(config-router)#neighbor 11.11.12.1 remote-as 100 | Create a static BGP neighbor 11.11.12.1 in remote AS 100. |
(config-router)#address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 11.11.12.1 activate | Activate the neighbor under address family mode |
(config-router-af)# neighbor 11.11.12.1 activate | Activate the neighbor under address family mode |
(config-router-af)# network 22.22.22.22/32 | Advertise the loopback network into BGP. |
(config-router-af)#exit-address-family | Exit address-family mode. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
Validation
R1
#show ip bgp summary
BGP router identifier 1.1.1.1, local AS number 100
BGP table version is 2
1 BGP AS-PATH entries
0 BGP community entries
Neighbor V AS MsgRcv MsgSen TblVer InQ OutQ Up/Down State/PfxRcd
*11.11.11.2 4 100 42 43 2 0 0 00:20:25 1
*11.11.12.2 4 100 42 43 2 0 0 00:20:25 1
* Dynamically created based on a listen range command
BGP dynamic peer-group: IPV4_IBGP_PEER
listen range: 11.11.0.0/16
Total number of dynamically created neighbors/limit: 2/(200)
Total number of dynamically created neighbors: 2
Total number of activated dynamic peer-groups for IPv4 Unicast address-family: 1
Total number of neighbors 2
Total number of Established sessions 2
#show ip bgp neighbors
BGP neighbor is 11.11.11.2, remote AS 100, local AS 100, internal link
Member of peer-group IPV4_IBGP_PEER for session parameters
BGP version 4, local router ID 1.1.1.1, remote router ID 2.2.2.2
BGP state = Established, up for 00:21:56
Last read 00:00:27, hold time is 90, keepalive interval is 30 seconds
Neighbor capabilities:
Route refresh: advertised and received (old and new)
Address family IPv4 Unicast: advertised and received
Received 46 messages, 0 notifications, 0 in queue
Sent 46 messages, 0 notifications, 0 in queue
Route refresh request: received 0, sent 0
Minimum time between advertisement runs is 5 seconds
For address family: IPv4 Unicast
BGP table version 3, neighbor version 3
Index 0, Offset 0, Mask 0x1
IPV4_IBGP_PEER peer-group member
Community attribute sent to this neighbor (both)
1 accepted prefixes
1 announced prefixes
Connections established 1; dropped 0
Local host: 11.11.11.1, Local port: 40361
Foreign host: 11.11.11.2, Foreign port: 179
Nexthop: 11.11.11.1
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
BGP neighbor is 11.11.12.2, remote AS 100, local AS 100, internal link
Member of peer-group IPV4_IBGP_PEER for session parameters
BGP version 4, local router ID 1.1.1.1, remote router ID 2.2.2.2
BGP state = Established, up for 00:21:56
Last read 00:00:27, hold time is 90, keepalive interval is 30 seconds
Neighbor capabilities:
Route refresh: advertised and received (old and new)
Address family IPv4 Unicast: advertised and received
Received 46 messages, 0 notifications, 0 in queue
Sent 46 messages, 0 notifications, 0 in queue
Route refresh request: received 0, sent 0
Minimum time between advertisement runs is 5 seconds
For address family: IPv4 Unicast
BGP table version 3, neighbor version 3
Index 1, Offset 0, Mask 0x2
IPV4_IBGP_PEER peer-group member
Community attribute sent to this neighbor (both)
1 accepted prefixes
1 announced prefixes
Connections established 1; dropped 0
Local host: 11.11.12.1, Local port: 33478
Foreign host: 11.11.12.2, Foreign port: 179
Nexthop: 11.11.12.1
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
#show running-config bgp
router bgp 100
bgp router-id 1.1.1.1 network 33.33.33.33/32
neighbor IPV4_IBGP_PEER peer-group range 11.11.0.0/16 neighbor IPV4_IBGP_PEER remote-as 100
!
address-family ipv4 unicast
neighbor IPV4_IBGP_PEER activate
exit-address-family
#show ip bgp
BGP table version is 2, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
l - labeled, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*>i 22.22.22.22/32 11.11.11.2 0 100 0 i
* i 11.11.12.2 0 100 0 i
*> 33.33.33.33/32 0.0.0.0 0 100 32768 i
Total number of prefixes 2
R2
#show ip bgp summary
BGP router identifier 2.2.2.2, local AS number 100
BGP table version is 3
1 BGP AS-PATH entries
0 BGP community entries
Neighbor V AS MsgRcv MsgSen TblVer InQ OutQ Up/Down State/PfxRcd
11.11.11.1 4 100 55 56 3 0 0 00:26:21 1
11.11.12.1 4 100 55 56 3 0 0 00:26:21 1
Total number of neighbors 2
Total number of Established sessions 2
#show bgp neighbors
BGP neighbor is 11.11.11.1, remote AS 100, local AS 100, internal link
BGP version 4, local router ID 2.2.2.2, remote router ID 1.1.1.1
BGP state = Established, up for 00:26:43
Last read 00:00:14, hold time is 90, keepalive interval is 30 seconds
Neighbor capabilities:
Route refresh: advertised and received (old and new)
Address family IPv4 Unicast: advertised and received
Received 56 messages, 0 notifications, 0 in queue
Sent 57 messages, 0 notifications, 0 in queue
Route refresh request: received 0, sent 0
Minimum time between advertisement runs is 5 seconds
For address family: IPv4 Unicast
BGP table version 3, neighbor version 3
Index 0, Offset 0, Mask 0x1
Community attribute sent to this neighbor (both)
1 accepted prefixes
1 announced prefixes
Connections established 1; dropped 0
Local host: 11.11.11.2, Local port: 179
Foreign host: 11.11.11.1, Foreign port: 40361
Nexthop: 11.11.11.2
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
BGP neighbor is 11.11.12.1, remote AS 100, local AS 100, internal link
BGP version 4, local router ID 2.2.2.2, remote router ID 1.1.1.1
BGP state = Established, up for 00:26:43
Last read 00:00:14, hold time is 90, keepalive interval is 30 seconds
Neighbor capabilities:
Route refresh: advertised and received (old and new)
Address family IPv4 Unicast: advertised and received
Received 56 messages, 0 notifications, 0 in queue
Sent 57 messages, 0 notifications, 0 in queue
Route refresh request: received 0, sent 0
Minimum time between advertisement runs is 5 seconds
For address family: IPv4 Unicast
BGP table version 3, neighbor version 3
Index 1, Offset 0, Mask 0x2
Community attribute sent to this neighbor (both)
1 accepted prefixes
1 announced prefixes
Connections established 1; dropped 0
Local host: 11.11.12.2, Local port: 179
Foreign host: 11.11.12.1, Foreign port: 33478
Nexthop: 11.11.12.2
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
#show ip bgp
BGP table version is 3, local router ID is 2.2.2.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
l - labeled, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 22.22.22.22/32 0.0.0.0 0 100 32768 i
*>i 33.33.33.33/32 11.11.11.1 0 100 0 i
* i 11.11.12.1 0 100 0 i
Total number of prefixes 2
IPv4 IBGP VRF Configuration
Below figure displays the minimum configuration required to enable BGP on an interface with vrf enabled on the device and interface being part of vrf. R1 and R2 are two routers belonging to the same AS, AS100, connecting to network 11.11.11.0/24 and 11.11.12.0/24. First, define the routing process and the AS number to which the routers belong. Then, define BGP neighbors to start exchanging routing updates.
Topology
Figure 1-10: IPv4 VRF IBGP Peering
R1
#Configure terminal | Enter Configuration mode. |
(config)#ip vrf vrfA | Create a VRF, vrfA on the router. |
(config-vrf)#rd 1:1 | Assign a route distinguisher to VRF. |
(config-if)#exit | Exit VRF mode and return to Configure mode. |
(config)#interface xe1 | Enter interface mode for xe1. |
(config-if)# ip vrf forwarding vrfA | Assign IP address to VRF. |
(config-if)#ip address 11.11.11.1/24 | Assign IP address to the interface. |
(config-if)#exit | Exit interface mode. |
(config)#interface xe2 | Enter interface mode for xe2. |
(config-if)# ip vrf forwarding vrfA | Assign IP address to VRF. |
(config-if)#ip add 11.11.12.1/24 | Assign IP address to the interface. |
(config-if)#exit | Exit interface mode. |
(config)#router bgp 100 | Enter Router BGP mode. |
(config-router)#bgp router-id 1.1.1.1 | Assign a BGP router ID. |
(config-router)#address-family ipv4 vrf vrfA | Enter IPv4 VRF Address Family. |
(config-router-af)#neighbor IPV4_IBGP_PEER peer-group range 11.11.0.0/16 | Create a dynamic peer-group, IPV4_IBGP_PEER with a dynamic range 11.11.0.0/16. |
(config-router-af)#neighbor IPV4_IBGP_PEER remote-as 100 | Assign a remote AS for the peer-group, IPV4_IBGP_PEER. |
(config-router-af)# neighbor IPV4_IBGP_PEER activate | Activate peer-group in the address family |
(config-router-af)#network 33.33.33.33/32 | Advertise the loopback network into BGP |
(config-router-af)#exit-address-family | Exit address-family mode. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
R2
#configure terminal | Enter configure mode. |
---|
(config)#ip vrf vrfA | Create a VRF, vrfA on router. |
(config-vrf)#rd 2:1 | Assign a route distinguisher to VRF. |
(config-if)#exit | Exit VRF mode and return to Configure mode. |
(config)#interface xe1 | Enter interface mode for xe1. |
(config-if)# ip vrf forwarding vrfA | Assign IP address to VRF. |
(config-if)#ip address 11.11.11.2/24 | Assign IP address to the interface. |
(config-if)#exit | Exit interface mode. |
(config)#interface xe2 | Enter interface mode for xe2. |
(config-if)# ip vrf forwarding vrfA | Assign IP address to VRF. |
(config-if)#ip add 11.11.12.2/24 | Assign IP address to the interface. |
(config-if)#exit | Exit interface mode. |
(config)#router bgp 100 | Enter Router BGP mode. |
(config-router)#bgp router-id 2.2.2.2 | Assign a BGP router ID. |
(config-router)#address-family ipv4 vrf vrfA | Enter IPv4 VRF Address Family. |
(config-router-af)#neighbor 11.11.11.1 remote-as 100 | Create a static BGP neighbor 11.11.11.1 in remote AS 100. |
(config-router-af)# neighbor 11.11.11.1 activate | Activate neighbor in the address family |
(config-router-af)#neighbor 11.11.12.1 remote-as 100 | Create a static BGP neighbor 11.11.12.1 in remote AS 100 |
(config-router-af)# neighbor 11.11.12.1 activate | Activate neighbor in the address family |
(config-router-af)#network 22.22.22.22/32 | Advertise the loopback network into BGP. |
(config-router-af)#exit-address-family | Exit address-family mode. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
Validation
R1
#show running-config bgp
!
router bgp 100
bgp router-id 1.1.1.1
!
address-family ipv4 vrf vrfA
neighbor IPV4_VRF_IBGP_PEER peer-group range 11.11.0.0/16
neighbor IPV4_VRF_IBGP_PEER remote-as 100
neighbor IPV4_VRF_IBGP_PEER activate
network 33.33.33.33/32
exit-address-family
!
#show ip bgp summary vrf vrfA
BGP router identifier 11.11.11.1, local AS number 100
BGP VRF vrfA Route Distinguisher: 1:1
BGP table version is 1
1 BGP AS-PATH entries
0 BGP community entries
Neighbor V AS MsgRcv MsgSen TblVer InQ OutQ Up/Down State/PfxRcd
*11.11.11.2 4 100 3 3 1 0 0 00:01:00 0
*11.11.12.2 4 100 3 3 1 0 0 00:00:55 0
* Dynamically created based on a listen range command
BGP dynamic peer-group: IPV4_IBGP_PEER
listen range: 11.11.0.0/16
Total number of dynamically created neighbors/limit: 2/(200)
Total number of dynamically created neighbors: 2
Total number of activated dynamic peer-groups for IPv4 Unicast address-family: 1
Total number of neighbors 2
Total number of Established sessions 2
#show bgp neighbors
BGP neighbor is 11.11.11.2, vrf vrfA, remote AS 100, local AS 100, internal link
Member of peer-group IPV4_IBGP_PEER for session parameters
BGP version 4, local router ID 11.11.11.1, remote router ID 11.11.11.2
BGP state = Established, up for 00:07:26
Last read 00:00:26, hold time is 90, keepalive interval is 30 seconds
Neighbor capabilities:
Route refresh: advertised and received (old and new)
Address family IPv4 Unicast: advertised and received
Received 16 messages, 0 notifications, 0 in queue
Sent 16 messages, 0 notifications, 0 in queue
Route refresh request: received 0, sent 0
Minimum time between advertisement runs is 5 seconds
For address family: IPv4 Unicast
BGP table version 1, neighbor version 1
Index 1, Offset 0, Mask 0x2
IPV4_IBGP_PEER peer-group member
Community attribute sent to this neighbor (both)
0 accepted prefixes
0 announced prefixes
Connections established 1; dropped 0
Local host: 11.11.11.1, Local port: 36365
Foreign host: 11.11.11.2, Foreign port: 179
Nexthop: 11.11.11.1
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
BGP neighbor is 11.11.12.2, vrf vrfA, remote AS 100, local AS 100, internal link
Member of peer-group IPV4_IBGP_PEER for session parameters
BGP version 4, local router ID 11.11.11.1, remote router ID 11.11.11.2
BGP state = Established, up for 00:07:21
Last read 00:00:21, hold time is 90, keepalive interval is 30 seconds
Neighbor capabilities:
Route refresh: advertised and received (old and new)
Address family IPv4 Unicast: advertised and received
Received 16 messages, 0 notifications, 0 in queue
Sent 16 messages, 0 notifications, 0 in queue
Route refresh request: received 0, sent 0
Minimum time between advertisement runs is 5 seconds
For address family: IPv4 Unicast
BGP table version 1, neighbor version 1
Index 2, Offset 0, Mask 0x4
IPV4_IBGP_PEER peer-group member
Community attribute sent to this neighbor (both)
0 accepted prefixes
0 announced prefixes
Connections established 1; dropped 0
Local host: 11.11.12.1, Local port: 38144
Foreign host: 11.11.12.2, Foreign port: 179
Nexthop: 11.11.12.1
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
IPv4 EBGP Configuration
Below figure displays the minimum configuration required to enable BGP on an interface. R1, R2 and R3 are three routers belonging to the different AS, AS100 AS200 and AS300, connecting to network 11.11.11.0/24 and 11.11.12.0/24. First, define the routing process and the AS number to which the routers belong. Then, define BGP neighbors to start exchanging routing updates.
Topology
Figure 1-11: IPv4 EBGP Peering
R1
#configure terminal | Enter configure mode. |
(config)#interface lo | Enter interface mode for loopback. |
(config-if)#ip address 33.33.33.33/32 secondary | Assign a secondary IP address. |
(config-if)#exit | Exit interface mode. |
(config)#interface xe1 | Enter interface mode for xe1. |
(config-if)#ip address 11.11.11.1/24 | Assign IP address to the interface. |
(config-if)#exit | Exit interface mode. |
(config)#router bgp 100 | Enter Router BGP mode. |
(config-router)#bgp router-id 1.1.1.1 | Assign a BGP router ID. |
(config-router)#neighbor 11.11.11.2 remote-as 200 | Create a static neighbor 11.11.11.2 with remote AS 200. |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode. |
(config-router-af)# neighbor 11.11.11.2 activate | Activate the neighbor under address family mode |
(config-router-af)#exit-address-family | Exit address-family mode. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
R2
#configure terminal | Enter configure mode. |
---|
(config)#interface lo | Enter interface mode for loopback. |
(config-if)#ip address 22.22.22.22/32 secondary | Assign a secondary IP address. |
(config-if)#exit | Exit interface mode. |
(config)#interface xe1 | Enter interface mode for xe1. |
(config-if)#ip address 11.11.11.2/24 | Assign IP address to the interface. |
(config-if)#exit | Exit interface mode. |
(config)#interface xe2 | Enter interface mode for xe2. |
(config-if)#ip add 11.11.12.2/24 | Assign IP address to the interface. |
(config-if)#exit | Exit interface mode. |
(config)#router bgp 200 | Enter Router BGP mode. |
(config-router)#bgp router-id 2.2.2.2 | Assign a BGP router ID. |
(config-router)#neighbor IPV4_EBGP_PEER peer-group range 11.11.0.0/16 | Create a dynamic peer-group, IPV4_EBGP_PEER. |
(config-router)#neighbor IPV4_EBGP_PEER remote-as 100 | Assign remote AS with the peer-group IPV4_EBGP_PEER. |
(config-router)#neighbor IPV4_EBGP_PEER optional-as 300 | Assign optional AS with the peer-group IPV4_EBGP_PEER |
(config-router)#address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor IPV4_EBGP_PEER activate | Activate the peer-group in address family |
(config-router-af)#network 22.22.22.22/32 | Advertise the loopback network into BGP. |
(config-router-af)#exit-address-family | Exit address-family mode. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
R3
#configure terminal | Enter configure mode. |
(config)#interface lo | Enter interface mode for loopback. |
(config-if)#ip address 44.44.44.44/32 secondary | Assign a secondary IP address. |
(config-if)#exit | Exit interface mode. |
(config)#interface xe2 | Enter interface mode for xe2. |
(config-if)#ip add 11.11.12.3/24 | Assign IP address to the interface. |
(config-if)#exit | Exit interface mode. |
(config)#router bgp 300 | Enter Router BGP mode. |
(config-router)#bgp router-id 3.3.3.3 | Assign a BGP router ID. |
(config-router)#neighbor 11.11.12.2 remote-as 200 | Create a static BGP neighbor 11.11.12.2 with remote AS 200. |
(config-router)#address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 11.11.12.2 activate | Activate the neighbor under address family mode |
(config-router-af)#network 44.44.44.44/32 | Advertise the loopback network into BGP. |
(config-router-af)#exit-address-family | Exit address-family mode. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
Validation
R2
#show ip bgp summary
BGP router identifier 2.2.2.2, local AS number 200
BGP table version is 3
2 BGP AS-PATH entries
0 BGP community entries
Neighbor V AS MsgRcv MsgSen TblVer InQ OutQ Up/Down State/PfxRcd
*11.11.11.1 4 100 29 29 3 0 0 00:13:10 1
*11.11.12.3 4 300 27 27 3 0 0 00:12:20 1
* Dynamically created based on a listen range command
BGP dynamic peer-group: IPV4_EBGP_PEER
listen range: 11.11.0.0/16
Total number of dynamically created neighbors/limit: 2/(200)
Total number of dynamically created neighbors: 2
Total number of activated dynamic peer-groups for IPv4 Unicast address-family: 1
Total number of neighbors 2
Total number of Established sessions 2
#show running-config bgp
!
router bgp 200
bgp router-id 2.2.2.2
neighbor IPV4_EBGP_PEER peer-group range 11.11.0.0/16
neighbor IPV4_EBGP_PEER remote-as 100
neighbor IPV4_EBGP_PEER optional-as 300
!
address-family ipv4 unicast
neighbor IPV4_EBGP_PEER activate
network 22.22.22.22/32
exit-address-family
!
#show bgp neighbors
BGP neighbor is 11.11.11.1, remote AS 100, local AS 200, external link
Member of peer-group IPV4_EBGP_PEER for session parameters
BGP version 4, local router ID 2.2.2.2, remote router ID 1.1.1.1
BGP state = Established, up for 00:17:15
Last read 00:00:15, hold time is 90, keepalive interval is 30 seconds
Neighbor capabilities:
Route refresh: advertised and received (old and new)
Address family IPv4 Unicast: advertised and received
Received 37 messages, 0 notifications, 0 in queue
Sent 38 messages, 0 notifications, 0 in queue
Route refresh request: received 0, sent 0
Minimum time between advertisement runs is 30 seconds
For address family: IPv4 Unicast
BGP table version 3, neighbor version 3
Index 1, Offset 0, Mask 0x2
IPV4_EBGP_PEER peer-group member
Community attribute sent to this neighbor (both)
1 accepted prefixes
2 announced prefixes
Connections established 1; dropped 0
Local host: 11.11.11.2, Local port: 42252
Foreign host: 11.11.11.1, Foreign port: 179
Nexthop: 11.11.11.2
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
BGP neighbor is 11.11.12.3, remote AS 300, local AS 200, external link
Member of peer-group IPV4_EBGP_PEER for session parameters
BGP version 4, local router ID 2.2.2.2, remote router ID 3.3.3.3
BGP state = Established, up for 00:13:17
Last read 00:00:17, hold time is 90, keepalive interval is 30 seconds
Neighbor capabilities:
Route refresh: advertised and received (old and new)
Address family IPv4 Unicast: advertised and received
Received 29 messages, 0 notifications, 0 in queue
Sent 30 messages, 0 notifications, 0 in queue
Route refresh request: received 0, sent 0
Minimum time between advertisement runs is 30 seconds
For address family: IPv4 Unicast
BGP table version 3, neighbor version 3
Index 2, Offset 0, Mask 0x4
IPV4_EBGP_PEER peer-group member
Community attribute sent to this neighbor (both)
1 accepted prefixes
2 announced prefixes
Connections established 1; dropped 0
Local host: 11.11.12.2, Local port: 59839
Foreign host: 11.11.12.3, Foreign port: 179
Nexthop: 11.11.12.2
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
IPv6 IBGP Configuration
Below figure displays the minimum configuration required to enable BGP on an interface. R1 and R2 are two routers belonging to the same AS, AS100, connecting to network 11:11:11::1/64 and 11:11:12::1/64. First, define the routing process and the AS number to which the routers belong. Then, define BGP neighbors to start exchanging routing updates.
Topology
Figure 1-12: IPv6 IBGP Peering
R1
#Configure terminal | Enter configure mode. |
(config)#interface lo | Enter interface mode for loopback. |
(config-if)#ipv6 address 33::1/128 | Assign an IPv6 address. |
(config-if)#exit | Exit interface mode. |
(config)#interface xe1 | Enter interface mode for xe1. |
(config-if)#ipv6 address 11:11:11::1/64 | Assign an IPv6 address to the interface. |
(config-if)#exit | Exit interface mode. |
(config)#interface xe2 | Enter interface mode for xe2. |
(config-if)#ipv6 address 11:11:12::1/64 | Assign an IPv6 address to the interface. |
(config-if)#exit | Exit interface mode. |
(config)#router bgp 100 | Enter Router BGP mode. |
(config-router)#bgp router-id 1.1.1.1 | Assign a BGP router ID. |
(config-router)#neighbor IPV6_IBGP_PEER peer-group range 11:11::/16 | Create a dynamic peer-group, IPV6_IBGP_PEER with a dynamic range 11:11::/16 |
(config-router)#neighbor IPV6_IBGP_PEER remote-as 100 | Configure a remote AS with the peer group, IPV6_IBGP_PEER. |
(config-router)#neighbor IPV6_IBGP_PEER limit 1 | Set peer group neighbors limit to 1. Only one BGP session will be up. |
(config-router)#address-family ipv6 unicast | Enter the IPv6 Unicast Address Family. |
(config-router-af)#neighbor IPV6_IBGP_PEER activate | Activate the peer group, IPV6_IBGP_PEER in the IPv6 address family. |
(config-router-af)#network 33::1/128 | Advertise the loopback network into the BGP IPv6 address family. |
(config-router-af)#exit-address-family | Exit address-family mode. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
R2
#Configure terminal | Enter Configuration mode. |
(config)#interface lo | Enter interface mode for loopback. |
(config-if)#ipv6 address 22::2/128 | Assign an IPv6 address. |
(config-if)#exit | Exit interface mode. |
(config)#interface xe1 | Enter interface mode for xe1. |
(config-if)#ipv6 address 11:11:11::2/64 | Assign an IPv6 address to the interface. |
(config-if)#exit | Exit interface mode. |
(config)#interface xe2 | Enter interface mode for xe2. |
(config-if)#ipv6 address 11:11:12::2/64 | Assign an IPv6 address to the interface. |
(config-if)#exit | Exit interface mode. |
(config)#router bgp 100 | Enter Router BGP mode. |
(config-router)#bgp router-id 2.2.2.2 | Assign a BGP router ID. |
(config-router)#neighbor 11:11:11::1 remote-as 100 | Configure BGP neighbor by specifying the neighbor IP address. |
(config-router)#neighbor 11:11:12::1 remote-as 100 | Configure BGP neighbor by specifying the neighbor IP address. |
(config-router)#address-family ipv4 unicast | Enter the Ipv4 Unicast Address Family. |
(config-router-af)# neighbor 11:11:11::1 activate | Activate the neighbor under address family mode |
(config-router-af)# neighbor 11:11:12::1 activate | Activate the neighbor under address family mode |
(config-router-af)# exit-address-family | Exit address-family mode. |
(config-router)#address-family ipv6 unicast | Enter the IPv6 Unicast Address Family. |
(config-router-af)#network 22::2/128 | Advertise the loopback network into BGP. |
(config-router-af)#neighbor 11:11:12::1 activate | Activate the neighbor in the IPv6 address family. |
(config-router-af)#neighbor 11:11:11::1 activate | Activate the neighbor in the IPv6 address family. |
(config-router-af)#exit-address-family | Exit address-family mode. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
Validation
R1
#show ipv6 bgp summary
BGP router identifier 1.1.1.1, local AS number 100
BGP table version is 2
1 BGP AS-PATH entries
0 BGP community entries
Neighbor V AS MsgRcv MsgSen TblVer InQ OutQ Up/Down State/PfxRcd
*11:11:11::2 4 100 6 6 2 0 0 00:01:41 1
* Dynamically created based on a listen range command
BGP dynamic peer-group: IPV6_IBGP_PEER
listen range: 11::/16
Total number of dynamically created neighbors/limit: 1/(1)
Total number of dynamically created neighbors: 1
Total number of activated dynamic peer-groups for IPv6 Unicast address-family: 1
Total number of neighbors 1
Total number of Established sessions 1
#show ip bgp peer-group IPV6_IBGP_PEER
BGP dynamic peer-group is IPV6_IBGP_PEER, IBGP, remote AS 100
BGP dynamic peer-group IPV6_IBGP_PEER listen range group members:
11::/16
BGP version 4
Minimum time between advertisement runs is 5 seconds
For address family: IPv4 Unicast
Peer-group member:
*11:11:11::2
Index 1, Offset 0, Mask 0x2
0 accepted prefixes, 0 announced prefixes
For address family: IPv6 Unicast
Peer-group member:
*11:11:11::2
Index 0, Offset 0, Mask 0x0
1 accepted prefixes, 1 announced prefixes
#show bgp ipv6
BGP table version is 2, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
l - labeled, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*>i 22::2/128 11:11:11::2(fe80::5054:ff:fe95:85ec)
0 100 0 i
*> 33::1/128 :: 0 100 32768 i
Total number of prefixes 2
#show running-config bgp
!
router bgp 100
bgp router-id 1.1.1.1
neighbor IPV6_IBGP_PEER peer-group range 11::/16
neighbor IPV6_IBGP_PEER remote-as 100
neighbor IPV6_IBGP_PEER limit 1
!
address-family ipv6 unicast
network 33::1/128
neighbor IPV6_IBGP_PEER activate
exit-address-family
#show bgp neighbors
BGP neighbor is 11:11:11::2, remote AS 100, local AS 100, internal link
Member of peer-group IPV6_IBGP_PEER for session parameters
BGP version 4, local router ID 1.1.1.1, remote router ID 2.2.2.2
BGP state = Established, up for 00:04:17
Last read 00:00:18, hold time is 90, keepalive interval is 30 seconds
Neighbor capabilities:
Route refresh: advertised and received (old and new)
Address family IPv4 Unicast: advertised and received
Address family IPv6 Unicast: advertised and received
Received 11 messages, 0 notifications, 0 in queue
Sent 11 messages, 0 notifications, 0 in queue
Route refresh request: received 0, sent 0
Minimum time between advertisement runs is 5 seconds
For address family: IPv4 Unicast
BGP table version 1, neighbor version 1
Index 0, Offset 0, Mask 0x1
IPV6_IBGP_PEER peer-group member
Community attribute sent to this neighbor (both)
0 accepted prefixes
0 announced prefixes
For address family: IPv6 Unicast
BGP table version 2, neighbor version 2
Index 0, Offset 0, Mask 0x0
IPV6_IBGP_PEER peer-group member
Community attribute sent to this neighbor (both)
1 accepted prefixes
1 announced prefixes
Connections established 1; dropped 0
Local host: 11:11:11::1, Local port: 42410
Foreign host: 11:11:11::2, Foreign port: 179
Nexthop: 1.1.1.1
Nexthop global: 11:11:11::1
Nexthop local: fe80::5054:ff:fe51:f74
BGP connection: shared network
IPV6 IBGP VRF Configuration
Below figure displays the minimum configuration required to enable BGP on an interface with VRF enabled on the device and interface being part of VRF. R1 and R2 are two routers belonging to the same AS, AS100, connecting to network 11:11:11::1 and 11:11:12::1. First, define the routing process and the AS number to which the routers belong. Then, define BGP neighbors to start exchanging routing updates.
Topology
Figure 1-13: IPv6 VRF IBGP peering
R1
#Configure terminal | Enter Configuration mode. |
(config)#ip vrf vrfA | Configure a VRF, vrfA. |
(config-vrf)#rd 1:1 | Configure a route distinguisher to VRF. |
(config-vrf)#router-id 7.7.7.7 | Configure a router ID. |
(config-vrf)#exit | Exit from VRF mode and return to Configuration mode. |
(config)#interface xe1 | Enter interface mode for xe1. |
(config-if)# ip vrf forwarding vrfA | Assign IP address to VRF. |
(config-if)#ipv6 address 11:11:11::1/64 | Assign an IPv6 address to the interface. |
(config-if)#exit | Exit interface mode. |
(config)#interface xe2 | Enter interface mode for xe2. |
(config-if)# ip vrf forwarding vrfA | Assign IP address to VRF. |
(config-if)#ipv6 address 11:11:12::1/64 | Assign an IPv6 address to the interface. |
(config-if)#exit | Exit interface mode. |
(config)#router bgp 100 | Enter Router BGP mode. |
(config-router)#address-family ipv6 vrf vrfA | Enter IPv6 VRF Address Family. |
(config-router-af)#neighbor IPV6_VRF_IBGP_PEER peer-group range 11:11::1/16 | Configure a dynamic peer group, IPV6_IBGP_PEER with a dynamic range value. |
(config-router-af)#neighbor IPV6_VRF_IBGP_PEER remote-as 100 | Configure a remote AS with the peer group, IPV6_IBGP_PEER. |
(config-router-af)# neighbor IPV6_VRF_IBGP_PEER activate | Activate neighbor in the address family |
(config-router-af)#exit-address-family | Exit address-family mode. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
R2
#configure terminal | Enter configure mode. |
---|
(config)#ip vrf vrfA | Configure a VRF, vrfA. |
(config-vrf)#rd 2:1 | Configure a route distinguisher to VRF. |
(config-vrf)#router-id 1.1.1.1 | Configure a router ID. |
(config-vrf)#exit | Exit from VRF mode and return to Configuration mode. |
(config)#interface xe1 | Enter interface mode for xe1. |
(config-if)# ip vrf forwarding vrfA | Assign IP address to VRF. |
(config-if)#ipv6 address 11:11:11::2/64 | Assign an IPv6 address to the interface. |
(config-if)#exit | Exit interface mode. |
(config)#interface xe2 | Enter interface mode for xe2. |
(config-if)# ip vrf forwarding vrfA | Assign IP address to vrf. |
(config-if)#ipv6 address 11:11:12::2/64 | Assign an IPv6 address to the interface. |
(config-if)#exit | Exit interface mode. |
(config)#router bgp 100 | Enter Router BGP mode |
(config-router)#address-family ipv6 vrf vrfA | Enter IPv6 VRF Address Family. |
(config-router-af)#neighbor 11:11:12::1 remote-as 100 | Configure BGP neighbor by specifying the neighbor IP address. |
(config-router-af)# neighbor 11:11:12::1 activate | Activate neighbor in the address family |
(config-router-af)#neighbor 11:11:11::1 remote-as 100 | Configure BGP neighbor by specifying the neighbor IP address. |
(config-router-af)# neighbor 11:11:11::1 activate | Activate neighbor in the address family |
(config-router-af)#exit-address-family | Exit address-family mode. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
Validation
R1
#show ipv6 bgp summary vrf vrfA
BGP router identifier 7.7.7.7, local AS number 100
BGP VRF vrfA Route Distinguisher: 1:1
BGP table version is 1
0 BGP AS-PATH entries
0 BGP community entries
Neighbor V AS MsgRcv MsgSen TblVer InQ OutQ Up/Down State/PfxRcd
*11:11:11::2 4 100 6 6 1 0 0 00:00:17 0
*11:11:12::2 4 100 7 10 1 0 0 00:00:15 0
* Dynamically created based on a listen range command
BGP dynamic peer-group: IPV6_VRF_IBGP_PEER
listen range: 11::/16
Total number of dynamically created neighbors/limit: 2/(200)
Total number of dynamically created neighbors: 2
Total number of activated dynamic peer-groups for IPv6 Unicast address-family: 1
Total number of neighbors 2
Total number of Established sessions 2
#show running-config bgp
!
router bgp 100
!
address-family ipv6 vrf vrfA
neighbor IPV6_VRF_IBGP_PEER peer-group range 11::/16
neighbor IPV6_VRF_IBGP_PEER remote-as 100
neighbor IPV6_VRF_IBGP_PEER activate
exit-address-family
!
#show ip bgp peer-group vrf vrfA
BGP dynamic peer-group is IPV6_VRF_IBGP_PEER, IBGP, remote AS 100
BGP dynamic peer-group IPV6_VRF_IBGP_PEER listen range group members:
11::/16
BGP version 4
Minimum time between advertisement runs is 5 seconds
For address family: IPv6 Unicast
Peer-group member:
*11:11:12::2
Index 1, Offset 0, Mask 0x2
0 accepted prefixes, 0 announced prefixes
Peer-group member:
*11:11:11::2
Index 2, Offset 0, Mask 0x4
0 accepted prefixes, 0 announced prefixes
#show running-config bgp
!
router bgp 100
!
address-family ipv6 vrf vrfA
neighbor IPV6_VRF_IBGP_PEER peer-group range 11::/16
neighbor IPV6_VRF_IBGP_PEER remote-as 100
neighbor IPV6_VRF_IBGP_PEER activate
exit-address-family
!
#show bgp ipv6 neighbors
BGP neighbor is 11:11:11::2, vrf vrfA, remote AS 100, local AS 100, internal link
Member of peer-group IPV6_VRF_IBGP_PEER for session parameters
BGP version 4, local router ID 7.7.7.7, remote router ID 1.1.1.1
BGP state = Established, up for 00:02:13
Last read 00:00:14, hold time is 90, keepalive interval is 30 seconds
Neighbor capabilities:
Route refresh: advertised and received (old and new)
Address family IPv6 Unicast: advertised and received
Received 8 messages, 2 notifications, 0 in queue
Sent 10 messages, 0 notifications, 0 in queue
Route refresh request: received 0, sent 0
Minimum time between advertisement runs is 5 seconds
For address family: IPv6 Unicast
BGP table version 1, neighbor version 1
Index 2, Offset 0, Mask 0x4
IPV6_VRF_IBGP_PEER peer-group member
Community attribute sent to this neighbor (both)
0 accepted prefixes
0 announced prefixes
Connections established 1; dropped 0
Local host: 11:11:11::1, Local port: 179
Foreign host: 11:11:11::2, Foreign port: 48206
Nexthop: 7.7.7.7
Nexthop global: 11:11:11::1
Nexthop local: fe80::5054:ff:fe51:f74
BGP connection: shared network
Last Reset: 00:02:18, due to BGP Notification received
Notification Error Message: (OPEN Message Error/Bad BGP Identifier.)
BGP neighbor is 11:11:12::2, vrf vrfA, remote AS 100, local AS 100, internal link
Member of peer-group IPV6_VRF_IBGP_PEER for session parameters
BGP version 4, local router ID 7.7.7.7, remote router ID 1.1.1.1
BGP state = Established, up for 00:02:11
Last read 00:00:12, hold time is 90, keepalive interval is 30 seconds
Neighbor capabilities:
Route refresh: advertised and received (old and new)
Address family IPv6 Unicast: advertised and received
Received 8 messages, 3 notifications, 0 in queue
Sent 13 messages, 1 notifications, 0 in queue
Route refresh request: received 0, sent 0
Minimum time between advertisement runs is 5 seconds
For address family: IPv6 Unicast
BGP table version 1, neighbor version 1
Index 1, Offset 0, Mask 0x2
IPV6_VRF_IBGP_PEER peer-group member
Community attribute sent to this neighbor (both)
0 accepted prefixes
0 announced prefixes
Connections established 1; dropped 0
Local host: 11:11:12::1, Local port: 179
Foreign host: 11:11:12::2, Foreign port: 49010
Nexthop: 7.7.7.7
Nexthop global: 11:11:12::1
Nexthop local: fe80::5054:ff:fe8b:8f5c
BGP connection: shared network
Last Reset: 00:02:16, due to BGP Notification received
Notification Error Message: (OPEN Message Error/Bad BGP Identifier.)
IPv6 EBGP Configuration
Below figure displays the minimum configuration required to enable BGP on an interface. R1, R2 and R3 are three routers belonging to the different AS, AS100 AS200 and AS300, connecting to network 11:11:11::/64 and 11:11:12::/64. First, define the routing process and the AS number to which the routers belong. Then, define BGP neighbors to start exchanging routing updates.
Topology
Figure 1-14: IPv6 EBGP peering
R1
#configure terminal | Enter Configuration mode. |
(config)#interface lo | Enter interface mode for loopback. |
(config-if)#ipv6 address 33::1/128 | Assign an IPv6 address. |
(config-if)#exit | Exit interface mode. |
(config)#interface xe1 | Enter interface mode for xe1. |
(config-if)#ipv6 address 11:11:11::1/64 | Assign an IPv6 address to the interface. |
(config-if)#exit | Exit interface mode. |
(config)#router bgp 100 | Enter Router BGP mode. |
(config-router)#bgp router-id 1.1.1.1 | Assign a BGP router ID. |
(config-router)#neighbor 11:11:11::2 remote-as 200 | Configure BGP neighbor by specifying the neighbor IP address. |
(config-router)#address-family ipv6 unicast | Enter the IPv6 Unicast Address Family. |
(config-router-af)#neighbor 11:11:11::2 activate | Activate the neighbor in the address family. |
(config-router-af)#network 33::1/128 | Advertise the loopback network into BGP. |
(config-router-af)#exit-address-family | Exit address-family mode. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
R2
#configure terminal | Enter Configuration mode. |
(config)#interface lo | Enter interface mode for loopback. |
(config-if)#ipv6 address 22::1/128 | Assign an IPv6 address. |
(config-if)#exit | Exit interface mode. |
(config)#interface xe1 | Enter interface mode for xe1 |
(config-if)#ipv6 address 11:11:11::2/64 | Assign an IPv6 address to the interface. |
(config-if)#exit | Exit interface mode. |
(config)#interface xe2 | Enter interface mode for xe2. |
(config-if)#ipv6 address 11:11:12::2/64 | Assign an IPv6 address to the interface. |
(config-if)#exit | Exit interface mode. |
(config)#router bgp 200 | Enter Router BGP mode. |
(config-router)#bgp router-id 2.2.2.2 | Assign a BGP router ID. |
(config-router)#neighbor IPV6_EBGP_PEER peer-group range 11::1/16 | Configure a dynamic peer group, IPV6_EBGP_PEER. |
(config-router)#neighbor IPV6_EBGP_PEER remote-as 100 | Configure remote AS with peer group, IPV6_EBGP_PEER. |
(config-router)#neighbor IPV6_EBGP_PEER optional-as 300 | Configure optional AS with peer group, IPV6_EBGP_PEER. |
(config-router)#address-family ipv6 unicast | Enter IPv6 Unicast Address Family. |
(config-router-af)#neighbor IPV6_EBGP_PEER activate | Activate peer group in the address family. |
(config-router-af)#network 22::1/128 | Advertise the loopback network into BGP. |
(config-router-af)#exit-address-family | Exit address-family mode. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
R3
#Configure terminal | Enter Configuration mode. |
(config)#interface lo | Enter interface mode for loopback. |
(config-if)#ipv6 address 44::1/128 | Assign an IPv6 address. |
(config-if)#exit | Exit interface mode. |
(config)#interface xe2 | Enter interface mode for xe2 |
(config-if)#ipv6 address 11:11:12::3/64 | Assign an IPv6 address. |
(config-if)#exit | Exit interface mode. |
(config)#router bgp 300 | Enter Router BGP mode. |
(config-router)#bgp router-id 3.3.3.3 | Assign a BGP router ID. |
(config-router)#neighbor 11:11:12::2 remote-as 200 | Configure the BGP neighbor by specifying the neighbor IP address. |
(config-router)#address-family ipv6 unicast | Enter the IPv6 Unicast Address Family. |
(config-router-af)#neighbor 11:11:12::2 activate | Activate the neighbor in address family. |
(config-router-af)#network 44::1/128 | Advertise the loopback network into BGP. |
(config-router-af)#exit-address-family | Exit address-family mode. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
Validation
R2
#show ipv6 bgp sum
BGP router identifier 2.2.2.2, local AS number 200
BGP table version is 5
3 BGP AS-PATH entries
0 BGP community entries
Neighbor V AS MsgRcv MsgSen TblVer InQ OutQ Up/Down State/PfxRcd
*11:11:11::1 4 100 9 11 5 0 0 00:01:28 1
*11:11:12::3 4 300 6 6 5 0 0 00:01:14 1
* Dynamically created based on a listen range command
BGP dynamic peer-group: IPV6_EBGP_PEER
listen range: 11::/16
Total number of dynamically created neighbors/limit: 2/(200)
Total number of dynamically created neighbors: 2
Total number of activated dynamic peer-groups for IPv6 Unicast address-family: 1
Total number of neighbors 2
Total number of Established sessions 2
#show running-config bgp
!
router bgp 200
bgp router-id 2.2.2.2
neighbor IPV6_EBGP_PEER peer-group range 11::/16
neighbor IPV6_EBGP_PEER remote-as 100
neighbor IPV6_EBGP_PEER optional-as 300
!
address-family ipv6 unicast
network 22::1/128
neighbor IPV6_EBGP_PEER activate
exit-address-family
!
#show bgp ipv6 neighbors
BGP neighbor is 11:11:11::1, remote AS 100, local AS 200, external link
Member of peer-group IPV6_EBGP_PEER for session parameters
BGP version 4, local router ID 2.2.2.2, remote router ID 1.1.1.1
BGP state = Established, up for 00:02:15
Last read 00:00:16, hold time is 90, keepalive interval is 30 seconds
Neighbor capabilities:
Route refresh: advertised and received (old and new)
Address family IPv4 Unicast: advertised and received
Address family IPv6 Unicast: advertised and received
Received 11 messages, 0 notifications, 0 in queue
Sent 12 messages, 1 notifications, 0 in queue
Route refresh request: received 0, sent 0
Minimum time between advertisement runs is 30 seconds
For address family: IPv4 Unicast
BGP table version 1, neighbor version 1
Index 0, Offset 0, Mask 0x1
IPV6_EBGP_PEER peer-group member
Community attribute sent to this neighbor (both)
0 accepted prefixes
0 announced prefixes
For address family: IPv6 Unicast
BGP table version 5, neighbor version 5
Index 0, Offset 0, Mask 0x0
IPV6_EBGP_PEER peer-group member
Community attribute sent to this neighbor (both)
1 accepted prefixes
2 announced prefixes
Connections established 2; dropped 1
Local host: 11:11:11::2, Local port: 53043
Foreign host: 11:11:11::1, Foreign port: 179
Nexthop: 2.2.2.2
Nexthop global: 11:11:11::2
Nexthop local: fe80::5054:ff:fe95:85ec
BGP connection: shared network
Last Reset: 00:02:20, due to BGP Notification sent
Notification Error Message: (Cease/Other Configuration Change.)
BGP neighbor is 11:11:12::3, remote AS 300, local AS 200, external link
Member of peer-group IPV6_EBGP_PEER for session parameters
BGP version 4, local router ID 2.2.2.2, remote router ID 3.3.3.3
BGP state = Established, up for 00:02:01
Last read 00:00:02, hold time is 90, keepalive interval is 30 seconds
Neighbor capabilities:
Route refresh: advertised and received (old and new)
Address family IPv4 Unicast: advertised and received
Address family IPv6 Unicast: advertised and received
Received 8 messages, 0 notifications, 0 in queue
Sent 8 messages, 0 notifications, 0 in queue
Route refresh request: received 0, sent 0
Minimum time between advertisement runs is 30 seconds
For address family: IPv4 Unicast
BGP table version 1, neighbor version 1
Index 0, Offset 0, Mask 0x1
IPV6_EBGP_PEER peer-group member
Community attribute sent to this neighbor (both)
0 accepted prefixes
0 announced prefixes
For address family: IPv6 Unicast
BGP table version 5, neighbor version 5
Index 0, Offset 0, Mask 0x0
IPV6_EBGP_PEER peer-group member
Community attribute sent to this neighbor (both)
1 accepted prefixes
2 announced prefixes
Connections established 1; dropped 0
Local host: 11:11:12::2, Local port: 47743
Foreign host: 11:11:12::3, Foreign port: 179
Nexthop: 2.2.2.2
Nexthop global: 11:11:12::2
Nexthop local: fe80::5054:ff:fee5:b088
BGP connection: shared network
VPNV4 Configuration
Below mentioned topology displays bgp vpnv4 configuration on PE nodes, R1 and R3. IBGP peering will be formed on the loopback interface of R1 and R3; also IGP is running between all the routers.
Topology
Figure 1-15: IPv4 IBGP VPNv4 Configuration
R1
#Configure terminal | Enter Configuration mode. |
(config)#ip vrf vrf1 | Create a VRF, vrf1. |
(config-vrf)#rd 100:1 | Configure a route distinguisher value. |
(config-vrf)#route-target export 100:1 | Configure a route target export value to VRF. |
(config-vrf)#route-target import 200:1 | Configure a route target import value to VRF. |
(config-vrf)#exit | Exit from VRF configuration mode. |
(config)#router ldp | Enter Router LDP mode. |
(config-router)#router-id 3.3.3.3 | Configure an LDP router ID. |
(config-router)#exit | Exit from Router LDP mode. |
(config)#interface xe5 | Enter Interface configuration mode. |
(config-if)#ip vrf forwarding vrf1 | Configure the interface to a VRF. |
(config-if)#ip address 1.1.1.1/24 | Assign an IP address to the interface. |
(config-if)#exit | Exit from Interface configuration mode. |
(config-if)#interface xe1 | Enter another interface. |
(config-if)#ip address 11.11.11.1/24 | Assign an IP address to the interface. |
(config-if)#label-switching | Enable label switching on interface. |
(config-if)#enable-ldp ipv4 | Enable IPv4 LDP configuration on interface. |
(config-if)#exit | Exit from Interface configuration mode. |
(config-if)#interface lo | Enter the loopback interface. |
(config-if)#ip address 20.20.20.20/32 secondary | Assign a secondary IP address to the interface. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
(config-if)#exit | Exit from Interface Configuration mode. |
(config)#router ospf 100 | Enter Router OSPF mode. |
(config-router)#network 11.11.11.0/24 area 0 | Configure the interface on which OSPF runs, and associate the area ID. |
(config-router)#network 20.20.20.20/32 area 0 | Configure the interface on which OSPF runs, and associate the area ID. |
(config-router)#exit | Exit from Router OSPF mode. |
(config)#router ospf 200 vrf1 | Create an OSPF process on VRF. |
(config-router)#network 1.1.1.1/24 area 0 | Configure the interface on which OSPF runs, and associate the area ID. |
(config-router)#redistribute bgp | Redistribute BGP into OSPF. |
(config-router)#exit | Exit from Router OSPF mode. |
(config)#router bgp 100 | Create a BGP process. |
(config-router)#neighbor lo_peer peer-group range 30.30.30.30/32 | Configure a dynamic peer group with the range command. |
(config-router)#neighbor lo_peer remote-as 100 | Configure remote AS to the peer group. |
(config-router)#neighbor lo_peer update-source lo | Configure BGP neighbors to update the source routes. |
(config-router)#address-family vpnv4 unicast | Enter the VPNv4 Address Family. |
(config-router-af)#neighbor lo_peer activate | Activate the peer group in VPNv4 address family. |
(config-router-af)#exit-address-family | Exit from VPNv4 address family. |
(config-router)#address-family ipv4 vrf vrf1 | Enter IPv4 VRF address family. |
(config-router-af)#redistribute ospf 200 | Redistribute OSPF into the IPv4 VRF address family. |
(config-router-af)#exit-address-family | Exit address-family mode. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
R2
#Configure terminal | Enter Configuration mode. |
(config)#router ldp | Enter Router LDP mode. |
(config-router)#router-id 4.4.4.4 | Configure an LDP router ID. |
(config-router)#exit | Exit from Router LDP mode. |
(config-if)#interface xe2 | Enter Interface Configuration mode. |
(config-if)#ip address 12.12.12.2/24 | Assign an IP address to the interface. |
(config-if)#label-switching | Enable label switching on the interface. |
(config-if)#enable-ldp ipv4 | Enable IPv4 LDP configuration on the interface. |
(config-if)#exit | Exit from Interface configuration mode. |
(config-if)#interface xe1 | Enter another Interface. |
(config-if)#ip address 11.11.11.2/24 | Assign an IP address to the interface. |
(config-if)#label-switching | Enable label switching on the interface. |
(config-if)#enable-ldp ipv4 | Enable IPv4 LDP configuration on the interface. |
(config-if)#exit | Exit from Interface mode. |
(config)#commit | Commit the candidate configuration to the running configuration. |
(config)#router ospf 100 | Create an OSPF process. |
(config-router)#network 11.11.11.0/24 area 0 | Define the interface on which OSPF runs, and associate the area ID |
(config-router)#network 12.12.12.0/24 area 0 | Define the interface on which OSPF runs, and associate the area ID |
(config-router)#exit | Exit from Router BGP mode. |
(config)#commit | Commit the candidate configuration to the running configuration. |
R3
#Configure terminal | Enter Configuration mode. |
(config)#router ldp | Enter Router LDP mode. |
(config-router)#router-id 5.5.5.5 | Configure an LDP router ID. |
(config-router)#exit | Exit from Router LDP mode. |
(config)#ip vrf vrf2 | Create a VRF, vrf2. |
(config-vrf)#rd 200:1 | Configure a route distinguisher value. |
(config-vrf)#route-target export 200:1 | Configure a route target export value to VRF. |
(config-vrf)#route-target import 100:1 | Configure a route target import value to VRF. |
(config-vrf)#exit | Exit from VRF configuration mode. |
(config)#interface xe1 | Enter Interface configuration mode. |
(config-if)#ip vrf forwarding vrf2 | Configure an interface to a VRF. |
(config-if)#ip address 2.2.2.3/24 | Assign an IP address to the interface. |
(config-if)#exit | Exit from Interface configuration mode. |
(config-if)#interface xe2 | Enter another interface. |
(config-if)#ip address 12.12.12.3/24 | Assign an IP address to the interface. |
(config-if)#label-switching | Enable label switching on interface. |
(config-if)#enable-ldp ipv4 | Enable IPv4 LDP configuration on the interface. |
(config-if)#exit | Exit from Interface configuration mode. |
(config-if)#interface lo | Enter loopback interface. |
(config-if)#ip address 30.30.30.30/32 se | Assign a secondary IP address to the interface. |
(config-if)#exit | Exit from Interface mode. |
(config)#commit | Commit the candidate configuration to the running configuration. |
(config)#router ospf 100 | Enter Router OSPF mode. |
(config-router)#network 12.12.12.0/24 area 0 | Define the interface on which OSPF runs, and associate the area ID |
(config-router)#network 30.30.30.30/32 area 0 | Define the interface on which OSPF runs, and associate the area ID |
(config-router)#exit | Exit from Router OSPF mode. |
(config)#router ospf 200 vrf2 | Create an OSPF process on VRF. |
(config-router)#network 2.2.2.3/24 area 0 | Define the interface on which OSPF runs, and associate the area ID. |
(config-router)#redistribute bgp | Redistribute BGP into OSPF. |
(config-router)#exit | Exit from Router OSPF mode. |
(config)#commit | Commit the candidate configuration to the running configuration. |
(config)#router bgp 100 | Create a BGP process. |
(config-router)#neighbor 20.20.20.20 remote-as 100 | Configure BGP neighbor by specifying a neighbor IP address. |
(config-router)#neighbor 20.20.20.20 update-s lo | Define the BGP neighbors to update the source routes. |
(config-router)#address-family vpnv4 unicast | Enter VPNv4 Address Family. |
(config-router-af)#neighbor 20.20.20.20 activate | Activate the neighbor in VPNv4 address family. |
(config-router-af)#exit-address-family | Exit from VPNv4 address family. |
(config-router)#address-family ipv4 vrf vrf2 | Enter IPv4 VRF address family. |
(config-router-af)#redistribute ospf 200 | Redistribute OSPF into the IPv4 address family. |
(config-router-af)#exit-address-family | Exit address-family mode. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
Validation
R1
#show running-config router bgp
router bgp 100
neighbor lo_peer peer-group range 30.30.30.30/32
neighbor lo_peer remote-as 100
neighbor lo_peer update-source lo
!
address-family vpnv4 unicast
neighbor lo_peer activate
exit-address-family
!
address-family ipv4 vrf vrf1
redistribute ospf 200
exit-address-family
!
#show ip bgp vpnv4 all summary
BGP router identifier 192.168.52.3, local AS number 100
BGP table version is 2
1 BGP AS-PATH entries
0 BGP community entries
Neighbor V AS MsgRcv MsgSen TblVer InQ OutQ Up/Down State/PfxRcd
*30.30.30.30 4 100 4 4 2 0 0 00:00:37 1
* Dynamically created based on a listen range command
BGP dynamic peer-group: lo_peer
listen range: 30.30.30.30/32
Total number of dynamically created neighbors/limit: 1/(200)
Total number of dynamically created neighbors: 1
Total number of activated dynamic peer-groups for VPNv4 Unicast address-family: 1
Total number of neighbors 1
Total number of Established sessions 1
#show ip bgp vpnv4 all
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, l - labeled
S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
Route Distinguisher: 100:1 (Default for VRF vrf1)
*> 1.1.1.0/24 0.0.0.0 1 100 32768 ?
*>i 2.2.2.0/24 30.30.30.30 1 100 0 ?
Announced routes count = 1
Accepted routes count = 1
Route Distinguisher: 200:1
*>i 2.2.2.0/24 30.30.30.30 1 100 0 ?
Announced routes count = 0
Accepted routes count = 1
#show ip bgp vpnv4 all 1.1.1.0
Route Distinguisher: 100:1
Local
20.20.20.20 (metric 12) from 20.20.20.20 (192.178.50.2)
Origin incomplete, metric 1, localpref 100, label 24960, valid, internal, best
Extended Community: RT:100:1 0:0 OSPF-Route-type:0.0.0.0 :3:0
Last update: Tue Apr 23 10:29:10 2019
Route Distinguisher: 200:1 (Default for VRF vrf2)
Local
20.20.20.20 from 20.20.20.20 (192.178.50.2)
Origin incomplete, metric 1, localpref 100, label 24960, valid, internal, best
Extended Community: RT:100:1 0:0 OSPF-Route-type:0.0.0.0 :3:0
Last update: Tue Apr 23 10:29:10 2019
#show ip bgp peer-group
BGP dynamic peer-group is lo_peer, IBGP, remote AS 100
BGP dynamic peer-group lo_peer listen range group members:
30.30.30.30/32
BGP version 4
Minimum time between advertisement runs is 5 seconds
For address family: IPv4 Unicast
Peer-group member:
*30.30.30.30
Index 1, Offset 0, Mask 0x2
0 accepted prefixes, 0 announced prefixes
For address family: VPNv4 Unicast
Peer-group member:
*30.30.30.30
Index 0, Offset 0, Mask 0x0
1 accepted prefixes, 1 announced prefixes
R2
R2#show ip bgp vpnv4 all
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, l - labeled
S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
Route Distinguisher: 100:1 (Default for VRF vrf1)
*> 1.1.1.0/24 0.0.0.0 1 100 32768 ?
*>i 2.2.2.0/24 30.30.30.30 1 100 0 ?
Announced routes count = 1
Accepted routes count = 1
Route Distinguisher: 200:1
*>i 2.2.2.0/24 30.30.30.30 1 100 0 ?
Announced routes count = 0
Accepted routes count = 1
R2#
R3
R3#show ip bgp vpnv4 all 1.1.1.0
Route Distinguisher: 100:1
Local
20.20.20.20 (metric 12) from 20.20.20.20 (192.178.50.2)
Origin incomplete, metric 1, localpref 100, label 24960, valid, internal, best
Extended Community: RT:100:1 0:0 OSPF-Route-type:0.0.0.0 :3:0
Last update: Tue Apr 23 10:29:10 2019
Route Distinguisher: 200:1 (Default for VRF vrf2)
Local
20.20.20.20 from 20.20.20.20 (192.178.50.2)
Origin incomplete, metric 1, localpref 100, label 24960, valid, internal, best
Extended Community: RT:100:1 0:0 OSPF-Route-type:0.0.0.0 :3:0
Last update: Tue Apr 23 10:29:10 2019
R3#