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

CX11x, CX31x, CX710 (Earlier Than V6.03), and CX91x Series Switch Modules V100R001C10 Configuration Guide 12

The documents describe the configuration of various services supported by the CX11x&CX31x&CX91x series switch modules The description covers configuration examples and function configurations.
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).
Configuration Examples

Configuration Examples

The configuration examples in this section explain the networking requirements, networking diagram, configuration notes, configuration roadmap, and configuration procedure for different types of routing policies.

Example for Filtering the Routes to Be Received or Advertised

Networking Requirements

As shown in Figure 7-127, on the network where OSPF runs, Switch ModuleA receives routes from the Internet, and provides these routes for the OSPF network. Users want devices on the OSPF network to access only the network segments 172.1.17.0/24, 172.1.18.0/24, and 172.1.19.0/24, and Switch ModuleC to access only the network segment 172.1.18.0/24.

Figure 7-127 Networking diagram for filtering the received and advertised routes



Configuration Roadmap

The configuration roadmap is as follows:

  1. Configure a routing policy on Switch ModuleA and apply the routing policy during route advertisement. When routes are advertised, the routing policy allows Switch ModuleA to provide routes from network segments 172.1.17.0/24, 172.1.18.0/24, and 172.1.19.0/24 for Switch ModuleB, and allows devices on the OSPF network to access these three network segments.

  2. Configure a routing policy on Switch ModuleC and apply the routing policy during route importing. When routes are imported, the routing policy allows Switch ModuleC to receive only the routes from the network segment 172.1.18.0/24 and access this network segment.

