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 several configuration examples of OSPF together with the configuration flowchart. The configuration examples explain networking requirements, and configuration roadmap.

Example for Configuring Basic OSPF Functions

Networking Requirements

As shown in Figure 7-49, all switch moduless run OSPF, and the entire AS is partitioned into three areas. Switch Module A and Switch Module B function as ABRs to forward the routes between areas.

After the configuration is complete, each switch modules should learn the routes to all network segments in the AS.

Figure 7-49 Networking diagram of configuring basic OSPF functions

Configuration Roadmap

The configuration roadmap is as follows:

  1. Enable OSPF on each switch modules.

  2. Specify network segments in different areas.

Procedure

  1. Assign an IP address to each interface. The detailed configuration is not mentioned here.
  2. Configure basic OSPF functions.

    # Configure Switch Module A.

    <HUAWEI> system-view
    [~HUAWEI] sysname SwitchA
    [*HUAWEI] commit
    [~Switch ModuleA] router id 1.1.1.1
    [*Switch ModuleA] ospf 1
    [*Switch ModuleA-ospf-1] area 0
    [*Switch ModuleA-ospf-1-area-0.0.0.0] network 192.168.0.0 0.0.0.255
    [*Switch ModuleA-ospf-1-area-0.0.0.0] quit
    [*Switch ModuleA-ospf-1] area 1
    [*Switch ModuleA-ospf-1-area-0.0.0.1] network 192.168.1.0 0.0.0.255
    [*Switch ModuleA-ospf-1-area-0.0.0.1] quit
    [*Switch ModuleA-ospf-1] commit
    [~Switch ModuleA-ospf-1] quit

    # Configure Switch Module B.

    <HUAWEI> system-view
    [~HUAWEI] sysname SwitchB
    [*HUAWEI] commit
    [~Switch ModuleB] router id 2.2.2.2
    [*Switch ModuleB] ospf 1
    [*Switch ModuleB-ospf-1] area 0
    [*Switch ModuleB-ospf-1-area-0.0.0.0] network 192.168.0.0 0.0.0.255
    [*Switch ModuleB-ospf-1-area-0.0.0.0] quit
    [*Switch ModuleB-ospf-1] area 2
    [*Switch ModuleB-ospf-1-area-0.0.0.2] network 192.168.2.0 0.0.0.255
    [*Switch ModuleB-ospf-1-area-0.0.0.2] quit
    [*Switch ModuleB-ospf-1] commit
    [~Switch ModuleB-ospf-1] quit

    # Configure Switch Module C.

    <HUAWEI> system-view
    [~HUAWEI] sysname SwitchC
    [*HUAWEI] commit
    [~Switch ModuleC] router id 3.3.3.3
    [*Switch ModuleC] ospf 1
    [*Switch ModuleC-ospf-1] area 1
    [*Switch ModuleC-ospf-1-area-0.0.0.1] network 192.168.1.0 0.0.0.255
    [*Switch ModuleC-ospf-1-area-0.0.0.1] network 172.16.1.0 0.0.0.255
    [*Switch ModuleC-ospf-1-area-0.0.0.1] commit
    [~Switch ModuleC-ospf-1-area-0.0.0.1] quit
    [~Switch ModuleC-ospf-1] quit

    # Configure Switch Module D.

    <HUAWEI> system-view
    [~HUAWEI] sysname SwitchD
    [*HUAWEI] commit
    [~Switch ModuleD] router id 4.4.4.4
    [*Switch ModuleD] ospf 1
    [*Switch ModuleD-ospf-1] area 2
    [*Switch ModuleD-ospf-1-area-0.0.0.2] network 192.168.2.0 0.0.0.255
    [*Switch ModuleD-ospf-1-area-0.0.0.2] network 172.17.1.0 0.0.0.255
    [*Switch ModuleD-ospf-1-area-0.0.0.2] commit
    [~Switch ModuleD-ospf-1-area-0.0.0.2] quit
    [~Switch ModuleD-ospf-1] quit

    # Configure Switch Module E.

    <HUAWEI> system-view
    [~HUAWEI] sysname SwitchE
    [*HUAWEI] commit
    [~Switch ModuleE] router id 5.5.5.5
    [*Switch ModuleE] ospf 1
    [*Switch ModuleE-ospf-1] area 1
    [*Switch ModuleE-ospf-1-area-0.0.0.1] network 172.16.1.0 0.0.0.255
    [*Switch ModuleE-ospf-1-area-0.0.0.1] commit
    [~Switch ModuleE-ospf-1-area-0.0.0.1] quit
    [~Switch ModuleE-ospf-1] quit

    # Configure Switch Module F.

    <Huawei> system-view
    [~HUAWEI] sysname SwitchF
    [*HUAWEI] commit
    [~Switch ModuleF] router id 6.6.6.6
    [*Switch ModuleF] ospf 1
    [*Switch ModuleF-ospf-1] area 2
    [*Switch ModuleF-ospf-1-area-0.0.0.2] network 172.17.1.0 0.0.0.255
    [*Switch ModuleF-ospf-1-area-0.0.0.2] commit
    [~Switch ModuleF-ospf-1-area-0.0.0.2] quit
    [~Switch ModuleF-ospf-1] quit

  3. Verify the configuration.

    # Display the OSPF neighbors of Switch Module A.

    [~Switch ModuleA] display ospf peer
    OSPF Process 1 with Router ID 1.1.1.1
     Area 0.0.0.0 interface 192.168.0.1(Vlanif10)'s neighbors
      Router ID: 2.2.2.2            Address : 192.168.0.2
      State    : Full               Mode    : Nbr is Master      Priority: 1
      DR       : 192.168.0.2        BDR     : 192.168.0.1        MTU     : 0
      Dead timer due (in seconds) : 36
      Retrans timer interval      : 5
      Neighbor up time            : 02h29m06s
      Authentication Sequence     : 0
    
     Area 0.0.0.1 interface 192.168.1.1(Vlanif20)'s neighbors
      Router ID: 3.3.3.3            Address : 192.168.1.2
      State    : Full               Mode    : Nbr is Master      Priority: 1
      DR       : 192.168.1.2        BDR     : 192.168.1.1        MTU     : 0
      Dead timer due (in seconds) : 33
      Retrans timer interval      : 5
      Neighbor up time            : 02h28m52s
      Authentication Sequence     : 0

    # Display the OSPF routes of Switch Module A.

    [~Switch ModuleA] display ospf routing
    OSPF Process 1 with Router ID 1.1.1.1
    
     Routing for Network
     --------------------------------------------------------------------------------
     Destination        Cost       Type       NextHop         AdvRouter       Area
     172.16.1.0/24      2          Transit    192.168.1.2     3.3.3.3         0.0.0.1
    
     172.17.1.0/24      3          Inter-area 192.168.0.2     2.2.2.2         0.0.0.0
    
     192.168.0.0/24     1          Direct     192.168.0.1     1.1.1.1         0.0.0.0
    
     192.168.1.0/24     1          Direct     192.168.1.1     1.1.1.1         0.0.0.1
    
     192.168.2.0/24     2          Inter-area 192.168.0.2     2.2.2.2         0.0.0.0
    
     Total Nets: 5
     Intra Area: 3  Inter Area: 2  ASE: 0  NSSA: 0    

    # Display the LSDB of Switch Module A.

    [~Switch ModuleA] display ospf lsdb
    OSPF Process 1 with Router ID 1.1.1.1
    Link State Database
    
                              Area: 0.0.0.0
     Type      LinkState ID    AdvRouter        Age  Len   Sequence       Metric
     Router    1.1.1.1         1.1.1.1           93  48    80000004            1
     Router    2.2.2.2         2.2.2.2           92  48    80000004            1
     Sum-Net   172.16.1.0      1.1.1.1         1287  28    80000002            2
     Sum-Net   192.168.1.0     1.1.1.1         1716  28    80000001            1
     Sum-Net   172.17.1.0      2.2.2.2         1336  28    80000001            2
     Sum-Net   192.168.2.0     2.2.2.2           87  28    80000002            1
    
                              Area: 0.0.0.1
     Type      LinkState ID    AdvRouter        Age  Len   Sequence       Metric
     Router    1.1.1.1         1.1.1.1         1420  48    80000002            1
     Router    3.3.3.3         3.3.3.3         1294  60    80000003            1
     Router    5.5.5.5         5.5.5.5         1296  36    80000002            1
     Network   172.16.1.1      3.3.3.3         1294  32    80000001            0
     Sum-Net   172.17.1.0      1.1.1.1         1325  28    80000001            3
     Sum-Net   192.168.0.0     1.1.1.1         1717  28    80000001            1
     Sum-Net   192.168.2.0     1.1.1.1         1717  28    80000001            2

    # Display the routing table on Switch Module D and perform the ping operation to test the connectivity.

    [~Switch ModuleD] display ospf routing
    OSPF Process 1 with Router ID 4.4.4.4
    
     Routing for Network
     --------------------------------------------------------------------------------
     Destination        Cost       Type       NextHop         AdvRouter       Area
     172.16.1.0/24      4          Inter-area 192.168.2.1     2.2.2.2         0.0.0.2
    
     172.17.1.0/24      1          Direct     172.17.1.1      4.4.4.4         0.0.0.2
    
     192.168.0.0/24     2          Inter-area 192.168.2.1     2.2.2.2         0.0.0.2
    
     192.168.1.0/24     3          Inter-area 192.168.2.1     2.2.2.2         0.0.0.2
    
     192.168.2.0/24     1          Direct     192.168.2.2     4.4.4.4         0.0.0.2
    
     Total Nets: 5
     Intra Area: 2  Inter Area: 3  ASE: 0  NSSA: 0
    [~Switch ModuleD] ping 172.16.1.1
      PING 172.16.1.1: 56  data bytes, press CTRL_C to break
        Reply from 172.16.1.1: bytes=56 Sequence=1 ttl=253 time=62 ms
        Reply from 172.16.1.1: bytes=56 Sequence=2 ttl=253 time=16 ms
        Reply from 172.16.1.1: bytes=56 Sequence=3 ttl=253 time=62 ms
        Reply from 172.16.1.1: bytes=56 Sequence=4 ttl=253 time=94 ms
        Reply from 172.16.1.1: bytes=56 Sequence=5 ttl=253 time=63 ms
    
    
      --- 172.16.1.1 ping statistics ---
        5 packet(s) transmitted
        5 packet(s) received
        0.00% packet loss
        round-trip min/avg/max = 16/59/94 ms

