OcNOS-SP : Layer 3 Guide : Layer 3 Unicast Configuration Guide : BGP4+ : Configuration
Configuration
R1
 
#configure terminal
Enter Configure mode.
(config)# ip vrf VRF1
Create a VRF, vrf1.
(config-vrf)#rd 100:10
Configure a route distinguisher value.
(config-vrf)#route-target both 100:10
Configure a route target both value to VRF.
(config-vrf)#exit
Exit from VRF configuration mode.
(config)#interface eth1
Enter Interface configuration mode.
(config-if)#ip vrf forwarding VRF1
Configure the interface to a VRF.
(config-if)#ip address 30.30.30.30/24
Assign an IP address to the interface.
(config-if)#ipv6 address 2ffe::10/64
Assign an IPV6 address to the interface.
(config-if)#exit
Exit from interface configuration mode.
(config)#ip route vrf VRF1 50.50.50.0/24 eth1
Create a VRF static route.
(config)#interface eth2 Enter
Interface configuration mode.
(config-if)#ipv6 address 3ffe::10/64
Assign an IPV6 address to the interface.
(config-if)#exit
Exit from interface configuration mode.
(config)#router bgp 100 Define the routing process.
The number 100 specifies the AS number of R1.
(config-router)#bgp router-id 1.1.1.1
Configure a fixed Router ID (1.1.1.1) for the BGP4+ routing process.
(config-router)#neighbor 2.2.2.2 remote-as 200
Define BGP neighbors, and establish a TCP session. 2.2.2.2 is the IP address of the neighbor (R1), and 200 is the neighbor’s AS number.
(config-router)#neighbor 3ffe::11 remote-as 200
Define the BGP neighbor (R2), and establish a TCP session by specifying the IPv6 address (3ffe::11)and the AS number(200)of neighbor R2.
(config-router)#address-family vpnv4
unicast
Enter Address Family mode for configuring routing sessions that use IPv6 address prefixes.
(config-router-af)#neighbor 2.2.2.2
activate
Activate the neighbor R2(2.2.2.2), and enable exchange of IP address prefix types with this neighbor.
(config-router-af)#neighbor 3ffe::11 allow-ebgp-vpn
Apply allow-ebgp-vpn to allow an eBGP neighbor to be a VPN peer.
(config-router-af)#neighbor 3ffe::11 activate
Activate the neighbor R2(3ffe::11), and enable exchange of IPv6 address prefix types with this neighbor.
(config-router-af)#neighbor 3ffe::11 capability extended-nexthop-encode
Enable capability to encode IPv6 nexthop in VPNv4 NLRI.
(config-router-af)#exit-address-family
Exit Address Family mode, and return to Router mode.
(config-router)#address-family ipv4 vrf
VRF1
Enter IPv4 VRF address family.
(config-router-af)#redistribute static
Redistribute static into the IPv4 VRF address family.
(config-router-af)#exit-address-family
Exit Address Family mode, and return to Router mode.
(config-router)#exit
Exit Router mode, and return to Configure mode.
(config)#commit
Apply commit.
(config)#exit
Exit the config mode.
R2
 
