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

NE40E V800R010C10SPC500 Configuration Guide - IP Routing 01

This is NE40E V800R010C10SPC500 Configuration Guide - IP Routing
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 Next Hop Iteration Based on a Routing Policy

Example for Configuring BGP Next Hop Iteration Based on a Routing Policy

Configuring BGP next hop iteration based on a routing policy prevents traffic loss in case of route changes.

Networking Requirements

As shown in Figure 1, OSPF runs in AS 100. An IBGP peer relationship is established between Loopback 0s of Device A and Device B, and between Loopback 0s of Device A and Device C. Device B and Device C both receive BGP routes destined for 200.1.1.0/24. Because the router ID of Device B is smaller than that of Device C, Device A chooses the route that is learned from Device B as the optimal route with the original next hop of 2.2.2.2/32.

In most cases, Device A iterates the next hop of the BGP route destined for 200.1.1.0/24 to an IGP route destined for 2.2.2.2/32 with GE 1/0/00 as the outbound interface. When Device B is faulty, Device A deletes the IGP route destined for 2.2.2.2/32 immediately. However, Device A still considers the BGP route with 2.2.2.2/32 as the original next hop the optimal route because it does not know the BGP route change before the BGP hold timer expires. Based on the longest matching rule, Device A mistakenly iterates the BGP route destined for 200.1.1.0/24 to the direct route destined for 2.2.2.0/24 with GE 1/0/2 as the outbound interface, causing traffic loss.

Figure 10-48 Networking diagram for configuring BGP next hop iteration based on a routing policy
NOTE:

Interfaces 1 through 4 in this example are GE 1/0/0, GE 1/0/1, GE 1/0/2, Loopback0, respectively.


To prevent traffic loss, configure BGP next hop iteration based on a routing policy on Device A to control the iterated routes. In this example, only the iterated routes with a mask length of 32 bits are not filtered out by the routing policy, and the iterated routes that are filtered out by the routing policy are considered unreachable. Therefore, when Device B is faulty, the route change can be detected in time, and a correct route is re-selected, preventing traffic loss.

Precautions

When configuring BGP next hop iteration based on a routing policy, note the following:

  • Ensure that all desirably iterated routes cannot be filtered out by the routing policy. If some desirably iterated routes are filtered out by the routing policy, the BGP route may be considered unreachable by mistake and traffic cannot be forwarded over the route.

Configuration Roadmap

The configuration roadmap is as follows:

  1. Configure OSPF on Device A, Device B, and Device C to enable them to communicate with each other.

  2. Establish an IBGP peer relationship between Loopback 0s of Device A and Device B, and between Loopback 0s of Device A and Device C.

  3. Enable Device B and Device C to advertise a BGP route destined for 200.1.1.0/24 to Device A.

  4. Configure BGP next hop iteration based on a routing policy on Device A. This configuration allows Device A to know the route change in time when Device B is faulty and re-select a correct BGP route, preventing traffic loss.

Data Preparation

To complete the configuration, you need the following data:

  • Router IDs of Device A, Device B, and Device C (1.1.1.1, 2.2.2.2, and 3.3.3.3, respectively) and AS number (100)

  • Routing policy (np-by-rp) configured on Device A to control route iteration.

