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 Routing 01

NE05E and NE08E V300R003C10SPC500

This is NE05E and NE08E V300R003C10SPC500 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 Filtering the Received Routes and Those to Be Advertised

Example for Filtering the Received Routes and Those to Be Advertised

Filters can be applied to the received routes and those to be advertised based on networking requirements.

Networking Requirements

In Figure 12-1, on the network running OSPF, Device A receives routes from the Internet and provides some Internet routes for Device B. It is required that Device A provide only 172.1.17.0/24, 172.1.18.0/24, and 172.1.19.0/24 for Device B, Device C receive only 172.1.18.0/24, and that Device D receive all the routes provided by Device B.

Figure 12-1 Filtering the received routes and those to be advertised
NOTE:

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



Precautions

When filtering received routes and those to be advertised, note the following rules:

  • When configuring an IP prefix list, specify the IP prefix range as required.

  • The IP prefix list name is case sensitive.

Configuration Roadmap

The configuration roadmap is as follows:

  1. Configure basic OSPF functions on Device A, Device B, Device C, and Device D.

  2. Configure static routes on Device A and import these routes into OSPF.

  3. Configure a policy to filter routes to be advertised on Device A and then check the routing table on Device B.

  4. Configure a policy to filter received routes on Device C and then check the routing table on Device C.

Data Preparation

To complete the configuration, you need the following data:

  • Five static routes imported by Device A

  • Area 0 (backbone area), in which Device A, Device B, Device C, and Device D are located

  • Name of the IP prefix list and routes to be filtered

