Sunday, February 12, 2023

MPLS Building LAB

Pre-requisites for MPLS

  • Fully Operational IP routing
  • IP CEF should be enabled
  • Label exchange protocol should be enabled on interface (LDP/TDP, RSVP, BGP, Static)

Step to Configuring the MPLS

Common configuration for MPLS

conf t

Enter into global configuration mode

ip cef

Enable ip cef

no mpls ip

Disable MPLS

mpls label range first-label  last-label

Set label range for mpls to be used. Default label range – 16/100000.

mpls ip

Run MPLS

mpls ldp router-id loopback0 force

Forcefully set the router-id to be used by LDP to form neighbor.

interface fa 0/0

Enter into fast ethernet port

mpls ip

Run MPLS

end

Exit to privilege mode

MPLS Building LAB

Configuration for Router R1 (Edge LSR)

configure terminal
interface loopback0
ip address 1.1.1.1 255.255.255.255
ip ospf 1 area 0
exit
!
router ospf 1
router-id 1.1.1.1
network 192.168.20.0 255.255.255.0 area 0
exit
!
ip cef
!
no mpls ip
mpls label range 100 199
mpls ip
mpls ldp router-id loopback0 force
!
interface GigabitEthernet0/0
ip address 192.168.20.0 255.255.255.254
mpls ip
no shut
!
interface FastEthernet1/0
 ip address 192.168.10.1 255.255.255.0
 ip ospf 1 area 1
no shutdown
!
ip dhcp pool DHCPPCPOOL
network 192.168.10.0 255.255.255.0
default-router 192.168.10.1
dns-server 192.168.10.1
exit
!
ip dhcp excluded-address 192.168.10.1
end
wr
!
 
Configuration for Router R2 (Transit LSR)
configure terminal
interface loopback0
ip address 2.2.2.2 255.255.255.255
ip ospf 1 area 0
exit
!
ip cef
!
router ospf 1
router-id 2.2.2.2
network 192.168.20.0 255.255.255.0 area 0
exit
!
no mpls ip
mpls label range 200 299
mpls ip
mpls ldp router-id loopback0 force
!
interface GigabitEthernet0/0
ip address 192.168.20.1 255.255.255.254
mpls ip
no shut
exit
!
interface FastEthernet1/0
ip address 192.168.20.2 255.255.255.254
mpls ip
no shut
exit
!
interface serial 2/0
ip address 192.168.20.6 255.255.255.254
mpls ip
no shut
end
wr
!

Configuration for Router R3 (Transit LSR)
configure terminal
interface loopback0
ip address 3.3.3.3 255.255.255.255
ip ospf 1 area 0
exit
!
ip cef
!
router ospf 1
router-id 3.3.3.3
network 192.168.20.0 255.255.255.0 area 0
exit
!
no mpls ip
mpls label range 300 399
mpls ip
mpls ldp router-id loopback0 force
!
interface GigabitEthernet0/0
ip address 192.168.20.4 255.255.255.254
mpls ip
no shut
exit
!
interface FastEthernet1/0
ip address 192.168.20.3 255.255.255.254
mpls ip
no shut
exit
!
interface serial 2/1
ip address 192.168.20.9 255.255.255.254
mpls ip
no shut
end
wr
!
 
Configuration for Router R4 (Transit LSR)
configure terminal
interface loopback0
ip address 4.4.4.4 255.255.255.255
ip ospf 1 area 0
exit
!
ip cef
!
router ospf 1
router-id 4.4.4.4
network 192.168.20.0 255.255.255.0 area 0
exit
!
no mpls ip
mpls label range 400 499
mpls ip
mpls ldp router-id loopback0 force
!
interface serial 2/0
ip address 192.168.20.7 255.255.255.254
mpls ip
no shut
exit
!
interface serial 2/1
ip address 192.168.20.8 255.255.255.254
mpls ip
no shut
end
wr
!
 