Procedure

  1. Configure an IP address for each interface. For configuration details, see Configuration File.
  2. Configure OSPF in AS 100.

    # Configure Device A.

    [~DeviceA] ospf 1
    [*DeviceA-ospf-1] area 0
    [*DeviceA-ospf-1-area-0.0.0.0] network 1.1.1.1 0.0.0.0
    [*DeviceA-ospf-1-area-0.0.0.0] network 11.1.0.0 0.0.255.255
    [*DeviceA-ospf-1-area-0.0.0.0] commit
    [~DeviceA-ospf-1-area-0.0.0.0] quit
    [~DeviceA-ospf-1] quit

    # Configure Device B.

    [~DeviceB] ospf 1
    [*DeviceB-ospf-1] area 0
    [*DeviceC-ospf-1-area-0.0.0.0] network 2.2.2.2 0.0.0.0
    [*DeviceB-ospf-1-area-0.0.0.0] network 11.1.1.0 0.0.0.255
    [*DeviceB-ospf-1-area-0.0.0.0] commit
    [~DeviceB-ospf-1-area-0.0.0.0] quit
    [~DeviceB-ospf-1] quit

    # Configure Device C.

    [~DeviceC] ospf 1
    [*DeviceC-ospf-1] area 0
    [*DeviceC-ospf-1-area-0.0.0.0] network 3.3.3.3 0.0.0.0
    [*DeviceC-ospf-1-area-0.0.0.0] network 11.1.2.0 0.0.0.255
    [*DeviceC-ospf-1-area-0.0.0.0] commit
    [~DeviceC-ospf-1-area-0.0.0.0] quit
    [~DeviceC-ospf-1] quit

  3. Establish IBGP connections.

    # Configure Device A.

    [~DeviceA] bgp 100
    [*DeviceA-bgp] router-id 1.1.1.1
    [*DeviceA-bgp] peer 2.2.2.2 as-number 100
    [*DeviceA-bgp] peer 3.3.3.3 as-number 100
    [*DeviceA-bgp] peer 2.2.2.2 connect-interface Loopback 0
    [*DeviceA-bgp] peer 3.3.3.3 connect-interface Loopback 0
    [*DeviceA-bgp] commit
    [~DeviceA-bgp] quit

    # Configure Device B.

    [~DeviceB] bgp 100
    [*DeviceB-bgp] router-id 2.2.2.2
    [*DeviceB-bgp] peer 1.1.1.1 as-number 100
    [*DeviceB-bgp] peer 1.1.1.1 connect-interface Loopback 0
    [*DeviceB-bgp] commit
    [~DeviceB-bgp] quit

    # Configure Device C.

    [~DeviceC] bgp 100
    [*DeviceC-bgp] router-id 3.3.3.3
    [*DeviceC-bgp] peer 1.1.1.1 as-number 100
    [*DeviceC-bgp] peer 1.1.1.1 connect-interface Loopback 0
    [*DeviceC-bgp] commit
    [~DeviceC-bgp] quit

  4. Enable Device B and Device C to advertise a BGP route destined for 200.1.1.0/24 to Device A.

    # Configure Device B.

    [~DeviceB] ip route-static 200.1.1.0 24 NULL 0
    [*DeviceB] commit
    [~DeviceB] bgp 100
    [*DeviceB-bgp] import-route static
    [*DeviceB-bgp] commit
    [~DeviceB-bgp] quit

    # Configure Device C.

    [~DeviceC] ip route-static 200.1.1.0 24 NULL 0
    [*DeviceC] commit
    [~DeviceC] bgp 100
    [*DeviceC-bgp] import-route static
    [*DeviceC-bgp] commit
    [~DeviceC-bgp] quit

  5. Configure BGP next hop iteration based on a routing policy on Device A.

    # Configure Device A.

    [~DeviceA] bgp 100
    [*DeviceA-bgp] nexthop recursive-lookup route-policy np-by-rp
    [*DeviceA-bgp] commit
    [~DeviceA-bgp] quit
    [~DeviceA] route-policy np-by-rp permit node 0
    [*DeviceA-route-policy] if-match ip-prefix np-by-rp-ip
    [*DeviceA-route-policy] commit
    [~DeviceA-route-policy] quit
    [~DeviceA] ip ip-prefix np-by-rp-ip permit 0.0.0.0 32
    [*DeviceA] commit

  6. Verify the configuration.

    # Display detailed information about the BGP route destined for 200.1.1.0/24 on Device A when Device B is running properly.

    [~DeviceA] display bgp routing-table 200.1.1.0 24
     
     BGP local router ID : 1.1.1.1
     Local AS number : 100
     Paths:   2 available, 1 best, 1 select
     BGP routing table entry information of 200.1.1.0/24:
     From: 2.2.2.2 (2.2.2.2)  Route Duration: 0d00h00m36s
     Relay IP Nexthop: 11.1.1.2
     Relay IP Out-interface: GigabitEthernet1/0/0
     Original nexthop: 2.2.2.2
     Qos information : 0x0            
     AS-path Nil, origin incomplete, MED 0, localpref 100, pref-val 0, valid, internal, best, select, pre 255
     Not advertised to any peer yet
    
     BGP routing table entry information of 200.1.1.0/24:
     From: 3.3.3.3 (3.3.3.3)  Route Duration: 0d02h53m45s
     Relay IP Nexthop: 11.1.2.2
     Relay IP Out-interface: GigabitEthernet1/0/1
     Original nexthop: 3.3.3.3
     Qos information : 0x0            
     AS-path Nil, origin incomplete, MED 0, localpref 100, pref-val 0, valid, internal, pre 255, 
    not preferred for router ID
     Not advertised to any peers yet

    # Run the shutdown command on GE 1/0/0 of Device B to simulate a fault.

    [~DeviceB] interface GigabitEthernet 1/0/0
    [~DeviceB-GigabitEthernet1/0/0] shutdown
    [*DeviceB-GigabitEthernet1/0/0] commit
    [~DeviceB-GigabitEthernet1/0/0] quit

    # Display detailed information about the BGP route destined for 200.1.1.0/24 on Device A.

    [~DeviceA] display bgp routing-table 200.1.1.0 24
     BGP local router ID : 1.1.1.1
     Local AS number : 100
     Paths:   2 available, 1 best, 1 select
     BGP routing table entry information of 200.1.1.0/24:
     From: 3.3.3.3 (3.3.3.3)  Route Duration: 0d03h10m58s
     Relay IP Nexthop: 11.1.2.2
     Relay IP Out-interface: GigabitEthernet1/0/1
     Original nexthop: 3.3.3.3
     Qos information : 0x0            
     AS-path Nil, origin incomplete, MED 0, localpref 100, pref-val 0, valid, internal, best, select, pre 255
     Not advertised to any peer yet
    
     BGP routing table entry information of 200.1.1.0/24:
     From: 2.2.2.2 (2.2.2.2)  Route Duration: 0d00h00m50s
     Relay IP Nexthop: 0.0.0.0
     Relay IP Out-interface: 
     Original nexthop: 2.2.2.2
     Qos information : 0x0            
     AS-path Nil, origin incomplete, MED 0, localpref 100, pref-val 0, internal, pre 255
     Not advertised to any peers yet

    When Device B is faulty, the original next hop (2.2.2.2/32) of the route destined for 200.1.1.0/24 is iterated to 2.2.2.10/24. However, the mask length of 2.2.2.10/24 is not 32 bits, causing the route is filtered out by the routing policy named np-by-rp. As a result, the route is considered unreachable. Then, Device A re-selects the correct route with 3.3.3.3/32 as the original next hop.