Configuration Files
  • Configuration file of Switch Module A

    #
     sysname Switch ModuleA
    #
     vlan batch 10 20
    #
     router id 1.1.1.1
    #
    interface Vlanif10
     ip address 192.168.0.1 255.255.255.0 
    #
    interface Vlanif20
     ip address 192.168.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 
    #
    ospf 1
     area 0.0.0.0
      network 192.168.0.0 0.0.0.255
     area 0.0.0.1
      network 192.168.1.0 0.0.0.255
    #
    return
  • Configuration file of Switch Module B

    #
     sysname Switch ModuleB
    #
     vlan batch 10 30
    #
     router id 2.2.2.2
    #
    interface Vlanif10
     ip address 192.168.0.2 255.255.255.0
    #
    interface Vlanif30
     ip address 192.168.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 30 
    #
    ospf 1
     area 0.0.0.0
      network 192.168.0.0 0.0.0.255
     area 0.0.0.2
      network 192.168.2.0 0.0.0.255
    #
    return
  • Configuration file of Switch Module C

    #
     sysname Switch ModuleC
    #
     vlan batch 20 40
    #
     router id 3.3.3.3
    #
    interface Vlanif20
     ip address 192.168.1.2 255.255.255.0
    #
    interface Vlanif40
     ip address 172.16.1.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 
    #
    ospf 1
     area 0.0.0.1
      network 192.168.1.0 0.0.0.255
      network 172.16.1.0 0.0.0.255
    #
    return
  • Configuration file of Switch Module D

    #
     sysname Switch ModuleD
    #
     vlan batch 30 50
    #
     router id 4.4.4.4
    #
    interface Vlanif30
     ip address 192.168.2.2 255.255.255.0
    #
    interface Vlanif50
     ip address 172.17.1.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 50 
    #
    ospf 1
     area 0.0.0.2
      network 192.168.2.0 0.0.0.255
      network 172.17.1.0 0.0.0.255
    #
    return
  • Configuration file of Switch Module E

    #
     sysname Switch ModuleE
    #
     vlan batch 40
    #
     router id 5.5.5.5
    #
    interface Vlanif40
     ip address 172.16.1.2 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 40 
    #
    ospf 1
     area 0.0.0.1
      network 172.16.1.0 0.0.0.255
    #
    return
  • Configuration file of Switch Module F

    #
     sysname Switch ModuleF
    #
     router id 6.6.6.6
    #
     vlan batch 50
    #
    interface Vlanif50
     ip address 172.17.1.2 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 50
    #
    ospf 1
     area 0.0.0.2
      network 172.17.1.0 0.0.0.255
    #
    return

Example for Configuring OSPF Stub Areas

Networking Requirements

As shown in Figure 7-50, all switch moduless run OSPF, and the entire AS is partitioned into three areas. Switch Module A and Switch Module B function as ABRs to advertise routes between areas; Switch Module D functions as the ASBR to import external routes, that is, static routes.

It is required to configure Area 1 as a stub area to reduce the LSAs advertised to this area without affecting the route reachability.

Figure 7-50 Networking diagram of configuring an OSPF stub area

Configuration Roadmap

The configuration roadmap is as follows:

  1. Configure basic OSPF functions on each switch modules to realize interconnection.

  2. Configure static routes on Switch Module D and import it into OSPF.

  3. Configure Area 1 as a stub area by running the stub command on all switch moduless in Area 1 and check the OSPF routing information on Switch Module C.

  4. Prevent Switch Module A from advertising Type 3 LSAs to the stub area, and check the OSPF routing information on Switch Module C.

Procedure

  1. Assign an IP address to each interface. The detailed configuration is not mentioned here.
  2. Configure basic OSPF functions. For details, see Example for Configuring Basic OSPF Functions.
  3. Configure Switch Module D to import static routes.

    [~Switch ModuleD] ip route-static 200.0.0.0 8 null 0
    [*Switch ModuleD] ospf 1
    [*Switch ModuleD-ospf-1] import-route static type 1
    [*Switch ModuleD-ospf-1] commit
    [~Switch ModuleD-ospf-1] quit

    # Display ABR and ASBR information on Switch Module C.

    [~Switch ModuleC] display ospf abr-asbr
    
    
    OSPF Process 1 with Router ID 3.3.3.3
    Routing Table to ABR and ASBR
    
    
     Type        Destination       Area       Cost  NextHop         RtType
     Intra-area  1.1.1.1           0.0.0.1    1     192.168.1.1     ABR
     Inter-area  4.4.4.4           0.0.0.1    3     192.168.1.1     ASBR

    # Display the OSPF routing table on Switch Module C.

    NOTE:

    If the area where Switch Module C resides is a common area, external routes exist in the routing table.

    [~Switch ModuleC] display ospf routing
    OSPF Process 1 with Router ID 3.3.3.3
    
     Routing for Network
     --------------------------------------------------------------------------------
     Destination        Cost       Type       Next-Hop         AdvRouter       Area
     172.16.1.0/24      1          Direct     172.16.1.1       3.3.3.3         0.0.0.1
    
     172.17.1.0/24      4          Inter-area 192.168.1.1      1.1.1.1         0.0.0.1
    
     192.168.0.0/24     2          Inter-area 192.168.1.1      1.1.1.1         0.0.0.1
    
     192.168.1.0/24     1          Direct     192.168.1.2      1.1.1.1         0.0.0.1
    
     192.168.2.0/24     3          Inter-area 192.168.1.1      1.1.1.1         0.0.0.1
    
     Routing for ASEs
     --------------------------------------------------------------------------------
     Destination        Cost       Type       Tag        NextHop         AdvRouter
     200.0.0.0/8       4         Type1      1         192.168.1.1     4.4.4.4
    
    
     Total Nets: 6
     Intra Area: 2  Inter Area: 3  ASE: 1  NSSA: 0

  4. Configure Area 1 as a stub area.

    # Configure Switch Module A.

    [~Switch ModuleA] ospf 1
    [*Switch ModuleA-ospf-1] area 1
    [*Switch ModuleA-ospf-1-area-0.0.0.1] stub
    [*Switch ModuleA-ospf-1-area-0.0.0.1] commit
    [~Switch ModuleA-ospf-1-area-0.0.0.1] quit
    [~Switch ModuleA-ospf-1] quit

    # Configure Switch Module C.

    [~Switch ModuleC] ospf 1
    [*Switch ModuleC-ospf-1] area 1
    [*Switch ModuleC-ospf-1-area-0.0.0.1] stub
    [*Switch ModuleC-ospf-1-area-0.0.0.1] commit
    [~Switch ModuleC-ospf-1-area-0.0.0.1] quit
    [~Switch ModuleC-ospf-1] quit

    # Configure Switch Module E.

    [~Switch ModuleE] ospf 1
    [*Switch ModuleE-ospf-1] area 1
    [*Switch ModuleE-ospf-1-area-0.0.0.1] stub
    [*Switch ModuleE-ospf-1-area-0.0.0.1] commit
    [~Switch ModuleE-ospf-1-area-0.0.0.1] quit
    [~Switch ModuleE-ospf-1] quit

    # Display the routing table on Switch Module C.

    NOTE:

    After the area where Switch Module C resides is configured as a stub area, a default route rather than AS external routes exists in the routing table.

    [~Switch ModuleC] display ospf routing
    OSPF Process 1 with Router ID 3.3.3.3
    
     Routing for Network
     --------------------------------------------------------------------------------
     Destination        Cost       Type       Next-Hop         AdvRouter       Area
     0.0.0.0/0        2        Inter-area 192.168.1.1  1.1.1.1       0.0.0.1
    
     172.16.1.0/24      1          Direct     172.16.1.1       3.3.3.3         0.0.0.1
    
     172.17.1.0/24      4          Inter-area 192.168.1.1      1.1.1.1         0.0.0.1
    
     192.168.0.0/24     2          Inter-area 192.168.1.1      1.1.1.1         0.0.0.1
    
     192.168.1.0/24     1          Direct     192.168.1.2      3.3.3.3         0.0.0.1
    
     192.168.2.0/24     3          Inter-area 192.168.1.1      1.1.1.1         0.0.0.1
    
     Total Nets: 6
     Intra Area: 2  Inter Area: 4  ASE: 0  NSSA: 0

  5. # Prevent Switch Module A from advertising Type 3 LSAs to the stub area.

    [~Switch ModuleA] ospf
    [*Switch ModuleA-ospf-1] area 1
    [*Switch ModuleA-ospf-1-area-0.0.0.1] stub no-summary
    [*Switch ModuleA-ospf-1-area-0.0.0.1] commit
    [~Switch ModuleA-ospf-1-area-0.0.0.1] quit

  6. Verify the configuration.

    # Display the OSPF routing table on Switch Module C.

    [~Switch ModuleC] display ospf routing
    OSPF Process 1 with Router ID 3.3.3.3
    
     Routing for Network
     --------------------------------------------------------------------------------
     Destination        Cost       Type       Next-Hop         AdvRouter       Area
     0.0.0.0/0          2          Inter-area 192.168.1.1      1.1.1.1         0.0.0.1
    
     172.16.1.0/24      1          Direct     172.16.1.1       3.3.3.3         0.0.0.1
    
     192.168.1.0/24     1          Direct     192.168.1.2      3.3.3.3         0.0.0.1
    
     Total Nets: 3
     Intra Area: 2  Inter Area: 1  ASE: 0  NSSA: 0
    NOTE:

    After the advertisement of summary LSAs to the stub area is disabled, the routing entries on the switch modules in the stub area are further reduced, and only the default route to a destination outside the stub area is reserved.

