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 BGP Load Balancing and the MED Attribute

Example for Configuring BGP Load Balancing and the MED Attribute

Networking Requirements

As shown in Figure 9-22, BGP is configured on all switches; SwitchA resides in AS 65008; SwitchB and SwitchC reside in AS 65009. EBGP connections are established between SwitchA and SwitchB, and between SwitchA and SwitchC. An IBGP connection is established between SwitchB and SwitchC. Load balancing needs to be implemented between AS 65008 and AS 65009. After a period, traffic from AS 65008 to AS 65009 needs to first pass through SwitchC.

Figure 9-22 Networking diagram of BGP route selection



Configuration Roadmap

The configuration roadmap is as follows:

  1. Configure load balancing on SwitchA.
  2. Set the MED value on SwitchA to enable traffic from AS 65008 to AS 65009 to first pass through SwitchC.

Procedure

  1. Configure the VLAN to which each interface belongs.

    <HUAWEI> system-view
    [~HUAWEI] sysname SwitchA
    [*HUAWEI] commit
    [~SwitchA] vlan batch 10 20
    [*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] commit

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

  2. Configure VLANIF interfaces and assign IP addresses to the VLANIF interfaces.

    [~SwitchA] interface vlanif 10
    [*SwitchA-Vlanif10] ip address 192.168.1.2 24
    [*SwitchA-Vlanif10] quit
    [*SwitchA] interface vlanif 20
    [*SwitchA-Vlanif20] ip address 192.168.2.2 24
    [*SwitchA-Vlanif20] quit
    [*SwitchA] commit

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

  3. Configure BGP connections.

    # Configure SwitchA.

    [~SwitchA] bgp 65008
    [*SwitchA-bgp] router-id 172.16.1.1
    [*SwitchA-bgp] peer 192.168.1.1 as-number 65009
    [*SwitchA-bgp] peer 192.168.2.1 as-number 65009
    [*SwitchA-bgp] quit
    [*SwitchA] commit

    # Configure SwitchB.

    [~SwitchB] bgp 65009
    [*SwitchB-bgp] router-id 172.16.2.2
    [*SwitchB-bgp] peer 192.168.1.2 as-number 65008
    [*SwitchB-bgp] peer 10.1.1.2 as-number 65009
    [*SwitchB-bgp] ipv4-family unicast 
    [*SwitchB-bgp-af-ipv4] network 10.1.1.0 255.255.255.0
    [*SwitchB-bgp-af-ipv4] quit
    [*SwitchB-bgp] quit
    [*SwitchB] commit

    # Configure SwitchC.

    [~SwitchC] bgp 65009
    [*SwitchC-bgp] router-id 172.16.3.3
    [*SwitchC-bgp] peer 192.168.2.2 as-number 65008
    [*SwitchC-bgp] peer 10.1.1.1 as-number 65009
    [*SwitchC-bgp] ipv4-family unicast
    [*SwitchC-bgp-af-ipv4] network 10.1.1.0 255.255.255.0
    [*SwitchC-bgp-af-ipv4] quit
    [*SwitchC-bgp] quit
    [*SwitchC] commit

    # View the BGP routing table of SwitchA.

    [~SwitchA] display bgp routing-table
     BGP Local router ID is 172.16.1.1
     Status codes: * - valid, > - best, d - damped,h - history,
                   i - internal, s - suppressed, S - Stale
    Origin :       i - IGP, e - EGP, ? - incomplete
     
     Total Number of Routes: 2
          Network            NextHop        MED        LocPrf    PrefVal Path/Ogn
     
     *>   10.1.1.0/24       192.168.1.1     0                     0       65009i
     *                      192.168.2.1     0                     0       65009i
    [~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 : 12       Routes : 12                                                                                        
                                                                                                                                        
    Destination/Mask    Proto   Pre  Cost        Flags NextHop         Interface                                                        
                                                                                                                                        
           10.1.1.0/24  EBGP    255  0             RD  192.168.1.1     Vlanif10                                                        
           10.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                                                      
        192.168.1.0/24  Direct  0    0             D   192.168.1.2     Vlanif10                                                        
        192.168.1.2/32  Direct  0    0             D   127.0.0.1       Vlanif10                                                        
      192.168.1.255/32  Direct  0    0             D   127.0.0.1       Vlanif10                                                        
        192.168.2.0/24  Direct  0    0             D   192.168.2.2     Vlanif20                                                        
        192.168.2.2/32  Direct  0    0             D   127.0.0.1       Vlanif20                                                        
      192.168.2.255/32  Direct  0    0             D   127.0.0.1       Vlanif20                                                        
    255.255.255.255/32  Direct  0    0             D   127.0.0.1       InLoopBack0                                                      

    In the BGP routing table, there are two valid routes to destination 10.1.1.0/24. The route with next-hop address 192.168.1.1 is the optimal route because the router ID of SwitchB is the smallest.

  4. Configure load balancing.

    # Configure SwitchA.

    [~SwitchA] bgp 65008
    [~SwitchA-bgp] ipv4-family unicast 
    [~SwitchA-bgp-af-ipv4] maximum load-balancing 2
    [*SwitchA-bgp-af-ipv4] quit
    [*SwitchA-bgp] quit
    [*SwitchA] commit

    # View the BGP routing table of SwitchA.

    [~SwitchA] display bgp routing-table
     BGP Local router ID is 172.16.1.1
     Status codes: * - valid, > - best, d - damped, h - history,
                   i - internal, s - suppressed, S - Stale
    Origin       : i - IGP, e - EGP, ? - incomplete
    
     Total Number of Routes: 2
          Network            NextHop        MED        LocPrf    PrefVal Path/Ogn
     
     *>   10.1.1.0/24        192.168.1.1    0                     0      65009i
     *>                      192.168.2.1    0                     0      65009i
    [~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 : 12       Routes : 13                                                                                        
                                                                                                                                        
    Destination/Mask    Proto   Pre  Cost        Flags NextHop         Interface                                                        
                                                                                                                                        
           10.1.1.0/24  EBGP    255  0             RD  192.168.1.1     Vlanif10                                                        
                        EBGP    255  0             RD  192.168.2.1     Vlanif20                                                        
           10.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                                                      
        192.168.1.0/24  Direct  0    0             D   192.168.1.2     Vlanif10                                                        
        192.168.1.2/32  Direct  0    0             D   127.0.0.1       Vlanif10                                                        
      192.168.1.255/32  Direct  0    0             D   127.0.0.1       Vlanif10                                                        
        192.168.2.0/24  Direct  0    0             D   192.168.2.2     Vlanif20                                                        
        192.168.2.2/32  Direct  0    0             D   127.0.0.1       Vlanif20                                                        
      192.168.2.255/32  Direct  0    0             D   127.0.0.1       Vlanif20                                                        
    255.255.255.255/32  Direct  0    0             D   127.0.0.1       InLoopBack0                                                      

    In the BGP routing table, BGP route 10.1.1.0/24 has two next hops: 192.168.1.1 and 192.168.2.1. Both of them are optimal routes.

  5. Configure the MED attribute.

    # Set the MED value for the route sent from SwitchB to SwitchA using a route-policy.

    [~SwitchB] route-policy 10 permit node 10
    [*SwitchB-route-policy] apply cost 100
    [*SwitchB-route-policy] quit
    [*SwitchB] bgp 65009
    [*SwitchB-bgp] peer 192.168.1.2 route-policy 10 export
    [*SwitchB-bgp] quit
    [*SwitchB] commit

    # View the BGP routing table of SwitchA.

    [~SwitchA] display bgp routing-table
     BGP Local router ID is 172.16.1.1
     Status codes: * - valid, > - best, d - damped, h - history,
                   i - internal, s - suppressed, S - Stale
    Origin       : i - IGP, e - EGP, ? - incomplete
     Total Number of Routes: 2
          Network            NextHop        MED        LocPrf    PrefVal Path/Ogn
     
     *>   10.1.1.0/24        192.168.2.1    0                     0      65009i
     *                       192.168.1.1    100                   0      65009i
    [~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 : 26       Routes : 26                                                                                        
                                                                                                                                        
    Destination/Mask    Proto   Pre  Cost        Flags NextHop         Interface                                                        
                                                                                                                                        
           10.1.1.0/24  EBGP    255  0             RD  192.168.2.1     Vlanif20                                                        
           10.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                                                      
        192.168.1.0/24  Direct  0    0             D   192.168.1.2     Vlanif10                                                        
        192.168.1.2/32  Direct  0    0             D   127.0.0.1       Vlanif10                                                        
      192.168.1.255/32  Direct  0    0             D   127.0.0.1       Vlanif10                                                        
        192.168.2.0/24  Direct  0    0             D   192.168.2.2     Vlanif20                                                        
        192.168.2.2/32  Direct  0    0             D   127.0.0.1       Vlanif20                                                        
      192.168.2.255/32  Direct  0    0             D   127.0.0.1       Vlanif20                                                        
    255.255.255.255/32  Direct  0    0             D   127.0.0.1       InLoopBack0                                                      

    In the BGP routing table, the MED value of the route with next hop 192.168.1.1 (SwitchB) is 100, and the MED value of the route with next hop 192.168.2.1 is 0. Therefore, the route with the smaller MED value is preferred.

Configuration Files

  • Configuration file of SwitchA

    #
    sysname SwitchA
    #
    vlan batch 10 20
    #
    interface Vlanif10
     ip address 192.168.1.2 255.255.255.0
    #
    interface Vlanif20
     ip address 192.168.2.2 255.255.255.0
    #
    interface 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
    #
    bgp 65008
     router-id 172.16.1.1
     peer 192.168.1.1 as-number 65009
     peer 192.168.2.1 as-number 65009
     #
     ipv4-famlily unicast
      maximum load-balancing 2
      peer 192.168.1.1 enable
      peer 192.168.2.1 enable
    #
    return
  • Configuration file of SwitchB

    #
    sysname SwitchB
    #
    vlan batch 10 30
    #
    interface Vlanif10
     ip address 192.168.1.1 255.255.255.0
    #
    interface Vlanif30
     ip address 10.1.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 30
    #
    bgp 65009
     router-id 172.16.2.2
     peer 10.1.1.2 as-number 65009
     peer 192.168.1.2 as-number 65008
     #
     ipv4-family unicast
      default med 100
      network 10.1.1.0 255.255.255.0
      peer 10.1.1.2 enable
      peer 192.168.1.2 enable
      peer 192.168.1.2 route-policy 10 export
    #
    route-policy 10 permit node 10
     apply cost 100
    #
    return
  • Configuration file of SwitchC

    #
    sysname SwitchC
    #
    vlan batch 20 30
    #
    interface Vlanif20
     ip address 192.168.2.1 255.255.255.0
    #
    interface Vlanif30
     ip address 10.1.1.2 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 30
    #
    bgp 65009
     router-id 172.16.3.3
     peer 10.1.1.1 as-number 65009
     peer 192.168.2.2 as-number 65008
     #
     ipv4-family unicast
      network 10.1.1.0 255.255.255.0
      peer 10.1.1.1 enable
      peer 192.168.2.2 enable
    #
    return
Translation
Download
Updated: 2019-04-20

Document ID: EDOC1100074760

Views: 47937

Downloads: 58

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