Example for Configuring Static BFD to Monitor Static LSPs
Networking Requirements
As shown in Figure 2-4, PEs and Ps are backbone network devices, and static LSPs have been set up on the backbone network to transmit network services.
Network services, such as VoIP, online game, and online video service, have high requirements for real-timeliness. Data loss caused by faulty links will seriously affect services. It is required that services be fast switched to the backup LSP when the primary LSP becomes faulty, minimizing packet loss. Static BFD for static LSPs is configured to fast detect static LSPs.
Configuration Roadmap
The configuration roadmap is as follows:
- Configure OSPF between the PEs and Ps to implement IP connectivity on the backbone network.
- Configure static LSPs on PEs and P to transmit network services.
- Configure static BFD on PEs to fast detect static LSPs. This is because faults on static LSPs can only be detected by static BFD.
Procedure
- Configure IP addresses for interfaces.
# Configure PE_1. The configurations of P_1, P_2, and PE_2, are similar to the configuration of PE_1, and are not mentioned here.
<Huawei> system-view [Huawei] sysname PE_1 [PE_1] interface loopback 1 [PE_1-LoopBack1] ip address 10.10.1.1 32 [PE_1-LoopBack1] quit [PE_1] interface gigabitethernet 1/0/0 [PE_1-GigabitEthernet1/0/0] ip address 10.1.1.1 24 [PE_1-GigabitEthernet1/0/0] quit [PE_1] interface gigabitethernet 2/0/0 [PE_1-GigabitEthernet2/0/0] ip address 10.3.1.1 24 [PE_1-GigabitEthernet2/0/0] quit
- Configure OSPF to advertise the network segments that the interfaces are connected to and the host route of the LSR ID.
# Configure PE_1. The configurations of P_1, P_2, and PE_2, are similar to the configuration of PE_1, and are not mentioned here.
[PE_1] ospf 1 [PE_1-ospf-1] area 0 [PE_1-ospf-1-area-0.0.0.0] network 10.10.1.1 0.0.0.0 [PE_1-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255 [PE_1-ospf-1-area-0.0.0.0] network 10.3.1.0 0.0.0.255 [PE_1-ospf-1-area-0.0.0.0] quit [PE_1-ospf-1] quit
- Set the cost of GE2/0/0 on PE_1 to 1000.
[PE_1] interface gigabitethernet 2/0/0 [PE_1-GigabitEthernet2/0/0] ospf cost 1000 [PE_1-GigabitEthernet2/0/0] quit
After the configuration is complete, run the display ip routing-table command on each node. You can see that the nodes learn routes from each other. The outbound interface of the route from PE_1 to PE_2 is GE1/0/0.
- Enable basic MPLS functions on each node.
# Configure PE_1.
[PE_1] mpls lsr-id 10.10.1.1 [PE_1] mpls [PE_1-mpls] quit
# Configure P_1.
[P_1] mpls lsr-id 10.10.1.2 [P_1] mpls [P_1-mpls] quit
# Configure P_2.
[P_2] mpls lsr-id 10.10.1.3 [P_2] mpls [P_2-mpls] quit
# Configure PE_2.
[PE_2] mpls lsr-id 10.10.1.4 [PE_2] mpls [PE_2-mpls] quit
- Enable MPLS on each interface.
# Configure PE_1.
[PE_1] interface gigabitethernet 1/0/0 [PE_1-GigabitEthernet1/0/0] mpls [PE_1-GigabitEthernet1/0/0] quit [PE_1] interface gigabitethernet 2/0/0 [PE_1-GigabitEthernet2/0/0] mpls [PE_1-GigabitEthernet2/0/0] quit
# Configure P_1.
[P_1] interface gigabitethernet 1/0/0 [P_1-GigabitEthernet1/0/0] mpls [P_1-GigabitEthernet1/0/0] quit [P_1] interface gigabitethernet 2/0/0 [P_1-GigabitEthernet2/0/0] mpls [P_1-GigabitEthernet2/0/0] quit
# Configure P_2.
[P_2] interface gigabitethernet 1/0/0 [P_2-GigabitEthernet1/0/0] mpls [P_2-GigabitEthernet1/0/0] quit [P_2] interface gigabitethernet 2/0/0 [P_2-GigabitEthernet2/0/0] mpls [P_2-GigabitEthernet2/0/0] quit
# Configure PE_2.
[PE_2] interface gigabitethernet 1/0/0 [PE_2-GigabitEthernet1/0/0] mpls [PE_2-GigabitEthernet1/0/0] quit [PE_2] interface gigabitethernet 2/0/0 [PE_2-GigabitEthernet2/0/0] mpls [PE_2-GigabitEthernet2/0/0] quit
- Create a static LSP named LSP1 with PE_1 being the ingress node, P_1 being the transit node, and PE_2 being the egress node.
# Configure ingress node PE_1.
[PE_1] static-lsp ingress LSP1 destination 10.10.1.4 32 nexthop 10.1.1.2 out-label 20
# Configure transit node P_1.
[P_1] static-lsp transit LSP1 incoming-interface gigabitethernet 1/0/0 in-label 20 nexthop 10.2.1.2 out-label 40
# Configure egress node PE_2.
[PE_2] static-lsp egress LSP1 incoming-interface gigabitethernet 1/0/0 in-label 40
- Create a static LSP named LSP2 with PE_1 being the ingress node, P_2 being the transit node, and PE_2 being the egress node.
# Configure ingress node PE_1.
[PE_1] static-lsp ingress LSP2 destination 10.10.1.4 32 nexthop 10.3.1.2 out-label 30
# Configure transit node P_2.
[P_2] static-lsp transit LSP2 incoming-interface gigabitethernet 1/0/0 in-label 30 nexthop 10.4.1.2 out-label 60
# Configure egress node PE_2.
[PE_2] static-lsp egress LSP2 incoming-interface gigabitethernet 2/0/0 in-label 60
After the configuration is complete, run the ping lsp ip 10.10.1.4 32 command on PE_1. The command output shows that the LSP can be pinged.
Run the display mpls static-lsp or display mpls static-lsp verbose command on each node to check the status and detailed information about the static LSP. Use the command output on PE_1 as an example.
[PE_1] display mpls static-lsp verbose No : 1 LSP-Name : LSP1 LSR-Type : Ingress FEC : 10.10.1.4/32 In-Label : NULL Out-Label : 20 In-Interface : - Out-Interface : GigabitEthernet1/0/0 NextHop : 10.1.1.2 Static-Lsp Type: Normal Lsp Status : Up No : 2 LSP-Name : LSP2 LSR-Type : Ingress FEC : 10.10.1.4/32 In-Label : NULL Out-Label : 30 In-Interface : - Out-Interface : GigabitEthernet2/0/0 NextHop : 10.3.1.2 Static-Lsp Type: Normal Lsp Status : Up
- Configure the BFD session to detect static LSP LSP1.
# On ingress node PE_1, configure a BFD session, with the local discriminator of 1, the remote discriminator of 2, and the minimal intervals for sending and receiving packets of 100 ms. The port state table (PST) can be modified.
[PE_1] bfd [PE_1-bfd] quit [PE_1] bfd pe1tope2 bind static-lsp LSP1 [PE_1-bfd-lsp-session-pe1tope2] discriminator local 1 [PE_1-bfd-lsp-session-pe1tope2] discriminator remote 2 [PE_1-bfd-lsp-session-pe1tope2] min-tx-interval 100 [PE_1-bfd-lsp-session-pe1tope2] min-rx-interval 100 [PE_1-bfd-lsp-session-pe1tope2] process-pst [PE_1-bfd-lsp-session-pe1tope2] commit [PE_1-bfd-lsp-session-pe1tope2] quit
# On egress node PE_2, configure a BFD session to notify PE_1 of faults on the static LSP.
[PE_2] bfd [PE_2-bfd] quit [PE_2] bfd pe2tope1 bind peer-ip 10.10.1.1 [PE_2-bfd-session-pe2tope1] discriminator local 2 [PE_2-bfd-session-pe2tope1] discriminator remote 1 [PE_2-bfd-session-pe2tope1] min-tx-interval 100 [PE_2-bfd-session-pe2tope1] min-rx-interval 100 [PE_2-bfd-session-pe2tope1] commit [PE_2-bfd-session-pe2tope1] quit
# Run the display bfd session all verbose command on PE_1 to check the configuration. The command output shows that the BFD session on PE_2 is Up.
[PE_1] display bfd session all -------------------------------------------------------------------------------- Local Remote PeerIpAddr State Type InterfaceName -------------------------------------------------------------------------------- 1 2 10.10.1.4 Up S_STA_LSP GigabitEthernet1/0/0 -------------------------------------------------------------------------------- Total UP/DOWN Session Number : 1/0
# Run the display bfd session all verbose command on PE_2 to check the configuration.
[PE_2] display bfd session all -------------------------------------------------------------------------------- Local Remote PeerIpAddr State Type InterfaceName -------------------------------------------------------------------------------- 2 1 10.10.1.1 Up S_IP_PEER - -------------------------------------------------------------------------------- Total UP/DOWN Session Number : 1/0
- Verify the configuration.
# Run the shutdown command on GE2/0/0 of P_1 to simulate a fault on a static LSP.
[P_1] interface gigabitethernet 2/0/0 [P_1-GigabitEthernet2/0/0] shutdown
# Run the display bfd session all verbose command on PE to check the status of the BFD session.
[PE_1] display bfd session all -------------------------------------------------------------------------------- Local Remote PeerIpAddr State Type InterfaceName -------------------------------------------------------------------------------- 1 2 10.10.1.4 Down S_STA_LSP - -------------------------------------------------------------------------------- Total UP/DOWN Session Number : 0/1 [PE_2] display bfd session all -------------------------------------------------------------------------------- Local Remote PeerIpAddr State Type InterfaceName -------------------------------------------------------------------------------- 2 1 10.10.1.1 Down S_IP_PEER - -------------------------------------------------------------------------------- Total UP/DOWN Session Number : 0/1
Configuration Files
PE_1 configuration file
# sysname PE_1 # bfd # mpls lsr-id 10.10.1.1 mpls # interface GigabitEthernet1/0/0 ip address 10.1.1.1 255.255.255.0 mpls # interface GigabitEthernet2/0/0 ip address 10.3.1.1 255.255.255.0 ospf cost 1000 mpls # interface LoopBack1 ip address 10.10.1.1 255.255.255.255 # bfd pe1tope2 bind static-lsp LSP1 discriminator local 1 discriminator remote 2 min-tx-interval 100 min-rx-interval 100 process-pst commit # ospf 1 area 0.0.0.0 network 10.10.1.1 0.0.0.0 network 10.1.1.0 0.0.0.255 network 10.3.1.0 0.0.0.255 # static-lsp ingress LSP1 destination 10.10.1.4 32 nexthop 10.1.1.2 out-label 20 static-lsp ingress LSP2 destination 10.10.1.4 32 nexthop 10.3.1.2 out-label 30 # return
P_1 configuration file
# sysname P_1 # mpls lsr-id 10.10.1.2 mpls # interface GigabitEthernet1/0/0 ip address 10.1.1.2 255.255.255.0 mpls # interface GigabitEthernet2/0/0 ip address 10.2.1.1 255.255.255.0 mpls # interface LoopBack1 ip address 10.10.1.2 255.255.255.255 # ospf 1 area 0.0.0.0 network 10.10.1.2 0.0.0.0 network 10.1.1.0 0.0.0.255 network 10.2.1.0 0.0.0.255 # static-lsp transit LSP1 incoming-interface GigabitEthernet1/0/0 in-label 20 nexthop 10.2.1.2 out-label 40 # return
P_2 configuration file
# sysname P_2 # bfd # mpls lsr-id 10.10.1.3 mpls # interface GigabitEthernet1/0/0 ip address 10.3.1.2 255.255.255.0 mpls # interface GigabitEthernet2/0/0 ip address 10.4.1.1 255.255.255.0 mpls # interface LoopBack1 ip address 10.10.1.3 255.255.255.255 # ospf 1 area 0.0.0.0 network 10.10.1.3 0.0.0.0 network 10.3.1.0 0.0.0.255 network 10.4.1.0 0.0.0.255 # static-lsp transit LSP2 incoming-interface GigabitEthernet1/0/0 in-label 30 nexthop 10.4.1.2 out-label 60 # return
PE_2 configuration file
# sysname PE_2 # bfd # mpls lsr-id 10.10.1.4 mpls # interface GigabitEthernet1/0/0 ip address 10.2.1.2 255.255.255.0 mpls # interface GigabitEthernet2/0/0 ip address 10.4.1.2 255.255.255.0 mpls # interface LoopBack1 ip address 10.10.1.4 255.255.255.255 # bfd pe2tope1 bind peer-ip 10.10.1.1 discriminator local 2 discriminator remote 1 min-tx-interval 100 min-rx-interval 100 commit # ospf 1 area 0.0.0.0 network 10.10.1.4 0.0.0.0 network 10.2.1.0 0.0.0.255 network 10.4.1.0 0.0.0.255 # static-lsp egress LSP1 incoming-interface GigabitEthernet1/0/0 in-label 40 static-lsp egress LSP2 incoming-interface GigabitEthernet2/0/0 in-label 60 # return