Configuration Files
  • Configuration file of Switch Module A

    #
     sysname Switch ModuleA
    #
     vlan batch 10 20
    #
     router id 1.1.1.1
    #
    interface Vlanif10
     ip address 192.168.0.1 255.255.255.0
    #
    interface Vlanif20
     ip address 192.168.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
    #
    ospf 1
     area 0.0.0.0
      network 192.168.0.0 0.0.0.255
     area 0.0.0.1
      network 192.168.1.0 0.0.0.255
      stub no-summary
    #
    return
    NOTE:

    Configuration files of Switch Module B and Switch Module F are similar to the configuration file of Switch Module A, and are not mentioned here.

  • Configuration file of Switch Module C

    #
     sysname Switch ModuleC
    #
     vlan batch 20 40
    #
     router id 3.3.3.3
    #
    interface Vlanif20
     ip address 192.168.1.2 255.255.255.0
    #
    interface Vlanif40
     ip address 172.16.1.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
    #
    ospf 1
    area 0.0.0.1
      network 192.168.1.0 0.0.0.255
      network 172.16.1.0 0.0.0.255
      stub
    #
    return
  • Configuration file of Switch Module D

    #
     sysname Switch ModuleD
    #
     vlan batch 30 50
    #
     router id 4.4.4.4
    #
    interface Vlanif30
     ip address 192.168.2.2 255.255.255.0
    #
    interface Vlanif50
     ip address 172.17.1.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 50
    #
    ospf 1
     import-route static type 1
     area 0.0.0.2
      network 192.168.2.0 0.0.0.255
      network 172.17.1.0 0.0.0.255
    #
     ip route-static 200.0.0.0 255.0.0.0 NULL0
    #
    return
  • Configuration file of Switch Module E

    #
     sysname Switch ModuleE
    #
     vlan batch 40
    #
     router id 5.5.5.5
    #
    interface Vlanif40
     ip address 172.16.1.2 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 40
    #
    ospf 1
     area 0.0.0.1
      network 172.16.1.0 0.0.0.255
      stub
    #
    return

Example for Configuring an NSSA Area

Networking Requirements

As shown in Figure 7-51, OSPF is enabled on all Switch Modulees and the AS is divided into three areas. Switch Module A and Switch Module B function as ABRs to forward routes between areas; Switch Module D functions as the ASBR to import external routes, that is, static routes.

You need to configure Area 1 as an NSSA area and configure Switch ModuleC as an ASBR to import external routes (static routes). The routing information can be transmitted correctly in the AS.

Figure 7-51 Networking diagram for configuring an NSSA area

Configuration Roadmap

The configuration roadmap is as follows:

  1. Enable OSPF on each Switch Module and configure the basic OSPF functions.
  2. Configure static routes on Switch Module D and import them into OSPF.
  3. Configure Area 1 as an NSSA area and check the OSPF routing information of Switch Module C. You must run the nssa command on all the devices in Area 1.
  4. Configure static routes on Switch Module C, import them into OSPF, and check the OSPF routing information of Switch Module D.

