Example for Configuring Association between LDP and Static Routes
Networking Requirements
On an MPLS network with primary and secondary LSPs established using static routes, when association between LDP and static routes is not enabled, traffic is interrupted for a short period of time during traffic switchover from the primary LSP to the secondary LSP if the LDP session on the primary link fails (not because of a link fault) or during traffic switchback if the primary link recovers from a fault.
In Figure 2-15, LSRA has two static routes to LSRD. One of the static routes passes through LSRB, whereas the other static route passes through LSRC. LDP LSPs are established based on the static routes. Link A is the primary link, whereas Link B is the backup link. It is required that association between LDP and static routes be configured to prevent traffic from being interrupted if the LDP session on Link A fails or Link A recovers from a fault.
Device Name |
Interface Name |
Interface IP Address |
---|---|---|
LSRA |
10GE 1/0/1 |
10.1.1.1/30 |
10GE 1/0/2 |
20.1.1.1/30 |
|
LoopBack 0 |
1.1.1.1/32 |
|
LSRB |
10GE 1/0/1 |
10.1.1.2/30 |
10GE 1/0/2 |
30.1.1.1/30 |
|
LoopBack 0 |
2.2.2.2/32 |
|
LSRC |
10GE 1/0/1 |
20.1.1.2/30 |
10GE 1/0/2 |
40.1.1.1/30 |
|
LoopBack 0 |
3.3.3.3/32 |
|
LSRD |
10GE 1/0/1 |
30.1.1.2/30 |
10GE 1/0/2 |
40.1.1.2/30 |
|
LoopBack 0 |
4.4.4.4/32 |
Configuration Roadmap
The configuration roadmap is as follows:
Configure static routes for each LSP to reach other LSRs.
Enable MPLS and MPLS LDP globally and on interfaces of LSRs.
Configure association between LDP and static routes and verify the configuration.
Data Preparation
To complete the configuration, you need the following data:
IP addresses of interfaces on LSRs
MPLS LSR IDs of LSRs
Hold-down timer value
Procedure
- Assign an IP address and mask to each interface.
Configure an IP address and mask for each interface based on Figure 2-15. For configuration details, see "Configuration Files" in this section.
- Configure static routes for LSRs to ensure network reachability.
# Configure two static routes with different preferences from LSRA to LSRD, and two static routes with different preferences from LSRD to LSRA.
# Configure LSRA.
[~LSRA] ip route-static 2.2.2.2 32 10GE1/0/1 10.1.1.2
[*LSRA] ip route-static 3.3.3.3 32 10GE1/0/2 20.1.1.2
[*LSRA] ip route-static 30.1.1.1 30 10GE1/0/1
[*LSRA] ip route-static 40.1.1.1 30 10GE1/0/2
[*LSRA] ip route-static 4.4.4.4 32 10GE1/0/1 10.1.1.2 preference 40
[*LSRA] ip route-static 4.4.4.4 32 10GE1/0/2 20.1.1.2 preference 60
[*LSRA] commit
# Configure LSRB.
[~LSRB] ip route-static 1.1.1.1 32 10GE1/0/1 10.1.1.1
[*LSRB] ip route-static 4.4.4.4 32 10GE1/0/2 30.1.1.2
[*LSRB] commit
# Configure LSRC.
[~LSRC] ip route-static 1.1.1.1 32 10GE1/0/1 20.1.1.1
[*LSRC] ip route-static 4.4.4.4 32 10GE1/0/2 40.1.1.2
[*LSRC] commit
# Configure LSRD.
[~LSRD] ip route-static 2.2.2.2 32 10GE1/0/1 30.1.1.1
[*LSRD] ip route-static 3.3.3.3 32 10GE1/0/2 40.1.1.1
[*LSRD] ip route-static 10.1.1.2 30 10GE1/0/1
[*LSRD] ip route-static 20.1.1.2 30 10GE1/0/2
[*LSRD] ip route-static 1.1.1.1 32 10GE1/0/1 30.1.1.1 preference 40
[*LSRD] ip route-static 1.1.1.1 32 10GE1/0/2 40.1.1.1 preference 60
[*LSRD] commit
# After completing the configuration, run the display ip routing-table protocol static command on each LSR to check the static route configuration. The following example uses the command output on LSRA.
[~LSRA] display ip routing-table protocol static
Proto: Protocol Pre: Preference Route Flags: R - relay, D - download to fib, T - to vpn-instance, B - black hole route ------------------------------------------------------------------------------ _public_ Routing Table : Static Destinations : 5 Routes : 5 Configured Routes : 5 Static routing table status : <Active> Destinations : 5 Routes : 5 Destination/Mask Proto Pre Cost Flags NextHop Interface 2.2.2.2/32 Static 60 0 D 10.1.1.1 10GE1/0/1 3.3.3.3/32 Static 60 0 D 20.1.1.1 10GE1/0/2 4.4.4.4/32 Static 40 0 D 10.1.1.1 10GE1/0/1 30.1.1.0/30 Static 60 0 D 10.1.1.1 10GE1/0/1 40.1.1.0/30 Static 60 0 D 20.1.1.1 10GE1/0/2 Static routing table status : <Inactive> Destinations : 0 Routes : 0
- Enable MPLS LDP on each LSR to set up LDP LSPs.
# Configure LSRA.
[~LSRA] mpls lsr-id 1.1.1.1
[*LSRA] mpls
[*LSRA-mpls] quit
[*LSRA] mpls ldp
[*LSRA-mpls-ldp] commit
[~LSRA-mpls-ldp] quit
[~LSRA] interface 10GE1/0/1
[~LSRA-10GE1/0/1] mpls
[*LSRA-10GE1/0/1] mpls ldp
[*LSRA-10GE1/0/1] commit
[~LSRA-10GE1/0/1] quit
[~LSRA] interface 10GE1/0/2
[~LSRA-10GE1/0/2] mpls
[*LSRA-10GE1/0/2] mpls ldp
[*LSRA-10GE1/0/2] commit
[~LSRA-10GE1/0/2] quit
Repeat this step for LSRB, LSRC, and LSRD. For configuration details, see "Configuration Files" in this section.
# Run the display mpls ldp session command on each LSR to view information about established LDP sessions (in Operational state). The following example uses the command output on LSRA.
[~LSRA] display mpls ldp session LDP Session(s) in Public Network LAM: Label Advertisement Mode, KA: KeepAlive SsnAge: Session Age, Unit(DDDD:HH:MM) An asterisk (*) before a session means the session is being deleted. ------------------------------------------------------------------------------ PeerID Status LAM SsnRole SsnAge KASent/Rcv ------------------------------------------------------------------------------ 2.2.2.2:0 Operational DU Passive 0000:15:34 3738/3738 3.3.3.3:0 Operational DU Passive 0000:00:45 182/182 ------------------------------------------------------------------------------ TOTAL: 2 Session(s) Found.
- Configure association between LDP and static routes on LSRA and LSRD.
# Configure LSRA.
[~LSRA] ip route-static 4.4.4.4 32 10GE1/0/1 10.1.1.2 preference 40 ldp-sync
[*LSRA] interface 10GE1/0/1
[*LSRA-10GE1/0/1] static-route timer ldp-sync hold-down 20
[*LSRA-10GE1/0/1] commit
[~LSRA-10GE1/0/1] quit
# Configure LSRD.
[~LSRD] ip route-static 1.1.1.1 32 10GE1/0/1 30.1.1.1 preference 40 ldp-sync
[*LSRD] interface 10GE1/0/1
[*LSRD-10GE1/0/1] static-route timer ldp-sync hold-down 20
[*LSRD-10GE1/0/1] commit
[~LSRD-10GE1/0/1] quit
- Verify the configuration.
# Display outbound interface status of the static route that is associated with LDP on LSRA.
[~LSRA] display static-route ldp-sync
Total number of routes enable Ldp-Sync: 1 ----------------------------------------------------- Interface 10GE1/0/1 Enable ldp-sync static routes number: 1 Static-route ldp-sync holddown timer: 20s Sync state: Normal Dest = 4.4.4.4, Mask = 32, NextHop = 10.1.1.2. -----------------------------------------------------
The command output shows that association between LDP and static routes has been configured (in Normal state).
If the LDP session on Link A fails, traffic is switched to Link B immediately to ensure association between LDP and static routes and prevent a traffic interruption.
If Link A fails and then recovers, the static route with the next hop of 10.1.1.2 is not preferentially selected until the hold-down timer (20 seconds) expires (by then the LDP session on Link A has been set up). Traffic then is switched back to Link A. In this way, association between LDP and static routes is ensured, and MPLS traffic is not interrupted.
Configuration Files
- LSRA configuration file
# sysname LSRA # mpls lsr-id 1.1.1.1 # mpls # mpls ldp # interface 10GE1/0/1 undo portswitch ip address 10.1.1.1 255.255.255.252 static-route timer ldp-sync hold-down 20 mpls mpls ldp # interface 10GE1/0/2 undo portswitch ip address 20.1.1.1 255.255.255.252 mpls mpls ldp # interface LoopBack0 ip address 1.1.1.1 255.255.255.255 # ip route-static 2.2.2.2 255.255.255.255 10GE1/0/1 10.1.1.2 ip route-static 3.3.3.3 255.255.255.255 10GE1/0/2 20.1.1.2 ip route-static 4.4.4.4 255.255.255.255 10GE1/0/1 10.1.1.2 preference 40 ldp-sync ip route-static 4.4.4.4 255.255.255.255 10GE1/0/2 20.1.1.2 ip route-static 30.1.1.0 255.255.255.252 10GE1/0/1 ip route-static 40.1.1.0 255.255.255.252 10GE1/0/2 # return
- LSRB configuration file
# sysname LSRB # mpls lsr-id 2.2.2.2 # mpls # mpls ldp # interface 10GE1/0/1 undo portswitch ip address 10.1.1.2 255.255.255.252 mpls mpls ldp # interface 10GE1/0/2 undo portswitch ip address 30.1.1.1 255.255.255.252 mpls mpls ldp # interface LoopBack0 ip address 2.2.2.2 255.255.255.255 # ip route-static 1.1.1.1 255.255.255.255 10GE1/0/1 10.1.1.1 ip route-static 4.4.4.4 255.255.255.255 10GE1/0/2 30.1.1.2 # return
- LSRC configuration file
# sysname LSRC # mpls lsr-id 3.3.3.3 # mpls # mpls ldp # interface 10GE1/0/1 undo portswitch ip address 20.1.1.2 255.255.255.252 mpls mpls ldp # interface 10GE1/0/2 undo portswitch ip address 40.1.1.1 255.255.255.252 mpls mpls ldp # interface LoopBack0 ip address 3.3.3.3 255.255.255.255 # ip route-static 1.1.1.1 255.255.255.255 10GE1/0/1 20.1.1.1 ip route-static 4.4.4.4 255.255.255.255 10GE1/0/2 40.1.1.2 # return
- LSRD configuration file
# sysname LSRD # mpls lsr-id 4.4.4.4 # mpls # mpls ldp # interface 10GE1/0/1 undo portswitch ip address 30.1.1.2 255.255.255.252 static-route timer ldp-sync hold-down 20 mpls mpls ldp # interface 10GE1/0/2 undo portswitch ip address 40.1.1.2 255.255.255.252 mpls mpls ldp # interface LoopBack0 ip address 4.4.4.4 255.255.255.255 # ip route-static 1.1.1.1 255.255.255.255 10GE1/0/1 30.1.1.1 preference 40 ldp-sync ip route-static 1.1.1.1 255.255.255.255 10GE1/0/2 40.1.1.1 ip route-static 2.2.2.2 255.255.255.255 10GE1/0/1 30.1.1.1 ip route-static 3.3.3.3 255.255.255.255 10GE1/0/2 40.1.1.1 ip route-static 10.1.1.0 255.255.255.252 10GE1/0/1 ip route-static 20.1.1.0 255.255.255.252 10GE1/0/2 # return