Scenario:
In this lab, I will use the IOU to configure the basic MPLS setting.
Shell script:
root@Home-Server:/home/peter/iou/lab/MPLS/lab01# cat ./mpls-lab01.sh
#!/bin/bash
#
# Creating 3 routers:
# R1 (Port #2001): e0/0-3 s1/0-3
# R2 (Port #2002): e0/0-3 s1/0-3
# R3 (Port #2003): e0/0-3 s1/0-3
#
# History:
# This shell sript is for MPLS lab01
# 2011/08/18 by Happy Peter
# Blog: http://blog.xuite.net/juilin77/happy
#
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
#
#iourc Environment Variable
export IOURC=/home/peter/iou/iourc
#
#NETMAP Environment Variable
export NETIO_NETMAP=/home/peter/iou/lab/MPLS/NETMAP
#
#R1
/home/peter/iou/wrapper-linux -m /home/peter/iou/i86bi_linux-adventerprisek9-ms -p 2001 -- -e 1 -s 1 1 &
sleep 5s
#R2
/home/peter/iou/wrapper-linux -m /home/peter/iou/i86bi_linux-adventerprisek9-ms -p 2002 -- -e 1 -s 1 2 &
sleep 5s
#R3
/home/peter/iou/wrapper-linux -m /home/peter/iou/i86bi_linux-adventerprisek9-ms -p 2003 -- -e 1 -s 1 3 &
sleep 5s
#
unset NETIO_NETMAP
#
unset IOURC
#
#Checking
exit 0
root@Home-Server:/home/peter/iou/lab/MPLS/lab01#
NETMAP:
root@Home-Server:/home/peter/iou/lab/MPLS/lab01# cat ./../NETMAP
1:1/1 2:1/0
2:1/1 3:1/0
root@Home-Server:/home/peter/iou/lab/MPLS/lab01#
1. Configuring the interface and other basic router setting:
R1
Router(config)#hostname R1
R1(config)#
R1(config)#no ip domain-lookup
R1(config)#
R1(config)#line console 0
R1(config-line)#logging synchronous
R1(config-line)#exec-timeout 0 0
R1(config)#
R1(config)#interface loopback 0
R1(config-if)#ip address 192.168.10.1 255.255.255.0
R1(config)#
R1(config)#interface loopback 1
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config)#
R1(config)#interface serial 1/1
R1(config-if)#ip address 192.168.12.1 255.255.255.0
R1(config-if)#no shutdown
R1(config)#
R2
Router(config)#hostname R2
R2(config)#
R2(config)#no ip domain-lookup
R2(config)#
R2(config)#line console 0
R2(config-line)#logging synchronous
R2(config-line)#exec-timeout 0 0
R2(config)#
R2(config)#interface loopback 0
R2(config-if)#ip address 192.168.20.2 255.255.255.0
R2(config)#
R2(config)#interface serial 1/0
R2(config-if)#ip address 192.168.12.2 255.255.255.0
R2(config-if)#no shutdown
R2(config)#
R2(config)#interface serial 1/1
R2(config-if)#ip address 192.168.23.2 255.255.255.0
R2(config-if)#no shutdown
R2(config)#
R3
Router(config)#hostname R3
R3(config)#
R3(config)#no ip domain-lookup
R3(config)#
R3(config)#line console 0
R3(config-line)#logging synchronous
R3(config-line)#exec-timeout 0 0
R3(config)#
R3(config)#interface loopback 0
R3(config-if)#ip address 192.168.30.3 255.255.255.0
R3(config)#
R3(config)#interface loopback 1
R3(config-if)#ip address 192.168.3.3 255.255.255.0
R3(config)#
R3(config)#interface serial 1/0
R3(config-if)#ip address 192.168.23.3 255.255.255.0
R3(config-if)#no shutdown
R3(config)#
2. Configurating the routing protocol.
R1
R1(config)#router rip
R1(config-router)#network 192.168.1.0
R1(config-router)#network 192.168.10.0
R1(config-router)#network 192.168.12.0
R1(config-router)#version 2
R1(config-router)#no auto-summary
R1(config)#
R2
R2(config)#router rip
R2(config-router)#network 192.168.12.0
R2(config-router)#network 192.168.23.0
R2(config-router)#network 192.168.20.0
R2(config-router)#version 2
R2(config-router)#no auto-summary
R2(config)#
R3
R3(config)#router rip
R3(config-router)#network 192.168.23.0
R3(config-router)#network 192.168.3.0
R3(config-router)#network 192.168.30.0
R3(config-router)#version 2
R3(config-router)#no auto-summary
R3(config)#
3. IGP verification
R1
R1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, + - replicated route
Gateway of last resort is not set
192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.1.0/24 is directly connected, Loopback1
L 192.168.1.1/32 is directly connected, Loopback1
R 192.168.3.0/24 [120/2] via 192.168.12.2, 00:00:01, Serial1/1
192.168.10.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.10.0/24 is directly connected, Loopback0
L 192.168.10.1/32 is directly connected, Loopback0
192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.12.0/24 is directly connected, Serial1/1
L 192.168.12.1/32 is directly connected, Serial1/1
R 192.168.20.0/24 [120/1] via 192.168.12.2, 00:00:01, Serial1/1
R 192.168.23.0/24 [120/1] via 192.168.12.2, 00:00:01, Serial1/1
R 192.168.30.0/24 [120/2] via 192.168.12.2, 00:00:01, Serial1/1
R1#
R2
R2#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, + - replicated route
Gateway of last resort is not set
R 192.168.1.0/24 [120/1] via 192.168.12.1, 00:00:13, Serial1/0
R 192.168.3.0/24 [120/1] via 192.168.23.3, 00:00:23, Serial1/1
R 192.168.10.0/24 [120/1] via 192.168.12.1, 00:00:13, Serial1/0
192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.12.0/24 is directly connected, Serial1/0
L 192.168.12.2/32 is directly connected, Serial1/0
192.168.20.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.20.0/24 is directly connected, Loopback0
L 192.168.20.2/32 is directly connected, Loopback0
192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.23.0/24 is directly connected, Serial1/1
L 192.168.23.2/32 is directly connected, Serial1/1
R 192.168.30.0/24 [120/1] via 192.168.23.3, 00:00:23, Serial1/1
R2#
R3
R3#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, + - replicated route
Gateway of last resort is not set
R 192.168.1.0/24 [120/2] via 192.168.23.2, 00:00:04, Serial1/0
192.168.3.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.3.0/24 is directly connected, Loopback1
L 192.168.3.3/32 is directly connected, Loopback1
R 192.168.10.0/24 [120/2] via 192.168.23.2, 00:00:04, Serial1/0
R 192.168.12.0/24 [120/1] via 192.168.23.2, 00:00:04, Serial1/0
R 192.168.20.0/24 [120/1] via 192.168.23.2, 00:00:04, Serial1/0
192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.23.0/24 is directly connected, Serial1/0
L 192.168.23.3/32 is directly connected, Serial1/0
192.168.30.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.30.0/24 is directly connected, Loopback0
L 192.168.30.3/32 is directly connected, Loopback0
R3#
4. Configurating the basic MPLS
R1
R1(config)#ip cef
R1(config)#
R1(config)#mpls ip
R1(config)#
R1(config)#interface serial 1/1
R1(config-if)#mpls ip
R1(config)#
R2
R2(config)#ip cef
R2(config)#
R2(config)#mpls ip
R2(config)#
R2(config)#interface serial 1/0
R2(config-if)#mpls ip
R2(config)#
R2(config)#interface serial 1/1
R2(config-if)#mpls ip
R2(config)#
R3
R3(config)#ip cef
R3(config)#
R3(config)#mpls ip
R3(config)#
R3(config)#interface serial 1/0
R3(config-if)#mpls ip
R3(config)#
5. CEF verification
R1
R1#show ip cef
Prefix Next Hop Interface
0.0.0.0/0 no route
0.0.0.0/8 drop
0.0.0.0/32 receive
127.0.0.0/8 drop
192.168.1.0/24 attached Loopback1
192.168.1.0/32 receive Loopback1
192.168.1.1/32 receive Loopback1
192.168.1.255/32 receive Loopback1
192.168.3.0/24 192.168.12.2 Serial1/1
192.168.10.0/24 attached Loopback0
192.168.10.0/32 receive Loopback0
192.168.10.1/32 receive Loopback0
192.168.10.255/32 receive Loopback0
192.168.12.0/24 attached Serial1/1
192.168.12.0/32 receive Serial1/1
192.168.12.1/32 receive Serial1/1
192.168.12.255/32 receive Serial1/1
192.168.20.0/24 192.168.12.2 Serial1/1
192.168.23.0/24 192.168.12.2 Serial1/1
192.168.30.0/24 192.168.12.2 Serial1/1
224.0.0.0/4 drop
224.0.0.0/24 receive
Prefix Next Hop Interface
240.0.0.0/4 drop
255.255.255.255/32 receive
R1#
R2
R2#show ip cef
Prefix Next Hop Interface
0.0.0.0/0 no route
0.0.0.0/8 drop
0.0.0.0/32 receive
127.0.0.0/8 drop
192.168.1.0/24 192.168.12.1 Serial1/0
192.168.3.0/24 192.168.23.3 Serial1/1
192.168.10.0/24 192.168.12.1 Serial1/0
192.168.12.0/24 attached Serial1/0
192.168.12.0/32 receive Serial1/0
192.168.12.2/32 receive Serial1/0
192.168.12.255/32 receive Serial1/0
192.168.20.0/24 attached Loopback0
192.168.20.0/32 receive Loopback0
192.168.20.2/32 receive Loopback0
192.168.20.255/32 receive Loopback0
192.168.23.0/24 attached Serial1/1
192.168.23.0/32 receive Serial1/1
192.168.23.2/32 receive Serial1/1
192.168.23.255/32 receive Serial1/1
192.168.30.0/24 192.168.23.3 Serial1/1
224.0.0.0/4 drop
224.0.0.0/24 receive
Prefix Next Hop Interface
240.0.0.0/4 drop
255.255.255.255/32 receive
R2#
R3
R3#show ip cef
Prefix Next Hop Interface
0.0.0.0/0 no route
0.0.0.0/8 drop
0.0.0.0/32 receive
127.0.0.0/8 drop
192.168.1.0/24 192.168.23.2 Serial1/0
192.168.3.0/24 attached Loopback1
192.168.3.0/32 receive Loopback1
192.168.3.3/32 receive Loopback1
192.168.3.255/32 receive Loopback1
192.168.10.0/24 192.168.23.2 Serial1/0
192.168.12.0/24 192.168.23.2 Serial1/0
192.168.20.0/24 192.168.23.2 Serial1/0
192.168.23.0/24 attached Serial1/0
192.168.23.0/32 receive Serial1/0
192.168.23.3/32 receive Serial1/0
192.168.23.255/32 receive Serial1/0
192.168.30.0/24 attached Loopback0
192.168.30.0/32 receive Loopback0
192.168.30.3/32 receive Loopback0
192.168.30.255/32 receive Loopback0
224.0.0.0/4 drop
224.0.0.0/24 receive
Prefix Next Hop Interface
240.0.0.0/4 drop
255.255.255.255/32 receive
R3#
6. MPLS interfaces verification
R1
R1#show mpls interfaces
Interface IP Tunnel BGP Static Operational
Serial1/1 Yes (ldp) No No No Yes
R1#
R2
R2#show mpls interfaces
Interface IP Tunnel BGP Static Operational
Serial1/0 Yes (ldp) No No No Yes
Serial1/1 Yes (ldp) No No No Yes
R2#
R3
R3#show mpls interfaces
Interface IP Tunnel BGP Static Operational
Serial1/0 Yes (ldp) No No No Yes
R3#
7. Label distribution verification
R1
R1#show mpls ldp discovery
Local LDP Identifier:
192.168.10.1:0
Discovery Sources:
Interfaces:
Serial1/1 (ldp): xmit/recv
LDP Id: 192.168.20.2:0; no host route
R1#
R2
R2#show mpls ldp discovery
Local LDP Identifier:
192.168.20.2:0
Discovery Sources:
Interfaces:
Serial1/0 (ldp): xmit/recv
LDP Id: 192.168.10.1:0; no host route
Serial1/1 (ldp): xmit/recv
LDP Id: 192.168.30.3:0; no host route
R2#
R3
R3#show mpls ldp discovery
Local LDP Identifier:
192.168.30.3:0
Discovery Sources:
Interfaces:
Serial1/0 (ldp): xmit/recv
LDP Id: 192.168.20.2:0; no host route
R3#
8. The MPLS label bindings
R1
R1#show mpls ldp bindings
lib entry: 192.168.1.0/24, rev 2
local binding: label: imp-null
remote binding: lsr: 192.168.20.2:0, label: 16
lib entry: 192.168.3.0/24, rev 12
local binding: label: 18
remote binding: lsr: 192.168.20.2:0, label: 18
lib entry: 192.168.10.0/24, rev 4
local binding: label: imp-null
remote binding: lsr: 192.168.20.2:0, label: 17
lib entry: 192.168.12.0/24, rev 6
local binding: label: imp-null
remote binding: lsr: 192.168.20.2:0, label: imp-null
lib entry: 192.168.20.0/24, rev 8
local binding: label: 16
remote binding: lsr: 192.168.20.2:0, label: imp-null
lib entry: 192.168.23.0/24, rev 10
local binding: label: 17
remote binding: lsr: 192.168.20.2:0, label: imp-null
lib entry: 192.168.30.0/24, rev 14
local binding: label: 19
remote binding: lsr: 192.168.20.2:0, label: 19
R1#
R2
R2#show mpls ldp bindings
lib entry: 192.168.1.0/24, rev 8
local binding: label: 16
remote binding: lsr: 192.168.10.1:0, label: imp-null
remote binding: lsr: 192.168.30.3:0, label: 16
lib entry: 192.168.3.0/24, rev 12
local binding: label: 18
remote binding: lsr: 192.168.30.3:0, label: imp-null
remote binding: lsr: 192.168.10.1:0, label: 18
lib entry: 192.168.10.0/24, rev 10
local binding: label: 17
remote binding: lsr: 192.168.10.1:0, label: imp-null
remote binding: lsr: 192.168.30.3:0, label: 17
lib entry: 192.168.12.0/24, rev 4
local binding: label: imp-null
remote binding: lsr: 192.168.10.1:0, label: imp-null
remote binding: lsr: 192.168.30.3:0, label: 18
lib entry: 192.168.20.0/24, rev 2
local binding: label: imp-null
remote binding: lsr: 192.168.10.1:0, label: 16
remote binding: lsr: 192.168.30.3:0, label: 19
lib entry: 192.168.23.0/24, rev 6
local binding: label: imp-null
remote binding: lsr: 192.168.10.1:0, label: 17
remote binding: lsr: 192.168.30.3:0, label: imp-null
lib entry: 192.168.30.0/24, rev 14
local binding: label: 19
remote binding: lsr: 192.168.30.3:0, label: imp-null
remote binding: lsr: 192.168.10.1:0, label: 19
R2#
R3
R3#show mpls ldp bindings
lib entry: 192.168.1.0/24, rev 8
local binding: label: 16
remote binding: lsr: 192.168.20.2:0, label: 16
lib entry: 192.168.3.0/24, rev 2
local binding: label: imp-null
remote binding: lsr: 192.168.20.2:0, label: 18
lib entry: 192.168.10.0/24, rev 10
local binding: label: 17
remote binding: lsr: 192.168.20.2:0, label: 17
lib entry: 192.168.12.0/24, rev 12
local binding: label: 18
remote binding: lsr: 192.168.20.2:0, label: imp-null
lib entry: 192.168.20.0/24, rev 14
local binding: label: 19
remote binding: lsr: 192.168.20.2:0, label: imp-null
lib entry: 192.168.23.0/24, rev 6
local binding: label: imp-null
remote binding: lsr: 192.168.20.2:0, label: imp-null
lib entry: 192.168.30.0/24, rev 4
local binding: label: imp-null
remote binding: lsr: 192.168.20.2:0, label: 19
R3#
9. MPLS forwarding table verification
R1
R1#show mpls forwarding-table
Local Outgoing Prefix Bytes Label Outgoing Next Hop
Label Label or Tunnel Id Switched interface
16 Pop Label 192.168.20.0/24 0 Se1/1 point2point
17 Pop Label 192.168.23.0/24 0 Se1/1 point2point
18 18 192.168.3.0/24 0 Se1/1 point2point
19 19 192.168.30.0/24 0 Se1/1 point2point
R1#
R2
R2#show mpls forwarding-table
Local Outgoing Prefix Bytes Label Outgoing Next Hop
Label Label or Tunnel Id Switched interface
16 Pop Label 192.168.1.0/24 520 Se1/0 point2point
17 Pop Label 192.168.10.0/24 0 Se1/0 point2point
18 Pop Label 192.168.3.0/24 0 Se1/1 point2point
19 Pop Label 192.168.30.0/24 0 Se1/1 point2point
R2#
R3
R3#show mpls forwarding-table
Local Outgoing Prefix Bytes Label Outgoing Next Hop
Label Label or Tunnel Id Switched interface
16 16 192.168.1.0/24 0 Se1/0 point2point
17 17 192.168.10.0/24 0 Se1/0 point2point
18 Pop Label 192.168.12.0/24 0 Se1/0 point2point
19 Pop Label 192.168.20.0/24 0 Se1/0 point2point
R3#
Final configuration:
R1
R1#show running-config
hostname R1
!
ip cef
!
no ip domain lookup
!
interface Loopback0
ip address 192.168.10.1 255.255.255.0
!
interface Loopback1
ip address 192.168.1.1 255.255.255.0
!
interface Serial1/1
ip address 192.168.12.1 255.255.255.0
mpls ip
no shutdown
!
router rip
version 2
network 192.168.1.0
network 192.168.10.0
network 192.168.12.0
no auto-summary
!
line con 0
exec-timeout 0 0
logging synchronous
!
end
R2
R2#show running-config
hostname R2
!
ip cef
!
no ip domain lookup
!
interface Loopback0
ip address 192.168.20.2 255.255.255.0
!
interface Serial1/0
ip address 192.168.12.2 255.255.255.0
mpls ip
no shutdown
!
interface Serial1/1
ip address 192.168.23.2 255.255.255.0
mpls ip
no shutdown
!
router rip
version 2
network 192.168.12.0
network 192.168.20.0
network 192.168.23.0
no auto-summary
!
line con 0
exec-timeout 0 0
logging synchronous
!
end
R3
R3#show running-config
hostname R3
!
ip cef
!
no ip domain lookup
!
interface Loopback0
ip address 192.168.30.3 255.255.255.0
!
interface Loopback1
ip address 192.168.3.3 255.255.255.0
!
interface Serial1/0
ip address 192.168.23.3 255.255.255.0
mpls ip
no shutdown
!
router rip
version 2
network 192.168.3.0
network 192.168.23.0
network 192.168.30.0
no auto-summary
!
line con 0
exec-timeout 0 0
logging synchronous
!
end
Reference:
1. CCIP: MPLS Study Guide
(ISBN-13: 978-0782140965)
http://www.amazon.com/CCIP-Study-Guide-James-Regan/dp/0782140963
最初發表 / 最後更新: 2011.08.20 / 2018.06.08
0 comments:
張貼留言