< Home

Applying a Routing Policy

A routing policy takes effect only when it is applied to a routing protocol.

Procedure

  • Apply a routing policy to RIP routes.
    1. Access the system view.

      system-view

    2. Access the RIP process view.

      rip [ process-id ]

    3. To apply a routing policy to specific RIP routes, see Table 1.

    Table 1 Applying a routing policy to RIP routes

    Objectives

    Command

    Reference

    To 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 routing policy are met

    default-route originate [ cost cost | tag tag | route-policy route-policy-name [ avoid-learning ] ] *

    Configuring RIP to Advertise Default Routes

    To configure RIP to import the BGP routes that match a routing policy

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

    Configuring RIP to Import External Routes

    To configure RIP to import the routes from another routing protocol that match a routing policy

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

    Configuring RIP to Import External Routes

    To set a priority for routes that match a routing policy

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

    Configuring RIP Preference

  • Apply a routing policy to RIPng routes.
    1. Access the system view.

      system-view

    2. Access the RIPng process view.

      ripng [ process-id ]

    3. To apply a routing policy to specific RIPng routes, see Table 2.

    Table 2 Applying a routing policy to RIPng routes

    Objectives

    Command

    Reference

    To configure RIPng to import the routes from another routing protocol that match a routing policy

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

    Configuring RIPng to Import External Routes

    To set a priority for RIPng routes that match a routing policy

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

    Configuring the RIPng Preference

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

    • To apply a routing 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 routing policy to IPv4 IS-IS routes in the IS-IS view, see Table 3.
      Table 3 Applying a routing policy to IPv4 IS-IS routes in the IS-IS view

      Objectives

      Command

      Reference

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

      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 Generate Default Routes

      To configure IS-IS to advertise the routes that are imported from another routing protocol and match a routing policy

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

      Configuring IPv4 IS-IS to Import External Routes

      To configure IS-IS to accept the routes that match a routing policy

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

      Filtering IPv4 IS-IS Routes

      To configure IS-IS to import the routes from another routing protocol that match a routing policy

      import-route { direct | static | unr | { ospf | rip | isis } [ process-id ] | 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 { { ospf | rip | isis } [ process-id ] | bgp [ permit-ibgp ] | direct | unr } inherit-cost [ { level-1 | level-2 | level-1-2 } | tag tag | route-policy route-policy-name ] *

      Configuring IPv4 IS-IS to Import External Routes

      To configure Level-1 routes that match a routing policy to leak to a Level-2 area

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

      Configuring IS-IS Route Leaking

      To configure Level-2 routes that match a routing policy to leak to a Level-1 area

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

      Configuring IS-IS Route Leaking

      To configure a priority for the IS-IS routes that match a routing policy

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

      Configuring a Preference Value for IS-IS

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

  • Apply a routing policy to OSPF routes.

    • To apply a routing 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 routing policy to OSPF routes in the OSPF view, see Table 5.
      Table 5 Applying a routing policy to OSPF routes

      Objectives

      Command

      Reference

      To configure OSPF to advertise the default routes in the routing table that are not generated by the local OSPF process to a common area based on the parameters of a routing policy

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

      Configuring OSPF to Import a Default Route

      To configure OSPF to advertise the routes that are imported from another routing protocol and match a routing policy

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

      Configuring OSPF to Import Routes of Other Protocols

      To configure OSPF to accept the routes that match a routing policy

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

      Configuring OSPF to Filter Routes Received by OSPF

      To configure OSPF to import the routes that match a routing 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 Routes of Other Protocols

      To configure a priority for OSPF routes that match a routing policy

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

      Configuring the OSPF Priority

    • To apply a routing 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 view.

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

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

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

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

  • Apply a routing policy to OSPFv3 routes.

    • To apply a routing 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 view.

      3. To apply a routing policy to OSPFv3 routes in the OSPFv3 view, see Table 6.

      Table 6 Applying a routing policy to OSPFv3 routes

      Objectives

      Command

      Reference

      To configure OSPFv3 to advertise the default routes in the routing table that are not generated by the local OSPFv3 process to an OSPFv3 routing area based on the parameters of a routing policy

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

      Configuring OSPFv3 to Import External Routes

      To configure OSPFv3 to import the routes that match a routing 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

      To configure a priority for OSPFv3 routes that match a routing policy

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

      -

    • To apply a routing 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 view.

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

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

        • Run the filter route-policy route-policy-name export command to apply a routing 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 routing policy to incoming Type 3 LSAs in the area.

  • Apply a routing 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 routing policy to specific BGP routes, see Table 7.

      Table 7 Applying a routing policy to BGP routes

      Objectives

      Command

      Reference

      To configure a summarized BGP route and apply a routing 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 Aggregation

      To configure BGP route dampening

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

      Configuring BGP Route Dampening

      To configure BGP to import the routes from another routing protocol that match a routing policy

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

      Configuring BGP to Import Routes

      To import local routes that match a routing policy to the BGP routing table and advertise them to BGP peers

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

      Configure BGP to Advertise Local Routes

      To enable BGP route iteration based on a routing policy

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

      Configuring Next_Hop Attributes for Routes

      To configure a device to send a default route to a peer or a peer group and use a routing 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 a BGP Device to Send a Default Route to Its Peer

      To prevent a device from performing bit-error-triggered protection switching when a routing policy is used as an export policy

      NOTE:

      When bit-error-triggered protection switching is configured, bit errors occur, and Local_Pref or MED is modified using an export routing policy, run the command to apply the Local_Pref or MED in the export routing policy.

      peer { group-name | ipv4-address } route-policy route-policy-name export ignore-bit-error

      -

      To configure a device to accept the routes that match a routing policy from a peer or peer group or advertise the routes that match a routing policy to a peer or peer group

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

      Configuring the Policy for Advertising BGP Routing Information and Configuring the Policy for Receiving BGP Routing Information

      To use a routing policy to set a BGP priority

      preference route-policy route-policy-name

      Configuring the BGP Preference

  • Apply a routing policy to BGP4+ routes.
    1. Access the system view.

      system-view

    2. Access the BGP view.

      bgp { as-number-plain | as-number-dot }

    3. Access the IPv6 unicast address family view.

      ipv6-family [ unicast ]

    4. To apply a routing policy to specific BGP4+ routes, see Table 8.

      Table 8 Applying a routing policy to BGP4+ routes

      Objectives

      Command

      Reference

      To configure a summarized BGP4+ route and apply a routing 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 BGP4+ Route Aggregation

      To configure BGP4+ route dampening and apply dampening parameters to the routes that match a routing policy

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

      Configuring BGP4+ Route Dampening

      To configure BGP4+ to import the routes from another routing protocol that match a routing policy

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

      Configuring BGP4+ to Import Routes

      To import local routes that match a routing policy to the BGP4+ routing table and advertise them to BGP4+ peers

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

      Configure BGP4+ to Advertise Local Routes

      To enable BGP4+ route iteration based on a routing policy

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

      Configuring the Next_Hop Attribute

      To configure a device to send a default route to a peer or a peer group and use a routing policy to modify the attributes of the default route

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

      Configuring Routers to Advertise a Default Route to a Peer

      To configure a device to accept the routes that match a routing policy from a peer or peer group or advertise the routes that match a routing policy to a peer or peer group

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

      Configuring the Policy for Receiving BGP4+ Routing Information and Configuring the Policy for Advertising BGP4+ Routing Information

      To use a routing policy to set a BGP4+ priority

      preference route-policy route-policy-name

      Configuring the BGP4+ Preference

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