No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

CX11x, CX31x, CX710 (Earlier Than V6.03), and CX91x Series Switch Modules V100R001C10 Configuration Guide 12

The documents describe the configuration of various services supported by the CX11x&CX31x&CX91x series switch modules The description covers configuration examples and function configurations.
Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
Configuration Examples

Configuration Examples

This section provides configuration examples of static routes. Configuration examples explain networking requirements, networking diagram, configuration notes, configuration roadmap, and configuration procedure.

Example for Configuring IPv4 Static Routes

Networking Requirements

Servers on different network segments are connected using several Switch Modules. Each two servers on different network segments can communicate with each other without using dynamic routing protocols.

Figure 7-10 Networking diagram of configuring IPv4 static routes

Configuration Roadmap

The configuration roadmap is as follows:

  1. Create VLANs, add interfaces to the VLANs, and assign IPv4 addresses to VLANIF interfaces so that directly-connected interfaces can communicate with each other.
  2. Configure the default gateway on each server, and configure IPv4 static routes and default routes on each Switch Module so that servers on different network segments can communicate with each other.

Procedure

  1. Create VLANs and add interfaces to the VLANs.

    <HUAWEI> system-view
    [~HUAWEI] sysname Switch ModuleA
    [*HUAWEI] commit
    [~Switch ModuleA] vlan 10
    [*Switch ModuleA-vlan10] quit
    [*Switch ModuleA] vlan 30
    [*Switch ModuleA-vlan30] quit
    [*Switch ModuleA] interface 10ge 1/17/1
    [*Switch ModuleA-10GE1/17/1] port link-type trunk
    [*Switch ModuleA-10GE1/17/1] port trunk allow-pass vlan 10
    [*Switch ModuleA-10GE1/17/1] quit
    [*Switch ModuleA] interface 10ge 1/17/2
    [*Switch ModuleA-10GE1/17/2] port default vlan 30
    [*Switch ModuleA-10GE1/17/2] quit
    [*Switch ModuleA] commit

    The configurations of Switch ModuleB and Switch ModuleC are similar to the configuration of Switch ModuleA, and are not mentioned here.

  2. Assign IPv4 addresses to the VLANIF interfaces.

    [~Switch ModuleA] interface vlanif 10
    [*Switch ModuleA-Vlanif10] ip address 1.1.4.1 30
    [*Switch ModuleA-Vlanif10] quit
    [*Switch ModuleA] interface vlanif 30
    [*Switch ModuleA-Vlanif30] ip address 1.1.1.1 24
    [*Switch ModuleA-Vlanif30] quit
    [*Switch ModuleA] commit

    The configurations of Switch ModuleB and Switch ModuleC are similar to the configuration of Switch ModuleA, and are not mentioned here.

  3. Configure servers.

    Set the Server1 default gateway to 1.1.1.1, the Server2 default gateway to 1.1.2.1, and the Server3 default gateway to 1.1.3.1.

  4. Configure static routes.

    # Configure an IPv4 default route on Switch ModuleA.

    [~Switch ModuleA] ip route-static 0.0.0.0 0.0.0.0 1.1.4.2
    [*Switch ModuleA] commit

    # Configure two IPv4 static routes on Switch ModuleB.

    [~Switch ModuleB] ip route-static 1.1.1.0 255.255.255.0 1.1.4.1
    [*Switch ModuleB] ip route-static 1.1.3.0 255.255.255.0 1.1.4.6
    [*Switch ModuleB] commit

    # Configure an IPv4 default route on Switch ModuleC.

    [~Switch ModuleC] ip route-static 0.0.0.0 0.0.0.0 1.1.4.5
    [*Switch ModuleC] commit

  5. Verify the configuration.

    # Check the routing table on Switch ModuleA.

    [~Switch ModuleA] display ip routing-table
    Proto: Protocol        Pre: Preference
    Route Flags: R - relay, D - download to fib, T - to vpn-instance
    ------------------------------------------------------------------------------
    Routing Table: _public_
             Destinations : 10        Routes : 10
     
    Destination/Mask    Proto  Pre  Cost   Flags   NextHop      Interface
     
            0.0.0.0/0   Static 60   0        RD    1.1.4.2      Vlanif10
            1.1.1.0/24  Direct 0    0         D    1.1.1.1      Vlanif30
            1.1.1.1/32  Direct 0    0         D    127.0.0.1    Vlanif30
            1.1.4.0/30  Direct 0    0         D    1.1.4.1      Vlanif10
            1.1.4.1/32  Direct 0    0         D    127.0.0.1    Vlanif10
            1.1.4.2/32  Direct 0    0         D    1.1.4.2      Vlanif10
           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
    127.255.255.255/32  Direct 0    0         D    127.0.0.1    InLoopBack0
    255.255.255.255/32  Direct 0    0         D    127.0.0.1    InLoopBack0 

    # Run the ping command to verify the connectivity.

    [~Switch ModuleA] ping 1.1.3.1
      PING 1.1.3.1: 56  data bytes, press CTRL_C to break
        Reply from 1.1.3.1: bytes=56 Sequence=1 ttl=254 time=62 ms
        Reply from 1.1.3.1: bytes=56 Sequence=2 ttl=254 time=63 ms
        Reply from 1.1.3.1: bytes=56 Sequence=3 ttl=254 time=63 ms
        Reply from 1.1.3.1: bytes=56 Sequence=4 ttl=254 time=62 ms
        Reply from 1.1.3.1: bytes=56 Sequence=5 ttl=254 time=62 ms
     
      --- 1.1.3.1 ping statistics ---
        5 packet(s) transmitted
        5 packet(s) received
        0.00% packet loss
        round-trip min/avg/max = 62/62/63 ms

Configuration Files
  • Configuration file of Switch ModuleA

    #
    sysname Switch ModuleA
    #
    vlan batch 10 30
    #
    interface Vlanif10
     ip address 1.1.4.1 255.255.255.252
    #
    interface Vlanif30
     ip address 1.1.1.1 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 10
    #
    interface 10GE1/17/2
     port default vlan 30
    #
    ip route-static 0.0.0.0 0.0.0.0 1.1.4.2
    #
    return
  • Configuration file of Switch ModuleB

    #
    sysname Switch ModuleB
    #
    vlan batch 10 20 40
    #
    interface Vlanif10
     ip address 1.1.4.2 255.255.255.252
    #
    interface Vlanif20
     ip address 1.1.4.5 255.255.255.252
    #
    interface Vlanif40
     ip address 1.1.2.1 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 10
    #
    interface 10GE1/17/2
     port link-type trunk
     port trunk allow-pass vlan 20
    #
    interface 10GE1/17/3
     port default vlan 40
    #
    ip route-static 1.1.1.0 255.255.255.0 1.1.4.1
    ip route-static 1.1.3.0 255.255.255.0 1.1.4.6
    #
    return
  • Configuration file of Switch ModuleC

    #
    sysname Switch ModuleC
    #
    vlan batch 20 50
    #
    interface Vlanif20
     ip address 1.1.4.6 255.255.255.252
    #
    interface Vlanif50
     ip address 1.1.3.1 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 20
    #
    interface 10GE1/17/2
     port default vlan 50
    #
    ip route-static 0.0.0.0 0.0.0.0 1.1.4.5
    #
    return

Example for Configuring IPv6 Static Routes

Networking requirements

In an IPv6 network, hosts in different network segments are connected through several Switch Modules. Each two hosts in different network segments are required to communicate with each other without using dynamic routing protocols.

Figure 7-11 Networking diagram of configuring IPv6 static routes

Configuration Roadmap

The configuration roadmap is as follows:

  1. Create VLANs, add interfaces to the VLANs, and assign IPv6 addresses to VLANIF interfaces so that devices can communicate with each other.
  2. Configure the default IPv6 gateway on each host, and configure IPv6 static routes and default static routes on each Switch Module so that hosts in different network segments can communicate with each other without using dynamic routing protocols.

