(Optional) Using a Routing Policy to Control VPNv4 Routes on ASBRs

ASBRs can use a routing policy to filter undesired VPNv4 routes.

Context

ASBRs can use a routing policy to filter VPNv4 routes based on:

  • VPN targets
  • RDs

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run either of the following commands:

    • Perform either of the following operations to configure an extcommunity filter:

      To configure a VPN-Target extcommunity filter

      • To configure a basic VPN-Target extcommunity filter, run the ip extcommunity-filter { basic-extcomm-filter-num | basic basic-extcomm-filter-name } { deny | permit } { rt { as-number:nn | 4as-number:nn | ipv4-address:nn } } &<1-16> command.

      • To configure an advanced VPN-Target extcommunity filter, run the ip extcommunity-filter { advanced-extcomm-filter-num | advanced advanced-extcomm-filter-name } { deny | permit } regular-expression command.

      To configure an SoO extcommunity filter

      • To configure a basic SoO extcommunity filter, run the ip extcommunity-list soo basic basic-extcomm-filter-name [ index index-number ] { permit | deny } { site-of-origin } &<1-16> command.

      • To configure an advanced SoO extcommunity filter, run the ip extcommunity-list soo advanced advanced-extcomm-filter-name [ index index-number ] { permit | deny } regular-expression command.

    • To configure an RD filter, run the ip rd-filter rd-filter-number { deny | permit } route-distinguisher &<1-10> command.

  3. Run route-policy route-policy-name permit node node

    A routing policy is configured.

  4. Run either of the following commands to configure the apply clause of the routing policy for the current node as needed:

    • To configure a match rule that is based on the VPN-Target extended community attribute, run the if-match extcommunity-filter { { basic-extcomm-filter-num | adv-extcomm-filter-num } &<1-16> | basic-extcomm-filter-name | advanced-extcomm-filter-name } command.

    • To configure a match rule that is based on the SoO extended community attribute, run the if-match extcommunity-list soo extcomm-filter-name command.

    • To configure a match rule that is based on the RD attribute, run the if-match rd-filter rd-filter-number command.

  5. Run quit

    Return to the system view.

  6. Run bgp as-number

    The BGP view is displayed.

  7. Run ipv4-family vpnv4 [ unicast ]

    The BGP-VPNv4 address family view is displayed.

  8. Run peer ipv4-address route-policy route-policy-name { export | import }

    The routing policy is applied to control the import and export of VPNv4 routes.

  9. Run commit

    The configuration is committed.

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