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
Figure 1-24: Extended Communities — 2-Byte ASN
CE1
#configure terminal | Enter configure mode. |
(config)#interface eth1 | Enter interface mode. |
(config-if)#ip address 172.4.5.115/24 | Configure the IP address on this interface |
(config-if)#exit | Exit interface mode. |
(config)#router bgp 100 | Assign the ASN value (100) to the router. The ASN range is <1-65535>. |
(config-router)#neighbor 172.4.5.116 remote-as 200 | Specify the neighbor's IP address (172.4.5.116) and the ASN value of the neighbor (200). |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 172.4.5.116 activate | Activate neighbor under address family mode |
(config-router-af)# exit-address-family | Exit address family mode |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
CE2
#configure terminal | Enter configure mode. |
(config)#interface eth1 | Enter interface mode. |
(config-if)#ip address 172.3.4.114/24 | Configure the IP address on this interface |
(config-if)#exit | Exit interface mode. |
(config)#router bgp 300 | Assign the ASN value (300) to the router. The ASN range is <1-65535>. |
(config-router)#neighbor 172.3.4.117 remote-as 200 | Specify the neighbor's IP address (172.3.4.117) and the ASN value of the neighbor (200). |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)# neighbor 172.3.4.117 activate | Activate neighbor under address family mode |
(config-router-af)# exit-address-family | Exit address family mode |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
PE1
#configure terminal | Enter configure mode. |
---|
(config)#ip vrf VRF1 | Specify the name of the VRF (VRF1) to be created. |
---|
(config-vrf)#rd 100:10 | Assign a route distinguisher (RD) for the VRF, which is a unique value on the router. The RD value can be in ASN:NN or A.B.C.D:NN format. |
---|
(config-vrf)#route-target both 100:10 | Specify the 2-Octet AS specific or IPv4 specific Transitive Route-Target extended community attribute. |
---|
(config-vrf)#exit | Exit VRF mode, and return to Configure mode. |
---|
(config)#interface eth1 | Enter interface mode. |
---|
(config-if)#ip vrf forwarding VRF1 | Bind the interface (eth1) to the VRF (VRF1). |
---|
(config-if)#ip address 172.4.5.116/24 | Configure the IP address on this interface |
---|
(config-if)#exit | Exit interface mode. |
---|
(config)#ip route vrf VRF1 75.1.1.0/24 eth1 | Create a VRF static route. |
---|
(config)#interface eth2 | Enter interface mode. |
---|
(config-if)#ip address 172.6.7.116/24 | Configure the IP address on this interface |
---|
(config-if)#exit | Exit interface mode. |
---|
(config)#router bgp 200 | Assign the ASN value (200) to the router. |
(config-router)#neighbor 172.6.7.117 remote-as 200 | Specify the neighbor’s (PE2) IP address (172.6.7.117) and the ASN value of the neighbor (200). In this case, it is an iBGP connection, so both PE1 and PE2 are in the same AS. |
(config-router)#address-family vpnv4 unicast | Enable the exchange of VPNv4 routing information among ISP PE-routers, and enter Address-Family-VPNv4 mode. |
(config-router-af)#neighbor 172.6.7.117 activate | Activate the neighbor in address-family. |
(config-router-af)#exit | Exit Address-Family-VPNv4 mode. |
(config-router)#address-family ipv4 vrf VRF1 | Enable the exchange of VRF routing information among ISP PE-routers, and enter Address-Family-VRF mode. |
(config-router-af)#neighbor 172.4.5.115 remote-as 100 | Specify the neighbor’s (CE1) IP address and ASN value. |
(config-router-af)#neighbor 172.4.5.115 activate | Activate the neighbor in address-family |
(config-router-af)#neighbor 172.4.5.115 send-community both | Enable extended community attribute for the neighbor. |
(config-router-af)#redistribute static | Configure static redistribution. |
(config-router-af)# exit-address-family | Exit address family mode |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
PE2
#configure terminal | Enter configure mode. |
(config)#ip vrf VRF1 | Specify the name of the VRF (VRF1) tobe created. |
(config-vrf)#rd 100:10 | Assign a route distinguisher (RD) for the VRF. |
(config-vrf)#route-target both 100:10 | Specify the 2-Octet AS specific or IPv4 specific Transitive Route-Target extended community attribute. |
(config-vrf)#exit | Exit VRF mode, and return to Configure mode. |
(config)#interface eth1 | Enter interface mode. |
(config-if)#ip vrf forwarding VRF1 | Bind the interface (eth1) to the VRF (VRF1). |
(config-if)#ip address 172.3.4.117/24 | Configure the IP address on this interface |
(config-if)#exit | Exit interface mode. |
(config)#ip route vrf VRF1 100.1.1.0/24 eth1 | Create a VRF static route. |
(config)#interface eth2 | Enter interface mode. |
(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)# exit-address-family | Exit address family mode |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
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
Figure 1-25: 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 |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
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)# exit-address-family | Exit address family mode |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
PE2
#configure terminal | Enter configure mode. |
(config)#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)#commit | Commit the candidate configuration to the running configuration. |
(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)# exit-address-family | Exit address family mode |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
CE2
#configure terminal | Enter configure mode. |
(config)#interface eth1 | Enter interface mode. |
(config-if)#ip address 172.3.4.114/24 | Configure the IP address on this interface |
(config-if)#exit | Exit interface mode. |
(config)#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 |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
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.)