Procedure

  1. Configure IP addresses for interfaces. For configuration details, see Configuration Files in this section.
  2. Configure OSPF.

    # Configure Device A.

    [~DeviceA] ospf
    [*DeviceA-ospf-1] area 0
    [*DeviceA-ospf-1-area-0.0.0.0] network 192.158.1.0 0.0.0.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
    [*DeviceB-ospf-1] area 0
    [*DeviceB-ospf-1-area-0.0.0.0] network 192.158.1.0 0.0.0.255
    [*DeviceB-ospf-1-area-0.0.0.0] network 192.158.2.0 0.0.0.255
    [*DeviceB-ospf-1-area-0.0.0.0] network 192.158.3.0 0.0.0.255
    [*DeviceB-ospf-1-area-0.0.0.0] commit
    [~DeviceB-ospf-1-area-0.0.0.0] quit

    # Configure Device C.

    [~DeviceC] ospf
    [*DeviceC-ospf-1] area 0
    [*DeviceC-ospf-1-area-0.0.0.0] network 192.158.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

    # Configure Device D.

    [~DeviceD] ospf
    [*DeviceD-ospf-1] area 0
    [*DeviceD-ospf-1-area-0.0.0.0] network 192.158.3.0 0.0.0.255
    [*DeviceD-ospf-1-area-0.0.0.0] commit
    [~DeviceD-ospf-1-area-0.0.0.0] quit

  3. Configure five static routes on Device A, and import these routes into OSPF.

    [~DeviceA] ip route-static 172.1.16.0 24 NULL0
    [*DeviceA] ip route-static 172.1.17.0 24 NULL0
    [*DeviceA] ip route-static 172.1.18.0 24 NULL0
    [*DeviceA] ip route-static 172.1.19.0 24 NULL0
    [*DeviceA] ip route-static 172.1.20.0 24 NULL0
    [*DeviceA] ospf
    [*DeviceA-ospf-1] import-route static
    [*DeviceA-ospf-1] commit
    [~DeviceA-ospf-1] quit

    # Display the IP routing table on Device B. The following command output shows that the five static routes have been imported into OSPF.

    [~DeviceB] display ip routing-table
    Route Flags: R - relay, D - download
    to fib, T - to vpn-instance, B - black hole route
    ------------------------------------------------------------------------------
    Routing Table : Public
             Destinations : 22       Routes : 22
    
    Destination/Mask    Proto  Pre  Cost        Flags NextHop         Interface
    
            1.1.1.1/32  Direct 0    0             D  127.0.0.1       LoopBack1
          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
    255.255.255.255/32  Direct 0    0             D  127.0.0.1       InLoopBack0
       172.1.16.0/24  O_ASE  150  1             D  192.158.1.1     GigabitEthernet0/1/0
       172.1.17.0/24  O_ASE  150  1             D  192.158.1.1     GigabitEthernet0/1/0
       172.1.18.0/24  O_ASE  150  1             D  192.158.1.1     GigabitEthernet0/1/0
       172.1.19.0/24  O_ASE  150  1             D  192.158.1.1     GigabitEthernet0/1/0
       172.1.20.0/24  O_ASE  150  1             D  192.158.1.1     GigabitEthernet0/1/0
        192.158.1.0/24  Direct 0    0             D  192.158.1.2     GigabitEthernet0/1/0
        192.158.1.1/32  Direct 0    0             D  192.158.1.1     GigabitEthernet0/1/0
        192.158.1.2/32  Direct 0    0             D  127.0.0.1       GigabitEthernet0/1/0
      192.158.1.255/32  Direct 0    0             D  127.0.0.1       GigabitEthernet0/1/0
        192.158.2.0/24  Direct 0    0             D  192.158.2.1     GigabitEthernet0/3/0
        192.158.2.1/32  Direct 0    0             D  127.0.0.1       GigabitEthernet0/3/0
        192.158.2.2/32  Direct 0    0             D  192.158.2.2     GigabitEthernet0/3/0
      192.158.2.255/32  Direct 0    0             D  127.0.0.1       GigabitEthernet0/3/0
        192.158.3.0/24  Direct 0    0             D  192.158.3.1     GigabitEthernet0/2/0
        192.158.3.1/32  Direct 0    0             D  127.0.0.1       GigabitEthernet0/2/0
        192.158.3.2/32  Direct 0    0             D  192.158.3.2     GigabitEthernet0/2/0
      192.158.3.255/32  Direct 0    0             D  127.0.0.1       GigabitEthernet0/2/0

  4. Configure a policy to filter routes to be advertised.

    # Configure the IP prefix list named a2b on Device A.

    [~DeviceA] ip ip-prefix a2b index 10 permit 172.1.17.0 24
    [*DeviceA] ip ip-prefix a2b index 20 permit 172.1.18.0 24
    [*DeviceA] ip ip-prefix a2b index 30 permit 172.1.19.0 24
    [*DeviceA] commit

    # Configure a policy on Device A and use the IP prefix list named a2b to filter routes.

    [~DeviceA] ospf
    [*DeviceA-ospf-1] filter-policy ip-prefix a2b export static
    [*DeviceA-ospf-1] commit
    [~DeviceA-ospf-1] quit

    # Display the IP routing table on Device B. The following command output shows that Device B has received only three routes specified in the IP prefix list named a2b.

    [~DeviceB] display ip routing-table
    Route Flags: R - relay, D - download
    to fib, T - to vpn-instance, B - black hole route
    ------------------------------------------------------------------------------
    Routing Table : Public
             Destinations : 20       Routes : 20
    
    Destination/Mask    Proto  Pre  Cost        Flags NextHop         Interface
    
            1.1.1.1/32  Direct 0    0             D  127.0.0.1       LoopBack1
          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
    255.255.255.255/32  Direct 0    0             D  127.0.0.1       InLoopBack0
       172.1.17.0/24  O_ASE  150  1             D  192.158.1.1     GigabitEthernet0/1/0
       172.1.18.0/24  O_ASE  150  1             D  192.158.1.1     GigabitEthernet0/1/0
       172.1.19.0/24  O_ASE  150  1             D  192.158.1.1     GigabitEthernet0/1/0
        192.158.1.0/24  Direct 0    0             D  192.158.1.2     GigabitEthernet0/1/0
        192.158.1.1/32  Direct 0    0             D  192.158.1.1     GigabitEthernet0/1/0
        192.158.1.2/32  Direct 0    0             D  127.0.0.1       GigabitEthernet0/1/0
      192.158.1.255/32  Direct 0    0             D  127.0.0.1       GigabitEthernet0/1/0
        192.158.2.0/24  Direct 0    0             D  192.158.2.1     GigabitEthernet0/3/0
        192.158.2.1/32  Direct 0    0             D  127.0.0.1       GigabitEthernet0/3/0
        192.158.2.2/32  Direct 0    0             D  192.158.2.2     GigabitEthernet0/3/0
      192.158.2.255/32  Direct 0    0             D  127.0.0.1       GigabitEthernet0/3/0
        192.158.3.0/24  Direct 0    0             D  192.158.3.1     GigabitEthernet0/2/0
        192.158.3.1/32  Direct 0    0             D  127.0.0.1       GigabitEthernet0/2/0
        192.158.3.2/32  Direct 0    0             D  192.158.3.2     GigabitEthernet0/2/0
      192.158.3.255/32  Direct 0    0             D  127.0.0.1       GigabitEthernet0/2/0

  5. Configure a policy to filter received routes.

    # Configure the IP prefix list named in on Device C.

    [~DeviceC] ip ip-prefix in index 10 permit 172.1.18.0 24
    [*DeviceC] commit

    # Configure a policy on Device C and use the IP prefix list named in to filter routes.

    [~DeviceC] ospf
    [*DeviceC-ospf-1] filter-policy ip-prefix in import
    [*DeviceC-ospf-1] commit

    # Display the IP routing table on Device C. The following command output shows that Device C has received only one route specified in the IP prefix list named in.

    [~DeviceC] display ip routing-table
    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
    
            1.1.1.1/32  O_ASE  10   1             D  192.158.2.1     GigabitEthernet0/1/0
          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
    255.255.255.255/32  Direct 0    0             D  127.0.0.1       InLoopBack0
       172.1.18.0/24  O_ASE  150  1             D  192.158.2.1     GigabitEthernet0/1/0
        192.158.1.0/24  O_ASE  10   2             D  192.158.2.1     GigabitEthernet0/1/0
        192.158.2.0/24  Direct 0    0             D  192.158.2.2     GigabitEthernet0/1/0
        192.158.2.1/32  Direct 0    0             D  192.158.2.1     GigabitEthernet0/1/0
        192.158.2.2/32  Direct 0    0             D  127.0.0.1       GigabitEthernet0/1/0
      192.158.2.255/32  Direct 0    0             D  127.0.0.1       GigabitEthernet0/1/0
        192.158.3.0/24  O_ASE  10   2             D  192.158.2.1     GigabitEthernet0/1/0

    # Display the OSPF routing table on Device C. The following command output shows that there are three routes specified in the IP prefix list named a2b in the OSPF routing table because the filter-policy import command filters the routes to be added to the local core routing table from the routing table of a link-state protocol.

    [~DeviceC] display ospf routing
              OSPF Process 1 with Router ID 192.158.2.2
                       Routing Tables
    
     Routing for Network
     Destination        Cost       Type       NextHop         AdvRouter       Area
    
     1.1.1.1/32         1          Stub       192.158.2.1     1.1.1.1         0.0.0.
    0
     192.158.1.0/24     2          Transit    192.158.2.1     192.158.1.1     0.0.0.
    0
     192.158.3.0/24     2          Stub       192.158.2.1     1.1.1.1         0.0.0.
    0
    
     Routing for ASEs
     Destination        Cost       Type       Tag        NextHop         AdvRouter
    
     172.1.17.0/24    1          Type2      1          192.158.2.1     192.158.1.1
    
     172.1.18.0/24    1          Type2      1          192.158.2.1     192.158.1.1
    
     172.1.19.0/24    1          Type2      1          192.158.2.1     192.158.1.1
    
    
     Total Nets: 6
     Intra Area: 3  Inter Area: 0  ASE: 3  NSSA: 0