#configure terminal
Enter Configure mode.
(config)# ip vrf VRF1
Create a VRF, vrf1.
(config-vrf)#rd 100:10
Configure a route distinguisher value.
(config-vrf)#route-target both 100:10
Configure a route target both value to VRF.
(config-vrf)#exit
Exit from VRF configuration mode.
(config)#interface eth1
Enter Interface configuration mode.
(config-if)#ip vrf forwarding VRF1
Configure the interface to a VRF.
(config-if)#ip address 40.40.40.40/24
Assign an IP address to the interface.
(config-if)#ipv6 address 4ffe::10/64
Assign an IPV6 address to the interface.
(config-if)#exit
Exit from interface configuration mode.
(config)#ip route vrf VRF1 66.66.66.0/24 eth1
Create a VRF static route.
(config)#interface eth2
Enter Interface configuration mode.
(config-if)#ipv6 address 3ffe::11/64
Assign an IPV6 address to the interface.
(config-if)#exit
Exit from interface configuration mode.
(config)#router bgp 200 Define the routing process.
The number 200 specifies the AS number of R1.
(config-router)#bgp router-id 2.2.2.2
Configure a fixed Router ID (2.2.2.2) for the BGP4+ routing process.
(config-router)#neighbor 1.1.1.1 remote-as 100
Define BGP neighbors, and establish a TCP session. 1.1.1.1 is the IP address of the neighbor (R1), and 100 is the neighbor’s AS number.
(config-router)#neighbor 3ffe::10 remote-as 100
Define the BGP neighbor (R2), and establish a TCP session by specifying the IPv6 address (3ffe::10)and the AS number(100)of neighbor R2.
(config-router)#address-family vpnv4
unicast
Enter Address Family mode for configuring routing sessions that use IPv6 address prefixes.
(config-router-af)#neighbor 1.1.1.1
activate
Activate the neighbor R2(1.1.1.1), and enable exchange of IP address prefix types with this neighbor.
(config-router-af)#neighbor 3ffe::10 allow- ebgp-vpn
Apply allow-ebgp-vpn to allow an eBGP neighbor to be a VPN peer.
(config-router-af)#neighbor 3ffe::10 activate
Activate the neighbor R2(3ffe::10), and enable exchange of IPv6 address prefix types with this neighbor.
(config-router-af)#neighbor 3ffe::10 capability extended-nexthop-encode
Enable capability to encode IPv6 nexthop in VPNv4 NLRI.
(config-router-af)#exit-address-family
Exit Address Family mode, and return to Router mode.
(config-router)#address-family ipv4 vrf
VRF1
Enter IPv4 VRF address family.
(config-router-af)#redistribute static
Redistribute static into the IPv4 VRF address family.
(config-router-af)#exit-address-family
Exit Address Family mode, and return to Router mode.
(config-router)#exit
Exit Router mode, and return to Configure mode.
(config)#commit
Apply commit.
(config)#exit
Exit the config mode.
Validation
R1
 
#show running-config router bgp
router bgp 100
bgp router-id 1.1.1.1
neighbor 2.2.2.2 remote-as 200
neighbor 3ffe::11 remote-as 200
!
address-family vpnv4 unicast
neighbor 2.2.2.2 activate
neighbor 3ffe::11 allow-ebgp-vpn
neighbor 3ffe::11 activate
neighbor 3ffe::11 capability extended-nexthop-encode
exit-address-family
!
address-family ipv4 vrf vrf1
redistribute static
exit-address-family
#sh ip bgp neighbors
BGP neighbor is 3ffe::11, remote AS 200, local AS 100, external link
BGP version 4, local router ID 1.1.1.1, remote router ID 2.2.2.2
BGP state = Established, up for 00:04:59
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 VPNv4 Unicast: advertised and received
Address family IPv4 Unicast: advertised and received
Received 167 messages, 1 notifications, 0 in queue
Sent 166 messages, 1 notifications, 0 in queue
Route refresh request: received 0, sent 0
Minimum time between advertisement runs is 30 seconds
For address family: VPNv4 Unicast
BGP table version 1, neighbor version 1
Index 3, Offset 0, Mask 0x8
Extended Nexthop Encoding: advertised and received
NEXT_HOP is always this router
Community attribute sent to this neighbor (both)
0 accepted prefixes
0 announced prefixes
Connections established 1; dropped 0
Local host: 3ffe::10, Local port: 60148
Foreign host: 3ffe::11, Foreign port: 179
Nexthop: 2.2.2.2
Nexthop global: 3ffe::10
Nexthop local: fe80::ba6a:97ff:fee0:61be
BGP connection: shared network
Last Reset: 00:05:04, due to Configuration Change (Cease Notification sent)
Notification Error Message: (Cease/Other Configuration Change.)
 
#sh ip bgp vpnv4 all
Status codes: s suppressed, d damped, h history, a add-path, * valid, > best, i
- internal, l - labeled
S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
 
