Download PNETLab Platform
PNETLAB Store
[Link]
L3VPN BASIC ON SEGMENT ROUTING
Lab Topology:
Please use the following topology to complete this lab exercise:
[Link]
Lab Objective:
The objective of this lab exercise is for you to learn and understand how can you configure
L3VPN on Segment Routing.
Task list:
Task 1: Configure the hostname and IP address for the interface for Routers as topo.
Task 2: Config Segment Routing Global Block for each Router as following table :
Router Segment Routing Global Block
R1 16000 – 23999
R2 24000 – 31999
R3 32000 – 39999
R4 40000 - 47999
Task 3: Config OSPF Routing in 4 Routers and enable Segment Routing on the area of OSPF.
Task 4: Config VRF in 2 PE Router (XRV1 & XRV4).
Task 5: Config BGP VPNv4 between 2 PE Router (XRV1 & XRV4). Advertise the network on VRF
to BGP.
Task 6: Config IP, Static Route for CE Routers (R5,R6,R7,R8) and check the connection between
CE Routers.
1
Download PNETLab Platform
PNETLAB Store
[Link]
SOLUTION:
Task 1: Configure the hostname and IP address for the interface for Routers as topo.
On R1
!
hostname R1
interface Loopback0
ipv4 address [Link] [Link]
!
interface GigabitEthernet0/0/0/0
ipv4 address [Link] [Link]
!
On R2
!
hostname R2
interface Loopback0
ipv4 address [Link] [Link]
!
interface GigabitEthernet0/0/0/0
ipv4 address [Link] [Link]
!
interface GigabitEthernet0/0/0/1
ipv4 address [Link] [Link]
!
On R3
!
hostname R3
interface Loopback0
ipv4 address [Link] [Link]
!
interface GigabitEthernet0/0/0/1
ipv4 address [Link] [Link]
!
interface GigabitEthernet0/0/0/2
ipv4 address [Link] [Link]
!
On R4
!
hostname R4
interface Loopback0
ipv4 address [Link] [Link]
!
2
Download PNETLab Platform
PNETLAB Store
[Link]
interface GigabitEthernet0/0/0/2
ipv4 address [Link] [Link]
!
Task 2: Config Segment Routing Global Block for each Router as following table :
On R1
!
segment-routing
global-block 16000 23999
!
On R2
!
segment-routing
global-block 24000 31999
!
On R3
!
segment-routing
global-block 32000 39999
!
On R4
!
segment-routing
global-block 40000 47999
!
Task 3: Config OSPF Routing in 4 Routers and enable Segment Routing on the area of OSPF.
On R1
!
router ospf 1
router-id [Link]
segment-routing mpls
segment-routing forwarding mpls
area 0
interface Loopback0
passive enable
prefix-sid index 1
!
interface GigabitEthernet0/0/0/0
network point-to-point
!
!
!
On R2
!
router ospf 1
3
Download PNETLab Platform
PNETLAB Store
[Link]
segment-routing mpls
segment-routing forwarding mpls
area 0
interface Loopback0
passive enable
prefix-sid index 2
!
interface GigabitEthernet0/0/0/0
network point-to-point
!
interface GigabitEthernet0/0/0/1
network point-to-point
!
!
!
On R3
!
router ospf 1
segment-routing mpls
segment-routing forwarding mpls
area 0
interface Loopback0
passive enable
prefix-sid index 3
!
interface GigabitEthernet0/0/0/1
network point-to-point
!
interface GigabitEthernet0/0/0/2
network point-to-point
!
!
!
On R4
!
router ospf 1
segment-routing mpls
segment-routing forwarding mpls
area 0
interface Loopback0
passive enable
prefix-sid index 4
!
interface GigabitEthernet0/0/0/2
network point-to-point
!
4
Download PNETLab Platform
PNETLAB Store
[Link]
!
!
Task 4: Config VRF in 2 PE Router (XRV1 & XRV4).
On R1,R4
!
vrf HR
address-family ipv4 unicast
import route-target
1:200
!
export route-target
1:200
!
!
!
vrf Accounting
address-family ipv4 unicast
import route-target
1:100
!
export route-target
1:100
!
!
!
Task 5: Config BGP VPNv4 between 2 PE Router (XRV1 & XRV4). Advertise the network on VRF
to BGP.
On R1
!
router bgp 12345
bgp router-id [Link]
address-family vpnv4 unicast
!
neighbor-group L3VPN
remote-as 12345
update-source Loopback0
address-family vpnv4 unicast
!
!
neighbor [Link]
use neighbor-group L3VPN
5
Download PNETLab Platform
PNETLAB Store
[Link]
!
vrf HR
rd 2:2
address-family ipv4 unicast
network [Link]/24
!
!
vrf Accounting
rd 1:1
address-family ipv4 unicast
network [Link]/24
!
!
!
On R4
!
router bgp 12345
bgp router-id [Link]
address-family vpnv4 unicast
!
neighbor-group L3VPN
remote-as 12345
update-source Loopback0
address-family vpnv4 unicast
!
!
neighbor [Link]
use neighbor-group L3VPN
!
vrf HR
rd auto
address-family ipv4 unicast
network [Link]/24
!
!
vrf Accounting
rd auto
address-family ipv4 unicast
network [Link]/24
!
!
!
6
Download PNETLab Platform
PNETLAB Store
[Link]
Task 6: Config IP, Static Route for CE Routers (R5,R6,R7,R8) and check the connection between
CE Routers.
On R5
!
interface Ethernet0/0
ip address [Link] [Link]
!
ip route [Link] [Link] [Link]
!
On R6
!
interface Ethernet0/0
ip address [Link] [Link]
!
ip route [Link] [Link] [Link]
!
On R7
!
interface Ethernet0/0
ip address [Link] [Link]
!
ip route [Link] [Link] [Link]
!
On R8
!
interface Ethernet0/0
ip address [Link] [Link]
!
ip route [Link] [Link] [Link]
!
Verification:
R5#ping [Link]
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to [Link], timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/24/45
ms
R6#ping [Link]
Type escape sequence to abort.
7
Download PNETLab Platform
PNETLAB Store
[Link]
Sending 5, 100-byte ICMP Echos to [Link], timeout is 2 seconds:
!!!!!
//2 Pairs CE belong to 2 VRF could reach to each other. Let’s check what’s happen on Core Area.
RP/0/0/CPU0:XRV1#show mpls forwarding
Mon Oct 12 15:06:16.211 UTC
Local Outgoing Prefix Outgoing Next Hop
Bytes
Label Label or ID Interface
Switched
------ ----------- ------------------ ------------ --------------- ---
---------
16002 Pop SR Pfx (idx 2) Gi0/0/0/0 [Link] 0
16003 24003 SR Pfx (idx 3) Gi0/0/0/0 [Link] 0
16004 24004 SR Pfx (idx 4) Gi0/0/0/0 [Link]
512127
24000 Pop SR Adj (idx 0) Gi0/0/0/0 [Link] 0
24001 Pop SR Adj (idx 0) Gi0/0/0/0 [Link] 0
24002 Aggregate Accounting: Per-VRF Aggr[V] \
Accounting 520
24003 Aggregate HR: Per-VRF Aggr[V] \
HR 1040
//2 Labels for L3VPN.
RP/0/0/CPU0:XRV1#show bgp vpnv4 unicast
Mon Oct 12 15:12:36.645 UTC
BGP router identifier [Link], local AS number 12345
BGP generic scan interval 60 secs
Non-stop routing is enabled
BGP table state: Active
Table ID: 0x0 RD version: 0
BGP main routing table version 15
BGP NSR Initial initsync version 7 (Reached)
BGP NSR/ISSU Sync-Group versions 0/0
BGP scan interval 60 secs
Status codes: s suppressed, d damped, h history, * valid, > best
i - internal, r RIB-failure, S stale, N Nexthop-discard
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
Route Distinguisher: 1:1 (default for vrf Accounting)
*> [Link]/24 [Link] 0 32768 i
8
Download PNETLab Platform
PNETLAB Store
[Link]
*>i192.168.47.0/24 [Link] 0 100 0 i
Route Distinguisher: 2:2 (default for vrf HR)
*> [Link]/24 [Link] 0 32768 i
*>i192.168.48.0/24 [Link] 0 100 0 i
Route Distinguisher: [Link]:0
*>i192.168.48.0/24 [Link] 0 100 0 i
Route Distinguisher: [Link]:1
*>i192.168.47.0/24 [Link] 0 100 0 i
//VPNv4 could be advertised between 2 PE.
RP/0/0/CPU0:XRV1#show bgp vrf HR [Link]/24
Mon Oct 12 15:10:42.143 UTC
BGP routing table entry for [Link]/24, Route Distinguisher: 2:2
Versions:
Process bRIB/RIB SendTblVer
Speaker 12 12
Last Modified: Oct 12 14:47:53.143 for 00:22:49
Paths: (1 available, best #1)
Not advertised to any peer
Path #1: Received by speaker 0
Not advertised to any peer
Local
[Link] (metric 4) from [Link] ([Link])
Received Label 24002
Origin IGP, metric 0, localpref 100, valid, internal, best,
group-best, import-candidate, imported
Received Path ID 0, Local Path ID 1, version 12
Extended community: RT:1:200
Source AFI: VPNv4 Unicast, Source VRF: default, Source Route
Distinguisher: [Link]:0
RP/0/0/CPU0:XRV1#show bgp vrf Accounting [Link]/24
Mon Oct 12 15:11:39.679 UTC
BGP routing table entry for [Link]/24, Route Distinguisher: 1:1
Versions:
Process bRIB/RIB SendTblVer
Speaker 13 13
Last Modified: Oct 12 14:47:53.143 for 00:23:46
Paths: (1 available, best #1)
Not advertised to any peer
Path #1: Received by speaker 0
Not advertised to any peer
Local
[Link] (metric 4) from [Link] ([Link])
9
Download PNETLab Platform
PNETLAB Store
[Link]
Received Label 24003
Origin IGP, metric 0, localpref 100, valid, internal, best,
group-best, import-candidate, imported
Received Path ID 0, Local Path ID 1, version 13
Extended community: RT:1:100
Source AFI: VPNv4 Unicast, Source VRF: default, Source Route
Distinguisher: [Link]:1
//Label 24002, 24003 will be use for corresponding VRF’s route. Let’s use traceroute for check
the label on packet.
R5#traceroute [Link]
Type escape sequence to abort.
Tracing the route to [Link]
VRF info: (vrf in name/id, vrf out name/id)
1 [Link] 29 msec 2 msec 2 msec
2 [Link] [MPLS: Labels 24004/24003 Exp 0] 39 msec 22 msec 35 msec
3 [Link] [MPLS: Labels 32004/24003 Exp 0] 34 msec 18 msec 30 msec
4 [Link] 31 msec 31 msec 26 msec
5 [Link] 16 msec 21 msec *
//It’s very similar with L3VPN over MPLS.
10