< Home

Example for Configuring EFM for Static IPv4 Routes

Networking Requirements

In Figure 1, SwitchA connects to the NMS across a network segment through SwitchB. SwitchA communicates with the NMS using static routes. SwitchA and SwitchB need to detect the link quality in real time. When the link between them becomes faulty, the corresponding static route will be deleted from the IP routing table. Traffic is then switched from the route using the faulty link to a working route to improve network reliability.

Figure 1 Configuring EFM for IPv4 static routes

Configuration Roadmap

The configuration roadmap is as follows:

  1. Enable Ethernet in the First Mile (EFM) OAM globally and on interfaces of SwitchA and SwitchB to implement real-time link quality detection.

  2. Configure a static route from SwitchA to the NMS and bind the static route to the EFM state to associate the static route with EFM. When a link where the static route resides becomes faulty, traffic is switched to a route without link faults.

Procedure

  1. Configure VLANs and add interfaces to the VLANs.

    # Configure SwitchA. The configuration of SwitchB is similar to that of SwitchA.

    <HUAWEI> system-view
    [HUAWEI] sysname SwitchA
    [SwitchA] vlan 10
    [SwitchA-vlan10] quit
    [SwitchA] interface gigabitethernet 0/0/1
    [SwitchA-GigabitEthernet0/0/1] port link-type trunk
    [SwitchA-GigabitEthernet0/0/1] port trunk allow-pass vlan 10
    [SwitchA-GigabitEthernet0/0/1] quit
    

  2. Configure IP addresses for VLANIF interfaces.

    # Configure SwitchA. The configuration of SwitchB is similar to that of SwitchA.

    [SwitchA] interface vlanif 10
    [SwitchA-Vlanif10] ip address 192.168.1.1 24
    [SwitchA-Vlanif10] quit

  3. Configure an EFM session between SwitchA and SwitchB.

    # Enable EFM OAM on SwitchA.

    [SwitchA] efm enable
    [SwitchA] interface gigabitethernet 0/0/1
    [SwitchA-GigabitEthernet0/0/1] efm enable
    [SwitchA-GigabitEthernet0/0/1] quit
    

    # Enable EFM OAM on SwitchB.

    [SwitchB] efm enable
    [SwitchB] interface gigabitethernet 0/0/1
    [SwitchB-GigabitEthernet0/0/1] efm enable
    [SwitchB-GigabitEthernet0/0/1] quit

  4. Configure a static route and bind it to the EFM state.

    # Configure a static route from SwitchA to an external network and bind it to the EFM state of GigabitEthernet0/0/1.

    [SwitchA] ip route-static 192.168.2.0 24 192.168.1.2 track efm-state gigabitethernet0/0/1

  5. Verify the configuration.

    # After the configuration is complete, run the display efm session all command on SwitchA and SwitchB. The command output shows that an EFM session has been set up and is in detect mode. That is, the interface is in handshake state. The following uses the display on SwitchA as an example.

    [SwitchA] display efm session all
      Interface                 EFM State                   Loopback Timeout
      ----------------------------------------------------------------------
      GigabitEthernet0/0/1      detect                      --

    # Check the IP routing table on SwitchA. The IP routing table contains the static route 192.168.2.0/24.

    [SwitchA] display ip routing-table
    Route Flags: R - relay, D - download to fib, T - to vpn-instance
    ------------------------------------------------------------------------------
    Routing Tables: Public
             Destinations : 5       Routes : 5       
    
    Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
    
          127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
          127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
        192.168.1.0/24  Direct  0    0           D   192.168.1.1     Vlanif10
        192.168.1.1/32  Direct  0    0           D   127.0.0.1       Vlanif10
        192.168.2.0/24  Static  60   0          RD   192.168.1.2     Vlanif10

    # Run the undo efm enable command in the view of GigabitEthernet0/0/1 on SwitchB to simulate a link fault.

    [SwitchB] interface gigabitethernet 0/0/1
    [SwitchB-GigabitEthernet0/0/1] undo efm enable

    # Run the display efm session all command on SwitchA. The command output shows that the EFM OAM protocol state is discovery, indicating that the interface is in OAM discovery state.

    [SwitchA] display efm session all
      Interface                 EFM State                   Loopback Timeout
      ----------------------------------------------------------------------
      GigabitEthernet0/0/1      discovery                   --

    # Check the IP routing table on SwitchA. The IP routing table does not contain the static route 192.168.2.0/24. This is because the static route has been bound to the EFM state, and EFM OAM rapidly notifies SwitchA that the static route becomes unavailable after detecting a link fault.

    [SwitchA] display ip routing-table
    Route Flags: R - relay, D - download to fib, T - to vpn-instance
    ------------------------------------------------------------------------------
    Routing Tables: Public
             Destinations : 4       Routes : 4       
    
    Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
    
          127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
          127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
        192.168.1.0/24  Direct  0    0           D   192.168.1.1     Vlanif10
        192.168.1.1/32  Direct  0    0           D   127.0.0.1       Vlanif10
    

    # Run the efm enable command in the view of GigabitEthernet0/0/1 on SwitchB to simulate link recovery.

    [SwitchB-GigabitEthernet0/0/1]efm enable

    # Run the display efm session all command on SwitchA. The command output shows that the EFM OAM protocol state is detect, indicating that the interface is in handshake state again.

    [SwitchA] display efm session all
      Interface                 EFM State                   Loopback Timeout
      ----------------------------------------------------------------------
      GigabitEthernet0/0/1      detect                      --

    # Check the IP routing table on SwitchA. The IP routing table contains the static route 192.168.2.0/24 again. This is because EFM OAM rapidly notifies that the bound static route becomes reachable again after detecting link recovery.

    [SwitchA] display ip routing-table
    Route Flags: R - relay, D - download to fib, T - to vpn-instance
    ------------------------------------------------------------------------------
    Routing Tables: Public
             Destinations : 5       Routes : 5       
    
    Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
    
          127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
          127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
        192.168.1.0/24  Direct  0    0           D   192.168.1.1     Vlanif10
        192.168.1.1/32  Direct  0    0           D   127.0.0.1       Vlanif10
        192.168.2.0/24  Static  60   0          RD   192.168.1.2     Vlanif10

Configuration Files

  • SwitchA configuration file

    # 
    sysname SwitchA
    #
    vlan batch 10
    #
    efm enable
    #
    interface Vlanif10
     ip address 192.168.1.1 255.255.255.0
    #
    interface GigabitEthernet0/0/1
     port link-type trunk
     port trunk allow-pass vlan 10
     efm enable
    #
    ip route-static 192.168.2.0 255.255.255.0 192.168.1.2 track efm-state GigabitEthernet0/0/1
    #
    return
  • SwitchB configuration file

    #
    sysname SwitchB
    #
    vlan batch 10 20
    #
    efm enable
    #
    interface Vlanif10
     ip address 192.168.1.2 255.255.255.0
    #
    interface Vlanif20
     ip address 192.168.2.2 255.255.255.0
    #
    interface GigabitEthernet0/0/1
     port link-type trunk
     port trunk allow-pass vlan 10
     efm enable
    #
    interface GigabitEthernet0/0/2
     port link-type trunk
     port trunk allow-pass vlan 20
    #
    return
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >