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

S7700 and S9700 V200R010C00

This document describes IP Unicast Routing configurations supported by the switch, including the principle and configuration procedures of IP Routing Overview, Static Route, RIP, RIPng, OSPF, OSPFv3, IS-IS(IPv4), IS-IS(IPv6), BGP, Routing Policy ,and PBR, and provides configuration examples.
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 OSPF-BGP Synchronization

Example for Configuring OSPF-BGP Synchronization

Networking Requirements

On the network shown in Figure 1, an EBGP connection is established between SwitchD and SwitchE. IBGP connections are established between switches in AS 10, and OSPF is used as an IGP protocol. OSPF-BGP synchronization needs to be enabled on SwitchB so that the traffic from SwitchA to AS 20 will not be interrupted after SwitchB restarts.

NOTE:

In this scenario, ensure that all connected interfaces have STP disabled. If STP is enabled and VLANIF interfaces of switches are used to construct a Layer 3 ring network, an interface on the network will be blocked. As a result, Layer 3 services on the network cannot run normally.

Figure 5-76  Networking diagram of configuring OSPF-BGP synchronization

Configuration Roadmap

The configuration roadmap is as follows:

  1. Configure IP addresses and VLANs for the VLANIF interfaces on switches to implement communication within network segments.

  2. Configure basic OSPF functions and IBGP connections on SwitchA, SwitchB, SwitchC, and SwitchD (excluding 10.2.1.1/30) to implement device connections within AS 10.

  3. Configure EBGP connections between SwitchD and SwitchE, and import direct routes and OSPF routes to implement communication between AS 10 and AS 20.

  4. Set the OSPF protocol cost to 2 on SwitchC so that SwitchA selects only SwitchB as the intermediate router to the network segment 10.2.1.0 and SwitchC becomes the backup of SwitchB.

  5. Enable OSPF-BGP synchronization on SwitchB so that the traffic from SwitchA to AS 20 will not be interrupted after SwitchB restarts.

