As shown in Figure 1, 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-timeness. 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.
In this scenario, to avoid loops, ensure that all connected interfaces have STP disabled and connected interfaces are removed from VLAN 1. If STP is enabled and VLANIF interfaces of switches are used to construct a Layer 3 ring network, an interface on the network will be blocked. As a result, Layer 3 services on the network cannot run normally.
The configuration roadmap is as follows:
# 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 1.1.1.9 32 [PE_1-LoopBack1] quit [PE_1] vlan batch 100 300 [PE_1] interface vlanif 100 [PE_1-Vlanif100] ip address 172.1.1.1 24 [PE_1-Vlanif100] quit [PE_1] interface vlanif 300 [PE_1-Vlanif300] ip address 172.3.1.1 24 [PE_1-Vlanif300] quit [PE_1] interface gigabitethernet0/0/1 [PE_1-GigabitEthernet0/0/1] port link-type trunk [PE_1-GigabitEthernet0/0/1] port trunk allow-pass vlan 100 [PE_1-GigabitEthernet0/0/1] quit [PE_1] interface gigabitethernet0/0/2 [PE_1-GigabitEthernet0/0/2] port link-type trunk [PE_1-GigabitEthernet0/0/2] port trunk allow-pass vlan 300 [PE_1-GigabitEthernet0/0/2] quit
# 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 1.1.1.9 0.0.0.0 [PE_1-ospf-1-area-0.0.0.0] network 172.1.1.0 0.0.0.255 [PE_1-ospf-1-area-0.0.0.0] network 172.3.1.0 0.0.0.255 [PE_1-ospf-1-area-0.0.0.0] quit [PE_1-ospf-1] quit
[PE_1] interface vlanif 300 [PE_1-Vlanif300] ospf cost 1000 [PE_1-Vlanif300] 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 VLANIF 100.
# Configure PE_1.
[PE_1] mpls lsr-id 1.1.1.9 [PE_1] mpls [PE_1-mpls] quit
# Configure P_1.
[P_1] mpls lsr-id 2.2.2.9 [P_1] mpls [P_1-mpls] quit
# Configure P_2.
[P_2] mpls lsr-id 3.3.3.9 [P_2] mpls [P_2-mpls] quit
# Configure PE_2.
[PE_2] mpls lsr-id 4.4.4.9 [PE_2] mpls [PE_2-mpls] quit
# Configure PE_1.
[PE_1] interface vlanif 100 [PE_1-Vlanif100] mpls [PE_1-Vlanif100] quit [PE_1] interface vlanif 300 [PE_1-Vlanif300] mpls [PE_1-Vlanif300] quit
# Configure P_1.
[P_1] interface vlanif 100 [P_1-Vlanif100] mpls [P_1-Vlanif100] quit [P_1] interface vlanif 200 [P_1-Vlanif200] mpls [P_1-Vlanif200] quit
# Configure P_2.
[P_2] interface vlanif 300 [P_2-Vlanif300] mpls [P_2-Vlanif300] quit [P_2] interface vlanif 400 [P_2-Vlanif400] mpls [P_2-Vlanif400] quit
# Configure PE_2.
[PE_2] interface vlanif 200 [PE_2-Vlanif200] mpls [PE_2-Vlanif200] quit [PE_2] interface vlanif 400 [PE_2-Vlanif400] mpls [PE_2-Vlanif400] quit
# Configure ingress node PE_1.
[PE_1] static-lsp ingress LSP1 destination 4.4.4.9 32 nexthop 172.1.1.2 out-label 20
# Configure transit node P_1.
[P_1] static-lsp transit LSP1 incoming-interface vlanif 100 in-label 20 nexthop 172.2.1.2 out-label 40
# Configure egress node PE_2.
[PE_2] static-lsp egress LSP1 incoming-interface vlanif 200 in-label 40
# Configure ingress node PE_1.
[PE_1] static-lsp ingress LSP2 destination 4.4.4.9 32 nexthop 172.3.1.2 out-label 30
# Configure transit node P_2.
[P_2] static-lsp transit LSP2 incoming-interface vlanif 300 in-label 30 nexthop 172.4.1.2 out-label 60
# Configure egress node PE_2.
[PE_2] static-lsp egress LSP2 incoming-interface vlanif 400 in-label 60
After the configuration is complete, run the ping lsp ip 4.4.4.9 32 command on PE_1. The command output shows that the LSP can be pinged.
Run the display mpls static-lsp verbose command on each node to check the 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 : 4.4.4.9/32 In-Label : NULL Out-Label : 20 In-Interface : - Out-Interface : Vlanif100 NextHop : 172.1.1.2 Static-Lsp Type: Normal Lsp Status : Up No : 2 LSP-Name : LSP2 LSR-Type : Ingress FEC : 4.4.4.9/32 In-Label : NULL Out-Label : 30 In-Interface : - Out-Interface : Vlanif300 NextHop : 172.3.1.2 Static-Lsp Type: Normal Lsp Status : Down
# On ingress node PE_1, configure a BFD session, with the local discriminator of 1, the remote discriminator of 2, and the 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 1.1.1.9 [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 command on PE_1 to check the configuration. The command output shows that the BFD session on PE_1 is Up.
[PE_1] display bfd session all -------------------------------------------------------------------------------- Local Remote PeerIpAddr State Type InterfaceName -------------------------------------------------------------------------------- 1 2 4.4.4.9 Up S_STA_LSP - -------------------------------------------------------------------------------- Total UP/DOWN Session Number : 1/0
# Run the display bfd session all command on PE_2 to check the configuration.
[PE_2] display bfd session all -------------------------------------------------------------------------------- Local Remote PeerIpAddr State Type InterfaceName -------------------------------------------------------------------------------- 2 1 1.1.1.9 Up S_IP_PEER - -------------------------------------------------------------------------------- Total UP/DOWN Session Number : 1/0
# Run the shutdown command on GE0/0/2 of P_1 to simulate a fault on a static LSP.
[P_1] interface gigabitethernet0/0/2 [P_1-GigabitEthernet0/0/2] shutdown
# Run the display bfd session all command on PE to check the status of the BFD session.
[PE_2] display bfd session all -------------------------------------------------------------------------------- Local Remote PeerIpAddr State Type InterfaceName -------------------------------------------------------------------------------- 2 1 1.1.1.9 Down S_IP_PEER - -------------------------------------------------------------------------------- Total UP/DOWN Session Number : 0/1
PE_1 configuration file
# sysname PE_1 # vlan batch 100 300 # bfd # mpls lsr-id 1.1.1.9 mpls # interface Vlanif100 ip address 172.1.1.1 255.255.255.0 mpls # interface Vlanif300 ip address 172.3.1.1 255.255.255.0 ospf cost 1000 mpls # interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 100 # interface GigabitEthernet0/0/2 port link-type trunk port trunk allow-pass vlan 300 # interface LoopBack1 ip address 1.1.1.9 255.255.255.255 # ospf 1 area 0.0.0.0 network 1.1.1.9 0.0.0.0 network 172.1.1.0 0.0.0.255 network 172.3.1.0 0.0.0.255 # static-lsp ingress LSP1 destination 4.4.4.9 32 nexthop 172.1.1.2 out-label 20 static-lsp ingress LSP2 destination 4.4.4.9 32 nexthop 172.3.1.2 out-label 30 # bfd pe1tope2 bind static-lsp LSP1 discriminator local 1 discriminator remote 2 min-tx-interval 100 min-rx-interval 100 process-pst commit # return
P_1 configuration file
# sysname P_1 # vlan batch 100 200 # mpls lsr-id 2.2.2.9 mpls # interface Vlanif100 ip address 172.1.1.2 255.255.255.0 mpls # interface Vlanif200 ip address 172.2.1.1 255.255.255.0 mpls # interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 100 # interface GigabitEthernet0/0/2 port link-type trunk port trunk allow-pass vlan 200 # interface LoopBack1 ip address 2.2.2.9 255.255.255.255 # ospf 1 area 0.0.0.0 network 2.2.2.9 0.0.0.0 network 172.1.1.0 0.0.0.255 network 172.2.1.0 0.0.0.255 # static-lsp transit LSP1 incoming-interface Vlanif100 in-label 20 nexthop 172.2.1.2 out-label 40 # return
P_2 configuration file
# sysname P_2 # vlan batch 300 400 # mpls lsr-id 3.3.3.9 mpls # interface Vlanif300 ip address 172.3.1.2 255.255.255.0 mpls # interface Vlanif400 ip address 172.4.1.1 255.255.255.0 mpls # interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 300 # interface GigabitEthernet0/0/2 port link-type trunk port trunk allow-pass vlan 400 # interface LoopBack1 ip address 3.3.3.9 255.255.255.255 # ospf 1 area 0.0.0.0 network 3.3.3.9 0.0.0.0 network 172.3.1.0 0.0.0.255 network 172.4.1.0 0.0.0.255 # static-lsp transit LSP2 incoming-interface Vlanif300 in-label 30 nexthop 172.4.1.2 out-label 60 # return
PE_2 configuration file
# sysname PE_2 # vlan batch 200 400 # bfd # mpls lsr-id 4.4.4.9 mpls # interface Vlanif200 ip address 172.2.1.2 255.255.255.0 mpls # interface Vlanif400 ip address 172.4.1.2 255.255.255.0 mpls # interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 200 # interface GigabitEthernet0/0/2 port link-type trunk port trunk allow-pass vlan 400 # interface LoopBack1 ip address 4.4.4.9 255.255.255.255 # bfd pe2tope1 bind peer-ip 1.1.1.9 discriminator local 2 discriminator remote 1 min-tx-interval 100 min-rx-interval 100 commit # ospf 1 area 0.0.0.0 network 4.4.4.9 0.0.0.0 network 172.2.1.0 0.0.0.255 network 172.4.1.0 0.0.0.255 # static-lsp egress LSP1 incoming-interface Vlanif200 in-label 40 static-lsp egress LSP2 incoming-interface Vlanif400 in-label 60 # return