Procedure

  1. Add interfaces to VLANs.

    <HUAWEI> system-view
    [~HUAWEI] sysname Switch ModuleA
    [*Switch ModuleA] vlan batch 10 20
    [~Switch ModuleA] interface 10ge 1/17/2
    [*Switch ModuleA-10GE1/17/2] port link-type hybrid
    [*Switch ModuleA-10GE1/17/2] port hybrid pvid vlan 10
    [*Switch ModuleA-10GE1/17/2] port hybrid untagged vlan 10
    [*Switch ModuleA-10GE1/17/2] commit
    [~Switch ModuleA-10GE1/17/2] quit
    [~Switch ModuleA] interface 10ge 1/17/1
    [~Switch ModuleA-10GE1/17/1] port link-type hybrid
    [*Switch ModuleA-10GE1/17/1] port hybrid pvid vlan 20
    [*Switch ModuleA-10GE1/17/1] port hybrid untagged vlan 20
    [*Switch ModuleA-10GE1/17/1] commit
    [~Switch ModuleA-10GE1/17/1] quit

    The configurations of Switch ModuleB and Switch ModuleC are the same as the configuration of Switch ModuleA. The detailed configurations are not mentioned here.

  2. Assign IP addresses to the VLANIF interfaces.

    [~Switch ModuleA] interface vlanif 10
    [*Switch ModuleA-Vlanif10] ipv6 enable
    [*Switch ModuleA-Vlanif10] ipv6 address 1::1/64
    [*Switch ModuleA-Vlanif10] commit
    [*Switch ModuleA-Vlanif10] quit
    [*Switch ModuleA] interface vlanif 20
    [*Switch ModuleA-Vlanif20] ipv6 enable
    [*Switch ModuleA-Vlanif20] ipv6 address 4::1/64
    [*Switch ModuleA-Vlanif20] commit
    [~Switch ModuleA-Vlanif20] quit

    The configurations of Switch ModuleB and Switch ModuleC are the same as the configuration of Switch ModuleA. The detailed configurations are not mentioned here.

  3. Configure the host addresses and gateways.

    Configure an IPv6 address for each host according to the networking diagram. Configure the default gateway of PC1 to 1::1, that of PC2 to 2::1, and that of Host3 to 3::1.

  4. Configure static IPv6 routes.

    # Configure default IPv6 routes on Switch ModuleA.

    [~Switch ModuleA] ipv6 route-static :: 0 vlanif20 4::2
    [*Switch ModuleA] commit

    # Configure two IPv6 static routes on Switch ModuleB.

    [~Switch ModuleB] ipv6 route-static 1:: 64 vlanif20 4::1
    [*Switch ModuleB] ipv6 route-static 3:: 64 vlanif40 5::1
    [*Switch ModuleB] commit

    # Configure default IPv6 routes on Switch ModuleC.

    [~Switch ModuleC] ipv6 route-static :: 0 vlanif40 5::2
    [*Switch ModuleC] commit

  5. Verify the configuration.

    # Check the IPv6 routing table on Switch ModuleA.

    [~Switch ModuleA] display ipv6 routing-table
    Routing Table : _public_                                                                                                            
             Destinations : 6        Routes : 6                                                                                         
                                                                                                                                        
    Destination  : ::                                      PrefixLength : 0                                                             
    NextHop      : 4::2                                    Preference   : 60                                                            
    Cost         : 0                                       Protocol     : Static                                                        
    RelayNextHop : ::                                      TunnelID     : 0x0                                                           
    Interface    : Vlanif20                                Flags        : D                                                             
                                                                                                                                        
    Destination  : 1::                                     PrefixLength : 64                                                            
    NextHop      : 1::1                                    Preference   : 0                                                             
    Cost         : 0                                       Protocol     : Direct                                                        
    RelayNextHop : ::                                      TunnelID     : 0x0                                                           
    Interface    : Vlanif10                                Flags        : D                                                             
                                                                                                                                        
    Destination  : 1::1                                    PrefixLength : 128                                                           
    NextHop      : ::1                                     Preference   : 0                                                             
    Cost         : 0                                       Protocol     : Direct                                                        
    RelayNextHop : ::                                      TunnelID     : 0x0                                                           
    Interface    : Vlanif10                                Flags        : D                                                             
                                                                                                                                        
    Destination  : 4::                                     PrefixLength : 64                                                            
    NextHop      : 4::1                                    Preference   : 0                                                             
    Cost         : 0                                       Protocol     : Direct                                                        
    RelayNextHop : ::                                      TunnelID     : 0x0                                                           
    Interface    : Vlanif20                                Flags        : D                                                             
                                                                                                                                        
    Destination  : 4::1                                    PrefixLength : 128                                                           
    NextHop      : ::1                                     Preference   : 0                                                             
    Cost         : 0                                       Protocol     : Direct                                                        
    RelayNextHop : ::                                      TunnelID     : 0x0                                                           
    Interface    : Vlanif20                                Flags        : D                                                             
                                                                                                                                        
    Destination  : FE80::                                  PrefixLength : 10                                                            
    NextHop      : ::                                      Preference   : 0                                                             
    Cost         : 0                                       Protocol     : Direct                                                        
    RelayNextHop : ::                                      TunnelID     : 0x0                                                           
    Interface    : NULL0                                   Flags        : D  

    # Run the ping command.

    [~Switch ModuleA] ping ipv6 3::1
      PING 3::1 : 56  data bytes, press CTRL_C to break
        Reply from 3::1
        bytes=56 Sequence=1 hop limit=63  time = 63 ms
        Reply from 3::1
        bytes=56 Sequence=2 hop limit=63  time = 62 ms
        Reply from 3::1
        bytes=56 Sequence=3 hop limit=63  time = 62 ms
        Reply from 3::1
        bytes=56 Sequence=4 hop limit=63  time = 63 ms
        Reply from 3::1
        bytes=56 Sequence=5 hop limit=63  time = 63 ms
    
      --- 3::1 ping statistics ---
        5 packet(s) transmitted
        5 packet(s) received
        0.00% packet loss
        round-trip min/avg/max = 62/62/63 ms

    # Run the tracert command.

    [~Switch ModuleA] tracert ipv6 3::1
     traceroute to 3::1  30 hops max,60 bytes packet
     1 4::2 31 ms  32 ms  31 ms
     2 3::1 62 ms  63 ms  62 ms

Configuration Files
  • Configuration file of Switch ModuleA

    #
    sysname Switch ModuleA
    #
    vlan batch 10 20
    #
    interface Vlanif10
     ipv6 enable
     ipv6 address 1::1/64
    #
    interface Vlanif20
     ipv6 enable
     ipv6 address 4::1/64
    #
    interface 10GE1/17/1
     port link-type hybrid
     port hybrid pvid vlan 20
     port hybrid untagged vlan 20
    #
    interface 10GE1/17/2
     port link-type hybrid
     port hybrid pvid vlan 10
     port hybrid untagged vlan 10
    #
    ipv6 route-static :: 0 vlanif20 4::2
    #
    return
  • Configuration file of Switch ModuleB

    #
    sysname Switch ModuleB
    #
    vlan batch 20 30 40
    #
    interface Vlanif20
     ipv6 enable
     ipv6 address 4::2/64
    #
    interface Vlanif30
     ipv6 enable
     ipv6 address 2::1/64
    #
    interface Vlanif40
     ipv6 enable
     ipv6 address 5::2/64
    #
    interface 10GE1/17/1
     port link-type hybrid
     port hybrid pvid vlan 20
     port hybrid untagged vlan 20
    #
    interface 10GE1/17/2
     port link-type hybrid
     port hybrid pvid vlan 40
     port hybrid untagged vlan 40
    #
    interface 10GE1/17/3
     port link-type hybrid
     port hybrid pvid vlan 30
     port hybrid untagged vlan 30
    #
    ipv6 route-static 1:: 64 Vlanif20 4::1
    ipv6 route-static 3:: 64 Vlanif40 5::1
    #
    return
  • Configuration file of Switch ModuleC

    #
    sysname Switch ModuleC
    #
    vlan batch 40 50
    #
    interface Vlanif40
     ipv6 enable
     ipv6 address 5::1/64
    #
    interface Vlanif50
     ipv6 enable
     ipv6 address 3::1/64
    #
    interface 10GE1/17/1
     port link-type hybrid
     port hybrid pvid vlan 40
     port hybrid untagged vlan 40
    #
    interface 10GE1/17/2
     port link-type hybrid
     port hybrid pvid vlan 50
     port hybrid untagged vlan 50
    #
    ipv6 route-static :: 0 Vlanif40 5::2
    #
    return

Example for Configuring Dynamic BFD for IPv4 Static Routes

Networking Requirements

As shown in Figure 7-12, a static route with destination address 8.1.1.0/24 is configured on Switch ModuleA, and static routes with destination address 7.1.1.0/24 are configured on Switch ModuleA and Switch ModuleB. To improve convergence speed, users require link faults between Switch ModuleA and Switch ModuleB to be detected at the millisecond level.