Configuration for Router R5 (Edge LSR)
configure terminal
interface loopback0
ip address 5.5.5.5 255.255.255.255
ip ospf 1 area 0
exit
!
ip cef
!
router ospf 1
router-id 5.5.5.5
network 192.168.20.0 255.255.255.0 area 0
exit
!
no mpls ip
mpls label range 500 599
mpls ip
mpls ldp router-id loopback0 force
!
interface GigabitEthernet0/0
ip address 192.168.20.5 255.255.255.254
mpls ip
no shut
!
interface FastEthernet1/0
 ip address 192.168.30.1 255.255.255.0
 ip ospf 1 area 1
no shutdown
!
ip dhcp pool DHCPPCPOOL
network 192.168.30.0 255.255.255.0
default-router 192.168.30.1
dns-server 192.168.30.1
exit
!
ip dhcp excluded-address 192.168.30.1
end
wr
!

Ping and Traceroute from Router R1 to R5 and Vice versa

R1#ping 5.5.5.5
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 5.5.5.5, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 76/80/88 ms
R1#traceroute 5.5.5.5
Type escape sequence to abort.
Tracing the route to 5.5.5.5
VRF info: (vrf in name/id, vrf out name/id)
  1 192.168.20.1 [MPLS: Label 205 Exp 0] 80 msec 72 msec 76 msec
  2 192.168.20.3 [MPLS: Label 304 Exp 0] 40 msec 56 msec 72 msec
  3 192.168.20.5 92 msec 80 msec 80 msec
R1#

 R5#ping 1.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 80/97/132 ms
R5#traceroute 1.1.1.1
Type escape sequence to abort.
Tracing the route to 1.1.1.1
VRF info: (vrf in name/id, vrf out name/id)
  1 192.168.20.4 [MPLS: Label 305 Exp 0] 64 msec 56 msec 88 msec
  2 192.168.20.2 [MPLS: Label 204 Exp 0] 28 msec 60 msec 80 msec
  3 192.168.20.0 140 msec 80 msec 80 msec
R5#
 
Ping from PC1 to PC2 and Vice Versa
 
PC1> show ip
 
NAME        : PC1[1]
IP/MASK     : 192.168.10.2/24
GATEWAY     : 192.168.10.1
DNS         : 192.168.10.1
DHCP SERVER : 192.168.10.1
DHCP LEASE  : 83648, 86400/43200/75600
MAC         : 00:50:79:66:68:00
LPORT       : 10008
RHOST:PORT  : 127.0.0.1:10009
MTU:        : 1500
 
PC1>
PC1> ping 192.168.30.2
84 bytes from 192.168.30.2 icmp_seq=1 ttl=60 time=124.009 ms
84 bytes from 192.168.30.2 icmp_seq=2 ttl=60 time=123.820 ms
84 bytes from 192.168.30.2 icmp_seq=3 ttl=60 time=126.046 ms
84 bytes from 192.168.30.2 icmp_seq=4 ttl=60 time=121.992 ms
84 bytes from 192.168.30.2 icmp_seq=5 ttl=60 time=125.262 ms

PC2> show ip
 
NAME        : PC2[1]
IP/MASK     : 192.168.30.2/24
GATEWAY     : 192.168.30.1
DNS         : 192.168.30.1
DHCP SERVER : 192.168.30.1
DHCP LEASE  : 83618, 86400/43200/75600
MAC         : 00:50:79:66:68:01
LPORT       : 10010
RHOST:PORT  : 127.0.0.1:10011
MTU:        : 1500
 
PC2>
PC2> ping 192.168.10.2
84 bytes from 192.168.10.2 icmp_seq=1 ttl=60 time=107.085 ms
84 bytes from 192.168.10.2 icmp_seq=2 ttl=60 time=122.199 ms
84 bytes from 192.168.10.2 icmp_seq=3 ttl=60 time=122.571 ms
84 bytes from 192.168.10.2 icmp_seq=4 ttl=60 time=124.323 ms
84 bytes from 192.168.10.2 icmp_seq=5 ttl=60 time=123.460 ms

No comments:

Post a Comment