Network Next Hop Metric LocPrf Weight Path
Route Distinguisher: 100:10 (Default for VRF vrf1)
*> 55.55.55.0/24 0.0.0.0 0 100 32768 ?
*> 66.66.66.0/24 0.0.0.0 0 100 0 ?
Announced routes count = 2
Accepted routes count = 0
Route Distinguisher: 100:10
* i 55.55.55.0/24 3ffe::11 0 100 0 ?
* i 66.66.66.0/24 3ffe::11 0 100 0 ?
Announced routes count = 0
Accepted routes count = 2
 
#sh ip bgp vpnv4 all summary
BGP router identifier 2.2.2.2, local AS number 100
BGP table version is 1
1 BGP AS-PATH entries
0 BGP community entries
 
Neighbor V AS MsgRcv MsgSen TblVer InQ OutQ Up/Dow
n State/PfxRcd
2.2.2.2 4 400 0 0 0 0 0 never
Idle
 
3ffe::11 4 400 163 163 1 0 0 00:00:04
2
Total number of neighbors 2
 
Total number of Established sessions 1
R2
 
#show running-config router bgp
router bgp 200
bgp router-id 2.2.2.2
neighbor 1.1.1.1 remote-as 100
neighbor 3ffe::10 remote-as 100
!
address-family vpnv4 unicast
neighbor 1.1.1.1 activate
neighbor 3ffe::10 allow-ebgp-vpn
neighbor 3ffe::10 activate
neighbor 3ffe::10 capability extended-nexthop-encode
exit-address-family
!
address-family ipv4 vrf vrf1
redistribute static
exit-address-family
#sh ip bgp neighbors
BGP neighbor is 3ffe::10, remote AS 100, local AS 200, external link
BGP version 4, local router ID 2.2.2.2, remote router ID 1.1.1.1
BGP state = Established, up for 00:04:59
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 VPNv4 Unicast: advertised and received
Address family IPv4 Unicast: advertised and received
Received 167 messages, 1 notifications, 0 in queue
Sent 166 messages, 1 notifications, 0 in queue
Route refresh request: received 0, sent 0
Minimum time between advertisement runs is 30 seconds
For address family: VPNv4 Unicast
BGP table version 1, neighbor version 1
Index 3, Offset 0, Mask 0x8
Extended Nexthop Encoding: advertised and received
NEXT_HOP is always this router
Community attribute sent to this neighbor (both)
0 accepted prefixes
0 announced prefixes
Connections established 1; dropped 0
Local host: 3ffe::11, Local port: 60148
Foreign host: 3ffe::10, Foreign port: 179
Nexthop: 1.1.1.1
Nexthop global: 3ffe::11
Nexthop local: fe80::ba6a:97ff:fee0:61ab
BGP connection: shared network
Last Reset: 00:05:04, due to Configuration Change (Cease Notification sent)
Notification Error Message: (Cease/Other Configuration Change.)
#sh ip bgp vpnv4 all
Status codes: s suppressed, d damped, h history, a add-path, * valid, > best, i
- internal, l - labeled
S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
 
Network Next Hop Metric LocPrf Weight Path
Route Distinguisher: 100:10 (Default for VRF vrf1)
*> 55.55.55.0/24 0.0.0.0 0 100 32768 ?
*> 66.66.66.0/24 0.0.0.0 0 100 0 ?
Announced routes count = 2
Accepted routes count = 0
Route Distinguisher: 100:10
* i 55.55.55.0/24 3ffe::10 0 100 0 ?
* i 66.66.66.0/24 3ffe::10 0 100 0 ?
Announced routes count = 0
Accepted routes count = 2
 
#sh ip bgp vpnv4 all summary
BGP router identifier 1.1.1.1, 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/Dow
n State/PfxRcd
1.1.1.1 4 400 0 0 0 0 0 never
Idle
 
3ffe::10 4 400 163 163 1 0 0 00:00:04
2
Total number of neighbors 2
 
Total number of Established sessions 1
 
 
Last modified date: 10/16/2023