Procedure

  1. Configure VLANs for interfaces.

    # Configure SwitchA. The configurations of SwitchB, SwitchC, SwitchD, and SwitchE are similar to the configuration of SwitchA.

    <HUAWEI> system-view
    [HUAWEI] sysname SwitchA
    [SwitchA] vlan batch 10 20
    [SwitchA] interface gigabitethernet 1/0/1
    [SwitchA-GigabitEthernet1/0/1] port link-type trunk
    [SwitchA-GigabitEthernet1/0/1] port trunk allow-pass vlan 10
    [SwitchA-GigabitEthernet1/0/1] quit
    [SwitchA] interface gigabitethernet 1/0/2
    [SwitchA-GigabitEthernet1/0/2] port link-type trunk
    [SwitchA-GigabitEthernet1/0/2] port trunk allow-pass vlan 20
    [SwitchA-GigabitEthernet1/0/2] quit

  2. Assign IP addresses to the VLANIF interfaces and loopback interfaces.

    # Configure SwitchA. The configurations of SwitchB, SwitchC, SwitchD, and SwitchE are similar to the configuration of SwitchA.

    [SwitchA] interface vlanif 10
    [SwitchA-Vlanif10] ip address 10.1.1.1 30
    [SwitchA-Vlanif10] quit
    [SwitchA] interface vlanif 20
    [SwitchA-Vlanif20] ip address 10.1.2.1 30
    [SwitchA-Vlanif20] quit
    [SwitchA] interface loopback 0
    [SwitchA-LoopBack0] ip address 10.10.10.1 32
    [SwitchA-LoopBack0] quit

  3. Configure basic OSPF functions.

    # Configure SwitchA. The configurations of SwitchB, SwitchC, and SwitchD are similar to the configuration of SwitchA.

    [SwitchA] router id 10.10.10.1
    [SwitchA] ospf 1
    [SwitchA-ospf-1] area 0
    [SwitchA-ospf-1-area-0.0.0.0] network 10.10.10.1 0.0.0.0
    [SwitchA-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.3
    [SwitchA-ospf-1-area-0.0.0.0] network 10.1.2.0 0.0.0.3
    [SwitchA-ospf-1-area-0.0.0.0] quit
    [SwitchA-ospf-1] quit

  4. Configure IBGP fully meshed connections.

    # Configure SwitchA.

    [SwitchA] bgp 10
    [SwitchA-bgp] peer 10.10.10.2 as-number 10
    [SwitchA-bgp] peer 10.10.10.2 connect-interface LoopBack 0
    [SwitchA-bgp] peer 10.10.10.3 as-number 10
    [SwitchA-bgp] peer 10.10.10.3 connect-interface LoopBack 0
    [SwitchA-bgp] peer 10.10.10.4 as-number 10
    [SwitchA-bgp] peer 10.10.10.4 connect-interface LoopBack 0
    [SwitchA-bgp] quit

    # Configure SwitchB.

    [SwitchB] bgp 10
    [SwitchB-bgp] peer 10.10.10.1 as-number 10
    [SwitchB-bgp] peer 10.10.10.1 connect-interface LoopBack 0
    [SwitchB-bgp] peer 10.10.10.3 as-number 10
    [SwitchB-bgp] peer 10.10.10.3 connect-interface LoopBack 0
    [SwitchB-bgp] peer 10.10.10.4 as-number 10
    [SwitchB-bgp] peer 10.10.10.4 connect-interface LoopBack 0
    [SwitchB-bgp] quit

    # Configure SwitchC.

    [SwitchC] bgp 10
    [SwitchC-bgp] peer 10.10.10.1 as-number 10
    [SwitchC-bgp] peer 10.10.10.1 connect-interface LoopBack 0
    [SwitchC-bgp] peer 10.10.10.2 as-number 10
    [SwitchC-bgp] peer 10.10.10.2 connect-interface LoopBack 0
    [SwitchC-bgp] peer 10.10.10.4 as-number 10
    [SwitchC-bgp] peer 10.10.10.4 connect-interface LoopBack 0
    [SwitchC-bgp] quit

    # Configure SwitchD.

    [SwitchD] bgp 10
    [SwitchD-bgp] peer 10.10.10.1 as-number 10
    [SwitchD-bgp] peer 10.10.10.1 connect-interface LoopBack 0
    [SwitchD-bgp] peer 10.10.10.2 as-number 10
    [SwitchD-bgp] peer 10.10.10.2 connect-interface LoopBack 0
    [SwitchD-bgp] peer 10.10.10.3 as-number 10
    [SwitchD-bgp] peer 10.10.10.3 connect-interface LoopBack 0
    [SwitchD-bgp] quit

  5. Establish an EBGP connection.

    # Configure SwitchD.

    [SwitchD] bgp 10
    [SwitchD-bgp] peer 10.2.1.2 as-number 20
    [SwitchD-bgp] import-route direct
    [SwitchD-bgp] import-route ospf 1
    [SwitchD-bgp] quit

    # Configure SwitchE.

    [SwitchE] bgp 20
    [SwitchE-bgp] router-id 10.10.10.5
    [SwitchE-bgp] peer 10.2.1.1 as-number 10
    [SwitchE-bgp] ipv4-family unicast
    [SwitchE-bgp-af-ipv4] network 10.3.1.0 30
    [SwitchE-bgp-af-ipv4] quit
    [SwitchE-bgp] quit

  6. Configure a cost for OSPF on SwitchC.

    [SwitchC] interface vlanif 20
    [SwitchC-Vlanif20] ospf cost 2
    [SwitchC-Vlanif20] quit
    [SwitchC] interface vlanif 30
    [SwitchC-Vlanif30] ospf cost 2
    [SwitchC-Vlanif30] quit

    # Check the routing table on SwitchA. The routing table shows that the route to the destination network segment 10.3.1.0 is learned through BGP and the outbound interface is Vlanif10.

    [SwitchA] display ip routing-table
    Route Flags: R - relay, D - download to fib 
    ------------------------------------------------------------------------------
    Routing Tables: Public 
             Destinations : 14       Routes : 15 
    
    Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface 
    
           10.1.1.0/30  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.2.0/30  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.3.0/30  OSPF    10   2           D   10.1.1.2        Vlanif10      
           10.1.4.0/30  OSPF    10   3           D   10.1.2.2        Vlanif20      
                        OSPF    10   3           D   10.1.1.2        Vlanif10      
           10.2.1.0/30  IBGP    255  0          RD   10.10.10.4      Vlanif10      
           10.3.1.0/30  IBGP    255  0          RD   10.2.1.2        Vlanif10      
         10.10.10.1/32  Direct  0    0           D   127.0.0.1       LoopBack0     
         10.10.10.2/32  OSPF    10   1           D   10.1.1.2        Vlanif10      
         10.10.10.3/32  OSPF    10   1           D   10.1.2.2        Vlanif20      
         10.10.10.4/32  OSPF    10   2           D   10.1.1.2        Vlanif10      
          127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0   
          127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0   

    # Check the routing table on SwitchB.

    [SwitchB] display ip routing-table
    Route Flags: R - relay, D - download to fib 
    ------------------------------------------------------------------------------
    Routing Tables: Public 
             Destinations : 14       Routes : 15 
    
    Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface 
    
           10.1.1.0/30  Direct  0    0           D   10.1.1.2        Vlanif10      
           10.1.1.2/32  Direct  0    0           D   127.0.0.1       Vlanif10      
           10.1.2.0/30  OSPF    10   2           D   10.1.1.1        Vlanif10      
           10.1.3.0/30  Direct  0    0           D   10.1.3.1        Vlanif40      
           10.1.3.1/32  Direct  0    0           D   127.0.0.1       Vlanif40      
           10.1.4.0/30  OSPF    10   2           D   10.1.3.2        Vlanif40      
           10.2.1.0/30  IBGP    255  0          RD   10.10.10.4      Vlanif40      
           10.3.1.0/30  IBGP    255  0          RD   10.2.1.2        Vlanif40      
         10.10.10.1/32  OSPF    10   1           D   10.1.1.1        Vlanif10      
         10.10.10.2/32  Direct  0    0           D   127.0.0.1       LoopBack0     
         10.10.10.3/32  OSPF    10   2           D   10.1.1.1        Vlanif10      
                        OSPF    10   2           D   10.1.3.2        Vlanif40      
         10.10.10.4/32  OSPF    10   1           D   10.1.3.2        Vlanif40      
          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   

    The preceding command output shows that the route to the destination network segment 10.3.1.0 is learned by SwitchB through BGP and the outbound interface is Vlanif40. The routes to the network segments 10.1.2.0 and 10.1.4.0 are learned through OSPF. The costs of these routes are both 2.

  7. Configure OSPF-BGP synchronization on SwitchB.

    [SwitchB] ospf
    [SwitchB-ospf-1] stub-router on-startup
    [SwitchB-ospf-1] return

  8. Verify the configuration.

    # Save the configuration.

    <SwitchB> save
    

    The system displays a message asking whether you want to save the configuration. Enter y.

    # Restart SwitchB.

    <SwitchB> reboot
    

    The system displays a message asking whether you want to continue with a system reboot. Enter y.

    # Check the routing table on SwitchA. The routing table shows that the route to the destination network segment 10.3.1.0 is learned through BGP and the outbound interface is Vlanif20.

    [SwitchA] display ip routing-table
    Route Flags: R - relay, D - download to fib 
    ------------------------------------------------------------------------------
    Routing Tables: Public 
             Destinations : 10       Routes : 10 
    
    Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface 
    
           10.1.2.0/30  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.4.0/30  OSPF    10   3           D   10.1.2.2        Vlanif20      
           10.2.1.0/30  IBGP    255  0          RD   10.10.10.4      Vlanif20      
           10.3.1.0/30  IBGP    255  0          RD   10.2.1.2        Vlanif20      
         10.10.10.1/32  Direct  0    0           D   127.0.0.1       LoopBack0     
         10.10.10.3/32  OSPF    10   1           D   10.1.2.2        Vlanif20      
         10.10.10.4/32  OSPF    10   3           D   10.1.2.2        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   

    # Check the routing table on SwitchB. The routing table shows that only OSPF routes exist in the routing table and their costs are at least 65535. This is because IGP routes are converged faster than BGP routes.

    <SwitchB> display ip routing-table
    Route Flags: R - relay, D - download to fib 
    ------------------------------------------------------------------------------
    Routing Tables: Public 
             Destinations : 12       Routes : 13 
    
    Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface        
    
           10.1.1.0/30  Direct  0    0           D   10.1.1.2        Vlanif10      
           10.1.1.2/32  Direct  0    0           D   127.0.0.1       Vlanif10      
           10.1.2.0/30  OSPF    10   65536       D   10.1.1.1        Vlanif10      
           10.1.3.0/30  Direct  0    0           D   10.1.3.1        Vlanif40      
           10.1.3.1/32  Direct  0    0           D   127.0.0.1       Vlanif40      
           10.1.4.0/30  OSPF    10   65536       D   10.1.3.2        Vlanif40      
         10.10.10.1/32  OSPF    10   65535       D   10.1.1.1        Vlanif10      
         10.10.10.2/32  Direct  0    0           D   127.0.0.1       LoopBack0     
         10.10.10.3/32  OSPF    10   65536       D   10.1.1.1        Vlanif10      
                        OSPF    10   65536       D   10.1.3.2        Vlanif40      
         10.10.10.4/32  OSPF    10   65535       D   10.1.3.2        Vlanif40      
          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   

    # After the network is stable, check the routing table of SwitchB again.

    <SwitchB> display ip routing-table
    Route Flags: R - relay, D - download to fib
    ------------------------------------------------------------------------------
    Routing Tables: Public 
             Destinations : 14       Routes : 15 
    
    Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface        
    
           10.1.1.0/30  Direct  0    0           D   10.1.1.2        Vlanif10      
           10.1.1.2/32  Direct  0    0           D   127.0.0.1       Vlanif10      
           10.1.2.0/30  OSPF    10   2           D   10.1.1.1        Vlanif10      
           10.1.3.0/30  Direct  0    0           D   10.1.3.1        Vlanif40      
           10.1.3.1/32  Direct  0    0           D   127.0.0.1       Vlanif40      
           10.1.4.0/30  OSPF    10   2           D   10.1.3.2        Vlanif40      
           10.2.1.0/30  IBGP    255  0          RD   10.10.10.4      Vlanif40      
           10.3.1.0/30  IBGP    255  0          RD   10.2.1.2        Vlanif40      
         10.10.10.1/32  OSPF    10   1           D   10.1.1.1        Vlanif10      
         10.10.10.2/32  Direct  0    0           D   127.0.0.1       LoopBack0     
         10.10.10.3/32  OSPF    10   2           D   10.1.1.1        Vlanif10      
                        OSPF    10   2           D   10.1.3.2        Vlanif40      
         10.10.10.4/32  OSPF    10   1           D   10.1.3.2        Vlanif40      
          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   

    The preceding command output shows that after BGP routes on SwitchB are converged, the routing information restores.

Configuration Files

  • SwitchA configuration file

    #
    sysname SwitchA
    #
    router id 10.10.10.1
    #
    vlan batch 10 20
    #
    interface Vlanif10
     ip address 10.1.1.1 255.255.255.252
    #
    interface Vlanif20
     ip address 10.1.2.1 255.255.255.252
    #
    interface GigabitEthernet1/0/1
     port link-type trunk
     port trunk allow-pass vlan 10
    #
    interface GigabitEthernet1/0/2
     port link-type trunk
     port trunk allow-pass vlan 20
    #
    interface LoopBack0
     ip address 10.10.10.1 255.255.255.255
    #
    bgp 10
     peer 10.10.10.2 as-number 10
     peer 10.10.10.2 connect-interface LoopBack0
     peer 10.10.10.3 as-number 10
     peer 10.10.10.3 connect-interface LoopBack0
     peer 10.10.10.4 as-number 10
     peer 10.10.10.4 connect-interface LoopBack0
     #
     ipv4-family unicast
      undo synchronization
      peer 10.10.10.2 enable
      peer 10.10.10.3 enable
      peer 10.10.10.4 enable
    #
    ospf 1
     area 0.0.0.0
      network 10.1.1.0 0.0.0.3
      network 10.1.2.0 0.0.0.3
      network 10.10.10.1 0.0.0.0
    #
    return
  • SwitchB configuration file

    #
    sysname SwitchB
    #
    router id 10.10.10.2
    #
    vlan batch 10 40
    #
    interface Vlanif10
     ip address 10.1.1.2 255.255.255.252
    #
    interface Vlanif40
     ip address 10.1.3.1 255.255.255.252
    #
    interface GigabitEthernet1/0/1
     port link-type trunk
     port trunk allow-pass vlan 10
    #
    interface GigabitEthernet1/0/2
     port link-type trunk
     port trunk allow-pass vlan 40
    #
    interface LoopBack0
     ip address 10.10.10.2 255.255.255.255
    #
    bgp 10
     peer 10.10.10.1 as-number 10
     peer 10.10.10.1 connect-interface LoopBack0
     peer 10.10.10.3 as-number 10
     peer 10.10.10.3 connect-interface LoopBack0
     peer 10.10.10.4 as-number 10
     peer 10.10.10.4 connect-interface LoopBack0
     #
     ipv4-family unicast
      undo synchronization
      peer 10.10.10.1 enable
      peer 10.10.10.3 enable
      peer 10.10.10.4 enable
    #
    ospf 1
     stub-router on-startup
     area 0.0.0.0
      network 10.1.1.0 0.0.0.3
      network 10.1.3.0 0.0.0.3
      network 10.10.10.2 0.0.0.0
    #
    return
  • SwitchC configuration file

    #
    sysname SwitchC
    #
    router id 10.10.10.3
    #
    vlan batch 20 30
    #
    interface Vlanif20
     ip address 10.1.2.2 255.255.255.252
     ospf cost 2
    #
    interface Vlanif30
     ip address 10.1.4.1 255.255.255.252
     ospf cost 2
    #
    interface GigabitEthernet1/0/1
     port link-type trunk
     port trunk allow-pass vlan 30
    #
    interface GigabitEthernet1/0/2
     port link-type trunk
     port trunk allow-pass vlan 20
    #
    interface LoopBack0
     ip address 10.10.10.3 255.255.255.255
    #
    bgp 10
     peer 10.10.10.1 as-number 10
     peer 10.10.10.1 connect-interface LoopBack0
     peer 10.10.10.2 as-number 10
     peer 10.10.10.2 connect-interface LoopBack0
     peer 10.10.10.4 as-number 10
     peer 10.10.10.4 connect-interface LoopBack0
     #
     ipv4-family unicast
      undo synchronization
      peer 10.10.10.1 enable
      peer 10.10.10.2 enable
      peer 10.10.10.4 enable
    #
    ospf 1
     area 0.0.0.0
      network 10.1.2.0 0.0.0.3
      network 10.1.4.0 0.0.0.3
      network 10.10.10.3 0.0.0.0
    #
    return
  • SwitchD configuration file

    #
    sysname SwitchD
    #
    router id 10.10.10.4
    #
    vlan batch 30 40 50
    #
    interface Vlanif30
     ip address 10.1.4.2 255.255.255.252
    #
    interface Vlanif40
     ip address 10.1.3.2 255.255.255.252
    #
    interface Vlanif50
     ip address 10.2.1.1 255.255.255.252
    #
    interface GigabitEthernet1/0/1
     port link-type trunk
     port trunk allow-pass vlan 30
    #
    interface GigabitEthernet1/0/2
     port link-type trunk
     port trunk allow-pass vlan 40
    #
    interface GigabitEthernet1/0/3
     port link-type trunk
     port trunk allow-pass vlan 50
    #
    interface LoopBack0
     ip address 10.10.10.4 255.255.255.255
    #
    bgp 10
     peer 10.10.10.1 as-number 10
     peer 10.10.10.1 connect-interface LoopBack0
     peer 10.10.10.2 as-number 10
     peer 10.10.10.2 connect-interface LoopBack0
     peer 10.10.10.3 as-number 10
     peer 10.10.10.3 connect-interface LoopBack0
     peer 10.2.1.2 as-number 20
     #
     ipv4-family unicast
      undo synchronization
      import-route direct
      import-route ospf 1
      peer 10.10.10.1 enable
      peer 10.10.10.2 enable
      peer 10.10.10.3 enable
      peer 10.2.1.2 enable
    #
    ospf 1
     area 0.0.0.0
      network 10.1.3.0 0.0.0.3
      network 10.1.4.0 0.0.0.3
      network 10.10.10.4 0.0.0.0
    #
    return
  • SwitchE configuration file

    #
    sysname SwitchE
    #
    vlan batch 50 60
    #
    interface Vlanif50
     ip address 10.2.1.2 255.255.255.252
    #
    interface Vlanif60
     ip address 10.3.1.1 255.255.255.252
    #
    interface GigabitEthernet1/0/1
     port link-type trunk
     port trunk allow-pass vlan 50
    #
    interface GigabitEthernet1/0/2
     port link-type trunk
     port trunk allow-pass vlan 60
    #
    interface LoopBack0
     ip address 10.10.10.5 255.255.255.255
    #
    bgp 20
     router-id 10.10.10.5
     peer 10.2.1.1 as-number 10
     #
     ipv4-family unicast
      undo synchronization
      network 10.3.1.0 255.255.255.252
      peer 10.2.1.1 enable
    #
    return
Translation
Download
Updated: 2019-08-21

Document ID: EDOC1000141900

Views: 191127

Downloads: 194

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