< Home

Applying a Route-Policy

Context

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 1.

      Table 1 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 2.

    Table 2 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 3.

    Table 3 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 4.
      Table 4 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 5.
      Table 5 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 6.
      Table 6 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 Default Routes 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 7.

      Table 7 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 8.

      Table 8 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 9.

      Table 9 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.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >