- Table of Contents
-
- H3C S12500R Ethernet Switch Router Series Config Examples-Release 36xx-6W100
- 01-Login Management Configuration Examples
- 02-RBAC Configuration Examples
- 03-Software Upgrade Examples
- 04-Ethernet Link Aggregation Configuration Examples
- 05-Port Isolation Configuration Examples
- 06-Spanning Tree Configuration Examples
- 07-VLAN Configuration Examples
- 08-VLAN Tagging Configuration Examples
- 09-DHCP Snooping Configuration Examples
- 10-Cross-Subnet Dynamic IP Address Allocation Configuration Examples
- 11-IPv6 over IPv4 Tunneling with OSPFv3 Configuration Examples
- 12-GRE Tunnel Configuration Examples
- 13-GRE with OSPF Configuration Examples
- 14-OSPF Configuration Examples
- 15-IS-IS Configuration Examples
- 16-BGP Configuration Examples
- 17-Policy-Based Routing Configuration Examples
- 18-OSPFv3 Configuration Examples
- 19-IPv6 IS-IS Configuration Examples
- 20-Routing Policy Configuration Examples
- 21-IGMP Snooping Configuration Examples
- 22-IGMP Configuration Examples
- 23-MLD Snooping Configuration Examples
- 24-Basic MPLS Configuration Examples
- 25-MPLS L3VPN Configuration Examples
- 26-ACL Configuration Examples
- 27-Control Plane-Based QoS Policy Configuration Examples
- 28-Traffic Policing Configuration Examples
- 29-GTS and Rate Limiting Configuration Examples
- 30-Priority Mapping and Queue Scheduling Configuration Examples
- 31-Traffic Filtering Configuration Examples
- 32-AAA Configuration Examples
- 33-SSH Configuration Examples
- 34-IP Source Guard Configuration Examples
- 35-Ethernet OAM Configuration Examples
- 36-CFD Configuration Examples
- 37-DLDP Configuration Examples
- 38-VRRP Configuration Examples
- 39-BFD Configuration Examples
- 40-NTP Configuration Examples
- 41-SNMP Configuration Examples
- 42-NQA Configuration Examples
- 43-Mirroring Configuration Examples
- 44-sFlow Configuration Examples
- 45-OpenFlow Configuration Examples
- 46-MAC Address Table Configuration Examples
- 47-Static Multicast MAC Address Entry Configuration Examples
- 48-IP Unnumbered Configuration Examples
- 49-Congestion Avoidance and Queue Scheduling Configuration Examples
- 50-Attack Protection Configuration Examples
- 51-Smart Link Configuration Examples
- 52-RRPP Configuration Examples
- 53-BGP Route Selection Configuration Examples
- 54-IS-IS Route Summarization Configuration Examples
- 55-MPLS OAM Configuration Examples
- 56-MPLS TE Configuration Examples
- 57-VXLAN Configuration Examples
- 58-NetStream Configuration Examples
- 59-EVPN-DCI over an MPLS L3VPN Network Configuration Examples
- 60-PTP Configuration Examples
- 61-S-MLAG Configuration Examples
- 62-MPLS SR Configuration Examples
- 63-Puppet Configuration Examples
- Related Documents
-
Title | Size | Download |
---|---|---|
24-Basic MPLS Configuration Examples | 163.71 KB |
|
H3C S12500R Switch Router Series |
Basic MPLS Configuration Examples |
|
Copyright © 2021 New H3C Technologies Co., Ltd. All rights reserved.
No part of this manual may be reproduced or transmitted in any form or by any means without prior written consent of New H3C Technologies Co., Ltd.
Except for the trademarks of New H3C Technologies Co., Ltd., any trademarks that may be mentioned in this document are the property of their respective owners.
The information in this document is subject to change without notice.
Introduction
This document provides static LSP and LDP LSP configuration examples.
The following table shows the differences between a static LSP and an LDP LSP:
LSP type |
Establishment |
Feature |
Application scenario |
Static LSP |
You establish a static LSP by specifying the incoming and outgoing labels on ingress, transit, and egress nodes of the forwarding path. |
· Consumes fewer resources. · Cannot automatically adapt to network topology changes. |
Small and stable networks with simple topologies. |
LDP LSP |
You establish an LDP LSP by configuring MPLS LDP. LDP classifies FECs, distributes FEC-label mappings, and establishes and maintains LSPs. |
· Consumes more resources. · Automatically adapts to network topology changes. |
Large and unstable networks with complicated topologies. |
Prerequisites
This document is not restricted to specific software or hardware versions.
The configuration examples in this document were created and verified in a lab environment, and all the devices were started with the factory default configuration. When you are working on a live network, make sure you understand the potential impact of every command on your network.
This document assumes that you have basic knowledge of MPLS and LDP.
Example: Configuring static LSPs
Network configuration
As shown in Figure 1, establish static LSPs between Router A and Router C to allow communication between subnets 172.20.2.0/24 and 172.16.2.0/24 over the MPLS network.
Analysis
LSPs are unidirectional. To ensure that data can be bidirectionally forwarded, configure an LSP for each direction of the data forwarding path, and specify the ingress, transit, and egress nodes for each LSP.
To direct traffic to an LSP for MPLS forwarding, make sure the ingress node has a route to the FEC destination of the LSP. This example uses a static route. Route configuration is not needed on the transit and egress nodes.
Software versions used
This configuration example was created and verified on Release 3606.
Restrictions and guidelines
When you configure a static LSP, follow these restrictions and guidelines:
· Make sure the outgoing label specified on an LSR is the same as the incoming label specified on the directly connected downstream LSR.
· If you configure a static IP route for the LSP, specify the same next hop or outgoing interface for the static route and the static LSP.
· On the ingress or transit node of the static LSP, do not specify the public address of a local interface as the next hop address of the static LSP.
· MPLS adds a label or multiple labels to packets. After MPLS is enabled on an interface, configure jumboframe support on the interface to avoid MPLS packet dropping when the packet size exceeds the interface MTU.
Procedures
1. Configure IP addresses and masks for interfaces, including the loopback interfaces, as shown in Figure 1. (Details not shown.)
2. Configure a static route to the destination address of each LSP:
# Configure a static route to the FEC destination of the LSP from Router A to Router C.
<RouterA> system-view
[RouterA] ip route-static 172.16.2.1 24 10.0.3.2
# Configure a static route to the FEC destination of the LSP from Router C to Router A.
<RouterC> system-view
[RouterC] ip route-static 172.20.2.1 24 10.0.6.1
# Verify that the static route has been created on the ingress nodes, for example, on Router A.
[RouterA] display ip routing-table
Destinations : 13 Routes : 13
Destination/Mask Proto Pre Cost NextHop Interface
0.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
172.16.2.1/24 Static 60 0 10.0.3.2 HGE1/0/2
10.0.3.0/24 Direct 0 0 10.0.3.1 HGE1/0/2
10.0.3.0/32 Direct 0 0 10.0.3.1 HGE1/0/2
10.0.3.1/32 Direct 0 0 127.0.0.1 InLoop0
1.1.1.9/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
127.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
224.0.0.0/4 Direct 0 0 0.0.0.0 NULL0
224.0.0.0/24 Direct 0 0 0.0.0.0 NULL0
255.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
3. Configure basic MPLS on the switches:
# Configure Router A.
[RouterA] mpls lsr-id 1.1.1.9
[RouterA] interface hundredgige 1/0/2
[RouterA-HundredGigE1/0/2] mpls enable
[RouterA-HundredGigE1/0/2] quit
# Configure Router B.
[RouterB] mpls lsr-id 2.2.2.9
[RouterB] interface hundredgige 1/0/1
[RouterB-HundredGigE1/0/1] mpls enable
[RouterB-HundredGigE1/0/1] quit
[RouterB] interface hundredgige 1/0/2
[RouterB-HundredGigE1/0/2] mpls enable
[RouterB-HundredGigE1/0/2] quit
# Configure Router C.
[RouterC] mpls lsr-id 3.3.3.9
[RouterC] interface hundredgige 1/0/1
[RouterC-HundredGigE1/0/1] mpls enable
[RouterC-HundredGigE1/0/1] quit
4. Configure a static LSP from Router A to Router C:
# Configure the ingress node Router A. Specify the LSP name as AtoC, destination address as 172.16.2.1/24, next hop as 10.0.3.2, and outgoing label as 30.
[RouterA] static-lsp ingress AtoC destination 172.16.2.1 24 nexthop 10.0.3.2 out-label 30
# Configure the transit node Router B. Specify the LSP name as AtoC, incoming label as 30, next hop as 10.0.6.2, and outgoing label as 50.
[RouterB] static-lsp transit AtoC in-label 30 nexthop 10.0.6.2 out-label 50
# Configure the egress node Router C. Specify the LSP name as AtoC and incoming label as 50.
[RouterC] static-lsp egress AtoC in-label 50
5. Configure a static LSP from Router C to Router A:
# Configure the ingress node Router C. Specify the LSP name as CtoA, destination address as 172.20.2.1/24, next hop as 10.0.6.1, and outgoing label as 40.
[RouterC] static-lsp ingress CtoA destination 172.20.2.1 24 nexthop 10.0.6.1 out-label 40
# Configure the transit node Router B. Specify the LSP name as CtoA, incoming label as 40, next hop as 10.0.3.1, and outgoing label as 70.
[RouterB] static-lsp transit CtoA in-label 40 nexthop 10.0.3.1 out-label 70
# Configure the egress node Router A. Specify the LSP name as CtoA and incoming label as 70.
[RouterA] static-lsp egress CtoA in-label 70
Verifying the configuration
# Display static LSP information on switches, for example, on Router A.
[RouterA] display mpls static-lsp
Total: 2
Name FEC In/Out Label Nexthop/Out Interface State
AtoC 172.16.2.1/24 NULL/30 10.0.3.2 Up
CtoA -/- 70/NULL - Up
# Test the connectivity of the LSP from Router A to Router C.
[RouterA] ping mpls -a 172.20.2.1 ipv4 172.16.2.0 24
MPLS ping FEC 172.16.2.0/24 with 100 bytes of data:
100 bytes from 10.0.6.2: Sequence=1 time=3 ms
100 bytes from 10.0.6.2: Sequence=2 time=2 ms
100 bytes from 10.0.6.2: Sequence=3 time=2 ms
100 bytes from 10.0.6.2: Sequence=4 time=2 ms
100 bytes from 10.0.6.2: Sequence=5 time=27 ms
--- Ping statistics for FEC 172.16.2.0/24 ---
5 packets transmitted, 5 packets received, 0.0% packet loss
Round-trip min/avg/max = 2/7/27 ms
# Test the connectivity of the LSP from Router C to Router A.
[RouterC] ping mpls -a 172.16.2.1 ipv4 172.20.2.0 24
MPLS ping FEC 172.20.2.0/24 with 100 bytes of data:
100 bytes from 10.0.3.2: Sequence=1 time=3 ms
100 bytes from 10.0.3.2: Sequence=2 time=2 ms
100 bytes from 10.0.3.2: Sequence=3 time=2 ms
100 bytes from 10.0.3.2: Sequence=4 time=2 ms
100 bytes from 10.0.3.2: Sequence=5 time=27 ms
--- Ping statistics for FEC 172.20.2.0/24 ---
5 packets transmitted, 5 packets received, 0.0% packet loss
Round-trip min/avg/max = 2/7/27 ms
Configuration files
· Router A:
#
mpls lsr-id 1.1.1.9
#
interface LoopBack0
ip address 1.1.1.9 255.255.255.255
#
interface HundredGigE1/0/2
port link-mode route
ip address 10.0.3.1 255.255.255.0
mpls enable
#
interface HundredGigE1/0/1
port link-mode route
ip address 172.20.2.1 255.255.255.0
#
ip route-static 172.16.2.1 255.255.255.0 10.0.3.2
#
static-lsp ingress AtoC destination 172.16.2.1 24 nexthop 10.0.3.2 out-label 30
static-lsp egress CtoA in-label 70
#
· Router B:
#
mpls lsr-id 2.2.2.9
#
interface LoopBack0
ip address 2.2.2.9 255.255.255.255
#
interface HundredGigE1/0/1
port link-mode route
ip address 10.0.3.2 255.255.255.0
mpls enable
#
interface HundredGigE1/0/2
port link-mode route
ip address 10.0.6.1 255.255.255.0
mpls enable
#
static-lsp transit AtoC in-label 30 nexthop 10.0.6.2 out-label 50
static-lsp transit CtoA in-label 40 nexthop 10.0.3.1 out-label 70
#
· Router C:
#
mpls lsr-id 3.3.3.9
#
interface LoopBack0
ip address 3.3.3.9 255.255.255.255
#
interface HundredGigE1/0/1
port link-mode route
ip address 10.0.6.2 255.255.255.0
mpls enable
#
interface HundredGigE1/0/2
port link-mode route
ip address 172.16.2.1 255.255.255.0
#
ip route-static 172.20.2.1 255.255.255.0 10.0.6.2
#
static-lsp ingress CtoA destination 172.20.2.1 24 nexthop 10.0.6.1 out-label 40
static-lsp egress AtoC in-label 50
#
Example: Configuring LDP LSPs
Network configuration
As shown in Figure 2, two paths are available for PE 1 and PE 2 to communicate with each other.
· Configure LDP to establish LSPs between PE 1 and PE 2 to allow communication between subnets 192.168.10.0/24 and 192.168.20.0/24 over the MPLS network.
¡ Use LSP 1 as the primary path.
¡ Use LSP 2 as the backup path, which takes over LSP 1 when LSP 1 fails.
· Configure LDP to establish LSPs only for destinations 1.1.1.1/32, 2.2.2.2/32, 3.3.3.3/32, 4.4.4.4/32, 5.5.5.5/32, 192.168.10.0/24, and 192.168.20.0/24.
Device |
Interface |
IP address |
Device |
Interface |
IP address |
PE 1 |
Loop0 |
1.1.1.1/32 |
P 3 |
Loop0 |
5.5.5.5/32 |
|
HE1/0/1 |
12.12.12.1/24 |
|
HE1/0/1 |
35.35.35.5/24 |
|
HE1/0/2 |
14.14.14.1/24 |
|
HE1/0/2 |
45.45.45.5/24 |
|
HE1/0/3 |
192.168.10.1/24 |
PE 1 |
Loop0 |
3.3.3.3/32 |
P 1 |
Loop0 |
2.2.2.2/32 |
|
HE1/0/1 |
35.35.35.3/24 |
|
HE1/0/1 |
12.12.12.2/24 |
|
HE1/0/2 |
23.23.23.3/24 |
|
HE1/0/2 |
23.23.23.2/24 |
|
HE1/0/3 |
192.168.20.1/24 |
P 2 |
Loop0 |
4.4.4.4/32 |
|
|
|
|
HE1/0/1 |
45.45.45.4/24 |
|
|
|
|
HE1/0/2 |
14.14.14.4/24 |
|
|
|
Analysis
To establish LDP LSPs, configure a routing protocol to ensure IP connectivity among the devices. This example uses OSPF.
To use LSP 1 as the primary path and LSP 2 as the backup, configure the routes for LSP 1 and LSP 2 as the primary and backup routes, respectively. This example uses OSPF. The OSPF cost of the route for LSP 1 is smaller than that for LSP 2. Therefore, LSP 1 is used when it is available.
To control LSP establishment, configure LSP generation policies on each LSR.
Software versions used
This configuration example was created and verified on Release 3606.
Procedures
Before configuring LDP LSPs, make sure STP is disabled or each VLAN has been mapped to an MSTP instance.
1. Configure IP addresses and masks for interfaces, including the loopback interfaces, as shown in Figure 2. (Details not shown.)
2. Configure OSPF on each switch to ensure IP connectivity:
# Configure PE 1.
[PE1] ospf
[PE1-ospf-1] area 0
[PE1-ospf-1-area-0.0.0.0] network 1.1.1.1 0.0.0.0
[PE1-ospf-1-area-0.0.0.0] network 12.12.12.0 0.0.0.255
[PE1-ospf-1-area-0.0.0.0] network 14.14.14.0 0.0.0.255
[PE1-ospf-1-area-0.0.0.0] network 192.168.10.0 0.0.0.255
[PE1-ospf-1-area-0.0.0.0] quit
[PE1-ospf-1] quit
# Configure P 1.
[P1] ospf
[P1-ospf-1] area 0
[P1-ospf-1-area-0.0.0.0] network 2.2.2.2 0.0.0.0
[P1-ospf-1-area-0.0.0.0] network 12.12.12.0 0.0.0.255
[P1-ospf-1-area-0.0.0.0] network 23.23.23.0 0.0.0.255
[P1-ospf-1-area-0.0.0.0] quit
[P1-ospf-1] quit
# Configure P 2.
[P2] ospf
[P2-ospf-1] area 0
[P2-ospf-1-area-0.0.0.0] network 4.4.4.4 0.0.0.0
[P2-ospf-1-area-0.0.0.0] network 14.14.14.0 0.0.0.255
[P2-ospf-1-area-0.0.0.0] network 45.45.45.0 0.0.0.255
[P2-ospf-1-area-0.0.0.0] quit
[P2-ospf-1] quit
# Configure P 3.
[P3] ospf
[P3-ospf-1] area 0
[P3-ospf-1-area-0.0.0.0] network 5.5.5.5 0.0.0.0
[P3-ospf-1-area-0.0.0.0] network 45.45.45.0 0.0.0.255
[P3-ospf-1-area-0.0.0.0] network 35.35.35.0 0.0.0.255
[P3-ospf-1-area-0.0.0.0] quit
[P3-ospf-1] quit
# Configure PE 2.
[PE2] ospf
[PE2-ospf-1] area 0
[PE2-ospf-1-area-0.0.0.0] network 3.3.3.3 0.0.0.0
[PE2-ospf-1-area-0.0.0.0] network 23.23.23.0 0.0.0.255
[PE2-ospf-1-area-0.0.0.0] network 35.35.35.0 0.0.0.255
[PE2-ospf-1-area-0.0.0.0] network 192.168.20.0 0.0.0.255
[PE2-ospf-1-area-0.0.0.0] quit
[PE2-ospf-1] quit
# On each switch, for example, on PE 1, verify that the switches have learned the routes to each other.
[PE1] display ospf routing
OSPF Process 1 with Router ID 1.1.1.1
Routing Table
Topology base (MTID 0)
Routing for network
Destination Cost Type NextHop AdvRouter Area
45.45.45.0/24 2 Transit 14.14.14.4 5.5.5.5 0.0.0.0
35.35.35.0/24 3 Transit 14.14.14.4 5.5.5.5 0.0.0.0
35.35.35.0/24 3 Transit 12.12.12.2 5.5.5.5 0.0.0.0
192.168.10.0/24 1 Stub 192.168.10.1 1.1.1.1 0.0.0.0
5.5.5.5/32 2 Stub 14.14.14.4 5.5.5.5 0.0.0.0
14.14.14.0/24 1 Transit 14.14.14.1 4.4.4.4 0.0.0.0
23.23.23.0/24 2 Transit 12.12.12.2 3.3.3.3 0.0.0.0
4.4.4.4/32 1 Stub 14.14.14.4 4.4.4.4 0.0.0.0
3.3.3.3/32 2 Stub 12.12.12.2 3.3.3.3 0.0.0.0
12.12.12.0/24 1 Transit 12.12.12.1 2.2.2.2 0.0.0.0
2.2.2.2/32 1 Stub 12.12.12.2 2.2.2.2 0.0.0.0
1.1.1.1/32 0 Stub 1.1.1.1 1.1.1.1 0.0.0.0
192.168.20.0/24 3 Stub 12.12.12.2 3.3.3.3 0.0.0.0
# On each switch, for example, on PE 1, verify that OSPF neighbor relationships in Full state have been established between PE 1, P devices, and PE 2.
[PE1] display ospf peer verbose
OSPF Process 1 with Router ID 1.1.1.1
Neighbors
Area 0.0.0.0 interface 14.14.14.1(HundredGigE1/0/2)'s neighbors
Router ID: 4.4.4.4 Address: 14.14.14.4 GR state: Normal
State: Full Mode: Nbr is master Priority: 1
DR: 14.14.14.4 BDR: 14.14.14.1 MTU: 0
Options is 0x42 (-|O|-|-|-|-|E|-)
Dead timer due in 40 sec
Neighbor is up for 00:03:30
Authentication Sequence: [ 0 ]
Neighbor state change count: 6
BFD status: Disabled
Neighbors
Area 0.0.0.0 interface 12.12.12.1(HundredGigE1/0/1)'s neighbors
Router ID: 2.2.2.2 Address: 12.12.12.2 GR state: Normal
State: Full Mode: Nbr is master Priority: 1
DR: 12.12.12.2 BDR: 12.12.12.1 MTU: 0
Options is 0x42 (-|O|-|-|-|-|E|-)
Dead timer due in 36 sec
Neighbor is up for 00:03:24
Authentication Sequence: [ 0 ]
Neighbor state change count: 6
BFD status: Disabled
Last Neighbor Down Event:
Router ID: 4.4.4.4
Local Address: 14.14.14.1
Remote Address: 14.14.14.4
Time: May 14 09:07:19 2014
Reason: Reset ospf command was performed
3. Configure basic MPLS and MPLS LDP:
# Configure PE 1.
[PE1] mpls lsr-id 1.1.1.1
[PE1] mpls ldp
[PE1-ldp] quit
[PE1] interface hundredgige 1/0/1
[PE1-HundredGigE1/0/1] mpls enable
[PE1-HundredGigE1/0/1] mpls ldp enable
[PE1-HundredGigE1/0/1] quit
[PE1] interface hundredgige 1/0/2
[PE1-HundredGigE1/0/2] mpls enable
[PE1-HundredGigE1/0/2] mpls ldp enable
[PE1-HundredGigE1/0/2] quit
# Configure P 1.
[P1] mpls lsr-id 2.2.2.2
[P1] mpls ldp
[P1-ldp] quit
[P1] interface hundredgige 1/0/1
[P1-HundredGigE1/0/1] mpls enable
[P1-HundredGigE1/0/1] mpls ldp enable
[P1-HundredGigE1/0/1] quit
[P1] interface hundredgige 1/0/2
[P1-HundredGigE1/0/2] mpls enable
[P1-HundredGigE1/0/2] mpls ldp enable
[P1-HundredGigE1/0/2] quit
# Configure P 2.
[P2] mpls lsr-id 4.4.4.4
[P2] mpls ldp
[P2-ldp] quit
[P2] interface hundredgige 1/0/1
[P2-HundredGigE1/0/1] mpls enable
[P2-HundredGigE1/0/1] mpls ldp enable
[P2-HundredGigE1/0/1] quit
[P2] interface hundredgige 1/0/2
[P2-HundredGigE1/0/2] mpls enable
[P2-HundredGigE1/0/2] mpls ldp enable
[P2-HundredGigE1/0/2] quit
# Configure P 3.
[P3] mpls lsr-id 5.5.5.5
[P3] mpls ldp
[P3-ldp] quit
[P3] interface hundredgige 1/0/1
[P3-HundredGigE1/0/1] mpls enable
[P3-HundredGigE1/0/1] mpls ldp enable
[P3-HundredGigE1/0/1] quit
[P3] interface hundredgige 1/0/2
[P3-HundredGigE1/0/2] mpls enable
[P3-HundredGigE1/0/2] mpls ldp enable
[P3-HundredGigE1/0/2] quit
# Configure PE 2.
[PE2] mpls lsr-id 3.3.3.3
[PE2] mpls ldp
[PE2-ldp] quit
[PE2] interface hundredgige 1/0/1
[PE2-HundredGigE1/0/1] mpls enable
[PE2-HundredGigE1/0/1] mpls ldp enable
[PE2-HundredGigE1/0/1] quit
[PE2] interface hundredgige 1/0/2
[PE2-HundredGigE1/0/2] mpls enable
[PE2-HundredGigE1/0/2] mpls ldp enable
[PE2-HundredGigE1/0/2] quit
# On each switch, for example, on PE 1, verify that LDP sessions in Operational state have been established between PE 1, P devices, and PE 2.
[PE1 display mpls ldp peer
Total number of peers: 2
Peer LDP ID State Role GR MD5 KA Sent/Rcvd
2.2.2.2:0 Operational Passive Off Off 55/55
4.4.4.4:0 Operational Passive Off Off 6/6
4. Configure LSP generation policies:
# On PE 1, create IP prefix list PE1, and configure LDP to use only the routes permitted by the prefix list to establish LSPs.
[PE1] ip prefix-list PE1 index 10 permit 1.1.1.1 32
[PE1] ip prefix-list PE1 index 20 permit 2.2.2.2 32
[PE1] ip prefix-list PE1 index 30 permit 3.3.3.3 32
[PE1] ip prefix-list PE1 index 40 permit 4.4.4.4 32
[PE1] ip prefix-list PE1 index 50 permit 5.5.5.5 32
[PE1] ip prefix-list PE1 index 60 permit 192.168.10.0 24
[PE1] ip prefix-list PE1 index 70 permit 192.168.20.0 24
[PE1] mpls ldp
[PE1-ldp] lsp-trigger prefix-list PE1
[PE1-ldp] quit
# On P 1, create IP prefix list P1, and configure LDP to use only the routes permitted by the prefix list to establish LSPs.
[P1] ip prefix-list P1 index 10 permit 1.1.1.1 32
[P1] ip prefix-list P1 index 20 permit 2.2.2.2 32
[P1] ip prefix-list P1 index 30 permit 3.3.3.3 32
[P1] ip prefix-list P1 index 40 permit 4.4.4.4 32
[P1] ip prefix-list P1 index 50 permit 5.5.5.5 32
[P1] ip prefix-list P1 index 60 permit 192.168.10.0 24
[P1] ip prefix-list P1 index 70 permit 192.168.20.0 24
[P1] mpls ldp
[P1-ldp] lsp-trigger prefix-list P1
[P1-ldp] quit
# On P 2, create IP prefix list P2, and configure LDP to use only the routes permitted by the prefix list to establish LSPs.
[P2] ip prefix-list P2 index 10 permit 1.1.1.1 32
[P2] ip prefix-list P2 index 20 permit 2.2.2.2 32
[P2] ip prefix-list P2 index 30 permit 3.3.3.3 32
[P2] ip prefix-list P2 index 40 permit 4.4.4.4 32
[P2] ip prefix-list P2 index 50 permit 5.5.5.5 32
[P2] ip prefix-list P2 index 60 permit 192.168.10.0 24
[P2] ip prefix-list P2 index 70 permit 192.168.20.0 24
[P2] mpls ldp
[P2-ldp] lsp-trigger prefix-list P2
[P2-ldp] quit
# On P 3, create IP prefix list P3, and configure LDP to use only the routes permitted by the prefix list to establish LSPs.
[P3] ip prefix-list P3 index 10 permit 1.1.1.1 32
[P3] ip prefix-list P3 index 20 permit 2.2.2.2 32
[P3] ip prefix-list P3 index 30 permit 3.3.3.3 32
[P3] ip prefix-list P3 index 40 permit 4.4.4.4 32
[P3] ip prefix-list P3 index 50 permit 5.5.5.5 32
[P3] ip prefix-list P3 index 60 permit 192.168.10.0 24
[P3] ip prefix-list P3 index 70 permit 192.168.20.0 24
[P3] mpls ldp
[P3-ldp] lsp-trigger prefix-list P3
[P3-ldp] quit
# On PE 2, create IP prefix list PE2, and configure LDP to use only the routes permitted by the prefix list to establish LSPs.
[PE2] ip prefix-list PE2 index 10 permit 1.1.1.1 32
[PE2] ip prefix-list PE2 index 20 permit 2.2.2.2 32
[PE2] ip prefix-list PE2 index 30 permit 3.3.3.3 32
[PE2] ip prefix-list PE2 index 40 permit 4.4.4.4 32
[PE2] ip prefix-list PE2 index 50 permit 5.5.5.5 32
[PE2] ip prefix-list PE2 index 60 permit 192.168.10.0 24
[PE2] ip prefix-list PE2 index 70 permit 192.168.20.0 24
[PE2] mpls ldp
[PE2-ldp] lsp-trigger prefix-list PE2
[PE2-ldp] quit
Verifying the configuration
# Display LDP LSP information on PE 1. The output shows that the next hop is P 1 for the LSP associated with FEC 192.168.20.0/24.
[PE1] display mpls ldp lsp
Status Flags: * - stale, L - liberal, B - backup, N/A – unavailable
FECs: 7 Ingress: 5 Transit: 5 Egress: 2
FEC In/Out Label Nexthop OutInterface/LSINDEX
1.1.1.1/32 3/-
-/1151(L)
-/1151(L)
2.2.2.2/32 -/3 12.12.12.2 HGE1/0/1
1151/3 12.12.12.2 HGE1/0/1
-/1150(L)
3.3.3.3/32 -/1150 12.12.12.2 HGE1/0/1
1150/1150 12.12.12.2 HGE1/0/1
-/1148(L)
4.4.4.4/32 -/1149(L)
-/3 14.14.14.4 HGE1/0/2
1149/3 14.14.14.4 HGE1/0/2
5.5.5.5/32 -/1148(L)
-/1149 14.14.14.4 HGE1/0/2
1148/1149 14.14.14.4 HGE1/0/2
192.168.10.0/24 1147/-
192.168.20.0/24 -/1147 12.12.12.2 HGE1/0/1
1146/1147 12.12.12.2 HGE1/0/1
-/1147(L)
# Power down P 1 and execute the display mpls ldp lsp command on PE 1. The output shows that the next hop becomes P 2 for the LSP associated with FEC 192.168.20.0/24.
[PE1] display mpls ldp lsp
Status Flags: * - stale, L - liberal, B - backup, N/A – unavailable
FECs: 7 Ingress: 5 Transit: 5 Egress: 2
FEC In/Out Label Nexthop OutInterface/LSINDEX
1.1.1.1/32 3/-
-/1150(L)
2.2.2.2/32 -/1149 14.14.14.4 HGE1/0/2
1150/1149 14.14.14.4 HGE1/0/2
3.3.3.3/32 -/1148 14.14.14.4 HGE1/0/2
1147/1148 14.14.14.4 HGE1/0/2
4.4.4.4/32 -/3 14.14.14.4 HGE1/0/2
1149/3 14.14.14.4 HGE1/0/2
5.5.5.5/32 -/1151 14.14.14.4 HGE1/0/2
1148/1151 14.14.14.4 HGE1/0/2
192.168.10.0/24 1151/-
-/1146(L)
192.168.20.0/24 -/1147 14.14.14.4 HGE1/0/2
1146/1147 14.14.14.4 HGE1/0/2
# Use the following command on PE 1 to verify its connectivity to PE 2.
[PE1] ping mpls -a 192.168.10.1 ipv4 192.168.20.0 24
MPLS ping FEC 192.168.20.0/24 with 100 bytes of data:
100 bytes from 23.23.23.3: Sequence=1 time=2 ms
100 bytes from 23.23.23.3: Sequence=2 time=2 ms
100 bytes from 23.23.23.3: Sequence=3 time=2 ms
100 bytes from 23.23.23.3: Sequence=4 time=2 ms
100 bytes from 23.23.23.3: Sequence=5 time=2 ms
--- Ping statistics for FEC 192.168.20.0/24 ---
5 packets transmitted, 5 packets received, 0.0% packet loss
Round-trip min/avg/max = 2/2/2 ms
Configuration files
· PE1:
#
ospf 1
area 0.0.0.0
network 1.1.1.1 0.0.0.0
network 12.12.12.0 0.0.0.255
network 14.14.14.0 0.0.0.255
network 192.168.10.0 0.0.0.255
#
mpls lsr-id 1.1.1.1
#
mpls ldp
lsp-trigger prefix-list PE1
#
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
#
interface HundredGigE1/0/1
port link-mode route
ip address 12.12.12.1 255.255.255.0
mpls enable
mpls ldp enable
#
interface HundredGigE1/0/2
port link-mode route
ip address 14.14.14.1 255.255.255.0
mpls enable
mpls ldp enable
#
interface HundredGigE1/0/3
port link-mode route
ip address 192.168.10.1 255.255.255.0
#
ip prefix-list PE1 index 10 permit 1.1.1.1 32
ip prefix-list PE1 index 20 permit 2.2.2.2 32
ip prefix-list PE1 index 30 permit 3.3.3.3 32
ip prefix-list PE1 index 40 permit 4.4.4.4 32
ip prefix-list PE1 index 50 permit 5.5.5.5 32
ip prefix-list PE1 index 60 permit 192.168.10.0 24
ip prefix-list PE1 index 70 permit 192.168.20.0 24
#
· P 1:
#
ospf 1
area 0.0.0.0
network 2.2.2.2 0.0.0.0
network 12.12.12.0 0.0.0.255
network 23.23.23.0 0.0.0.255
#
mpls lsr-id 2.2.2.2
#
mpls ldp
lsp-trigger prefix-list P1
#
interface LoopBack0
ip address 2.2.2.2 255.255.255.255
#
interface HundredGigE1/0/1
port link-mode route
ip address 12.12.12.2 255.255.255.0
mpls enable
mpls ldp enable
#
interface HundredGigE1/0/2
port link-mode route
ip address 23.23.23.2 255.255.255.0
mpls enable
mpls ldp enable
#
#
ip prefix-list P1 index 10 permit 1.1.1.1 32
ip prefix-list P1 index 20 permit 2.2.2.2 32
ip prefix-list P1 index 30 permit 3.3.3.3 32
ip prefix-list P1 index 40 permit 4.4.4.4 32
ip prefix-list P1 index 50 permit 5.5.5.5 32
ip prefix-list P1 index 60 permit 192.168.10.0 24
ip prefix-list P1 index 70 permit 192.168.20.0 24
#
· P 2:
#
ospf 1
area 0.0.0.0
network 4.4.4.4 0.0.0.0
network 14.14.14.0 0.0.0.255
network 45.45.45.0 0.0.0.255
#
mpls lsr-id 4.4.4.4
#
mpls ldp
lsp-trigger prefix-list P2
#
interface LoopBack0
ip address 4.4.4.4 255.255.255.255
#
interface HundredGigE1/0/1
port link-mode route
ip address 45.45.45.4 255.255.255.0
mpls enable
mpls ldp enable
#
interface HundredGigE1/0/2
port link-mode route
ip address 14.14.14.4 255.255.255.0
mpls enable
mpls ldp enable
#
ip prefix-list P1 index 10 permit 1.1.1.1 32
ip prefix-list P1 index 20 permit 2.2.2.2 32
ip prefix-list P1 index 30 permit 3.3.3.3 32
ip prefix-list P1 index 40 permit 4.4.4.4 32
ip prefix-list P1 index 50 permit 5.5.5.5 32
ip prefix-list P1 index 60 permit 192.168.10.0 24
ip prefix-list P1 index 70 permit 192.168.20.0 24
#
· P 3:
#
ospf 1
area 0.0.0.0
network 5.5.5.5 0.0.0.0
network 35.35.35.0 0.0.0.255
network 45.45.45.0 0.0.0.255
#
mpls lsr-id 5.5.5.5
#
mpls ldp
lsp-trigger prefix-list P1
#
interface LoopBack0
ip address 2.2.2.2 255.255.255.255
#
interface HundredGigE1/0/1
port link-mode route
ip address 35.35.35.5 255.255.255.0
mpls enable
mpls ldp enable
#
interface HundredGigE1/0/2
port link-mode route
ip address 45.45.45.5 255.255.255.0
mpls enable
mpls ldp enable
#
ip prefix-list P1 index 10 permit 1.1.1.1 32
ip prefix-list P1 index 20 permit 2.2.2.2 32
ip prefix-list P1 index 30 permit 3.3.3.3 32
ip prefix-list P1 index 40 permit 4.4.4.4 32
ip prefix-list P1 index 50 permit 5.5.5.5 32
ip prefix-list P1 index 60 permit 192.168.10.0 24
ip prefix-list P1 index 70 permit 192.168.20.0 24
#
· PE 2:
#
ospf 1
area 0.0.0.0
network 3.3.3.3 0.0.0.0
network 23.23.23.0 0.0.0.255
network 35.35.35.0 0.0.0.255
network 192.168.20.0 0.0.0.255
#
mpls lsr-id 3.3.3.3
#
mpls ldp
lsp-trigger prefix-list PE2
#
interface LoopBack0
ip address 3.3.3.3 255.255.255.255
#
interface HundredGigE1/0/1
port link-mode route
ip address 35.35.35.3 255.255.255.0
mpls enable
mpls ldp enable
#
interface HundredGigE1/0/2
port link-mode route
ip address 23.23.23.3 255.255.255.0
mpls enable
mpls ldp enable
#
interface HundredGigE1/0/3
port link-mode route
ip address 192.168.20.1 255.255.255.0
#
ip prefix-list P1 index 10 permit 1.1.1.1 32
ip prefix-list P1 index 20 permit 2.2.2.2 32
ip prefix-list P1 index 30 permit 3.3.3.3 32
ip prefix-list P1 index 40 permit 4.4.4.4 32
ip prefix-list P1 index 50 permit 5.5.5.5 32
ip prefix-list P1 index 60 permit 192.168.10.0 24
ip prefix-list P1 index 70 permit 192.168.20.0 24
#
Related documentation
· H3C S12500R Switch Router Series MPLS Command Reference-R3606
· H3C S12500R Switch Router Series MPLS Configuration Guide-R3606