Procedure

  1. Add interfaces to the VLANs.

    <HUAWEI> system-view
    [~HUAWEI] sysname Switch ModuleA
    [*HUAWEI] commit
    [~Switch ModuleA] vlan 10
    [*Switch ModuleA-vlan10] quit
    [*Switch ModuleA] interface 10ge 1/17/1
    [*Switch ModuleA-10GE1/17/1] port link-type trunk
    [*Switch ModuleA-10GE1/17/1] port trunk allow-pass vlan 10
    [*Switch ModuleA-10GE1/17/1] quit
    [*Switch ModuleA] commit
    

    The configurations of Switch ModuleB, Switch ModuleC, and Switch ModuleD are similar to the configuration of Switch ModuleA, and are not mentioned here.

  2. Assign IP addresses to the VLANIF interfaces.

    [~Switch ModuleA] interface vlanif 10
    [*Switch ModuleA-Vlanif10] ip address 192.168.1.1 24
    [*Switch ModuleA-Vlanif10] quit
    [*Switch ModuleA] commit

    The configurations of Switch ModuleB, Switch ModuleC, and Switch ModuleD are similar to the configuration of Switch ModuleA, and are not mentioned here.

  3. Configure the basic OSPF functions.

    # Configure Switch ModuleA.

    [~Switch ModuleA] ospf
    [*Switch ModuleA-ospf-1] area 0
    [*Switch ModuleA-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255
    [*Switch ModuleA-ospf-1-area-0.0.0.0] quit
    [*Switch ModuleA-ospf-1] quit
    [*Switch ModuleA] commit

    # Configure Switch ModuleB.

    [~Switch ModuleB] ospf
    [*Switch ModuleB-ospf-1] area 0
    [*Switch ModuleB-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255
    [*Switch ModuleB-ospf-1-area-0.0.0.0] network 192.168.2.0 0.0.0.255
    [*Switch ModuleB-ospf-1-area-0.0.0.0] network 192.168.3.0 0.0.0.255
    [*Switch ModuleB-ospf-1-area-0.0.0.0] quit
    [*Switch ModuleB-ospf-1] quit
    [*Switch ModuleB] commit

    # Configure Switch ModuleC.

    [~Switch ModuleC] ospf
    [*Switch ModuleC-ospf-1] area 0
    [*Switch ModuleC-ospf-1-area-0.0.0.0] network 192.168.2.0 0.0.0.255
    [*Switch ModuleC-ospf-1-area-0.0.0.0] quit
    [*Switch ModuleC-ospf-1] quit
    [*Switch ModuleC] commit

    # Configure Switch ModuleD.

    [~Switch ModuleD] ospf
    [*Switch ModuleD-ospf-1] area 0
    [*Switch ModuleD-ospf-1-area-0.0.0.0] network 192.168.3.0 0.0.0.255
    [*Switch ModuleD-ospf-1-area-0.0.0.0] quit
    [*Switch ModuleD-ospf-1] quit
    [*Switch ModuleD] commit

  4. Configure five static routes on Switch ModuleA and import these routes into OSPF.

    [~Switch ModuleA] ip route-static 172.1.16.0 24 NULL 0
    [*Switch ModuleA] ip route-static 172.1.17.0 24 NULL 0
    [*Switch ModuleA] ip route-static 172.1.18.0 24 NULL 0
    [*Switch ModuleA] ip route-static 172.1.19.0 24 NULL 0
    [*Switch ModuleA] ip route-static 172.1.20.0 24 NULL 0
    [*Switch ModuleA] commit
    [~Switch ModuleA] ospf
    [~Switch ModuleA-ospf-1] import-route static
    [*Switch ModuleA-ospf-1] quit
    [*Switch ModuleA] commit

    # Check the routing table on Switch ModuleB. You can find that the five static routes are imported into OSPF.

    [~Switch ModuleB] display ip routing-table
    Proto: Protocol        Pre: Preference
    Route Flags: R - relay, D - download to fib, T - to vpn-instance
    ------------------------------------------------------------------------------
    Routing Tables: Public
             Destinations : 13       Routes : 13
     Destination/Mask    Proto  Pre  Cost     Flags NextHop         Interface 
          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
         172.1.16.0/24   O_ASE  150  1           D  192.168.1.1     Vlanif10
         172.1.17.0/24   O_ASE  150  1           D  192.168.1.1     Vlanif10
         172.1.18.0/24   O_ASE  150  1           D  192.168.1.1     Vlanif10
         172.1.19.0/24   O_ASE  150  1           D  192.168.1.1     Vlanif10
         172.1.20.0/24   O_ASE  150  1           D  192.168.1.1     Vlanif10
        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.2.0/24   Direct 0    0           D  192.168.2.1     Vlanif20
        192.168.2.1/32   Direct 0    0           D  127.0.0.1       Vlanif20
        192.168.3.0/24   Direct 0    0           D  192.168.3.1     Vlanif30
        192.168.3.1/32   Direct 0    0           D  127.0.0.1       Vlanif30
    

  5. Configure a policy for advertising routes.

    # Set an IP prefix list named a2b on Switch ModuleA.

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

    # Configure a policy for advertising routes on Switch ModuleA, and use the IP prefix list named a2b to filter routes.

    [~Switch ModuleA] ospf
    [~Switch ModuleA-ospf-1] filter-policy ip-prefix a2b export static
    [*Switch ModuleA-ospf-1] commit

    # Check the routing table on Switch ModuleB. You can find that Switch ModuleB receives only three routes defined in a2b.

    [~Switch ModuleB] display ip routing-table
    Proto: Protocol        Pre: Preference
    Route Flags: R - relay, D - download to fib, T - to vpn-instance
    ------------------------------------------------------------------------------
    Routing Tables: Public
             Destinations : 11       Routes : 11
     
    Destination/Mask    Proto  Pre  Cost     Flags NextHop         Interface
     
          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
         172.1.17.0/24  O_ASE  150  1           D  192.168.1.1     Vlanif10
         172.1.18.0/24  O_ASE  150  1           D  192.168.1.1     Vlanif10
         172.1.19.0/24  O_ASE  150  1           D  192.168.1.1     Vlanif10
        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.2.0/24  Direct 0    0           D  192.168.2.1     Vlanif20
        192.168.2.1/32  Direct 0    0           D  127.0.0.1       Vlanif20
        192.168.3.0/24  Direct 0    0           D  192.168.3.1     Vlanif30
        192.168.3.1/32  Direct 0    0           D  127.0.0.1       Vlanif30
    

  6. Configure a policy for receiving routes.

    # Set an IP prefix list named in on Switch ModuleC.

    [~Switch ModuleC] ip ip-prefix in index 10 permit 172.1.18.0 24
    [*Switch Modulec] commit

    # Set a policy for receiving routes on Switch ModuleC, and use in to filter routes.

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

    # Check the routing table on Switch ModuleC. You can find that Switch ModuleC in the local core routing table receives only one route defined in in.

    [~Switch ModuleC] display ip routing-table
    Proto: Protocol        Pre: Preference
    Route Flags: R - relay, D - download to fib, T - to vpn-instance
    ------------------------------------------------------------------------------
    Routing Tables: Public
             Destinations : 5        Routes : 5
     
    Destination/Mask    Proto  Pre  Cost     Flags NextHop         Interface
     
          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
         172.1.18.0/24   O_ASE  150  1           D  192.168.2.1     Vlanif20
        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
    

Configuration Files
  • Configuration file of Switch ModuleA
    #
     sysname Switch ModuleA
    #
     vlan batch 10
    #
    interface Vlanif10
     ip address 192.168.1.1 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 10
    #
    ospf 1
     filter-policy ip-prefix a2b export static
     import-route static
     area 0.0.0.0
      network 192.168.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
  • Configuration file of Switch ModuleB
    #
     sysname Switch ModuleB
    #
     vlan batch 10 20 30
    #
    interface Vlanif10
     ip address 192.168.1.2 255.255.255.0
    #
    interface Vlanif20
     ip address 192.168.2.1 255.255.255.0
    #
    interface Vlanif30
     ip address 192.168.3.1 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 10
    #
    interface 10GE1/17/2
     port link-type trunk
     port trunk allow-pass vlan 20
    #
    interface 10GE1/17/3
     port link-type trunk
     port trunk allow-pass vlan 30
    #
    ospf 1
     area 0.0.0.0
      network 192.168.1.0 0.0.0.255
      network 192.168.2.0 0.0.0.255
      network 192.168.3.0 0.0.0.255
    #
    return
  • Configuration file of Switch ModuleC
    #
     sysname Switch ModuleC
    #
     vlan batch 20
    #
    interface Vlanif20
     ip address 192.168.2.2 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 20
    #
    ospf 1
     filter-policy ip-prefix in import
     area 0.0.0.0
      network 192.168.2.0 0.0.0.255
    #
     ip ip-prefix in index 10 permit 172.1.18.0 24
    #
    return
  • Configuration file of Switch ModuleD
    #
     sysname Switch ModuleD
    #
     vlan batch 30
    #
    interface Vlanif30
     ip address 192.168.3.2 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 30
    #
    ospf 1
     area 0.0.0.0
      network 192.168.3.0 0.0.0.255
    #
    return

Example for Applying a Routing Policy for Importing Routes

Networking Requirements

As shown in Figure 7-128, Switch ModuleB exchanges routing information with Switch ModuleA through OSPF and with Switch ModuleC through IS-IS. Users want Switch ModuleB to import IS-IS routes into the OSPF network. Users also want that the route to 172.17.1.0/24 on the OSPF network has a low preference and the route to 172.17.2.0/24 has a tag, which makes it easy to reference by a routing policy.

Figure 7-128 Networking diagram for applying a routing policy for importing routes



Configuration Roadmap

The configuration roadmap is as follows:

  1. Configure a routing policy on Switch ModuleB, set the cost of the route to 172.17.1.0/24 to 100, and apply the routing policy when OSPF imports IS-IS routes. The routing policy allows the route to 172.17.1.0/24 have a low preference.

  2. Configure a routing policy on Switch ModuleB, set the tag of the route to 172.17.2.0/24 is 20, and apply the routing policy when OSPF imports IS-IS routes. In this way, the tag of the route to 172.17.2.0/24 can take effect, which makes it easy to reference by a routing policy.

Procedure

  1. Add interfaces to the VLANs.

    <HUAWEI> system-view
    [~HUAWEI] sysname Switch ModuleA
    [*HUAWEI] commit
    [~Switch ModuleA] vlan 10
    [*Switch ModuleA-vlan10] quit
    [*Switch ModuleA] interface 10ge 1/17/1
    [*Switch ModuleA-10GE1/17/1] port link-type trunk
    [*Switch ModuleA-10GE1/17/1] port trunk allow-pass vlan 10
    [*Switch ModuleA-10GE1/17/1] quit
    [*Switch ModuleA] commit
    

    The configurations of Switch ModuleB and Switch ModuleC are similar to the configuration of Switch ModuleA, and are not mentioned here.

  2. Assign IP addresses to the VLANIF interfaces.

    [~Switch ModuleA] interface vlanif 10
    [*Switch ModuleA-Vlanif10] ip address 192.168.1.1 24
    [*Switch ModuleA-Vlanif10] quit
    [*Switch ModuleA] commit

    The configurations of Switch ModuleB and Switch ModuleC are similar to the configuration of Switch ModuleA, and are not mentioned here.

  3. Configure IS-IS.

    # Configure Switch Module C.

    [~Switch ModuleC] isis
    [*Switch ModuleC-isis-1] is-level level-2
    [*Switch ModuleC-isis-1] network-entity 10.0000.0000.0001.00
    [*Switch ModuleC-isis-1] quit
    [*Switch ModuleC] interface vlanif 20
    [*Switch ModuleC-Vlanif20] isis enable
    [*Switch ModuleC-Vlanif20] quit
    [*Switch ModuleC] interface vlanif 30
    [*Switch ModuleC-Vlanif30] isis enable
    [*Switch ModuleC-Vlanif30] quit
    [*Switch ModuleC] interface vlanif 40
    [*Switch ModuleC-Vlanif40] isis enable
    [*Switch ModuleC-Vlanif40] quit
    [*Switch ModuleC] interface vlanif 50
    [*Switch ModuleC-Vlanif50] isis enable
    [*Switch ModuleC-Vlanif50] quit
    [*Switch ModuleC] commit

    # Configure Switch Module B.

    [~Switch ModuleB] isis
    [*Switch ModuleB-isis-1] is-level level-2
    [*Switch ModuleB-isis-1] network-entity 10.0000.0000.0002.00
    [*Switch ModuleB-isis-1] quit
    [*Switch ModuleB] interface vlanif 20
    [*Switch ModuleB-Vlanif20] isis enable
    [*Switch ModuleB-Vlanif20] quit
    [*Switch ModuleB] commit

  4. Configure OSPF and import routes.

    # Configure Switch ModuleA and enable OSPF.

    [~Switch ModuleA] ospf
    [*Switch ModuleA-ospf-1] area 0
    [*Switch ModuleA-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255
    [*Switch ModuleA-ospf-1-area-0.0.0.0] quit
    [*Switch ModuleA-ospf-1] quit
    [*Switch ModuleA] commit

    # Configure Switch ModuleB, enable OSPF, and import IS-IS routes.

    [~Switch ModuleB] ospf
    [*Switch ModuleB-ospf-1] area 0
    [*Switch ModuleB-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255
    [*Switch ModuleB-ospf-1-area-0.0.0.0] quit
    [*Switch ModuleB-ospf-1] import-route isis 1
    [*Switch ModuleB-ospf-1] quit
    [*Switch ModuleB] commit

    # Check the OSPF routing table on Switch ModuleA. You can find the imported routes.

    [~Switch ModuleA] display ospf routing
     
              OSPF Process 1 with Router ID 192.168.1.1
                       Routing Tables
     
     Routing for Network
     Destination        Cost  Type       NextHop         AdvRouter       Area
     192.168.1.0/24     1  Stub       192.168.1.1     192.168.1.1     0.0.0.0
     
     Routing for ASEs
     Destination        Cost      Type       Tag         NextHop         AdvRouter
     172.17.1.0/24      1        Type2      1           192.168.1.2     192.168.1.2
     172.17.2.0/24      1        Type2      1           192.168.1.2     192.168.1.2
     172.17.3.0/24      1        Type2      1           192.168.1.2     192.168.1.2
     192.168.2.0/24     1        Type2      1           192.168.1.2     192.168.1.2
     
     Total Nets: 5
     Intra Area: 1  Inter Area: 0  ASE: 4  NSSA: 0

  5. Set the filtering list.

    # Set ACL 2002 to match 172.17.2.0/24.

    [~Switch ModuleB] acl number 2002
    [*Switch ModuleB-acl-basic-2002] rule permit source 172.17.2.0 0.0.0.255
    [*Switch ModuleB-acl-basic-2002] quit
    [*Switch ModuleB] commit

    # Set an IP prefix list named prefix-a to match 172.17.1.0/24.

    [~Switch ModuleB] ip ip-prefix prefix-a index 10 permit 172.17.1.0 24
    [*Switch ModuleB] commit

  6. Configure a routing policy.

    [~Switch ModuleB] route-policy isis2ospf permit node 10
    [*Switch ModuleB-route-policy] if-match ip-prefix prefix-a
    [*Switch ModuleB-route-policy] apply cost 100
    [*Switch ModuleB-route-policy] quit
    [*Switch ModuleB] route-policy isis2ospf permit node 20
    [*Switch ModuleB-route-policy] if-match acl 2002
    [*Switch ModuleB-route-policy] apply tag 20
    [*Switch ModuleB-route-policy] quit
    [*Switch ModuleB] route-policy isis2ospf permit node 30  
    [*Switch ModuleB-route-policy] quit
    [*Switch ModuleB] commit

  7. Apply the routing policy when routes are imported.

    # Configure Switch ModuleB and apply the routing policy when routes are imported.

    [~Switch ModuleB] ospf
    [*Switch ModuleB-ospf-1] import-route isis 1 route-policy isis2ospf
    [*Switch ModuleB-ospf-1] quit
    [*Switch ModuleB] commit

    # Check the OSPF routing table on Switch ModuleA. You can find that the cost of the route to 172.17.1.0/24 is 100; the tag of the route to 172.17.2.0/24 is 20; other route attributes remain unchanged.

    [~Switch ModuleA] display ospf routing
     
              OSPF Process 1 with Router ID 192.168.1.1
                       Routing Tables
     Routing for Network
     Destination        Cost  Type       NextHop         AdvRouter       Area
     192.168.1.0/24     1     Stub      192.168.1.1     192.168.1.1     0.0.0.0
     
     Routing for ASEs
     Destination        Cost      Type       Tag         NextHop           AdvRouter
     172.17.1.0/24      100        Type2      1           192.168.1.2     192.168.1.2
     172.17.2.0/24      1          Type2      20          192.168.1.2     192.168.1.2
     172.17.3.0/24      1          Type2      1           192.168.1.2     192.168.1.2
     192.168.2.0/24     1          Type2      1           192.168.1.2     192.168.1.2
      
     Total Nets: 5
     Intra Area: 1  Inter Area: 0  ASE: 4  NSSA: 0

Configuration Files
  • Configuration file of Switch ModuleA
    #
     sysname Switch ModuleA
    #
     vlan batch 10
    #
    interface Vlanif10
     ip address 192.168.1.1 255.255.255.0
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 10
    #
    ospf 1
     area 0.0.0.0
      network 192.168.1.0 0.0.0.255
    #
    return
  • Configuration file of Switch ModuleB
    #
     sysname Switch ModuleB
    #
     vlan batch 10 20
    #
    acl number 2002
     rule 5 permit source 172.17.2.0 0.0.0.255
    #
    isis 1
     is-level level-2
     network-entity 10.0000.0000.0002.00
    #
    interface Vlanif10
     ip address 192.168.1.2 255.255.255.0
    #
    interface Vlanif20
     ip address 192.168.2.2 255.255.255.0
     isis enable 1
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 10
    #
    interface 10GE1/17/2
     port link-type trunk
     port trunk allow-pass vlan 20
    #
    ospf 1
     import-route isis 1 route-policy isis2ospf
     area 0.0.0.0
     network 192.168.1.0 0.0.0.255
    #
    route-policy isis2ospf permit node 10
     if-match ip-prefix prefix-a
     apply cost 100
    #
    route-policy isis2ospf permit node 20
     if-match acl 2002
     apply tag 20
    #
    route-policy isis2ospf permit node 30
    #
    ip ip-prefix prefix-a index 10 permit 172.17.1.0 24
    #
    return
  • Configuration file of Switch ModuleC
    #
     sysname Switch ModuleC
    #
     vlan batch 20 30 40 50
    #
    isis 1
     is-level level-2
     network-entity 10.0000.0000.0001.00
    #
    interface Vlanif20
     ip address 192.168.2.1 255.255.255.0
     isis enable 1
    #
    interface Vlanif30
     ip address 172.17.1.1 255.255.255.0
     isis enable 1
    #
    interface Vlanif40
     ip address 172.17.2.1 255.255.255.0
     isis enable 1
    #
    interface Vlanif50
     ip address 172.17.3.1 255.255.255.0
     isis enable 1
    #
    interface 10GE1/17/1
     port link-type trunk
     port trunk allow-pass vlan 20
    #
    interface 10GE1/17/2
     port link-type trunk
     port trunk allow-pass vlan 30
    #
    interface 10GE1/17/3
     port link-type trunk
     port trunk allow-pass vlan 40
    #
    interface 10GE1/17/4
     port link-type trunk
     port trunk allow-pass vlan 50
    #
    return
Translation
Download
Updated: 2019-08-09

Document ID: EDOC1000041694

Views: 58539

Downloads: 3621

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