Procedure

  1. Configure the VLAN that each interface belongs to.

    <HUAWEI> system-view
    [~HUAWEI] sysname Switch ModuleA
    [*HUAWEI] commit
    [~Switch ModuleA] vlan batch 10 20
    [*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 link-type trunk
    [*Switch ModuleA-10GE1/17/2] port trunk allow-pass vlan 20
    [*Switch ModuleA-10GE1/17/2] quit
    [*Switch ModuleA] commit

    The configurations of Switch Module B, Switch Module C, Switch Module D, Switch Module E, and Switch Module F are similar to the configuration of Switch A, and are not mentioned here.

  2. Assign an IP address to each VLANIF interface.

    [~Switch ModuleA] interface vlanif 10
    [*Switch ModuleA-Vlanif10] ip address 192.168.0.1 24
    [*Switch ModuleA-Vlanif10] quit
    [*Switch ModuleA] interface vlanif 20
    [*Switch ModuleA-Vlanif20] ip address 192.168.1.1 24
    [*Switch ModuleA-Vlanif20] quit
    [*Switch ModuleA] commit

    The configurations of Switch Module B, Switch Module C, Switch Module D, Switch Module E, and Switch Module F are similar to the configuration of Switch A, and are not mentioned here.

  3. Configure the basic OSPF functions. See Example for Configuring Basic OSPF Functions.
  4. Configure Switch Module D to import static routes. See Example for Configuring OSPF Stub Areas.
  5. Configure Area 1 as an NSSA area.

    # Configure Switch Module A.

    [~Switch ModuleA] ospf
    [*Switch ModuleA-ospf-1] area 1
    [*Switch ModuleA-ospf-1-area-0.0.0.1] nssa default-route-advertise no-summary
    [*Switch ModuleA-ospf-1-area-0.0.0.1] quit
    [*Switch ModuleA-ospf-1] quit
    [*Switch ModuleA] commit

    # Configure Switch Module C.

    [~Switch ModuleC] ospf
    [*Switch ModuleC-ospf-1] area 1
    [*Switch ModuleC-ospf-1-area-0.0.0.1] nssa
    [*Switch ModuleC-ospf-1-area-0.0.0.1] quit
    [*Switch ModuleC-ospf-1] quit
    [*Switch ModuleC] commit

    # Configure Switch Module E.

    [~Switch ModuleE] ospf
    [*Switch ModuleE-ospf-1] area 1
    [*Switch ModuleE-ospf-1-area-0.0.0.1] nssa
    [*Switch ModuleE-ospf-1-area-0.0.0.1] quit
    [*Switch ModuleE-ospf-1] quit
    [*Switch ModuleE] commit
    NOTE:

    The default-route-advertise and no-summary keywords are recommend on the ABR (Switch Module A). In this manner, the size of the routing table of devices in an NSSA area can be reduced. For the other devices in the NSSA area, you need to run only the nssa command.

    # View the OSPF routing table of Switch Module C.

    [~Switch ModuleC] display ospf routing
     
    OSPF Process 1 with Router ID 3.3.3.3
      
     Routing for Network
     -----------------------------------------------------------------------------
     Destination        Cost  Type          NextHop         AdvRouter       Area
     0.0.0.0/0          2     Inter-area   192.168.1.1      1.1.1.1         0.0.0.1
    
     172.16.1.0/24      1     Direct       172.16.1.1       3.3.3.3         0.0.0.1
    
     192.168.1.0/24     1     Direct       192.168.1.2      3.3.3.3         0.0.0.1
     
     Total Nets: 3
     Intra Area: 2  Inter Area: 1  ASE: 0  NSSA: 0

  6. Configure Switch Module C to import static routes.

    # Import static routes on Switch Module C.

    [~Switch ModuleC] ip route-static 100.0.0.0 8 null 0
    [~Switch ModuleC] ospf
    [~Switch ModuleC-ospf-1] import-route static
    [~Switch ModuleC-ospf-1] quit
    [~Switch ModuleC] commit

  7. Verify the configuration.

    # View the OSPF routing table of Switch Module D.

    [~Switch ModuleD] display ospf routing
     
    OSPF Process 1 with Router ID 4.4.4.4
     
     Routing for Network
     ----------------------------------------------------------------------------
     Destination        Cost  Type         NextHop         AdvRouter       Area
     172.16.1.0/24      4     Inter-area  192.168.2.1      2.2.2.2         0.0.0.2
    
     172.17.1.0/24      1     Direct      172.17.1.1       4.4.4.4         0.0.0.2
    
     192.168.0.0/24     2     Inter-area  192.168.2.1      2.2.2.2         0.0.0.2
    
     192.168.1.0/24     3     Inter-area  192.168.2.1      2.2.2.2         0.0.0.2
    
     192.168.2.0/24     1     Direct      192.168.2.2      4.4.4.4         0.0.0.2
    
     Routing for ASEs
     -----------------------------------------------------------------------------
     Destination        Cost      Type       Tag         NextHop         AdvRouter
     100.0.0.0/8        1         Type2      1           192.168.2.1     1.1.1.1
     
     Total Nets: 6
     Intra Area: 2  Inter Area: 3  ASE: 1  NSSA: 0

    From the routing table of Switch Module D, you can find that an AS external route is imported to the NSSA area.

Configuration Files
  • Configuration file of Switch ModuleA

    #
     sysname Switch ModuleA
    #
     vlan batch 10 20
    #
     router id 1.1.1.1
    #
    interface Vlanif10
     ip address 192.168.0.1 255.255.255.0
    #
    interface Vlanif20
     ip address 192.168.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
    #
    ospf 1
     area 0.0.0.0
      network 192.168.0.0 0.0.0.255
     area 0.0.0.1
      network 192.168.1.0 0.0.0.255
      nssa default-route-advertise no-summary
    #
    return
    NOTE:

    Configuration files of Switch Module B, Switch Module D, and Switch Module F are similar to the configuration file of Switch Module A, and are not mentioned here.

  • Configuration file of Switch Module C

    #
     sysname Switch ModuleC
    #
     vlan batch 20 40
    #
     router id 3.3.3.3
    #
    interface Vlanif20
     ip address 192.168.1.2 255.255.255.0
    #
    interface Vlanif40
     ip address 172.16.1.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
    #
    ospf 1
     import-route static
     area 0.0.0.1
      network 192.168.1.0 0.0.0.255
      network 172.16.1.0 0.0.0.255
      nssa
    #
     ip route-static 100.0.0.0 255.0.0.0 NULL0
    #
    return
  • Configuration file of Switch Module E

    #
     sysname Switch ModuleE
    #
     vlan batch 40
    #
     router id 5.5.5.5
    #
    interface Vlanif40
     ip address 172.16.1.2 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 40
    #
    ospf 1
     area 0.0.0.1
      network 172.16.1.0 0.0.0.255
      nssa
    #
    return

Example for Configuring DR Election of OSPF

Networking Requirements

As shown in Figure 7-52, Switch Module A has the highest priority of 100 on the network and is elected as the DR; Switch Module C has the highest priority of 2. Switch Module C has the second highest priority and is elected as the BDR; The priority of Switch Module B is 0 and therefore cannot be elected as a DR or a BDR; the priority of Switch Module D is not set, so Switch Module D uses the default value 1.

Figure 7-52 Networking diagram for configuring DR election of an OSPF process

Configuration Roadmap

The configuration roadmap is as follows:

  1. Configure the ID of the VLAN that each interface belongs to.
  2. Assign an IP address to each VLANIF interface.
  3. Configure the router ID, enable OSPF, and specify network segments on each Switch Module.
  4. Check whether an Switch Module is the DR or BDR with its default DR priority.
  5. Set the DR priority of the interface on each Switch Module and check whether the Switch Module becomes the DR or BDR.

Procedure

  1. Configure the VLAN that each interface belongs to.

    <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] commit

    The configurations of Switch Module B, Switch Module C, and Switch Module D are similar to the configuration of Switch Module A, and are not mentioned here.

  2. Assign an IP address to each VLANIF interface.

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

    The configurations of Switch Module B, Switch Module C, and Switch Module D are similar to the configuration of Switch Module A, and are not mentioned here.

  3. Configure the basic OSPF functions.

    # Configure Switch Module A.

    [~Switch ModuleA] router id 1.1.1.1
    [*Switch ModuleA] ospf
    [*Switch ModuleA-ospf-1] area 0
    [*Switch ModuleA-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255
    [*Switch ModuleA-ospf-1-area-0.0.0.0] quit
    [*Switch ModuleA-ospf-1] quit
    [*Switch ModuleA] commit

    # Configure Switch ModuleB.

    [~Switch ModuleB] router id 2.2.2.2
    [*Switch ModuleB] ospf
    [*Switch ModuleB-ospf-1] area 0
    [*Switch ModuleB-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255 
    [*Switch ModuleB-ospf-1-area-0.0.0.0] quit
    [*Switch ModuleB-ospf-1] quit
    [*Switch ModuleB] commit

    # Configure Switch Module C.

    [~Switch ModuleC] router id 3.3.3.3
    [*Switch ModuleC] ospf
    [*Switch ModuleC-ospf-1] area 0
    [*Switch ModuleC-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255 
    [*Switch ModuleC-ospf-1-area-0.0.0.0] quit
    [*Switch ModuleC-ospf-1] quit
    [*Switch ModuleC] commit

    # Configure Switch Module D.

    [~Switch ModuleD] router id 4.4.4.4
    [*Switch ModuleD] ospf
    [*Switch ModuleD-ospf-1] area 0
    [*Switch ModuleD-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255 
    [*Switch ModuleD-ospf-1-area-0.0.0.0] quit
    [*Switch ModuleD-ospf-1] quit
    [*Switch ModuleD] commit

    # Check information about neighbors of Switch Module A to find the DR and BDR.

    [~Switch ModuleA] display ospf peer
     
    OSPF Process 1 with Router ID 1.1.1.1
     Area 0.0.0.0 interface 192.168.1.1(Vlanif10)'s neighbors
       Router ID: 2.2.2.2      Address: 192.168.1.2      GR State: Normal
       State: Full  Mode:Nbr is  Master  Priority: 1
       DR: 192.168.1.4  BDR: 192.168.1.3  MTU: 0
       Dead timer due in 32  sec
       Neighbor is up for 00:00:00
       Authentication Sequence: [~ 0 ]
     
       Router ID: 3.3.3.3      Address: 192.168.1.3      GR State: Normal
       State: Full  Mode:Nbr is  Master  Priority: 1
       DR: 192.168.1.4  BDR: 192.168.1.3  MTU: 0
       Dead timer due in 37  sec
       Neighbor is up for 00:04:06
       Authentication Sequence: [~ 0 ]
     
       Router ID: 4.4.4.4      Address: 192.168.1.4      GR State: Normal
       State: Full  Mode:Nbr is  Master  Priority: 1
       DR: 192.168.1.4  BDR: 192.168.1.3  MTU: 0
       Dead timer due in 37  sec
       Neighbor is up for 00:03:53
       Authentication Sequence: [~ 0 ]

    Check the neighbors of Switch Module A. You can view the DR priority and the neighbor status. By default, the DR priority is 1. Now Switch Module D functions as the DR and Switch Module C functions as the BDR.

    NOTE:

    When the priority is the same, the switch modules with a higher router ID is elected as the DR. If a new switch modules is added after the DR/BDR election is complete, the new switch modules cannot become the DR even if it has the highest priority.

  4. Set the DR priority on each VLANIF interface.

    # Configure Switch Module A.

    [~Switch ModuleA] interface Vlanif 10
    [~Switch ModuleA-Vlanif10] ospf dr-priority 100
    [*Switch ModuleA-Vlanif10] quit
    [*Switch ModuleA] commit

    Configure Switch ModuleB.

    [~Switch ModuleB] interface Vlanif 10
    [~Switch ModuleB-Vlanif10] ospf dr-priority 0
    [*Switch ModuleB-Vlanif10] quit
    [*Switch ModuleB] commit

    # Configure Switch Module C.

    [~Switch ModuleC] interface Vlanif 10
    [~Switch ModuleC-Vlanif10] ospf dr-priority 2
    [*Switch ModuleC-Vlanif10] quit
    [*Switch ModuleC] commit

    # Check the status of the DR or BDR.

    [~Switch ModuleD] display ospf peer
     
    OSPF Process 1 with Router ID 4.4.4.4
     Area 0.0.0.0 interface 192.168.1.4(Vlanif10)'s neighbors
       Router ID: 1.1.1.1      Address: 192.168.1.1      GR State: Normal
       State: Full  Mode:Nbr is  Slave  Priority: 100
       DR: 192.168.1.4  BDR: 192.168.1.3  MTU: 0
       Dead timer due in 31  sec
       Neighbor is up for 00:11:17
       Authentication Sequence: [~ 0 ]
    
       Router ID: 2.2.2.2      Address: 192.168.1.2      GR State: Normal
       State: Full  Mode:Nbr is  Slave  Priority: 0
       DR: 192.168.1.4  BDR: 192.168.1.3  MTU: 0
       Dead timer due in 35  sec
       Neighbor is up for 00:11:19
       Authentication Sequence: [~ 0 ]
    
       Router ID: 3.3.3.3      Address: 192.168.1.3      GR State: Normal
       State: Full  Mode:Nbr is  Slave  Priority: 2
       DR: 192.168.1.4  BDR: 192.168.1.3  MTU: 0
       Dead timer due in 33  sec
       Neighbor is up for 00:11:15
       Authentication Sequence: [~ 0 ]
    NOTE:

    The DR priorities configured on the interfaces do not take effect immediately.

  5. Restart the OSPF process.

    In the user view of each Switch Module, run the reset ospf 1 process command to restart the OSPF process.

  6. Verify the configuration.

    # Check the status of OSPF neighbors.

    [~Switch ModuleD] display ospf peer
     
    OSPF Process 1 with Router ID 4.4.4.4
     Area 0.0.0.0 interface 192.168.1.4(Vlanif10)'s neighbors
       Router ID: 1.1.1.1      Address: 192.168.1.1      GR State: Normal
       State: Full  Mode:Nbr is  Slave  Priority: 100
       DR: 192.168.1.1  BDR: 192.168.1.3  MTU: 0
       Dead timer due in 35  sec
       Neighbor is up for 00:07:19
       Authentication Sequence: [~ 0 ]
     
       Router ID: 2.2.2.2      Address: 192.168.1.2      GR State: Normal
       State: Full  Mode:Nbr is  Master  Priority: 0
       DR: 192.168.1.1  BDR: 192.168.1.3  MTU: 0
       Dead timer due in 35  sec
       Neighbor is up for 00:00:00
       Authentication Sequence: [~ 0 ]
     
       Router ID: 3.3.3.3      Address: 192.168.1.3      GR State: Normal
       State: Full  Mode:Nbr is  Slave  Priority: 2
       DR: 192.168.1.1  BDR: 192.168.1.3  MTU: 0
       Dead timer due in 37  sec
       Neighbor is up for 00:07:17
       Authentication Sequence: [~ 0 ]

    # Check the status of OSPF interfaces.

    [~Switch ModuleA] display ospf interface
     
    OSPF Process 1 with Router ID 1.1.1.1
     
     Area: 0.0.0.0          (MPLS TE not enabled)
    
     Interface           IP Address      Type         State    Cost    Pri  
     Vlanif10            192.168.1.1     Broadcast    DR      1       1    
     [~Switch ModuleB] display ospf interface
     
    OSPF Process 1 with Router ID 2.2.2.2
     
     Area: 0.0.0.0          (MPLS TE not enabled)
    
     Interface           IP Address      Type         State    Cost    Pri  
     Vlanif10            192.168.1.2     Broadcast    DROther  1       0   
     

    If all neighbors are in Full state, it indicates that the local device establishes adjacencies with all its neighbors. If a neighbor stays in 2-Way state, it indicates the local Switch Module and the neighbor are not the DR or BDR. Therefore, they do not need to exchange LSAs.

    If the status of an OSPF interface is DROther, it indicates that the router is neither the DR nor the BDR.

Configuration Files
  • Configuration file of Switch Module A

    #
     sysname Switch ModuleA
    #
     vlan batch 10
    #
     router id 1.1.1.1
    #
    interface Vlanif10
     ip address 192.168.1.1 255.255.255.0
     ospf dr-priority 100
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 10 
    #
    ospf 1
     area 0.0.0.0
      network 192.168.1.0 0.0.0.255
    #
    return
  • Configuration file of Switch Module B

    #
     sysname Switch ModuleB
    #
     vlan batch 10
    #
     router id 2.2.2.2
    #
    interface Vlanif10
     ip address 192.168.1.2 255.255.255.0
     ospf dr-priority 0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 10 
    #
    ospf 1
     area 0.0.0.0
      network 192.168.1.0 0.0.0.255
    #
    return
  • Configuration file of Switch Module C

    #
     sysname Switch ModuleC
    #
     vlan batch 10
    #
     router id 3.3.3.3
    #
    interface Vlanif10
     ip address 192.168.1.3 255.255.255.0
     ospf dr-priority 2
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 10 
    #
    ospf 1
     area 0.0.0.0
      network 192.168.1.0 0.0.0.255
    #
    return
  • Configuration file of Switch Module D

    #
     sysname Switch ModuleD
    #
     vlan batch 10
    #
     router id 4.4.4.4
    #
    interface Vlanif10
     ip address 192.168.1.4 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 10 
    #
    ospf 1
     area 0.0.0.0
      network 192.168.1.0 0.0.0.255
    #
    return

Example for Configuring Load Balancing Among OSPF Routes

Networking Requirements

As shown in Figure 7-53, the networking requirements are as follows:

  • Switch Module A, Switch Module B, Switch Module C, and Switch Module D connect to each other through OSPF.
  • Switch Module A, Switch Module B, Switch Module C, and Switch Module D belong to Area 0.
  • Load balancing needs is configured so that the traffic of Switch Module A can be sent to Switch Module D through Switch Module B and Switch Module C.
Figure 7-53 Networking diagram for configuring load balancing among OSPF routes

Configuration Roadmap

The configuration roadmap is as follows:

  1. Configure the basic OSPF functions on each Switch Module to implement interconnection.
  2. Disable load balancing on Switch Module A and check the routing table of Switch Module A.
  3. (Optional) Set the weight of equal-cost routes on Switch Module A.

Procedure

  1. Configure VLANs that the related interfaces belong to.

    <HUAWEI> system-view
    [~HUAWEI] sysname Switch ModuleA
    [*HUAWEI] commit
    [~Switch ModuleA] vlan batch 10 20 50
    [*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 link-type trunk
    [*Switch ModuleA-10GE1/17/2] port trunk allow-pass vlan 20
    [*Switch ModuleA-10GE1/17/2] quit
    [*Switch ModuleA] interface 10ge 1/17/3
    [*Switch ModuleA-10GE1/17/3] port link-type trunk
    [*Switch ModuleA-10GE1/17/3] port trunk allow-pass vlan 50
    [*Switch ModuleA-10GE1/17/3] quit
    [*Switch ModuleA] commit

    The configurations of Switch Module B, Switch Module C, and Switch Module D are similar to the configuration of Switch Module A, and are not mentioned here.

  2. Assign an IP address to each VLANIF interface.

    [~Switch ModuleA] interface vlanif 10
    [*Switch ModuleA-Vlanif10] ip address 10.1.1.1 24
    [*Switch ModuleA-Vlanif10] quit
    [*Switch ModuleA] interface vlanif 20
    [*Switch ModuleA-Vlanif20] ip address 10.1.2.1 24
    [*Switch ModuleA-Vlanif20] quit
    [*Switch ModuleA] interface vlanif 50
    [*Switch ModuleA-Vlanif50] ip address 172.16.1.1 24
    [*Switch ModuleA-Vlanif50] quit
    [*Switch ModuleA] commit

    The configurations of Switch Module B, Switch Module C, and Switch Module D are similar to the configuration of Switch Module A, and are not mentioned here.

  3. Configure the basic OSPF functions. See Example for Configuring Basic OSPF Functions.
  4. Disable load balancing on Switch Module A.

    [~Switch ModuleA] ospf
    [*Switch ModuleA-ospf-1] maximum load-balancing 1
    [*Switch ModuleA-ospf-1] quit
    [*Switch ModuleA] commit

    # View the routing table of Switch Module A.

    [~Switch ModuleA] display ip routing-table
    Proto: Protocol        Pre: Preference
    Route Flags: R - relay, D - download to fib, T - to vpn-instance
    ------------------------------------------------------------------------------
    Routing Tables: _public_
             Destinations : 16       Routes : 16
     
    Destination/Mask    Proto   Pre  Cost    Flags   NextHop         Interface
     
           10.1.1.0/24  Direct  0    0       D        10.1.1.1        Vlanif10
           10.1.1.1/32  Direct  0    0       D        127.0.0.1       Vlanif10
         10.1.1.255/32  Direct  0    0       D        127.0.0.1       Vlanif10
           10.1.2.0/24  Direct  0    0       D        10.1.2.1        Vlanif20
           10.1.2.1/32  Direct  0    0       D        127.0.0.1       Vlanif20
         10.1.2.255/32  Direct  0    0       D        127.0.0.1       Vlanif20
          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      Vlanif50
         172.16.1.1/32  Direct  0    0       D        127.0.0.1       Vlanif50
       172.16.1.255/32  Direct  0    0       D        127.0.0.1       Vlanif50
         172.17.1.0/24  OSPF    10   3       D        10.1.1.2        Vlanif10
        192.168.0.0/24  OSPF    10   2       D        10.1.1.2        Vlanif10
        192.168.1.0/24  OSPF    10   2       D        10.1.2.2        Vlanif20
    255.255.255.255/32  Direct  0    0       D        127.0.0.1       InLoopBack0 

    As shown in the routing table, when the maximum number of equal-cost routes for load balancing is set to 1, OSPF selects 10.1.1.2 as the next hop to the destination network 172.17.1.0.

    NOTE:

    In the preceding example, 10.1.1.2 is selected as the optimal next hop. This is because OSPF selects the next hop randomly among equal-cost routes.

  5. Restore the default number of equal-cost routes for load balancing on Switch Module A.

    [~Switch ModuleA] ospf
    [*Switch ModuleA-ospf-1] undo maximum load-balancing
    [*Switch ModuleA-ospf-1] quit
    [*Switch ModuleA] commit

    # View the routing table of 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 : 16       Routes : 17
     
    Destination/Mask    Proto   Pre  Cost  Flags     NextHop         Interface
     
           10.1.1.0/24  Direct  0    0       D        10.1.1.1        Vlanif10
           10.1.1.1/32  Direct  0    0       D        127.0.0.1       Vlanif10
         10.1.1.255/32  Direct  0    0       D        127.0.0.1       Vlanif10
           10.1.2.0/24  Direct  0    0       D        10.1.2.1        Vlanif20
           10.1.2.1/32  Direct  0    0       D        127.0.0.1       Vlanif20
         10.1.2.255/32  Direct  0    0       D        127.0.0.1       Vlanif20
          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      Vlanif50
         172.16.1.1/32  Direct  0    0       D        127.0.0.1       Vlanif50
       172.16.1.255/32  Direct  0    0       D        127.0.0.1       Vlanif50
         172.17.1.0/24  OSPF    10   3       D        10.1.1.2        Vlanif10
                        OSPF    10   3       D        10.1.2.2        Vlanif20
        192.168.0.0/24  OSPF    10   2       D        10.1.1.2        Vlanif10
        192.168.1.0/24  OSPF    10   2       D        10.1.2.2        Vlanif20
    255.255.255.255/32  Direct  0    0       D        127.0.0.1       InLoopBack0 

    As shown in the routing table, when the default setting of load balancing is restored, the next hops of Switch Module A, that is, 10.1.1.2 and 10.1.2.2 , become valid routes. This is because the default number of equal-cost routes is 32.

  6. (Optional) Set the weight of equal-cost routes on Switch Module A.

    If you do not want to implement load balancing between Switch Module B and Switch Module C, set the weight of equal-cost routes to specify the next hop.

    [~Switch ModuleA] ospf
    [~Switch ModuleA-ospf-1] nexthop 10.1.2.2 weight 1
    [*Switch ModuleA-ospf-1] quit
    [*Switch ModuleA] commit

    # View the routing table of Switch Module A.

    [~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 : 16       Routes : 16
     
    Destination/Mask    Proto   Pre  Cost   Flags    NextHop         Interface
           10.1.1.0/24  Direct  0    0       D        10.1.1.1        Vlanif10
           10.1.1.1/32  Direct  0    0       D        127.0.0.1       Vlanif10
         10.1.1.255/32  Direct  0    0       D        127.0.0.1       Vlanif10
           10.1.2.0/24  Direct  0    0       D        10.1.2.1        Vlanif20
           10.1.2.1/32  Direct  0    0       D        127.0.0.1       Vlanif20
         10.1.2.255/32  Direct  0    0       D        127.0.0.1       Vlanif20
          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      Vlanif50
         172.16.1.1/32  Direct  0    0       D        127.0.0.1       Vlanif50
       172.16.1.255/32  Direct  0    0       D        127.0.0.1       Vlanif50
         172.17.1.0/24  OSPF    10   3       D        10.1.2.2        Vlanif20
        192.168.0.0/24  OSPF    10   2       D        10.1.1.2        Vlanif10
        192.168.1.0/24  OSPF    10   2       D        10.1.2.2        Vlanif20
    255.255.255.255/32  Direct  0    0       D        127.0.0.1       InLoopBack0 

    As shown in the routing table, the priority of the next hop 10.1.2.2 with the weight as 1 is higher than that of 10.1.1.2 , after the weight is set for equal-cost routes. Thus, OSPF selects the route with the next hop 10.1.2.2 as the optimal route.

Configuration Files
  • Configuration file of Switch Module A

    #
     sysname Switch ModuleA
    #
     vlan batch 10 20 50
    #
    interface Vlanif10
     ip address 10.1.1.1 255.255.255.0
    #
    interface Vlanif20
     ip address 10.1.2.1 255.255.255.0
    #
    interface Vlanif50
     ip address 172.16.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 
    #
    interface 10GE1/17/3
     port link-type trunk
     port trunk allow-pass vlan 50 
    #
    ospf 1 router-id 1.1.1.1
     nexthop 10.1.2.2 weight 1
     area 0.0.0.0
      network 10.1.1.0 0.0.0.255
      network 10.1.2.0 0.0.0.255
      network 172.16.1.0 0.0.0.255
    #
    return
  • Configuration file of Switch Module B

    #
     sysname Switch ModuleB
    #
     vlan batch 20 40
    #
    interface Vlanif20
     ip address 10.1.2.2 255.255.255.0
    #
    interface Vlanif40
     ip address 192.168.1.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 
    #
    ospf 1 router-id 3.3.3.3
     area 0.0.0.0
      network 10.1.2.0 0.0.0.255
      network 192.168.1.0 0.0.0.255
    #
    return 
  • Configuration file of Switch Module C

    sysname Switch ModuleC
    #
     vlan batch 10 30
    #
    interface Vlanif10
     ip address 10.1.1.2 255.255.255.0
    #
    interface Vlanif30
     ip address 192.168.0.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 30 
    #
    ospf 1 router-id 2.2.2.2
     area 0.0.0.0
      network 10.1.1.0 0.0.0.255
      network 192.168.0.0 0.0.0.255
    #
    return
  • Configuration file of Switch Module D

    #
     sysname Switch ModuleD
    #
     vlan batch 30 40 60
    #
    interface Vlanif30
     ip address 192.168.0.2 255.255.255.0
    #
    interface Vlanif40
     ip address 192.168.1.2 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 30 
    #
    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 router-id 4.4.4.4
     area 0.0.0.0
      network 192.168.0.0 0.0.0.255
      network 192.168.1.0 0.0.0.255
      network 172.17.1.0 0.0.0.255
    #
    return

Example for Configuring OSPF IP FRR

Networking Requirements
When a fault occurs on the primary link T, traffic is switched to a backup link. In such a scenario, two problems arise:
  • It takes hundreds of milliseconds for the traffic to be switched to a backup link during OSPF fault restoration. During this period, services are interrupted.
  • Traffic will pass Switch Module A after link switching. Switch Module A is an ASBR and is not expected to function as a backup device.

When a fault occurs on the network, OSPF IP FRR can fast switch traffic to the backup link without waiting for route convergence. This ensures uninterrupted traffic transmission. In addition, you can also configure Switch Module A to detour around the backup link.

As shown in Figure 7-54:
  • All switches run OSPF.
  • The link cost meets the OSPF IP FRR traffic protection inequality.
  • When the primary link T fails, Switch Module S immediately switches traffic to the backup link. Thus, the traffic is forwarded through Switch Module N.

  • Based on the network planning, the link where Switch Module A resides does not function as an FRR backup link.
Figure 7-54 Networking diagram for configuring OSPF IP FRR

Switch Module

Router ID

Interface

VLANIF interface

IP address

Switch ModuleS

1.1.1.1

10GE1/17/1

VLANIF 10

10.1.1.1/24

-

-

10GE1/17/2

VLANIF 20

10.1.2.1/24

-

-

10GE1/17/3

VLANIF 30

10.1.3.1/24

Switch ModuleA

2.2.2.2

10GE1/17/1

VLANIF 10

10.1.1.2/24

-

-

10GE1/17/2

VLANIF 40

20.1.1.2/24

Switch ModuleN

3.3.3.3

10GE1/17/1

VLANIF 30

10.1.3.2/24

-

-

10GE1/17/2

VLANIF 60

20.1.3.2/24

Switch ModuleE

4.4.4.4

10GE1/17/1

VLANIF 40

20.1.1.1/24

-

-

10GE1/17/2

VLANIF 20

10.1.2.1/24

-

-

10GE1/17/3

VLANIF 60

20.1.3.1/24

-

-

10GE1/17/4

VLANIF 70

172.17.1.1/24

Configuration Notes

When configuring OSPF IP FRR, note the following points:

Before configuring OSPF IP FRR, you need to block FRR on the interface that is not expected to be an interface of a backup link. After that, the link where the interface resides is not calculated as a backup link during FRR calculation.

During the configuration of OSPF IP FRR, the lower layer needs to fast respond to a link change so that traffic can be rapidly switched to the backup link. After the bfd all-interfaces frr-binding command is run, the BFD session status is associated with the link status of an interface (when the BFD session goes Down, the link status of the interface becomes Down) so that link faults can be rapidly detected.

Configuration Roadmap
The configuration roadmap is as follows:
  1. Configure basic OSPF functions on each switch modules.

  2. Configure BFD for OSPF on all the devices in Area 0.

  3. Set the costs of links to ensure that link T is preferred to transmit traffic.

  4. Block FRR on a specified interface of Switch Module S.

  5. Enable OSPF IP FRR on Switch Module S to protect the traffic forwarded by Switch Module S.

Procedure

  1. Assign an IP address to each interface. The configuration details are not mentioned here.
  2. Configure basic OSPF functions. For details, see Example for Configuring Basic OSPF Functions.
  3. Configure BFD for OSPF on all the devices in Area 0. For details, see Example for Configuring BFD for OSPF.
  4. Set the costs of links to ensure that link T is preferred to transmit traffic.

    # Configure Switch Module S.

    [~Switch ModuleS] interface vlanif 10
    [*Switch ModuleS-Vlanif10] ospf cost 10
    [*Switch ModuleS-Vlanif10] quit
    [*Switch ModuleS] interface vlanif 20
    [*Switch ModuleS-Vlanif20] ospf cost 15
    [*Switch ModuleS-Vlanif20] quit
    [*Switch ModuleS] interface vlanif 30
    [*Switch ModuleS-Vlanif30] ospf cost 10
    [*Switch ModuleS-Vlanif30] quit
    [*Switch ModuleS] commit

    # Configure Switch Module A.

    [~Switch ModuleA] interface vlanif 40
    [*Switch ModuleA-Vlanif40] ospf cost 15
    [*Switch ModuleA-Vlanif40] quit
    [*Switch ModuleA] interface vlanif 10
    [*Switch ModuleA-Vlanif10] ospf cost 10
    [*Switch ModuleA-Vlanif10] quit
    [*Switch ModuleA] commit

    # Configure Switch Module N.

    [~Switch ModuleN] interface vlanif 30
    [*Switch ModuleN-Vlanif30] ospf cost 10
    [*Switch ModuleN-Vlanif30] quit
    [*Switch ModuleN] interface vlanif 60
    [*Switch ModuleN-Vlanif60] ospf cost 10
    [*Switch ModuleN-Vlanif60] quit
    [*Switch ModuleN] commit

    # Configure Switch Module E.

    [~Switch ModuleE] interface vlanif 20
    [*Switch ModuleE-Vlanif20] ospf cost 15
    [*Switch ModuleE-Vlanif20] quit
    [*Switch ModuleE] interface vlanif 40
    [*Switch ModuleE-Vlanif30] ospf cost 15
    [*Switch ModuleE-Vlanif30] quit
    [*Switch ModuleE] interface vlanif 60
    [*Switch ModuleE-Vlanif40] ospf cost 10
    [*Switch ModuleE-Vlanif40] quit
    [*Switch ModuleE] interface vlanif 70
    [*Switch ModuleE-Vlanif70] ospf cost 5
    [*Switch ModuleE-Vlanif70] quit
    [*Switch ModuleE] commit

  5. Block FRR on a specified interface of Switch Module S.

    [~Switch ModuleS] interface vlanif 10
    [~Switch ModuleS-Vlanif10] ospf frr block
    [*Switch ModuleS-Vlanif10] quit
    [*Switch ModuleS] commit

  6. Enable OSPF IP FRR on Switch Module S.

    [~Switch ModuleS] ospf
    [*Switch ModuleS-ospf-1] frr
    [*Switch ModuleS-ospf-1-frr] loop-free-alternate
    [*Switch ModuleS-ospf-1-frr] commit

  7. Verify the configuration.

    # Run the display ospf routing router-id command on Switch Module S to view routing information.

    [~Switch ModuleS-ospf-1-frr] display ospf routing 172.17.1.1
    Flags: A - Added to URT, S - Secondary route 
    
              OSPF Process 1 with Router ID 1.1.1.1
    
     Destination    : 4.4.4.4/32                                                                                                       
     AdverRouter    : 4.4.4.4                  Area       : 0.0.0.0                                                                     
     Cost           : 3                        Type       : Stub                                                                     
     NextHop        : 10.1.2.2                 Interface  : Vlanif20                                                                   
     Priority       : Low                                                                                                               
     Backup NextHop : 10.1.3.2                 Backup Interface : Vlanif30                                                             
     Backup Type    : LFA LINK-NODE                                                                                                     
     Flags          : A/- 

    The preceding display shows that a backup route is generated on Switch Module S.

Configuration Files
  • Configuration file of Switch Module S

    #
     sysname Switch ModuleS
    #
    vlan batch 10 20 30
    #
     bfd
    #
    interface Vlanif10
     ip address 10.1.1.1 255.255.255.0
     ospf cost 10
     ospf frr block
    #
    interface Vlanif20
     ip address 10.1.2.1 255.255.255.0
     ospf cost 15
    #
    interface Vlanif30
     ip address 10.1.3.1 255.255.255.0
     ospf cost 10
    #
    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
    #
    ospf 1 router-id 1.1.1.1
     bfd all-interfaces enable
     bfd all-interfaces frr-binding
     frr
      loop-free-alternate
     area 0.0.0.0
      network 10.1.1.0 0.0.0.255
      network 10.1.2.0 0.0.0.255
      network 10.1.3.0 0.0.0.255
    #
    return
  • Configuration file of Switch Module A

    #
     sysname Switch ModuleA
    #
    vlan batch 10 40
    #  
     bfd
    #
    interface Vlanif10
     ip address 10.1.1.2 255.255.255.0
     ospf cost 10
    #
    interface Vlanif40
     ip address 20.1.1.2 255.255.255.0
     ospf cost 15
    #
    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 40
    #
    ospf 1 router-id 2.2.2.2
     bfd all-interfaces enable
     bfd all-interfaces frr-binding
     area 0.0.0.0
      network 10.1.1.0 0.0.0.255
      network 20.1.1.0 0.0.0.255
    #
    return
  • Configuration file of Switch Module N

    #
     sysname Switch ModuleN
    #
    vlan batch 30 60
    #
     bfd
    #
    interface Vlanif30
     ip address 10.1.3.2 255.255.255.0
     ospf cost 10
    #
    interface Vlanif60
     ip address 20.1.3.2 255.255.255.0
     ospf cost 10
    #
    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 60
    #
    ospf 1 router-id 3.3.3.3
     bfd all-interfaces enable
     bfd all-interfaces frr-binding
     frr
     area 0.0.0.0
      network 10.1.3.0 0.0.0.255
      network 20.1.3.0 0.0.0.255
    #
    return
  • Configuration file of Switch Module E

    #
     sysname Switch ModuleE
    #
    vlan batch 20 40 60 70
    #
     bfd
    #
    interface Vlanif20
     ip address 10.1.2.2 255.255.255.0
     ospf cost 15
     #
    interface Vlanif40
     ip address 20.1.1.1 255.255.255.0
     ospf cost 15
    #
    interface Vlanif60
     ip address 20.1.3.1 255.255.255.0
     ospf cost 10
    #
    interface Vlanif70
     ip address 172.17.1.1 255.255.255.0
     ospf cost 5
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 40
    #
    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 60
    #
    interface 10GE1/17/4
     port link-type trunk
     port trunk allow-pass vlan 70
    #
    ospf 1 router-id 4.4.4.4
     bfd all-interfaces enable
     bfd all-interfaces frr-binding
     area 0.0.0.0
      network 10.1.2.0 0.0.0.255
      network 20.1.1.0 0.0.0.255
      network 20.1.3.0 0.0.0.255
      network 172.17.1.0 0.0.0.255
    #
    return

Example for Configuring BFD for OSPF

Networking Requirements

As shown in Figure 7-55, the networking requirements are as follows:

  • Switch Module A, Switch Module B, and Switch Module C run OSPF.

  • BFD for OSPF is enabled on Switch Module A, Switch Module B, and Switch Module C.

  • Service traffic is transmitted on the main link Switch Module A→Switch Module B. Link Switch Module A→Switch Module C→Switch Module B is a backup link.

  • BFD is configured on the interfaces between Switch Module A and Switch Module B. When a fault occurs on the link between the Switch Module s, BFD can quickly detect the fault and notify OSPF of the fault. Then, the service flow is transmitted on the backup link.

Figure 7-55 Networking diagram for configuring BFD for OSPF

Configuration Roadmap

The configuration roadmap is as follows:

  1. Configure the basic OSPF functions on the switches.

  2. Enable the BFD feature globally.

  3. Enable BFD for OSPF on Switch Module A and Switch Module B.

Procedure

  1. Create VLANs and add corresponding interfaces to the VLANs.

    <HUAWEI> system-view
    [~HUAWEI] sysname Switch ModuleA
    [*HUAWEI] commit
    [~Switch ModuleA] vlan 10
    [*Switch ModuleA-vlan10] quit
    [*Switch ModuleA] vlan 20
    [*Switch ModuleA-vlan20] 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 link-type trunk
    [*Switch ModuleA-10GE1/17/2] port trunk allow-pass vlan 20
    [*Switch ModuleA-10GE1/17/2] quit
    [*Switch ModuleA] commit

    The configurations of Switch Module B and Switch Module C are similar to the configuration of Switch Module A, and are not mentioned here.

  2. Assign an IP address to each VLANIF interface.

    [~Switch ModuleA] interface vlanif 10
    [*Switch ModuleA-Vlanif10] ip address 1.1.1.1 24
    [*Switch ModuleA-Vlanif10] quit
    [*Switch ModuleA] interface vlanif 20
    [*Switch ModuleA-Vlanif20] ip address 3.3.3.1 24
    [*Switch ModuleA-Vlanif20] quit
    [*Switch ModuleA] commit

    The configurations of Switch Module B and Switch Module C are similar to the configuration of Switch Module A, and are not mentioned here.

  3. Configure the basic OSPF functions. See Example for Configuring Basic OSPF Functions.
  4. Configure BFD for OSPF.

    # Enable BFD globally on Switch Module A.

    [~Switch ModuleA] bfd
    [*Switch ModuleA-bfd] quit
    [*Switch ModuleA] ospf
    [*Switch ModuleA-ospf-1] bfd all-interfaces enable
    [*Switch ModuleA-ospf-1] quit
    [*Switch ModuleA] commit

    # Enable BFD globally on Switch Module B.

    [~Switch ModuleB] bfd
    [*Switch ModuleB-bfd] quit
    [*Switch ModuleB] ospf
    [*Switch ModuleB-ospf-1] bfd all-interfaces enable
    [*Switch ModuleB-ospf-1] quit
    [*Switch ModuleB] commit

    # Run the display ospf bfd session all command on Switch Module A or Switch Module B. You can see that the BFD state is Up.

    Take Switch Module A for example. The display is as follows:

    [~Switch ModuleA] display ospf bfd session all
              OSPF Process 1 with Router ID 1.1.1.1
      Area 0.0.0.0 interface  3.3.3.1(Vlanif20)'s BFD Sessions
                                                                                    
    NeighborId:2.2.2.2           BFDState:Up                                        
    LocalIpAdd:3.3.3.1           RemoteIpAdd:3.3.3.2                                
                                                                                    
      Area 0.0.0.0 interface 1.1.1.1(Vlanif10)'s BFD Sessions
                                                                                    
    NeighborId:3.3.3.3           BFDState:Up                                        
    LocalIpAdd:1.1.1.1           RemoteIpAdd:1.1.1.2                                
                                                                                    
        Total UP/DOWN/UNKNOWN BFD Session Number : 2 / 0 / 0
    

  5. Configure the BFD feature of interfaces.

    # Configure BFD on VLANIF 20 of Switch Module A, set the minimum interval for sending the packets and the minimum interval for receiving the packets to 100 ms, and set the local detection time multiplier to 4.

    [~Switch ModuleA] interface vlanif 20
    [*Switch ModuleA-Vlanif20] ospf bfd enable
    [*Switch ModuleA-Vlanif20] ospf bfd min-tx-interval 100 min-rx-interval 100 detect-multiplier 4
    [*Switch ModuleA-Vlanif20] quit
    [*Switch ModuleA] commit

    # Configure BFD on VLANIF20 of Switch Module B and set the minimum interval for sending the packets and the minimum interval for receiving the packets to 100 ms and the local detection time multiplier to 4.

    [*Switch ModuleB] interface vlanif 20
    [*Switch ModuleB-Vlanif20] ospf bfd enable
    [*Switch ModuleB-Vlanif20] ospf bfd min-tx-interval 100 min-rx-interval 100 detect-multiplier 4
    [*Switch ModuleB-Vlanif20] quit
    [*Switch ModuleB] commit

    # Run the display ospf bfd session all command on Switch Module A or Switch Module B. You can see that the BFD state is Up.

    Take Switch Module B for example. The display is as follows:

    [~Switch ModuleB] display ospf bfd session all
    
              OSPF Process 1 with Router ID 2.2.2.2
      Area 0.0.0.0 interface 3.3.3.2(Vlanif20)'s BFD Sessions
                                                                                    
    NeighborId:1.1.1.1           BFDState:Up                                        
    LocalIpAdd:3.3.3.2           RemoteIpAdd:3.3.3.1                                
                                                                                    
      Area 0.0.0.0 interface 2.2.2.2(Vlanif30)'s BFD Sessions
                                                                                    
    NeighborId:3.3.3.3           BFDState:Up                                        
    LocalIpAdd:2.2.2.2           RemoteIpAdd:2.2.2.1                                
                                                                                    
        Total UP/DOWN/UNKNOWN BFD Session Number : 2 / 0 / 0
    

  6. Verify the configuration.

    # Run the shutdown command on VLANIF 20 of Switch Module B to simulate a link fault.

    [~Switch ModuleB] interface vlanif 20
    [~Switch ModuleB-Vlanif20] shutdown
    [*Switch ModuleB-Vlanif20] commit

    # View the routing table of Switch Module A.

    [~Switch ModuleA] display ospf routing
    
              OSPF Process 1 with Router ID 1.1.1.1 Routing Tables
    
     Routing for Network
     Destination        Cost  Type       NextHop         AdvRouter       Area
     172.16.1.0/24      3     Stub       1.1.1.2         2.2.2.2         0.0.0.0
     3.3.3.0/24         1     Stub       3.3.3.1         1.1.1.1         0.0.0.0
     2.2.2.0/24         2     Transit    1.1.1.2         3.3.3.3         0.0.0.0
     1.1.1.0/24         1     Transit    1.1.1.1         1.1.1.1         0.0.0.0
    
     Total Nets: 4 Intra Area: 4  Inter Area: 0  ASE: 0  NSSA: 0

    As shown in the OSPF routing table, the backup link Switch Module A→Switch Module C→Switch Module B takes effect after the main link fails. The next hop address of the route to 172.16.1.0/24 becomes 1.1.1.2.

Configuration Files
  • Configuration file of Switch Module A

    #
     sysname Switch ModuleA
    #
     vlan batch 10 20
    #
     router id 1.1.1.1
    #
     bfd
    #
    interface Vlanif10
     ip address 1.1.1.1 255.255.255.0
    #
    interface Vlanif20
     ip address 3.3.3.1 255.255.255.0
     ospf bfd enable
     ospf bfd min-tx-interval 100 min-rx-interval 100 detect-multiplier 4
    #
    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
    #
    ospf 1
     bfd all-interface enable
     area 0.0.0.0
      network 3.3.3.0 0.0.0.255
      network 1.1.1.0 0.0.0.255
    #
    return
  • Configuration file of Switch Module B

    #
     sysname Switch ModuleB
    #
    vlan batch 20 30 40
    #
     router id 2.2.2.2
    #
     bfd
    #
    interface Vlanif20
     ip address 3.3.3.2 255.255.255.0
     ospf bfd enable
     ospf bfd min-tx-interval 100 min-rx-interval 100 detect-multiplier 4
    #
    interface Vlanif30
     ip address 2.2.2.2 255.255.255.0
    #
    interface Vlanif40
     ip address 172.16.1.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 20
    #
    interface 10GE1/17/3
     port link-type trunk
     port trunk allow-pass vlan 40
    #
    ospf 1
     bfd all-interface enable
     area 0.0.0.0
      network 3.3.3.0 0.0.0.255
      network 2.2.2.0 0.0.0.255
      network 172.16.1.0 0.0.0.255
    #
    return
  • Configuration file of Switch Module C

    #
     sysname Switch ModuleC
    #
     vlan batch 10 30
    #
     router id 3.3.3.3
    #
     bfd
    #
    interface Vlanif10
     ip address 1.1.1.2 255.255.255.0
    #
    interface Vlanif30
     ip address 2.2.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 30
    #
    ospf 1
     bfd all-interface enable
     area 0.0.0.0
      network 1.1.1.0 0.0.0.255
      network 2.2.2.0 0.0.0.255
    #
    return
Translation
Download
Updated: 2019-08-09

Document ID: EDOC1000041694

Views: 59417

Downloads: 3623

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