Figure 7-12 Networking diagram of configuring dynamic BFD for IPv4 static routes

Configuration Roadmap

The configuration roadmap is as follows:

  1. Configure dynamic BFD for IPv4 static routes to implement link fault detection at the millisecond level between Switch ModuleA and Switch ModuleB. This configuration can improve convergence speed of static routes.

Procedure

  1. Add interfaces to VLANs.

    <HUAWEI> system-view
    [~HUAWEI] sysname Switch ModuleA
    [*HUAWEI] commit
    [~Switch ModuleA] vlan 10
    [*Switch ModuleA-vlan10] quit
    [*Switch ModuleA] interface 10ge 1/17/1
    [*Switch ModuleA-10GE1/17/1] port link-type trunk
    [*Switch ModuleA-10GE1/17/1] port trunk allow-pass vlan 10
    [*Switch ModuleA-10GE1/17/1] quit
    [*Switch ModuleA] vlan 20
    [*Switch ModuleA-vlan20] quit
    [*Switch ModuleA] interface 10ge 1/17/2
    [*Switch ModuleA-10GE1/17/2] port link-type trunk
    [*Switch ModuleA-10GE1/17/2] port trunk allow-pass vlan 20
    [*Switch ModuleA-10GE1/17/2] quit
    [*Switch ModuleA] commit
    

    The configuration of Switch ModuleB is similar to the configuration of Switch ModuleA, and is not mentioned here.

  2. Assign IP addresses to the VLANIF interfaces.

    [~Switch ModuleA] interface vlanif 10
    [*Switch ModuleA-Vlanif10] ip address 200.1.1.1 24
    [*Switch ModuleA-Vlanif10] quit
    [*Switch ModuleA] interface vlanif 20
    [*Switch ModuleA-Vlanif10] ip address 7.1.1.1 24
    [*Switch ModuleA-Vlanif10] quit
    [*Switch ModuleA] commit

    The configuration of Switch ModuleB is similar to the configuration of Switch ModuleA, and is not mentioned here.

  3. Configure static routes.

    # Configure a static route to 8.1.1.1/24 on Switch ModuleA.

    [~Switch ModuleA] ip route-static 8.1.1.1 24 200.1.1.2
    [*Switch ModuleA] commit

    # Configure a static route to 7.1.1.1/24 on Switch ModuleB.

    [~Switch ModuleB] ip route-static 7.1.1.1 24 200.1.1.1
    [*Switch ModuleB] commit

  4. Configure dynamic BFD for static routes.

    # Bind a static route to a BFD session on Switch ModuleA.

    [~Switch ModuleA] bfd
    [*Switch ModuleA-bfd] quit
    [*Switch ModuleA] ip route-static bfd 200.1.1.2 local-address 200.1.1.1
    [*Switch ModuleA] ip route-static 8.1.1.1 24.1.1.2 bfd enable
    [*Switch ModuleA] commit

    # Bind a static route to a BFD session on Switch ModuleB.

    [~Switch ModuleB] bfd
    [*Switch ModuleB-bfd] quit
    [*Switch ModuleB] ip route-static bfd 200.1.1.1 local-address 200.1.1.2
    [*Switch ModuleB] ip route-static 7.1.1.1 24 200.1.1.1 bfd enable
    [*Switch ModuleB] commit

  5. Verify the configuration.

    # When the configuration is complete, run the display bfd session all verbose command on Switch ModuleA and Switch ModuleB. The command output shows that the BFD session is established, the BFD session status is Up, and static routes are bound to BFD sessions.

    Take the display on Switch ModuleA as an example.

    [~Switch ModuleA] display bfd session all verbose
    Total UP/DOWN Session Number : 1/0
    ------------------------------------------------------------------------------
    Name : dyn_16390             (Multi Hop) State : UP
    ------------------------------------------------------------------------------
      Local Discriminator    : 16390             Remote Discriminator   : 16388
      Session Detect Mode    : Asynchronous Mode Without Echo Function
      BFD Bind Type          : Peer IP Address
      Bind Session Type      : Dynamic
      Bind Peer IP Address   : 200.1.1.2
      Bind Interface         : -
      Bind Source IP Address : 200.1.1.1
      FSM Board ID           : 1                  ToS-EXP                : 7
      Min Tx Interval (ms)   : 1000               Min Rx Interval (ms)   : 1000
      Actual Tx Interval (ms): 1000               Actual Rx Interval (ms): 1000
      WTR Interval (ms)      : -                  Detect Interval (ms)   : 3000
      Local Detect Multi     : 3                  Active Multi           : 3
      Destination Port       : 4784               TTL                    : 253
      Process PST            : Disable            Config PST             : Disable
      Last Local Diagnostic  : No Diagnostic
      Bind Application       : STATICRT
      Session Description    : -
    ------------------------------------------------------------------------------
       

Configuration Files
  • Configuration file of Switch ModuleA

    #
    sysname Switch ModuleA
    #
    vlan batch 10 20
    #
    bfd
    #
    interface Vlanif10
     ip address 200.1.1.1 255.255.255.0
    #
    interface Vlanif20
     ip address 7.1.1.1 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 10
    #
    interface 10GE1/17/2
     port link-type trunk
     port trunk allow-pass vlan 20
    #
    ip route-static bfd 200.1.1.2 local-address 200.1.1.1
    ip route-static 8.1.1.1 255.255.255.0 200.1.1.2 bfd enable
    #
    return
  • Configuration file of Switch ModuleB

    #
    sysname Switch ModuleB
    #
    vlan batch 10 30
    #
    bfd
    #
    interface Vlanif10
     ip address 200.1.1.2 255.255.255.0
    #
    interface Vlanif20
     ip address 8.1.1.1 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 10
    #
    interface 10GE1/17/2
     port link-type trunk
     port trunk allow-pass vlan 20
    #
    ip route-static bfd 200.1.1.1 local-address 200.1.1.2
    ip route-static 7.1.1.1 255.255.255.0 200.1.1.1 bfd enable
    #
    return

Example for Configuring Dynamic BFD for IPv6 Static Routes

Dynamic BFD for IPv6 static routes allows for fast fault detection on a link.

Networking Requirements

As shown in Figure 7-13, SwitchA and SwitchB connect to each other and have static routes configured between them. Customers require that a fault on the link between SwitchA and SwitchB be detected within milliseconds, and SwitchA and SwitchB dynamically update their routing tables.

Figure 7-13 Networking diagram for configuring dynamic BFD for IPv6 static routes

Configuration Roadmap

To meet the preceding requirement, configure dynamic BFD for IPv6 static routes. The configuration roadmap is as follows:

  1. Configure dynamic BFD for IPv6 static routes so that faults on the link between SwitchA and SwitchB can be detected within milliseconds to speed up route convergence.

Procedure

  1. Configure IPv6 addresses for interfaces. The configuration details are not provided here.
  2. Configure static IPv6 routes.

    # Configure a static route to 8::1/64 on SwitchA.

    [~SwitchA] ipv6 route-static 8:: 64 200::2
    [*SwitchA] commit

    # Configure a static route to 7::1/64 on SwitchB.

    [~SwitchB] ipv6 route-static 7:: 64 200::1
    [*SwitchB] commit

  3. Configure dynamic BFD for IPv6 static routes.

    # Bind the static route to a BFD session on SwitchA.

    [~SwitchA] bfd
    [*SwitchA-bfd] quit
    [*SwitchA] ipv6 route-static bfd 200::2 local-address 200::1
    [*SwitchA] ipv6 route-static 8:: 64 200::2 bfd enable
    [*SwitchA] commit

    # Bind the static route to a BFD session on SwitchB.

    [~SwitchB] bfd
    [*SwitchB-bfd] quit
    [*SwitchB] ipv6 route-static bfd 200::1 local-address 200::2
    [*SwitchB] ipv6 route-static 7:: 64 200::1 bfd enable
    [*SwitchB] commit

  4. Verify the configuration.

    # After the configurations are complete, run the display bfd session all verbose command on SwitchA or SwitchB. You can view that the BFD session is established and in Up state. The static route is bound to the BFD session.

    Take the display on SwitchA as an example. The command output shows that a BFD session is set up.

    <SwitchA> display bfd session all verbose
    Total UP/DOWN Session Number : 1/0
    ------------------------------------------------------------------------------
      Name : dyn_16385             (Multi Hop) State : Up
    ------------------------------------------------------------------------------
      Local Discriminator    : 16385            Remote Discriminator   : 16385
      Session Detect Mode    : Asynchronous Mode Without Echo Function
      BFD Bind Type          : Peer IP Address
      Bind Session Type      : Dynamic
      Bind Peer IP Address  : 200::2
      Bind Interface         : -
      Bind Source IP Address : 200::1
      FSM Board ID           : 3                ToS-EXP                : 6
      Min Tx Interval (ms) :1000        Min Rx Interval (ms)  :1000
      Actual Tx Interval (ms): 1000               Actual Rx Interval (ms): 1000
      WTR Interval (ms)      : -                Detect Interval (ms)   : -           
      Local Detect Multi   : 3                Active Multi           : -    
      Destination Port       : 4784             TTL                    : 253
      Process PST            : Disable          Config PST             : Disable
      Last Local Diagnostic  : No Diagnostic
      Bind Application       : STATICRTV6
      Session Description    : -
    ------------------------------------------------------------------------------
     