Configuration Files

  • Configuration file of Device A

    #
    sysname DeviceA
    #               
    interface GigabitEthernet1/0/0
     undo shutdown  
     ip address 11.1.1.1 255.255.255.0
    #               
    interface GigabitEthernet1/0/1
     undo shutdown  
     ip address 11.1.2.1 255.255.255.0
    #          
    interface GigabitEthernet1/0/2
     undo shutdown
     ip address 2.2.2.10 255.255.255.0
    #               
    interface LoopBack0
     ip address 1.1.1.1 255.255.255.255
    #               
    bgp 100         
     router-id 1.1.1.1
     peer 2.2.2.2 as-number 100
     peer 2.2.2.2 connect-interface LoopBack0
     peer 3.3.3.3 as-number 100
     peer 3.3.3.3 connect-interface LoopBack0
     #              
     ipv4-family unicast
      undo synchronization
      nexthop recursive-lookup route-policy np-by-rp
      peer 2.2.2.2 enable
      peer 3.3.3.3 enable
    #               
    ospf 1          
     area 0.0.0.0   
      network 1.1.1.1 0.0.0.0
      network 11.1.0.0 0.0.255.255
    #               
    route-policy np-by-rp permit node 10
     if-match ip-prefix np-by-rp-ip
    #               
    ip ip-prefix np-by-rp-ip index 10 permit 0.0.0.0 32
    #               
    return
  • Configuration file of Device B

    #
    sysname DeviceB
    #               
    interface GigabitEthernet1/0/0
     undo shutdown       
     ip address 11.1.1.2 255.255.255.0
    #               
    interface LoopBack0
     ip address 2.2.2.2 255.255.255.255
    #               
    bgp 100         
     router-id 2.2.2.2
     peer 1.1.1.1 as-number 100
     peer 1.1.1.1 connect-interface LoopBack0
     #              
     ipv4-family unicast
      undo synchronization
      import-route static
      peer 1.1.1.1 enable
    #               
    ospf 1          
     area 0.0.0.0   
      network 2.2.2.2 0.0.0.0
      network 11.1.1.0 0.0.0.255
    #               
    ip route-static 200.1.1.0 24 NULL 0
    #               
    return          
  • Configuration file of Device C

    #
    sysname DeviceC
    #               
    interface GigabitEthernet1/0/1
     undo shutdown  
     ip address 11.1.2.2 255.255.255.0
    #               
    interface LoopBack0
     ip address 3.3.3.3 255.255.255.255
    #               
    bgp 100         
     router-id 3.3.3.3
     peer 1.1.1.1 as-number 100
     peer 1.1.1.1 connect-interface LoopBack0
     #              
     ipv4-family unicast
      undo synchronization
      import-route static
      peer 1.1.1.1 enable
    #               
    ospf 1          
     area 0.0.0.0   
      network 3.3.3.3 0.0.0.0
      network 11.1.2.0 0.0.0.255
    #               
    ip route-static 200.1.1.0 24 NULL 0
    #               
    return          
Translation
Download
Updated: 2019-01-03

Document ID: EDOC1100055018

Views: 54264

Downloads: 209

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