L3VPN Basic On Segment Routing
L3VPN Basic On Segment Routing
PNETLAB Store
PNETLab.com
Lab Topology:
Please use the following topology to complete this lab exercise:
https://user.pnetlab.com/store/labs/detail?id=16029946254406
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 :
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
PNETLab.com
SOLUTION:
Task 1: Configure the hostname and IP address for the interface for Routers as topo.
On R1
!
hostname R1
interface Loopback0
ipv4 address 1.1.1.1 255.255.255.255
!
interface GigabitEthernet0/0/0/0
ipv4 address 10.1.12.1 255.255.255.0
!
On R2
!
hostname R2
interface Loopback0
ipv4 address 2.2.2.2 255.255.255.255
!
interface GigabitEthernet0/0/0/0
ipv4 address 10.1.12.2 255.255.255.0
!
interface GigabitEthernet0/0/0/1
ipv4 address 10.1.23.2 255.255.255.0
!
On R3
!
hostname R3
interface Loopback0
ipv4 address 3.3.3.3 255.255.255.255
!
interface GigabitEthernet0/0/0/1
ipv4 address 10.1.23.3 255.255.255.0
!
interface GigabitEthernet0/0/0/2
ipv4 address 10.1.34.3 255.255.255.0
!
On R4
!
hostname R4
interface Loopback0
ipv4 address 4.4.4.4 255.255.255.255
!
2
Download PNETLab Platform
PNETLAB Store
PNETLab.com
interface GigabitEthernet0/0/0/2
ipv4 address 10.1.34.4 255.255.255.0
!
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 1.1.1.1
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
PNETLab.com
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
PNETLab.com
!
!
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 1.1.1.1
address-family vpnv4 unicast
!
neighbor-group L3VPN
remote-as 12345
update-source Loopback0
address-family vpnv4 unicast
!
!
neighbor 4.4.4.4
use neighbor-group L3VPN
5
Download PNETLab Platform
PNETLAB Store
PNETLab.com
!
vrf HR
rd 2:2
address-family ipv4 unicast
network 192.168.16.0/24
!
!
vrf Accounting
rd 1:1
address-family ipv4 unicast
network 192.168.15.0/24
!
!
!
On R4
!
router bgp 12345
bgp router-id 4.4.4.4
address-family vpnv4 unicast
!
neighbor-group L3VPN
remote-as 12345
update-source Loopback0
address-family vpnv4 unicast
!
!
neighbor 1.1.1.1
use neighbor-group L3VPN
!
vrf HR
rd auto
address-family ipv4 unicast
network 192.168.48.0/24
!
!
vrf Accounting
rd auto
address-family ipv4 unicast
network 192.168.47.0/24
!
!
!
6
Download PNETLab Platform
PNETLAB Store
PNETLab.com
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 192.168.15.5 255.255.255.0
!
ip route 0.0.0.0 0.0.0.0 192.168.15.1
!
On R6
!
interface Ethernet0/0
ip address 192.168.16.6 255.255.255.0
!
ip route 0.0.0.0 0.0.0.0 192.168.16.1
!
On R7
!
interface Ethernet0/0
ip address 192.168.47.7 255.255.255.0
!
ip route 0.0.0.0 0.0.0.0 192.168.47.4
!
On R8
!
interface Ethernet0/0
ip address 192.168.48.8 255.255.255.0
!
ip route 0.0.0.0 0.0.0.0 192.168.48.4
!
Verification:
R5#ping 192.168.47.7
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.47.7, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/24/45
ms
R6#ping 192.168.48.8
Type escape sequence to abort.
7
Download PNETLab Platform
PNETLAB Store
PNETLab.com
//2 Pairs CE belong to 2 VRF could reach to each other. Let’s check what’s happen on Core Area.
8
Download PNETLab Platform
PNETLAB Store
PNETLab.com
//Label 24002, 24003 will be use for corresponding VRF’s route. Let’s use traceroute for check
the label on packet.
R5#traceroute 192.168.47.7
Type escape sequence to abort.
Tracing the route to 192.168.47.7
VRF info: (vrf in name/id, vrf out name/id)
1 192.168.15.1 29 msec 2 msec 2 msec
2 10.1.12.2 [MPLS: Labels 24004/24003 Exp 0] 39 msec 22 msec 35 msec
3 10.1.23.3 [MPLS: Labels 32004/24003 Exp 0] 34 msec 18 msec 30 msec
4 10.1.34.4 31 msec 31 msec 26 msec
5 192.168.47.7 16 msec 21 msec *
10