Configuration Files
  • Configuration file of SwitchA

    #
    sysname SwitchA
    #
    bfd
    #
    interface 10GE1/17/1
     undo portswitch
     ipv6 enable
     ipv6 address 200::1/64
    #
    interface 10GE1/17/2
     undo portswitch
     ipv6 enable
     ipv6 address 7::1/64
    #
    ipv6 route-static bfd 200::2 local-address 200::1
    ipv6 route-static 8:: 64 200::2 bfd enable
    #
    return
  • Configuration file of SwitchB

    #
    sysname SwitchB
    #
    bfd
    #
    interface 10GE1/17/1
     undo portswitch
     ipv6 enable
     ipv6 address 200::2/64
    #
    interface 10GE1/17/2
     undo portswitch
     ipv6 enable
     ipv6 address 8::1/64
    #
    ipv6 route-static bfd 200::1 local-address 200::2
    ipv6 route-static 7:: 64 200::1 bfd enable
    #
    return

Example for Configuring Static BFD for IPv4 Static Routes

Networking Requirements

As shown in Figure 7-14, you can configure the default static route on Switch ModuleA so that Switch ModuleA can connect to the external network. Link fault detection between Switch ModuleA and Switch ModuleB must be at the millisecond level to improve convergence speed.

Figure 7-14 Networking diagram of configuring static BFD for static routes

Configuration Roadmap

The configuration roadmap is as follows:

  1. Configure a BFD session between Switch ModuleA and Switch ModuleB.

  2. Configure a default route from Switch ModuleA to other devices and bind a BFD session to the default route. This configuration can implement link fault detection at the millisecond level and improve convergence speed of static routes.

Procedure

  1. Create VLANs, add interfaces to the VLANs, and assign IP addresses to the VLANIF interfaces. (Details are not mentioned here.)
  2. Configure device names. (Details are not mentioned here.)
  3. Configure a BFD session between Switch ModuleA and Switch ModuleB.

    # Create a BFD session on Switch ModuleA.

    <Switch ModuleA> system-view
    [~Switch ModuleA] bfd
    [*Switch ModuleA-bfd] quit
    [*Switch ModuleA] bfd aa bind peer-ip 1.1.1.2
    [*Switch ModuleA-bfd-session-aa] discriminator local 10
    [*Switch ModuleA-bfd-session-aa] discriminator remote 20
    [*Switch ModuleA-bfd-session-aa] commit
    [~Switch ModuleA-bfd-session-aa] quit

    # Create a BFD session on Switch ModuleB.

    <Switch ModuleB> system-view
    [~Switch ModuleB] bfd
    [*Switch ModuleB-bfd] quit
    [*Switch ModuleB] bfd bb bind peer-ip 1.1.1.1
    [*Switch ModuleB-bfd-session-bb] discriminator local 20
    [*Switch ModuleB-bfd-session-bb] discriminator remote 10
    [*Switch ModuleB-bfd-session-bb] commit
    [~Switch ModuleB-bfd-session-bb] quit

  4. Configure a default static route and bind a BFD session to the default static route.

    # Configure a default static route to the external network on Switch ModuleA and bind the default static route to the BFD session named aa.

    [~Switch ModuleA] ip route-static 0.0.0.0 0 1.1.1.2 track bfd-session aa
    [*Switch ModuleA] commit

  5. Verify the configuration.

    # After the configuration is complete, run the display bfd session all command on Switch ModuleA and Switch ModuleB. The command output shows that the BFD session is established and its status is Up. Run the display current-configuration | include bfd command. The command output shows that the BFD session is bound to the static route.

    Take the display on Switch ModuleA as an example.

    [~Switch ModuleA] display bfd session all
    S: Static session
    D: Dynamic session
    IP: IP session
    IF: Single-hop session
    PEER: Multi-hop session
    AUTO: Automatically negotiated session
    --------------------------------------------------------------------------------
    Local  Remote PeerIpAddr      State     Type        InterfaceName
    --------------------------------------------------------------------------------
    10     20     1.1.1.2         Up       S/IP-PEER   -
    --------------------------------------------------------------------------------
    
    [~Switch ModuleA] display current-configuration | include bfd
    bfd
    bfd aa bind peer-ip 1.1.1.2
    ip route-static 0.0.0.0 0.0.0.0 1.1.1.2 track bfd-session aa 

    # Check the IP routing table on Switch ModuleA, and you can find that the static route exists in the routing table.

    [~Switch ModuleA] display ip routing-table
    Proto: Protocol        Pre: Preference
    Route Flags: R - relay, D - download to fib, T - to vpn-instance
    ------------------------------------------------------------------------------
    Routing Table: _Public_
             Destinations : 3        Routes : 3
    
    
    Destination/Mask    Proto  Pre  Cost     Flags NextHop         Interface
    
    
            0.0.0.0/0   Static 60   0          RD  1.1.1.2         Vlanif10
            1.1.1.0/24  Direct 0    0           D  1.1.1.1         Vlanif10
            1.1.1.1/32  Direct 0    0           D  127.0.0.1       Vlanif10

    Run the shutdown command on GE1/17/1 of Switch ModuleB to simulate a link fault.

    [~Switch ModuleB] interface 10GE 1/17/1
    [~Switch ModuleB-10GE1/17/1] shutdown
    [*Switch ModuleB-10GE1/17/1] commit

    # Check the routing table on Switch ModuleA, and you can find that the default static route 0.0.0.0/0 does not exist. This is because when the default static route is bound to a BFD session, BFD rapidly notifies that the bound static route is unavailable after BFD detects a link fault.

    [~Switch ModuleA] display ip routing-table
    Proto: Protocol        Pre: Preference
    Route Flags: R - relay, D - download to fib, T - to vpn-instance
    ------------------------------------------------------------------------------
    Routing Table: _Public_
             Destinations : 2        Routes : 2
    
    
    Destination/Mask    Proto  Pre  Cost     Flags NextHop         Interface
    
    
            1.1.1.0/24  Direct 0    0           D  1.1.1.1         Vlanif10
            1.1.1.1/32  Direct 0    0           D  127.0.0.1       Vlanif10

Configuration Files
  • Configuration file of Switch ModuleA

    #
    sysname Switch ModuleA
    #
    vlan batch 10
    #
    bfd
    #
    interface Vlanif10
     ip address 1.1.1.1 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 10
    #
     ip route-static 0.0.0.0 0.0.0.0 1.1.1.2 track bfd-session aa
    #
    bfd aa bind peer-ip 1.1.1.2
     discriminator local 10
     discriminator remote 20
    #
    return
  • Configuration file of Switch ModuleB

    #
    sysname Switch ModuleB
    #
    vlan batch 10 20
    #
    bfd
    #
    interface Vlanif10
     ip address 1.1.1.2 255.255.255.0
    #
    interface Vlanif20
     ip address 2.2.2.2 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 10
    #
    interface 10GE1/17/2
     port link-type trunk
     port trunk allow-pass vlan 20
    #
    bfd bb bind peer-ip 1.1.1.1
     discriminator local 20
     discriminator remote 10
    #
    return

Example for Configuring Static BFD for IPv6 Static Routes

To enhance reliability of an IPv6 network, bind IPv6 static routes to a BFD session, which can implement fast fault detection and speed up route convergence.

Networking Requirements

As shown in Figure 7-15, SwitchA and SwitchB connect to each other and have static routes configured between them. Customers require that a fault on the link between SwitchA and SwitchB be detected within milliseconds, and SwitchA and SwitchB dynamically update their routing tables.

Figure 7-15 Networking diagram for configuring static BFD for IPv6 static routes