Configuration Files

  • Device A configuration file

    #
    sysname DeviceA
    #
    interface GigabitEthernet0/1/0
     undo shutdown
     ip address 192.158.1.1 255.255.255.0
    #
    ospf 1
     filter-policy ip-prefix a2b export static
     import-route static
     area 0.0.0.0
      network 192.158.1.0 0.0.0.255
    #
    ip ip-prefix a2b index 10 permit 172.1.17.0 24
    ip ip-prefix a2b index 20 permit 172.1.18.0 24
    ip ip-prefix a2b index 30 permit 172.1.19.0 24
    #
    ip route-static 172.1.16.0 255.255.255.0 NULL0
    ip route-static 172.1.17.0 255.255.255.0 NULL0
    ip route-static 172.1.18.0 255.255.255.0 NULL0
    ip route-static 172.1.19.0 255.255.255.0 NULL0
    ip route-static 172.1.20.0 255.255.255.0 NULL0
    #
    return
  • Device B configuration file

    #
    sysname DeviceB
    #
    interface GigabitEthernet0/1/0
     undo shutdown
     ip address 192.158.1.2 255.255.255.0
    #
    interface GigabitEthernet0/2/0
     undo shutdown
     ip address 192.158.3.1 255.255.255.0
    #
    interface GigabitEthernet0/3/0
     undo shutdown
     ip address 192.158.2.1 255.255.255.0
    #
    ospf 1
     area 0.0.0.0
      network 192.158.1.0 0.0.0.255
      network 192.158.2.0 0.0.0.255
      network 192.158.3.0 0.0.0.255
    #
    return
  • Device C configuration file

    #
    sysname DeviceC
    #
    interface GigabitEthernet0/1/0
     undo shutdown
     ip address 192.158.2.2 255.255.255.0
    #
    ospf 1
     filter-policy ip-prefix in import
     area 0.0.0.0
      network 192.158.2.0 0.0.0.255
    #
    ip ip-prefix in index 10 permit 172.1.18.0 24
    #
    return
  • Device D configuration file

    #
    sysname DeviceD
    #
    interface GigabitEthernet0/1/0
     undo shutdown
     ip address 192.158.3.2 255.255.255.0
    #
    ospf 1
     area 0.0.0.0
      network 192.158.3.0 0.0.0.255
    #
    return
Translation
Download
Updated: 2019-01-14

Document ID: EDOC1100058916

Views: 35052

Downloads: 51

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