Configuring an EVPN Route-Policy

An EVPN route-policy can be configured to control EVPN route receiving and advertisement.

Context

An EVPN route-policy is used to match specified EVPN route information or some attributes in EVPN route information and to change these attributes as required. In addition, an EVPN route-policy can be deployed to control the routing table size, thereby conserving system resources.

A route-policy can consist of multiple nodes, and each node can comprise the following clauses:
  • if-match clause

    Defines the matching rules that EVPN routes meet. The matching objects are some attributes of the EVPN routes.

  • apply clause

    Specifies actions. Specifically, configuration commands are run after a route satisfies the matching rules specified by the if-match clauses. The apply clauses can change some attributes of EVPN routes.

After a route-policy is created, apply the route-policy to EVPN or L3VPN to make it take effect.

Procedure

  • Create a route-policy.
    1. Run system-view

      The system view is displayed.

    2. Run route-policy route-policy-name { permit | deny } node node

      A route-policy node is created, and the route-policy view is displayed.

    3. Run commit

      The configuration is committed.

  • Configure filter criteria (if-match clause).

    Filter Criteria

    Configuration Procedure

    Filtering by VNI

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

    2. Run the filter-list vni vni-list-name command to create a VNI list and enter its view.

    3. Run the vni vni-id command to configure a VNI ID.

    4. Run the quit command to return to the system view.

    5. Run the route-policy route-policy-name { permit | deny } node node to enter the route-policy view.

    6. Configure matching rules based on VNI lists:
      • Run the if-match l2vni [ l2vni-name ] command to configure a matching rule based on a Layer 2 VNI list.

      • Run the if-match l3vni [ l3vni-name ] command to configure a matching rule based on a Layer 3 VNI list.

    7. Run the commit command to commit the configuration.

    Filtering by MPLS label

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

    2. Run the route-policy route-policy-name { permit | deny } node node to enter the route-policy view.

    3. Run the if-match { mpls-label | mpls-label2 } * command to configure a matching rule based on an MPLS label.

    4. Run the commit command to commit the configuration.

    Filtering by route type

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

    2. Run the route-policy route-policy-name { permit | deny } node node to enter the route-policy view.

    3. Run the if-match route-type evpn { ad | es | inclusive | join | leave | mac | prefix | smet } * command to configure a matching rule based on a route type.

    4. Run the commit command to commit the configuration.

    Filtering by Ethernet tag

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

    2. Run the filter-list eth-tag eth-tag-list command to create an Ethernet tag list.

    3. Run the eth-tag ethtag-value command to configure an Ethernet tag of the Ethernet tag list.

    4. Run the quit command to return to the system view.

    5. Run the route-policy route-policy-name { permit | deny } node node to enter the route-policy view.

    6. Run the if-match eth-tag-list eth-tag-list-name command to configure a matching rule based on the Ethernet tag.

    7. Run the commit command to commit the configuration.

    Filtering by MAC address

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

    2. Run the filter-list mac mac-list-name command to create a MAC address list.

    3. Run the mac mac-address command to configure MAC addresses in the MAC address list.

    4. Run the quit command to return to the system view.

    5. Run the route-policy route-policy-name { permit | deny } node node to enter the route-policy view.

    6. Run the if-match mac-list mac-list-name command to configure a matching rule based on the MAC address list.

    7. Run the commit command to commit the configuration.

    Filtering by encapsulation extended community attribute

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

    2. Configure a filter for encapsulation extended community attributes.

      • Run the ip extcommunity-list encapsulation basic encapsulation-name [ index index-value ] { permit | deny } { encap-value } & <1-16> command to create a filter for basic encapsulation extended community attributes.

      • Run the ip extcommunity-list encapsulation advanced encapsulation-name [ index index-value ] { permit | deny } encap-value regular command to create a filter for advanced encapsulation extended community attributes.

      NOTE:

      In an EVPN VXLAN scenario, EVPN routes carry the VXLAN-encapsulated extended community attributes. You can set encap-value to 0:8 to filter the EVPN routes in this scenario. In an EVPN MPLS scenario, a device may receive EVPN routes that carry MPLS-encapsulated extended community attributes. To filter these EVPN routes, set encap-value to 0:10.

    3. Run the route-policy route-policy-name { permit | deny } node node to enter the route-policy view.

    4. Run the if-match extcommunity-list encapsulation encapsulation-name command to configure a matching rule based on the extended community attribute filter.

    5. Run the commit command to commit the configuration.

  • Configure an apply clause.

    (Optional) Configuring an apply Clause helps you add or modify the attributes of EVPN routes.

  • Apply a route-policy.

    Usage Scenario

    Configuration Procedure

    Control route receiving and advertisement between BGP EVPN peers.

    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 l2vpn-family evpn command to enter the BGP-EVPN address family view.

    4. Run the peer { group-name | ipv4-address } route-policy route-policy-name { import | export } command to configure a route-policy for the routes received from the BGP EVPN peer (group) or advertised to the BGP EVPN peer (group).

    5. Run the commit command to commit the configuration.

    Control the routes sent by an EVPN instance through EVPN or the routes received by an EVPN instance through BGP EVPN.

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

    2. Enter the EVPN instance view.

      • Run the evpn vpn-instance vpn-instance-name vpws command to create a VPWS EVPN instance and enter the VPWS EVPN instance view.

      • Run the evpn vpn-instance vpn-instance-name bd-mode command to create a BD EVPN instance and enter the BD EVPN instance view.

    3. Run the route-distinguisher route-distinguisher command to set an RD for the EVPN instance
    4. Run the import route-policy policy-name command to associate the EVPN instance with an import route-policy and apply the route-policy to the routes imported to the EVPN instance.

    5. Run the export route-policy policy-name command to associate the EVPN instance with an export route-policy and apply the route-policy to the routes exported from the EVPN instance.

    6. Run the commit command to commit the configuration.

    Control the routes sent by an L3VPN instance through EVPN or the routes received by an L3VPN instance through BGP EVPN.

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

    2. Run the ip vpn-instance vpn-instance-name command to create a VPN instance and enter the view of this VPN instance.

    3. Run the ipv4-family or ipv6-family command to enter the IPv4 or IPv6 address family view of the VPN instance.

    4. Run the route-distinguisher route-distinguisher command to set an RD for the VPN instance.
    5. Run the import route-policy policy-name evpn command to associate the IPv6 address family of the VPN instance with an import route-policy to filter the IPv6 address family routes imported from the VPN instance through EVPN.

    6. Run the export route-policy policy-name evpn command to associate the IPv6 address family of the VPN instance with an export route-policy to filter the IPv6 address family routes that are exported from the VPN instance and advertised to EVPN.

    7. Run the commit command to commit the configuration.

Result

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