Configuration Roadmap

To meet the preceding requirement, configure static BFD for IPv6 static routes. The configuration roadmap is as follows:

  1. Configure a BFD session between SwitchA and SwitchB to implement fault detection at millisecond level.

  2. Configure a static route from SwitchA to SwitchB and bind the static route to the BFD session so that SwitchA and SwitchB can update its routing tables after an fault is detected.

Procedure

  1. Configure IPv6 addresses for interfaces. The configuration details are not provided here.
  2. Configure BFD sessions between SwtichA and SwtichB.

    # On SwitchA, create a BFD session with SwitchB.

    <SwitchA> system-view
    [~SwitchA] bfd
    [*SwitchA-bfd] quit
    [*SwitchA] bfd aa bind peer-ipv6 1::2
    [*SwitchA-bfd-session-aa] discriminator local 10
    [*SwitchA-bfd-session-aa] discriminator remote 20
    [*SwitchA-bfd-session-aa] commit
    [~SwitchA-bfd-session-aa] quit

    # On SwtichB, create a BFD session with SwtichA.

    <SwitchB> system-view
    [~SwitchB] bfd
    [*SwitchB-bfd] quit
    [*SwitchB] bfd bb bind peer-ipv6 1::1
    [*SwitchB-bfd-session-bb] discriminator local 20
    [*SwitchB-bfd-session-bb] discriminator remote 10
    [*SwitchB-bfd-session-bb] commit
    [~SwitchB-bfd-session-bb] quit

  3. Configure a default static route and bind the route to the BFD session.

    # On SwtichA, configure a default static route to SwitchB and bind the route to the BFD session named aa.

    [~SwitchA] ipv6 route-static 0::0 0 1::2 track bfd-session aa
    [*SwitchA] commit
    [~SwitchA] quit

  4. Verify the configuration.

    # After the configurations are complete, run the display bfd session all command on SwitchA or SwitchB. You can view that the BFD session is established and in Up state. Run the display current-configuration | include bfd command in the system view. You can view that the default static route is already bound to the BFD session.

    Take the display on SwitchA as an example:

    <SwitchA> display bfd session all
    S: Static session            
    D: Dynamic session                      
    IP: IP session                         
    IF: Single-hop session               
    PEER: Multi-hop session                 
    AUTO: Automatically negotiated session    
    --------------------------------------------------------------------------------
    Local Remote PeerIpAddr      State     Type        InterfaceName
    --------------------------------------------------------------------------------
    10    20     1::2            Up       S_IP_PEER         -
    --------------------------------------------------------------------------------
         Total UP/DOWN Session Number : 1/0
    <SwitchA> display current-configuration | include bfd
     bfd
    bfd aa bind peer-ipv6 1::2
     ipv6 route-static :: 0 1::2 track bfd-session aa

    # Check the IPv6 routing table on SwitchA. You can view that the default static route exists in the routing table.

    <SwitchA> display ipv6 routing-table
    Routing Table : _public_
             Destinations : 5        Routes : 5
    
     Destination  : ::                              PrefixLength : 0
     NextHop      : 1::2                            Preference   : 60
     Cost         : 0                               Protocol     : Static
     RelayNextHop : ::                              TunnelID     : 0x0
     Interface    : 10GE1/17/1                       Flags        : RD
    
     Destination  : ::1                             PrefixLength : 128
     NextHop      : ::1                             Preference   : 0
     Cost         : 0                               Protocol     : Direct
     RelayNextHop : ::                              TunnelID     : 0x0
     Interface    : InLoopBack0                     Flags        : D
    
     Destination  : 1::                             PrefixLength : 64
     NextHop      : 1::1                            Preference   : 0
     Cost         : 0                               Protocol     : Direct
     RelayNextHop : ::                              TunnelID     : 0x0
     Interface    : 10GE1/17/1                       Flags        : D
    
     Destination  : 1::1                            PrefixLength : 128
     NextHop      : ::1                             Preference   : 0
     Cost         : 0                               Protocol     : Direct
     RelayNextHop : ::                              TunnelID     : 0x0
     Interface    : 10GE1/17/1                       Flags        : D
    
     Destination  : FE80::                          PrefixLength : 10
     NextHop      : ::                              Preference   : 0
     Cost         : 0                               Protocol     : Direct
     RelayNextHop : ::                              TunnelID     : 0x0
     Interface    : NULL0                           Flags        : D

    # Run the shutdown command on 10GE1/17/1 of SwtichB to simulate a link fault.

    [~SwitchB] interface 10ge1/17/1
    [~SwitchB-10GE1/17/1] shutdown
    [*SwitchB-10GE1/17/1] commit

    # Check the routing table on SwitchA. You can view that the default static route 0::0/0 does not exist. This is because the default static route is bound to the BFD session. After BFD detects a link fault, BFD rapidly notifies SwitchA that the static route is unavailable.

    <SwitchA> display ipv6 routing-table
    Routing Table : _public_
             Destinations : 1        Routes : 1
    
     Destination  : ::1                             PrefixLength : 128
     NextHop      : ::1                             Preference   : 0
     Cost         : 0                               Protocol     : Direct
     RelayNextHop : ::                              TunnelID     : 0x0
     Interface    : InLoopBack0                     Flags        : D

Configuration Files
  • Configuration file of SwitchA

    #
    sysname SwtichA
    #
    bfd
    #
    interface 10GE1/17/1
     undo portswitch
     ipv6 enable
     ipv6 address 1::1/64
    #
    ipv6 route-static :: 0 1::2 track bfd-session aa
    #
    bfd aa bind peer-ipv6 1::2
     discriminator local 10
     discriminator remote 20
    #
    return
  • Configuration file of SwitchB

    #
    sysname SwtichB
    #
    bfd
    #
    interface 10GE1/17/1
     undo portswitch
     ipv6 enable
     ipv6 address 1::2/64
    #
    interface 10GE1/17/2
     undo portswitch
     ipv6 enable
     ipv6 address 2::1/64
    #
    bfd bb bind peer-ipv6 1::1
     discriminator local 20
     discriminator remote 10
    #
    return

Example for Configuring FRR for IPv4 Static Routes on the Public Network

Networking Requirements

As shown in Figure 7-16, two static routes with next hops being Switch ModuleA and Switch ModuleB respectively are configured on Switch ModuleT. Link B functions as the backup of link A. If link A is faulty, traffic can be switched to link B in a timely manner.

Figure 7-16 Networking diagram of configuring FRR for IPv4 static routes on the public network

Configuration Roadmap

The configuration roadmap is as follows:

  1. Configure two static routes with next hops being Switch ModuleA and Switch ModuleB respectively on Switch ModuleT so that the devices can communicate with each other.

  2. Set a higher preference for link A on Switch ModuleT to ensure that link A functions as the primary link and link B functions as the backup of link A.

  3. Enable FRR for static routes on Switch ModuleT so that traffic can be fast switched to link B if link A is faulty.

