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

S1720, S2700, S5700, and S6720 V200R011C10

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).
Applying a Route-Policy

Applying a Route-Policy

Context

NOTE:

By default, the system does not allow a nonexistent route-policy to be specified in a command. To enable the system to allow a nonexistent route-policy to be specified in a command, run the route-policy nonexistent-config-check disable command.

Procedure

  • Apply a route-policy to direct routes.
    1. Run system-view

      The system view is displayed.

    2. To apply a route-policy to specific direct routes, see Table 11-11.

      Table 11-11  Applying a route-policy to direct routes

      Configuration Task

      Command

      Reference

      Configure a device to advertise ARP Vlink direct routes that match a route-policy on the public network

      arp vlink-direct-route advertise [ route-policy route-policy-name ]

      Configuring the Advertisement of IPv4 ARP Vlink Direct Routes

  • Apply a route-policy to RIP routes.
    1. Run system-view

      The system view is displayed.

    2. Run rip [ process-id ]

      A RIP process is enabled, and the RIP view is displayed.

    3. To apply a route-policy to specific RIP routes, see Table 11-12.

    Table 11-12  Applying a route-policy to RIP routes

    Configuration Task

    Command

    Reference

    Configure a device to generate a default route or advertise a default route in the routing table to neighbors only when the matching conditions of a route-policy are met.

    default-route originate [ cost cost | { match default | route-policy route-policy-name } [ avoid-learning ] ]*

    Configuring RIP to Advertise Default Routes

    Configure RIP to import the BGP routes that match a route-policy.

    import-route bgp [ permit-ibgp ] [ cost { cost | transparent } | route-policy route-policy-name ] *

    Configuring RIP to Import Routes

    Configure RIP to import routes that match a route-policy from another routing protocol.

    import-route { { static | direct | unr } | { rip | ospf | isis } [ process-id ] } [ cost cost | route-policy route-policy-name ] *

    Configuring RIP to Import Routes

    Set a priority for routes that match a route-policy.

    preference { preference | route-policy route-policy-name } *

    Configuring RIP Preference

  • Apply a route-policy to RIPng routes.
    1. Run system-view

      The system view is displayed.

    2. Run ripng [ process-id ]

      A RIPng process is enabled, and the RIPng view is displayed.

    3. To apply a route-policy to specific RIPng routes, see Table 11-13.

    Table 11-13  Applying a route-policy to RIPng routes

    Configuration Task

    Command

    Reference

    Configure RIPng to import routes that match a route-policy from another routing protocol.

    import-route { { ripng | isis | ospfv3 } [ process-id ] | bgp [ permit-ibgp ] | unr | direct | static } [ [ cost cost | inherit-cost ] | route-policy route-policy-name ] *

    Configuring a RIPng Process to Import External Routes

    Set a priority for RIPng routes that match a route-policy.

    preference { preference | route-policy route-policy-name } *

    Configuring RIPng Preference

  • Apply a route-policy to IPv4 IS-IS routes.

    • To apply a route-policy in the IS-IS view, perform the following operations:
      1. Run the system-view command to enter the system view.
      2. Run the isis [ process-id ] command to enter the IS-IS view.
      3. To apply a route-policy to IPv4 IS-IS routes in the IS-IS view, see Table 11-14.
      Table 11-14  Applying a route-policy to IPv4 IS-IS routes in the IS-IS view

      Configuration Task

      Command

      Reference

      Configure IS-IS to generate and advertise default routes to the IS-IS domain only when external routes that match a route-policy exist in the routing table of a Level-1-2 router.

      default-route-advertise [ always | match default | route-policy route-policy-name ] [ cost cost | tag tag | [ level-1 | level-1-2 | level-2 ] ] * [ avoid-learning ]

      Configuring IS-IS to Advertise a Default Route

      Configure IS-IS to advertise the routes that are imported from another routing protocol and match a route-policy.

      filter-policy route-policy route-policy-name export [ protocol [ process-id ] ]

      Configuring IS-IS to Advertise Specified External Routes to an IS-IS Routing Domain

      Configure IS-IS to accept the routes that match a route-policy.

      filter-policy route-policy route-policy-name import

      Adding Specified IS-IS Routes to the IP Routing Table

      Configure IS-IS to import routes that match a route-policy from another routing protocol.

      import-route { { rip | isis | ospf } [ process-id ] | static | direct | unr | bgp [ permit-ibgp ] } [ cost-type { external | internal } | cost cost | tag tag | route-policy route-policy-name | [ level-1 | level-2 | level-1-2 ] ] *

      import-route { { rip | isis | ospf } [ process-id ] | direct | unr | bgp } inherit-cost [ tag tag | route-policy route-policy-name | [ level-1 | level-2 | level-1-2 ] ] *

      Configuring IS-IS to Import External Routes

      Leak Level-1 routes that match a route-policy to a Level-2 area.

      import-route isis level-1 into level-2 filter-policy route-policy route-policy-name

      Configuring IS-IS Route Leaking

      Leak Level-2 routes that match a route-policy to a Level-1 area.

      import-route isis level-2 into level-1 filter-policy route-policy route-policy-name

      Configuring IS-IS Route Leaking

      Configure a priority for the IS-IS routes that match a route-policy.

      preference { preference | route-policy route-policy-name } *

      Configuring a Preference Value for IS-IS

    • To apply a route-policy in the IS-IS FRR view, perform the following operations:
      1. Run the system-view command to enter the system view.
      2. Run the isis [ process-id ] command to enter the IS-IS view.
      3. Run the frr command to enter the IS-IS FRR view.
      4. Run the frr-policy route route-policy route-policy-name command to configure IS-IS to add the backup routes that match a route-policy to the IP routing table.

        For details on how to configure IS-IS Auto FRR (IPv4), see Configuring IPv4 IS-IS Auto FRR.

  • Apply a route-policy to IPv6 IS-IS routes.

    • To apply a route-policy in the IS-IS view, perform the following operations:
      1. Run the system-view command to enter the system view.
      2. Run the isis [ process-id ] command to enter the IS-IS view.
      3. To apply a route-policy to IPv6 IS-IS routes in the IS-IS view, see Table 11-15.
      Table 11-15  Applying a route-policy to IPv6 IS-IS routes in the IS-IS view

      Configuration Task

      Command

      Reference

      Configure IS-IS to generate and advertise default IPv6 routes to the IS-IS domain only when external routes that match a route-policy exist in the routing table of a Level-1-2 router.

      ipv6 default-route-advertise route-policy route-policy-name [ cost cost | tag tag | [ level-1 | level-1-2 | level-2 ] ] * [ avoid-learning ]

      Configuring IS-IS to Advertise a Default Route

      Configure IS-IS to advertise the IPv6 routes that are imported from another routing protocol and match a route-policy.

      ipv6 filter-policy route-policy route-policy-name export [ protocol [ process-id ] ]

      Configuring IS-IS to Advertise Specified External Routes to an IS-IS Routing Domain

      Configure IS-IS to accept the IPv6 routes that match a route-policy.

      ipv6 filter-policy route-policy route-policy-name import

      Adding Specified IS-IS Routes to an IPv6 Routing Table

      Configure IS-IS to import IPv6 routes that match a route-policy from another routing protocol.

      ipv6 import-route { static | direct | unr | { ospfv3 | ripng | isis } [ process-id ] | bgp [ permit-ibgp ] } [ cost cost | tag tag | route-policy route-policy-name | [ level-1 | level-2 | level-1-2 ] ] *

      ipv6 import-route { direct | unr | { ospfv3 | ripng | isis } [ process-id ] | bgp [ permit-ibgp ] } inherit-cost [ tag tag | route-policy route-policy-name | [ level-1 | level-2 | level-1-2 ] ] *

      Configuring IS-IS to Import External Routes

      Leak Level-1 IPv6 routes that match a route-policy to a Level-2 area.

      ipv6 import-route isis level-1 into level-2 [ filter-policy route-policy route-policy-name | tag tag ] *

      Configuring IS-IS IPv6 Route Leaking

      Leak Level-2 IPv6 routes that match a route-policy to a Level-1 area.

      ipv6 import-route isis level-2 into level-1 [ filter-policy route-policy route-policy-name | tag tag ] *

      Configuring IS-IS IPv6 Route Leaking

      Configure a priority for the IPv6 IS-IS routes that match a route-policy.

      ipv6 preference { route-policy route-policy-name | preference } *

      Configuring a Preference Value for IPv6 IS-IS

  • Apply a route-policy to OSPF routes.

    • To apply a route-policy in the OSPF view, perform the following operations:

      1. Run the system-view command to enter the system view.
      2. Run the ospf [ process-id ] command to enable an OSPF process and enter the OSPF view.
      3. To apply a route-policy to OSPF routes in the OSPF view, see Table 11-16.
      Table 11-16  Applying a route-policy to OSPF routes

      Configuration Task

      Command

      Reference

      Configure OSPF to advertise the default routes in the routing table that are not generated by OSPF to a common area based on the parameters of a route-policy.

      default-route-advertise [ [ always | permit-calculate-other ] | cost cost | type type | route-policy route-policy-name [ match-any ] ] *

      Configuring OSPF to Advertise the Default Route to an OSPF Area

      Configure OSPF to advertise the routes that are imported from another routing protocol and match a route-policy.

      filter-policy route-policy route-policy-name export [ protocol [ process-id ] ]

      Configuring OSPF to Filter the Routes to Be Advertised

      Configure OSPF to accept the routes that match a route-policy.

      filter-policy route-policy route-policy-name [ secondary ] import

      Configuring OSPF to Filter Received Routes

      Configure OSPF to import the routes that match a route-policy.

      import-route { limit limit-number | { bgp [ permit-ibgp ] | direct | unr | rip [ process-id-rip ] | static | isis [ process-id-isis ] | ospf [ process-id-ospf ] } [ cost cost | type type | tag tag | route-policy route-policy-name ] * }

      Configuring OSPF to Import External Routes

      Configure a priority for OSPF routes that match a route-policy.

      preference [ ase ] { preference | route-policy route-policy-name } *

      Setting a Priority for OSPF Routes

    • To apply a route-policy in the OSPF area view, perform the following operations:

      1. Run the system-view command to enter the system view.

      2. Run the ospf [ process-id ] command to enable an OSPF process and enter the OSPF process view.

      3. Run the area area-id command to enter the OSPF area view.

      4. Perform either of the following operations to apply a route-policy in the OSPF area view:

        • Run the filter route-policy route-policy-name export command to apply a route-policy to outgoing Type 3 LSAs (summary LSAs) in the area.

        • Run the filter route-policy route-policy-name import command to apply a route-policy to incoming Type 3 LSAs in the area.

        Configuring OSPF to Filter ABR Type3 LSAs

    • To apply a route-policy in the OSPF FRR view, perform the following operations:

      1. Run the system-view command to enter the system view.

      2. Run the ospf [ process-id ] command to enable an OSPF process and enter the OSPF process view.

      3. Run the frr command to enter the OSPF FRR view.

      4. Run the loop-free-alternate command to enable OSPF IP FRR to generate a loop-free backup link.

      5. Run the frr-policy route route-policy route-policy-name command to configure OSPF to add the backup routes that match a route-policy to the IP routing table.

        For details on how to configure OSPF IP FRR, see Enabling OSPF IP FRR.

  • Apply a route-policy to OSPFv3 routes.

    • To apply a route-policy in the OSPFv3 view, perform the following operations:

      1. Run the system-view command to enter the system view.

      2. Run the ospfv3 [ process-id ] command to enable an OSPFv3 process and enter the OSPFv3 process view.

      3. To apply a route-policy to OSPFv3 routes in the OSPFv3 view, see Table 11-17.

      Table 11-17  Applying a route-policy to OSPFv3 routes

      Configuration Task

      Command

      Reference

      Configure OSPFv3 to advertise the default routes in the routing table that are not generated by OSPFv3 to an OSPFv3 area based on the parameters of a route-policy.

      default-route-advertise [ always | cost cost | type type | tag tag | route-policy route-policy-name ] *

      Configuring OSPFv3 to Import External Routes

      Configure OSPFv3 to import the routes that match a route-policy.

      import-route { bgp [ permit-ibgp ] | unr | direct | ripng help-process-id | static | isis help-process-id | ospfv3 help-process-id } [ { cost cost | inherit-cost } | type type | tag tag | route-policy route-policy-name ]*

      Configuring OSPFv3 to Import External Routes

      Configure a priority for OSPFv3 routes that match a route-policy.

      preference [ ase ] { preference | route-policy route-policy-name } *

      -

    • To apply a route-policy in the OSPFv3 area view, perform the following operations:

      1. Run the system-view command to enter the system view.

      2. Run the ospfv3 [ process-id ] command to enable an OSPFv3 process and enter the OSPFv3 process view.

      3. Run the area area-id command to enter the OSPFv3 area view.

      4. Perform either of the following operations to apply a route-policy in the OSPFv3 area view:

        • Run the filter route-policy route-policy-name export command to apply a route-policy to outgoing Type 3 LSAs (Inter-Area-Prefix-LSAs) in the area.

        • Run the filter route-policy route-policy-name import command to apply a route-policy to incoming Type 3 LSAs in the area.

        For details on how to apply a route-policy to Type 3 LSAs in an OSPFv3 area, see (Optional) Configuring OSPFv3 to Filter LSAs in an Area.

  • Apply a route-policy to BGP routes.
    1. Run the system-view command to enter the system view.
    2. Run the bgp { as-number-plain | as-number-dot } command to enter the BGP view.
    3. Run the ipv4-family unicast command to enter the IPv4 unicast address family view.
    4. To apply a route-policy to specific BGP routes, see Table 11-18.

      Table 11-18  Applying a route-policy to BGP routes

      Configuration Task

      Command

      Reference

      Configure a summarized BGP route and apply a route-policy to it.

      aggregate ipv4-address { mask | mask-length } [ as-set | attribute-policy route-policy-name1 | detail-suppressed | origin-policy route-policy-name2 | suppress-policy route-policy-name3 ] *

      Configuring BGP Route Summarization

      Configure BGP route dampening.

      dampening [ half-life-reach reuse suppress ceiling | route-policy route-policy-name ] *

      -

      Configure BGP to import routes that match a route-policy from another routing protocol.

      import-route protocol [ process-id ] [ med med | route-policy route-policy-name ] *

      Configuring BGP to Import Routes

      Import local routes that match a route-policy to the BGP routing table and advertise them to BGP peers.

      network ipv4-address [ mask | mask-length ] [ route-policy route-policy-name ]

      Configuring BGP to Import Routes

      Enable BGP route iteration based on a route-policy.

      nexthop recursive-lookup route-policy route-policy-name

      Configuring the Next_Hop Attribute

      Configure a device to send a default route to a peer or a peer group and use a route-policy to modify the attributes of the default route.

      peer { group-name | ipv4-address } default-route-advertise [ route-policy route-policy-name ] [ conditional-route-match-all { ipv4-address1 { mask1 | mask-length1 } } &<1-4> | conditional-route-match-any { ipv4-address2 { mask2 | mask-length2 } } &<1-4> ]

      Configuring BGP to Advertise Default Routes to Peers

      Configure a device to accept the routes that match a route-policy from a peer or peer group or advertise the routes that match a route-policy to a peer or peer group.

      peer { group-name | ipv4-address } route-policy route-policy-name { import | export }

      Controlling the Advertisement of BGP Routes

      Controlling the Receiving of BGP Routes

      Use a route-policy to set a BGP priority.

      preference route-policy route-policy-name

      Configuring the BGP Priority

      Prevent the BGP routes that match a route-policy from being added to the IP routing table.

      routing-table rib-only [ route-policy route-policy-name ]

      -

  • Apply a route-policy to BGP4+ routes.
    1. Run system-view

      The system view is displayed.

    2. Run bgp { as-number-plain | as-number-dot }

      The BGP view is displayed.

    3. Run ipv6-family [ unicast ]

      The IPv6 unicast address family view is displayed.

    4. To apply a route-policy to specific BGP4+ routes, see Table 11-19.

      Table 11-19  Applying a route-policy to BGP4+ routes

      Configuration Task

      Command

      Reference

      Configure a summarized BGP4+ route and apply a route-policy to it.

      aggregate ipv6-address prefix-length [ as-set | attribute-policy route-policy-name1 | detail-suppressed | origin-policy route-policy-name2 | suppress-policy route-policy-name3 ] *

      Configuring BGP Route Summarization

      Configure BGP4+ route dampening and apply dampening parameters to the routes that match a route-policy.

      dampening [ half-life-reach reuse suppress ceiling | route-policy route-policy-name ] *

      -

      Configure BGP4+ to import routes that match a route-policy from another routing protocol.

      import-route protocol [ process-id ] [ med med | route-policy route-policy-name ] *

      Configuring BGP to Import Routes

      Import local routes that match a route-policy to the BGP4+ routing table and advertise them to BGP4+ peers.

      network ipv6-address prefix-length [ route-policy route-policy-name ]

      Configuring BGP to Import Routes

      Enable BGP4+ route iteration based on a route-policy.

      nexthop recursive-lookup route-policy route-policy-name

      Configuring the Next_Hop Attribute

      Configure a device to send a default route to a peer or a peer group and use a route-policy to modify the attributes of the default route.

      peer { group-name | ipv6-address } default-route-advertise [ route-policy route-policy-name ]

      Configuring BGP to Advertise Default Routes to Peers

      Configure a device to accept the routes that match a route-policy from a peer or peer group or advertise the routes that match a route-policy to a peer or peer group.

      peer { group-name | ipv6-address } route-policy route-policy-name { import | export }

      Controlling the Advertisement of BGP Routes

      Controlling the Receiving of BGP Routes

      Use a route-policy to set a BGP4+ priority.

      preference route-policy route-policy-name

      Configuring the BGP Priority

      Prevent the BGP4+ routes that match a route-policy from being added to the IPv6 routing table.

      routing-table rib-only [ route-policy route-policy-name ]

      -

  • Apply a route-policy to multicast routes.

    1. Run the system-view command to enter the system view.

    2. Run the ip rpf-route-static [ vpn-instance vpn-instance-name ] source-address { mask | mask-length } [ isis process-id | ospf process-id | rip process-id | bgp | static ] [ route-policy route-policy-name ] { interface-type interface-number | gateway-address } [ preference preference ] [ order order-number ] command to configure multicast static routes and use route-policy route-policy-name to configure matching rules of multicast static routes.

      For details on how to configure multicast static routes, see Configuring a Multicast Static Route.

  • Apply a route-policy to BGP/MPLS IP VPN routes.

    • To apply a route-policy in the BGP view, perform the following operations:

      1. Run the system-view command to enter the system view.
      2. Run the bgp { as-number-plain | as-number-dot } command to enter the BGP view.
      3. Run the ingress-lsp trigger route-policy route-policy-name command to enable the function of establishing ingress LSPs for labeled BGP routes based on a route-policy.

        On a MAN where the hybrid access mode is used, a large number of BGP labeled routes are used to establish end-to-end LSPs. Some intermediate nodes do not need to carry VPN services, but excessive ingress LSPs are created, wasting network resources. In this situation, run thIS command to establish ingress LSPs based on a route-policy to reduce network resource consumption.

    • To apply a route-policy in the VPN instance view, perform the following operations:

      1. Run the system-view command to enter the system view.
      2. Run the ip vpn-instance vpn-instance-name command to enter the VPN instance view.
      3. Perform either of the following operations as required:
        • To associate the current VPN instance address family with one export route-policy, run the export route-policy route-policy-name command. Only one route-policy can be associated, and the last associated route-policy takes effect.

          The export command can control route transmission between different VPN instances on a PE, while the peer route-policy export command can control only the VPNv4 or VPNv6 routes that a PE sends to other PE peers.

        • To associate the current VPN instance address family with one import route-policy, run the import route-policy route-policy-name command. Only one route-policy can be associated, and the last associated route-policy takes effect.

          The import route-policy command can control route receiving between different VPN instances on a PE, while the peer route-policy import command can control only the VPNv4 or VPNv6 routes that a PE sends to other PE peers.

  • Apply a route-policy to an FRR scenario.

    • For route-policy applications in IP FRR on the public network. see Configuring IP FRR on the Public Network.
    • For route-policy applications in IP FRR for VPN Routes. see Configuring IP FRR for VPN Routes.
    • For route-policy applications in IP+VPNv4 hybrid FRR. see Configuring IP+VPNv4 Hybrid FRR.
    • For route-policy applications in VPN FRR. see Configuring VPN FRR.

Translation
Download
Updated: 2019-10-21

Document ID: EDOC1000178171

Views: 337284

Downloads: 1157

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