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

Configuration Guide - IP Unicast Routing

CloudEngine 8800, 7800, 6800, and 5800 V200R005C10

This document describes the configurations of IP Unicast Routing, including IP Routing, Static Route, RIP, RIPng, OSPF, OSPFv3, IPv4 IS-IS, IPv6 IS-IS, BGP, Routing Policy, and PBR.
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).
Example for Configuring Load Balancing Among OSPF Routes

Example for Configuring Load Balancing Among OSPF Routes

Networking Requirements

As shown in Figure 5-35, the networking requirements are as follows:

  • SwitchA, SwitchB, SwitchC, and SwitchD connect to each other through OSPF.
  • SwitchA, SwitchB, SwitchC, and SwitchD belong to Area 0.
  • Load balancing is configured so that the traffic from SwitchA can be sent to SwitchD through SwitchB or SwitchC.
Figure 5-35 Networking diagram for configuring load balancing among OSPF routes

Configuration Roadmap

The configuration roadmap is as follows:

  1. Configure basic OSPF functions on each Switchto implement interconnection.
  2. Disable load balancing on SwitchA and then check the routing table on SwitchA.
  3. (Optional) Set weights of equal-cost routes on SwitchA.

Procedure

  1. Configure the VLAN for each interface.

    <HUAWEI> system-view
    [~HUAWEI] sysname SwitchA
    [*HUAWEI] commit
    [~SwitchA] vlan batch 10 20 50
    [*SwitchA] interface 10ge 1/0/1
    [*SwitchA-10GE1/0/1] port link-type trunk
    [*SwitchA-10GE1/0/1] port trunk allow-pass vlan 10
    [*SwitchA-10GE1/0/1] quit
    [*SwitchA] interface 10ge 1/0/2
    [*SwitchA-10GE1/0/2] port link-type trunk
    [*SwitchA-10GE1/0/2] port trunk allow-pass vlan 20
    [*SwitchA-10GE1/0/2] quit
    [*SwitchA] interface 10ge 1/0/3
    [*SwitchA-10GE1/0/3] port link-type trunk
    [*SwitchA-10GE1/0/3] port trunk allow-pass vlan 50
    [*SwitchA-10GE1/0/3] quit
    [*SwitchA] commit

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

  2. Assign an IP address to each VLANIF interface.

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

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

  3. Configure basic OSPF functions. For details, see Example for Configuring Basic OSPF Functions.
  4. Disable load balancing on SwitchA.

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

    # View the routing table of SwitchA.

    [~SwitchA] display ip routing-table
    Proto: Protocol        Pre: Preference Route Flags: R - relay, D - download to fib, T - to vpn-instance, B - black hole route
    ------------------------------------------------------------------------------
    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.16.2.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, if 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.16.2.0.

    NOTE:

    OSPF selects the next hop randomly among equal-cost routes.

  5. Restore the default number of equal-cost routes for load balancing on SwitchA.

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

    # Display the routing table on Switch A.

    [~SwitchA] display ip routing-table
    Proto: Protocol        Pre: Preference Route Flags: R - relay, D - download to fib, T - to vpn-instance, B - black hole route
    ----------------------------------------------------------------------------
    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.16.2.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 settings of load balancing are restored, both next hops of SwitchA, namely, 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 weights of equal-cost routes on SwitchA.

    If you do not want to implement load balancing between SwitchB and SwitchC, set weights for the equal-cost routes to specify the next hop.

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

    # Display the routing table on SwitchA.

    [~SwitchA] display ip routing-table
    Proto: Protocol        Pre: Preference Route Flags: R - relay, D - download to fib, T - to vpn-instance, B - black hole route
    ------------------------------------------------------------------------------
    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.16.2.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, after weights are set for the equal-cost routes, the preference of the route with the next hop being 10.1.2.2 (the weight is 1) is higher than that of the route with the next hop being 10.1.1.2. Therefore, OSPF selects the route with the next hop being 10.1.2.2 as the optimal route.

Configuration Files

  • Configuration file of SwitchA

    #
     sysname SwitchA
    #
     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/0/1
     port link-type trunk
     port trunk allow-pass vlan 10 
    #
    interface 10GE1/0/2
     port link-type trunk
     port trunk allow-pass vlan 20 
    #
    interface 10GE1/0/3
     port link-type trunk
     port trunk allow-pass vlan 50 
    #
    ospf 1 router-id 10.10.10.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 SwitchB

    #
     sysname SwitchB
    #
     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/0/1
     port link-type trunk
     port trunk allow-pass vlan 20 
    #
    interface 10GE1/0/2
     port link-type trunk
     port trunk allow-pass vlan 40 
    #
    ospf 1 router-id 10.10.10.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 SwitchC

    sysname SwitchC
    #
     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/0/1
     port link-type trunk
     port trunk allow-pass vlan 10 
    #
    interface 10GE1/0/2
     port link-type trunk
     port trunk allow-pass vlan 30 
    #
    ospf 1 router-id 10.10.10.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 SwitchD

    #
     sysname SwitchD
    #
     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.16.2.1 255.255.255.0
    #
    interface 10GE1/0/1
     port link-type trunk
     port trunk allow-pass vlan 30
    #
    interface 10GE1/0/2
     port link-type trunk
     port trunk allow-pass vlan 40
    #
    interface 10GE1/0/3
     port link-type trunk
     port trunk allow-pass vlan 60
    #
    ospf 1 router-id 10.10.10.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.16.2.0 0.0.0.255
    #
    return
Translation
Download
Updated: 2019-04-20

Document ID: EDOC1100074760

Views: 56216

Downloads: 62

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