Procedure

  1. Create VLANs, add interfaces to the VLANs, and assign IP addresses to the VLANIF interfaces. (Details are not mentioned here.)
  2. Configure device names. (Details are not mentioned here.)
  3. Configure static routes.

    # Configure static routes on Switch ModuleA.

    [~Switch ModuleA] ip route-static 172.16.1.0 24 vlanif 20 192.168.10.1
    [*Switch ModuleA] ip route-static 172.17.1.0 24 vlanif 40 192.168.11.1
    [*Switch ModuleA] commit

    # Configure static routes on Switch ModuleB.

    [~Switch ModuleB] ip route-static 172.16.1.0 24 vlanif 30 192.168.20.1
    [*Switch ModuleB] ip route-static 172.17.1.0 24 vlanif 50 192.168.21.1
    [*Switch ModuleB] commit

    Configure a static route on Switch Module C.

    [~Switch ModuleC] ip route-static 172.16.1.0 24 vlanif 40 192.168.11.2
    [*Switch ModuleC] ip route-static 172.16.1.0 24 vlanif 50 192.168.21.2
    [*Switch ModuleC] commit

    # Configure static routes on Switch ModuleT.

    [~Switch ModuleT] ip route-static 172.17.1.0 24 vlanif 20 192.168.10.2
    [*Switch ModuleT] ip route-static 172.17.1.0 24 vlanif 30 192.168.20.2
    [*Switch ModuleT] commit

    # Check the routing table on Switch ModuleT. You can view that the two static routes are in load balancing mode.

    [~Switch ModuleT] display ip routing-table
    Proto: Protocol        Pre: Preference
    Route Flags: R - relay, D - download to fib, T - to vpn-instance
    ------------------------------------------------------------------------------
    Routing Table : _public_
             Destinations : 11       Routes : 12
    
    Destination/Mask    Proto  Pre  Cost        Flags NextHop         Interface
    
            1.1.1.1/32  Direct 0    0             D  127.0.0.1       LoopBack0
          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
    127.255.255.255/32  Direct 0    0             D  127.0.0.1       InLoopBack0
       172.17.1.0/24  Static 60   0             D  192.168.10.2    Vlanif20
                        Static 60   0             D  192.168.20.2    Vlanif30
       192.168.10.0/24  Direct 0    0             D  192.168.10.1    Vlanif20
       192.168.10.1/32  Direct 0    0             D  127.0.0.1       Vlanif20
     192.168.10.255/32  Direct 0    0             D  127.0.0.1       Vlanif20
       192.168.20.0/24  Direct 0    0             D  192.168.20.1    Vlanif30
       192.168.20.1/32  Direct 0    0             D  127.0.0.1       Vlanif30
     192.168.20.255/32  Direct 0    0             D  127.0.0.1       Vlanif30

  4. Change the preferences of IPv4 static routes.

    # Change the preferences of static routes on Switch ModuleT.

    [~Switch ModuleT] ip route-static 172.17.1.0 24 vlanif 20 192.168.10.2 preference 40
    [*Switch ModuleT] commit

    # Check the IP routing table on Switch ModuleT, and you can view that the preferences of static routes are changed.

    [~Switch ModuleT] display ip routing-table
    Proto: Protocol        Pre: Preference
    Route Flags: R - relay, D - download to fib, T - to vpn-instance
    ------------------------------------------------------------------------------
    Routing Table : _public_
             Destinations : 10       Routes : 10
    
    Destination/Mask    Proto  Pre  Cost        Flags NextHop         Interface
    
            1.1.1.1/32  Direct 0    0             D  127.0.0.1       LoopBack0
          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
    127.255.255.255/32  Direct 0    0             D  127.0.0.1       InLoopBack0
       172.17.1.0/24  Static 40   0             D  192.168.10.2    Vlanif20
       192.168.10.0/24  Direct 0    0             D  192.168.10.1    Vlanif20
       192.168.10.1/32  Direct 0    0             D  127.0.0.1       Vlanif20
     192.168.10.255/32  Direct 0    0             D  127.0.0.1       Vlanif20
       192.168.20.0/24  Direct 0    0             D  192.168.20.1    Vlanif30
       192.168.20.1/32  Direct 0    0             D  127.0.0.1       Vlanif30
     192.168.20.255/32  Direct 0    0             D  127.0.0.1       Vlanif30

  5. Enable FRR for IPv4 static routes.

    # Enable FRR for static routes on Switch ModuleT.

    [~Switch ModuleT] ip route-static frr
    [*Switch ModuleT] commit

    # Check information about the backup outbound interface and backup next hop on Switch ModuleT.

    [~Switch ModuleT] display ip routing-table 172.17.1.0 verbose
    Route Flags: R - relay, D - download to fib, T - to vpn-instance
    ------------------------------------------------------------------------------
    Routing Table : _public_
    Summary Count : 1
    
    Destination: 172.17.1.0/24
         Protocol: Static          Process ID: 0
       Preference: 40                    Cost: 0
         NextHop: 192.168.10.2    Neighbour: 0.0.0.0
            State: Active Adv             Age: 00h00m03s
              Tag: 0                 Priority: medium
            Label: NULL               QoSInfo: 0x0
       IndirectID: 0x31000032
     RelayNextHop: 0.0.0.0         Interface: Vlanif20
         TunnelID: 0x0                  Flags: D
       BkNextHop: 192.168.20.2  BkInterface: Vlanif30
          BkLabel: NULL           SecTunnelID: 0x0
     BkPETunnelID: 0x0        BkPESecTunnelID: 0x0
     BkIndirectID: 0x32000033

  6. If link A is faulty, traffic can be fast switched to link B.

    [~Switch ModuleT] interface 10GE 1/17/2
    [~Switch ModuleT-10GE1/17/2] shutdown
    [*Switch ModuleT-10GE1/17/2] commit
    [~Switch ModuleT-10GE1/17/2] quit

    # Check information about the route to 172.17.1.0/24 on Switch ModuleT.

    [~Switch ModuleT] display ip routing-table 172.17.1.0 verbose
    Route Flags: R - relay, D - download to fib, T - to vpn-instance
    ------------------------------------------------------------------------------
    Routing Table : _public_
    Summary Count : 1
    
    Destination: 172.17.1.0/24
         Protocol: Static          Process ID: 0
       Preference: 60                    Cost: 0
         NextHop: 192.168.20.2    Neighbour: 0.0.0.0
            State: Active Adv             Age: 00h00m07s
              Tag: 0                 Priority: medium
            Label: NULL               QoSInfo: 0x0
       IndirectID: 0x32000033
     RelayNextHop: 0.0.0.0         Interface: Vlanif30
         TunnelID: 0x0                  Flags: D

Configuration Files
  • Configuration file of Switch ModuleA

    #
    sysname Switch ModuleA
    #
    vlan batch 20 40
    #
    interface Vlanif20
     ip address 192.168.10.2 255.255.255.0
    #
    interface Vlanif40
     ip address 192.168.11.2 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 20
    #
    interface 10GE1/17/2
     port link-type trunk
     port trunk allow-pass vlan 40
    #
    ip route-static 172.16.1.0 255.255.255.0 vlanif 20 192.168.10.1
    ip route-static 172.17.1.0 255.255.255.0 vlanif 40 192.168.11.1
    #
    return
  • Configuration file of Switch ModuleB

    #
    sysname Switch ModuleB
    #
    vlan batch 30 50
    #
    interface Vlanif30
     ip address 192.168.20.2 255.255.255.0
    #
    interface Vlanif50
     ip address 192.168.21.2 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 30
    #
    interface 10GE1/17/2
     port link-type trunk
     port trunk allow-pass vlan 50
    #
    ip route-static 172.16.1.0 255.255.255.0 vlanif 30 192.168.20.1
    ip route-static 172.17.1.0 255.255.255.0 vlanif 50 192.168.21.1
    #
    return
  • Configuration file of Switch ModuleC

    #
    sysname Switch ModuleC
    #
    vlan batch 40 50 60
    #
    interface Vlanif40
     ip address 192.168.11.1 255.255.255.0
    #
    interface Vlanif50
     ip address 192.168.21.1 255.255.255.0
    #
    interface Vlanif60
     ip address 172.17.1.1 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 60
    #
    interface 10GE1/17/2
     port link-type trunk
     port trunk allow-pass vlan 40
    #
    interface 10GE1/17/3
     port link-type trunk
     port trunk allow-pass vlan 50
    #
    ip route-static 172.16.1.0 255.255.255.0 vlanif 40 192.168.11.2
    ip route-static 172.16.1.0 255.255.255.0 vlanif 50 192.168.21.2
    #
    return
  • Configuration file of Switch ModuleT

    #
    sysname Switch ModuleT
    #
    vlan batch 10 20 30
    #
    interface Vlanif10
     ip address 172.16.1.1 255.255.255.0
    #
    interface Vlanif20
     ip address 192.168.10.1 255.255.255.0
    #
    interface Vlanif30
     ip address 192.168.20.1 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 10
    #
    interface 10GE1/17/2
     port link-type trunk
     port trunk allow-pass vlan 20
    #
    interface 10GE1/17/3
     port link-type trunk
     port trunk allow-pass vlan 30
    #
    ip route-static frr
    ip route-static 172.17.1.0 255.255.255.0 vlanif 20 192.168.10.2 preference 40
    ip route-static 172.17.1.0 255.255.255.0 vlanif 30 192.168.20.2
    #
    return

Example for Configuring NQA for IPv4 Static Routes

Networking Requirements

As shown in Figure 7-17, static routes to clients are configured on SwitchB and SwitchC. SwitchB is the master switch and SwitchC is the backup switch. Normally, traffic must be forwarded along the primary link SwitchB→SwitchD. When the primary link fails, traffic is switched to the backup link SwitchC→SwitchD.

Figure 7-17 Networking diagram of configuring NQA for static IPv4 routes
Configuration Roadmap

