The examples in this
section show a common BGP prefix SID configuration between two routers.
This example shows how
to advertise a BGP speaker configuration of 10.10.10.10/32 and 20.20.20.20/32
with a label index of 10 and 20, respectively. It uses the default segment
routing global block (SRGB) range of 16000 to 23999.
hostname s1
install feature-set mpls
feature-set mpls
feature telnet
feature bash-shell
feature scp-server
feature bgp
feature mpls segment-routing
segment-routing
mpls
vlan 1
segment-routing
mpls
connected-prefix-sid-map
address-family ipv4
2.1.1.1/32 absolute 100100
route-map label-index-10 permit 10
set label-index 10
route-map label-index-20 permit 10
set label-index 20
vrf context management
ip route 0.0.0.0/0 10.30.108.1
interface Ethernet1/1
no switchport
ip address 10.1.1.1/24
no shutdown
interface mgmt0
ip address dhcp
vrf member management
interface loopback1
ip address 10.10.10.10/32
interface loopback2
ip address 20.20.20.20/32
line console
line vty
router bgp 1
address-family ipv4 unicast
network 10.10.10.10/32 route-map label-index-10
network 20.20.20.20/32 route-map label-index-20
allocate-label all
neighbor 10.1.1.2 remote-as 2
address-family ipv4 labeled-unicast
This example shows how
to receive the configuration from a BGP speaker.
hostname s2
install feature-set mpls
feature-set mpls
feature telnet
feature bash-shell
feature scp-server
feature bgp
feature mpls segment-routing
segment-routing mpls
vlan 1
vrf context management
ip route 0.0.0.0/0 10.30.97.1
ip route 0.0.0.0/0 10.30.108.1
interface Ethernet1/1
no switchport
ip address 10.1.1.2/24
ipv6 address 10:1:1::2/64
no shutdown
interface mgmt0
ip address dhcp
vrf member management
interface loopback1
ip address 2.2.2.2/32
line console
line vty
router bgp 2
address-family ipv4 unicast
allocate-label all
neighbor 10.1.1.1 remote-as 1
address-family ipv4 labeled-unicast
This example shows how
to display the configuration from a BGP speaker. The
show
command in this example displays the prefix 10.10.10.10 with label index 10
mapping to label 16010 in the SRGB range of 16000 to 23999.
switch# show bgp ipv4 labeled-unicast 10.10.10.10/32
BGP routing table information for VRF default, address family IPv4 Label Unicast
BGP routing table entry for 10.10.10.10/32, version 7
Paths: (1 available, best #1)
Flags: (0x20c001a) on xmit-list, is in urib, is best urib route, is in HW, , has label
label af: version 8, (0x100002) on xmit-list
local label: 16010
Advertised path-id 1, Label AF advertised path-id 1
Path type: external, path is valid, is best path, no labeled nexthop, in rib
AS-Path: 1 , path sourced external to AS
10.1.1.1 (metric 0) from 10.1.1.1 (10.10.10.10)
Origin IGP, MED not set, localpref 100, weight 0
Received label 0
Prefix-SID Attribute: Length: 10
Label Index TLV: Length 7, Flags 0x0 Label Index 10
Path-id 1 not advertised to any peer
Label AF advertisement
Path-id 1 not advertised to any peer
This example shows how to configure egress peer engineering on a BGP speaker.
hostname epe-as-1
install feature-set mpls
feature-set mpls
feature telnet
feature bash-shell
feature scp-server
feature bgp
feature mpls segment-routing
segment-routing mpls
vlan 1
vrf context management
ip route 0.0.0.0/0 10.30.97.1
ip route 0.0.0.0/0 10.30.108.1
interface Ethernet1/1
no switchport
ip address 10.1.1.1/24
no shutdown
interface Ethernet1/2
no switchport
ip address 11.1.1.1/24
no shutdown
interface Ethernet1/3
no switchport
ip address 12.1.1.1/24
no shutdown
interface Ethernet1/4
no switchport
ip address 13.1.1.1/24
no shutdown
interface Ethernet1/5
no switchport
ip address 14.1.1.1/24
no shutdown
The following is an example of show ip route vrf 2 command.
show ip route vrf 2
IP Route Table for VRF "2"
'*' denotes best ucast next-hop
'**' denotes best mcast next-hop
'[x/y]' denotes [preference/metric]
'%<string>' in via output denotes VRF <string>
41.11.2.0/24, ubest/mbest: 1/0
*via 1.1.1.9%default, [20/0], 13:26:48, bgp-2, external, tag 11 (mpls-vpn)
42.11.2.0/24, ubest/mbest: 1/0, attached
*via 42.11.2.1, Vlan2, [0/0], 13:40:52, direct
42.11.2.1/32, ubest/mbest: 1/0, attached
*via 42.11.2.1, Vlan2, [0/0], 13:40:52, local
The following is an example of show forwarding route vrf 2 command.
slot 1
=======
IPv4 routes for table 2/base
------------------+-----------------------------------------+----------------------+-----------------+-----------------
Prefix | Next-hop | Interface | Labels | Partial Install
------------------+-----------------------------------------+----------------------+-----------------+-----------------
0.0.0.0/32 Drop Null0
127.0.0.0/8 Drop Null0
255.255.255.255/32 Receive sup-eth1
*41.11.2.0/24 27.1.31.4 Ethernet1/3 PUSH 30002 492529
27.1.32.4 Ethernet1/21 PUSH 30002 492529
27.1.33.4 port-channel23 PUSH 30002 492529
27.11.31.4 Ethernet1/3.11 PUSH 30002 492529
27.11.33.4 port-channel23.11 PUSH 30002 492529
37.1.53.4 Ethernet1/53/1 PUSH 29002 492529
37.1.54.4 Ethernet1/54/1 PUSH 29002 492529
37.2.53.4 Ethernet1/53/2 PUSH 29002 492529
37.2.54.4 Ethernet1/54/2 PUSH 29002 492529
80.211.11.1 Vlan801 PUSH 30002 492529
The following is an example of show bgp l2vpn evpn summary command.
show bgp l2vpn evpn summary
BGP summary information for VRF default, address family L2VPN EVPN
BGP router identifier 2.2.2.3, local AS number 2
BGP table version is 17370542, L2VPN EVPN config peers 4, capable peers 1
1428 network entries and 1428 paths using 268464 bytes of memory
BGP attribute entries [476/76160], BGP AS path entries [1/6]
BGP community entries [0/0], BGP clusterlist entries [0/0]
476 received paths for inbound soft reconfiguration
476 identical, 0 modified, 0 filtered received paths using 0 bytes
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
1.1.1.1 4 11 0 0 0 0 0 23:01:53 Shut (Admin)
1.1.1.9 4 11 4637 1836 17370542 0 0 23:01:40 476
1.1.1.10 4 11 0 0 0 0 0 23:01:53 Shut (Admin)
1.1.1.11 4 11 0 0 0 0 0 23:01:52 Shut (Admin)
The following is an example of show bgp l2vpn evpn command.
show bgp l2vpn evpn 41.11.2.0
BGP routing table information for VRF default, address family L2VPN EVPN
Route Distinguisher: 14.1.4.1:115
BGP routing table entry for [5]:[0]:[0]:[24]:[41.11.2.0]:[0.0.0.0]/224, version 17369591
Paths: (1 available, best #1)
Flags: (0x000002) on xmit-list, is not in l2rib/evpn, is not in HW
Advertised path-id 1
Path type: external, path is valid, received and used, is best path
Imported to 2 destination(s)
AS-Path: 11 , path sourced external to AS
1.1.1.9 (metric 0) from 1.1.1.9 (14.1.4.1)
Origin incomplete, MED 0, localpref 100, weight 0
Received label 492529
Extcommunity: RT:2:20
Path-id 1 not advertised to any peer
Route Distinguisher: 2.2.2.3:113
BGP routing table entry for [5]:[0]:[0]:[24]:[41.11.2.0]:[0.0.0.0]/224, version 17369595
Paths: (1 available, best #1)
Flags: (0x000002) on xmit-list, is not in l2rib/evpn, is not in HW
Advertised path-id 1
Path type: external, path is valid, is best path
Imported from 14.1.4.1:115:[5]:[0]:[0]:[24]:[41.11.2.0]:[0.0.0.0]/224
AS-Path: 11 , path sourced external to AS
1.1.1.9 (metric 0) from 1.1.1.9 (14.1.4.1)