The configuration roadmap is as follows:

  1. Configure IP addresses and OSPF on each switch, and configure the cost of each link so that SwitchB functions as the master switch and SwitchC functions as the backup switch.
  2. Create an NQA ICMP test instance to monitor the link between SwitchB and SwitchD, and configure static routes from SwitchB and SwitchC to users. Associate the static route with the NQA test instance to implement fast link fault detection and service switchover.
NOTE:

When a static route is associated with an NQA test instance, only ICMP test instances are used to test whether there are reachable routes between the source and destination.

Procedure

  1. Create VLANs and add interfaces to the VLANs.

    <HUAWEI> system-view
    [~HUAWEI] sysname Switch ModuleA
    [*HUAWEI] commit
    [~Switch ModuleA] vlan 30
    [*Switch ModuleA-vlan30] quit
    [*Switch ModuleA] vlan 40
    [*Switch ModuleA-vlan40] quit
    [*Switch ModuleA] interface 10ge 1/17/1
    [*Switch ModuleA-10GE1/17/1] port link-type trunk 
    [*Switch ModuleA-10GE1/17/1] port trunk allow-pass vlan 30
    [*Switch ModuleA-10GE1/17/1] quit
    [*Switch ModuleA] interface 10ge 1/17/2
    [*Switch ModuleA-10GE1/17/2] port link-type trunk 
    [*Switch ModuleA-10GE1/17/2] port trunk allow-pass vlan 40
    [*Switch ModuleA-10GE1/17/2] quit
    [*Switch ModuleA] commit

    The configurations of SwitchB and SwitchC are similar to the configuration of SwitchA, and are not mentioned here.

  2. Assign IPv4 addresses to the VLANIF interfaces.

    [~Switch ModuleA] interface vlanif 30
    [*Switch ModuleA-Vlanif30] ip address 172.16.3.1 24
    [*Switch ModuleA-Vlanif30] quit
    [*Switch ModuleA] interface vlanif 40
    [*Switch ModuleA-Vlanif40] ip address 172.16.4.1 24
    [*Switch ModuleA-Vlanif40] quit
    [*Switch ModuleA] commit

    The configurations of SwitchB and SwitchC are similar to the configuration of SwitchA, and are not mentioned here.

  3. Create an NQA test instance on Switch ModuleB to test the link between Switch ModuleB and SwitchD.

    [~Switch ModuleB] nqa test-instance user test
    [*Switch ModuleB-nqa-user-test] test-type icmp
    [*Switch ModuleB-nqa-user-test] destination-address ipv4 172.16.1.2
    [*Switch ModuleB-nqa-user-test] frequency 10
    [*Switch ModuleB-nqa-user-test] probe-count 2
    [*Switch ModuleB-nqa-user-test] interval seconds 5
    [*Switch ModuleB-nqa-user-test] timeout 4
    [*Switch ModuleB-nqa-user-test] start now
    [*Switch ModuleB-nqa-user-test] commit
    [~Switch ModuleB-nqa-user-test] quit

  4. Configure IPv4 static routes.

    # Configure an IPv4 static route on Switch ModuleB and associate it with the NQA test instance.

    [~Switch ModuleB] ip route-static 172.16.7.0 255.255.255.0 vlanif 10 172.16.1.2 track nqa user test
    [*Switch ModuleB] commit

    # Configure an IPv4 static route on Switch ModuleC.

    [~Switch ModuleC] ip route-static 172.16.7.0 255.255.255.0 vlanif 60 172.16.6.2
    [*Switch ModuleC] commit

  5. Configure a dynamic routing protocol on Switch ModuleA, Switch ModuleB, and Switch ModuleC. OSPF is used in this example.

    # Configure OSPF on Switch ModuleA.

    [~Switch ModuleA] ospf 1
    [*Switch ModuleA-ospf-1] area 0.0.0.0
    [*Switch ModuleA-ospf-1-area-0.0.0.0] network 172.16.3.0 0.0.0.255
    [*Switch ModuleA-ospf-1-area-0.0.0.0] network 172.16.4.0 0.0.0.255
    [*Switch ModuleA-ospf-1-area-0.0.0.0] quit
    [*Switch ModuleA-ospf-1] quit
    [~Switch ModuleA] commit

    # Configure OSPF on Switch ModuleB.

    [~Switch ModuleB] ospf 1
    [*Switch ModuleB-ospf-1] area 0.0.0.0
    [*Switch ModuleB-ospf-1-area-0.0.0.0] network 172.16.3.0 0.0.0.255
    [*Switch ModuleB-ospf-1-area-0.0.0.0] quit
    [*Switch ModuleB-ospf-1] quit
    [~Switch ModuleB] commit

    # Configure OSPF on Switch ModuleC.

    [~Switch ModuleC] ospf 1
    [*Switch ModuleC-ospf-1] area 0.0.0.0
    [*Switch ModuleC-ospf-1-area-0.0.0.0] network 172.16.4.0 0.0.0.255
    [*Switch ModuleC-ospf-1-area-0.0.0.0] quit
    [*Switch ModuleC-ospf-1] quit
    [~Switch ModuleC] commit

  6. Configure OSPF on Switch ModuleB and Switch ModuleC to import static routes.

    # Configure OSPF on Switch ModuleB to import a static route, and set the cost to 10 for the static route.

    [~Switch ModuleB] ospf 1
    [~Switch ModuleB-ospf-1] import-route static cost 10
    [*Switch ModuleB-ospf-1] commit
    [*Switch ModuleB-ospf-1] quit

    # Configure OSPF on Switch ModuleC to import a static route, and set the cost to 20 for the static route.

    [~Switch ModuleC] ospf 1
    [~Switch ModuleC-ospf-1] import-route static cost 20
    [*Switch ModuleC-ospf-1] commit
    [*Switch ModuleC-ospf-1] quit

  7. Verify the configuration.

    After the configuration is complete, run the display current-configuration | include nqa command in the system view on Switch ModuleB. The command output shows that the IPv4 static route has been associated with the NQA test instance. Run the display nqa results command. The command output shows that an NQA test instance has been created.

    # Display configurations of NQA for IPv4 static routes.

    [~Switch ModuleB] display current-configuration | include nqa
     ip route-static 172.16.7.0 255.255.255.0 Vlanif 10 172.16.1.2 track nqa user test
     nqa test-instance user test
    

    # Display the NQA test results.

    [~Switch ModuleB] display nqa results test-instance user test
     NQA entry(user, test) : test flag is active ,test type is ICMP
      1 . Test 6645 result   The test is finished
       Send operation times: 2                Receive response times: 2
       Completion:success                   RTD over thresholds number:0
       Attempts number:1                      Drop operation number:0
       Disconnect operation number:0          Operation timeout number:0
       System busy operation number:0         Connection fail number:0
       Operation sequence errors number:0     RTT Stats errors number:0
       Destination ip address:172.16.1.2
       Min/Max/Average completion Time: 1/1/1
       Sum/Square-Sum  completion time: 2/2
       Last response packet receiving time: 2012-11-14 04:20:36.9
       Lost packet ratio: 0 %

    The command output shows "Lost packet ratio 0 %," indicating that the link is running properly.

    # Check the routing table on Switch ModuleB.

    [~Switch ModuleB] display ip routing-table
    Proto: Protocol        Pre: Preference
    Route Flags: R - relay, D - download to fib, T - to vpn-instance
    ------------------------------------------------------------------------------
    Routing Table : _public_
             Destinations : 15       Routes : 15
    
    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
    127.255.255.255/32  Direct  0    0             D  127.0.0.1       InLoopBack0
         172.16.1.0/24  Direct  0    0             D  172.16.1.1      Vlanif10
         172.16.1.1/32  Direct  0    0             D  127.0.0.1       Vlanif10
       172.16.1.255/32  Direct  0    0             D  127.0.0.1       Vlanif10
         172.16.3.0/24  Direct  0    0             D  172.16.3.2      Vlanif30
         172.16.3.2/32  Direct  0    0             D  127.0.0.1       Vlanif30
       172.16.3.255/32  Direct  0    0             D  127.0.0.1       Vlanif30
         172.16.4.0/24  OSPF    10   2             D  172.16.3.1      Vlanif30
         172.16.5.0/24  Direct  0    0             D  172.16.5.1      Vlanif50
         172.16.5.1/32  Direct  0    0             D  127.0.0.1       Vlanif50
       172.16.5.255/32  Direct  0    0             D  127.0.0.1       Vlanif50
         172.16.7.0/24  Static  60   0             D  172.16.1.2      Vlanif10
    255.255.255.255/32  Direct  0    0             D  127.0.0.1       InLoopBack0
    

    The command output shows that the static route exists in the routing table.

    # Check the routing table on Switch ModuleA.

    [~Switch ModuleA] display ip routing-table
    Proto: Protocol        Pre: Preference
    Route Flags: R - relay, D - download to fib, T - to vpn-instance
    ------------------------------------------------------------------------------
    Routing Table : _public_
             Destinations : 11       Routes : 11
    
    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
    127.255.255.255/32  Direct  0    0             D  127.0.0.1       InLoopBack0
         172.16.3.0/24  Direct  0    0             D  172.16.3.1      Vlanif30
         172.16.3.1/32  Direct  0    0             D  127.0.0.1       Vlanif30
       172.16.3.255/32  Direct  0    0             D  127.0.0.1       Vlanif30
         172.16.4.0/24  Direct  0    0             D  172.16.4.1      Vlanif40
         172.16.4.1/32  Direct  0    0             D  127.0.0.1       Vlanif40
       172.16.4.255/32  Direct  0    0             D  127.0.0.1       Vlanif40
         172.16.7.0/24  O_ASE   150  10            D  172.16.3.2      Vlanif30
    255.255.255.255/32  Direct  0    0             D  127.0.0.1       InLoopBack0
    

    The command output shows that a route to 172.16.7.0/24 exists in the routing table. The route's next hop address is 172.16.3.2 and cost is 10. Traffic is preferentially transmitted along the link Switch ModuleB->SwitchD.

    # Shut down 10GE1/17/2 on Switch ModuleB to simulate a link fault.

    [~Switch ModuleB] interface 10ge 1/17/2
    [~Switch ModuleB-10GE1/17/2] shutdown
    [*Switch ModuleB-10GE1/17/2] commit
    [~Switch ModuleB] quit

    # Check the NQA test results.

    [~Switch ModuleB] display nqa results test-instance user test
     NQA entry(user, test) : testflag is active ,testtype is ICMP
      1 . Test 7160 result   The test is finished
       Send operation times: 2                Receive response times: 0
       Completion:failed                    RTD over thresholds number:0
       Attempts number:1                      Drop operation number:0
       Disconnect operation number:0          Operation timeout number:2
       System busy operation number:0         Connection fail number:0
       Operation sequence errors number:0     RTT Stats errors number:0
       Destination ip address:172.16.1.2
       Min/Max/Average completion Time: 0/0/0
       Sum/Square-Sum  completion time: 0/0
       Last response packet receiving time: 0000-00-00 00:00:00.0             
       Lost packet ratio: 100 %

    The command output shows "Completion:failed" and "Lost packet ratio is 100 %," indicating that the link is faulty.

    # Check the routing table on Switch ModuleB.

    [~Switch ModuleB] display ip routing-table
    Proto: Protocol        Pre: Preference
    Route Flags: R - relay, D - download to fib, T - to vpn-instance
    ------------------------------------------------------------------------------
    Routing Table : _public_
             Destinations : 12       Routes : 12
    
    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
    127.255.255.255/32  Direct  0    0             D  127.0.0.1       InLoopBack0
         172.16.3.0/24  Direct  0    0             D  172.16.3.2      Vlanif30
         172.16.3.2/32  Direct  0    0             D  127.0.0.1       Vlanif30
       172.16.3.255/32  Direct  0    0             D  127.0.0.1       Vlanif30
         172.16.4.0/24  OSPF    10   2             D  172.16.3.1      Vlanif30
         172.16.5.0/24  Direct  0    0             D  172.16.5.1      Vlanif50
         172.16.5.1/32  Direct  0    0             D  127.0.0.1       Vlanif50
       172.16.5.255/32  Direct  0    0             D  127.0.0.1       Vlanif50
         172.16.7.0/24  O_ASE   150  20            D  172.16.3.1      Vlanif30
    255.255.255.255/32  Direct  0    0             D  127.0.0.1       InLoopBack0
    

    The command output shows that the static route has been deleted.

    # Check the routing table on Switch ModuleA.

    [~Switch ModuleA] display ip routing-table
    Proto: Protocol        Pre: Preference
    Route Flags: R - relay, D - download to fib, T - to vpn-instance
    ------------------------------------------------------------------------------
    Routing Table : _public_
             Destinations : 11       Routes : 11
    
    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
    127.255.255.255/32  Direct  0    0             D  127.0.0.1       InLoopBack0
         172.16.3.0/24  Direct  0    0             D  172.16.3.1      Vlanif30
         172.16.3.1/32  Direct  0    0             D  127.0.0.1       Vlanif30
       172.16.3.255/32  Direct  0    0             D  127.0.0.1       Vlanif30
         172.16.4.0/24  Direct  0    0             D  172.16.4.1      Vlanif40
         172.16.4.1/32  Direct  0    0             D  127.0.0.1       Vlanif40
       172.16.4.255/32  Direct  0    0             D  127.0.0.1       Vlanif40
         172.16.7.0/24  O_ASE   150  20            D  172.16.4.2      Vlanif40
    255.255.255.255/32  Direct  0    0             D  127.0.0.1       InLoopBack0
    

    On Switch ModuleB, the NQA test instance is associated with a static route. When NQA detects a link failure, it immediately notifies Switch ModuleB that the static route bound to the link is unreachable. Switch ModuleA cannot learn the route to 172.16.7.0/24 from Switch ModuleB, but it can learn the route to 172.16.7.0/24 from Switch ModuleC. Therefore, you can view that the route to 172.16.7.0/24 has a next hop 172.16.4.2 and cost 20. Service traffic is then switched to the link Switch ModuleC->Switch ModuleD.

Configuration Files
  • Configuration file of Switch ModuleA

    #
    sysname Switch ModuleA
    #
    vlan batch 30 40
    #
    interface Vlanif30
     ip address 172.16.3.1 255.255.255.0 
    #
    interface Vlanif40
     ip address 172.16.4.1 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk                                                           
     port trunk allow-pass vlan 30  
    #
    interface 10GE1/17/2
     port link-type trunk                                                           
     port trunk allow-pass vlan 40  
    #
    ospf 1
     area 0.0.0.0
      network 172.16.3.0 0.0.0.255
      network 172.16.4.0 0.0.0.255
    #
    return
  • Configuration file of Switch ModuleB

    #
    sysname Switch ModuleB
    #
    vlan batch 10 30 50
    #
    interface Vlanif10
     ip address 172.16.1.1 255.255.255.0 
    #
    interface Vlanif30
     ip address 172.16.3.2 255.255.255.0 
    #
    interface Vlanif50
     ip address 172.16.5.1 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk                                                           
     port trunk allow-pass vlan 30  
    #
    interface 10GE1/17/2
     port link-type trunk                                                           
     port trunk allow-pass vlan 10  
    #
    interface 10GE1/17/3
     port link-type trunk                                                           
     port trunk allow-pass vlan 50  
    #
    ospf 1
     import-route static cost 10
     area 0.0.0.0
      network 172.16.3.0 0.0.0.255
    #
    ip route-static 172.16.7.0 255.255.255.0 Vlanif 10 172.16.1.2 track nqa user test
    #
    nqa test-instance user test
     test-type icmp
     destination-address ipv4 172.16.1.2
     interval seconds 5
     timeout 4
     probe-count 2
     frequency 10
     start now
    #
    return
  • Configuration file of Switch Module C

    #
    sysname Switch ModuleC
    #
    vlan batch 20 40 60
    #
    interface Vlanif20
     ip address 172.16.2.1 255.255.255.0 
    #
    interface Vlanif40
     ip address 172.16.4.2 255.255.255.0 
    #
    interface Vlanif60
     ip address 172.16.6.1 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk                                                           
     port trunk allow-pass vlan 20  
    #
    interface 10GE1/17/2
     port link-type trunk                                                           
     port trunk allow-pass vlan 40  
    #
    interface 10GE1/17/3
     port link-type trunk                                                           
     port trunk allow-pass vlan 60  
    #
    ospf 1
     import-route static cost 20
     area 0.0.0.0
      network 172.16.4.0 0.0.0.255
    #
    ip route-static 172.16.7.0 255.255.255.0 Vlanif 60 172.16.6.2
    #
    return
Translation
Download
Updated: 2019-08-09

Document ID: EDOC1000041694

Views: 58883

Downloads: 3621

Average rating:
This Document Applies to these Products
Related Version
Related Documents
Share
Previous Next