Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

header-navigation
keyboard_arrow_up
close
keyboard_arrow_left
EVPN User Guide
Table of Contents Expand all
list Table of Contents
file_download PDF
{ "lLangCode": "en", "lName": "English", "lCountryCode": "us", "transcode": "en_US" }
English
keyboard_arrow_right

Example: Configuring VNI Route Targets Automatically

date_range 20-Dec-24

This example shows how to automatically derive route targets for multiple VNIs in an EVPN-VXLAN topology.

Requirements

This example uses the following hardware and software components:

  • A QFX Series switch.

  • Junos OS version 15.1X53-D30

Overview

You can configure the vrf-target statement with the auto option to automatically derives route targets in a routing instance. Devices auto-derive route targets only for EVPN Type 2 and Type 3 routes. As a result, in some cases you must also manually configure route targets for other EVPN route types such as Type 1 (in L2 routing instances) or Type 5 (in L3 routing instances). See Example: Configuring VNI Route Targets Manually for manual route target configuration examples.

You can also manually set specific route targets for individual virtual network identifiers (VNIs) if you configure the vrf-target statement at the [edit <routing-instances name> protocols evpn vni-options vni vni] hierarchy level. Like auto-derived route targets, VNI level route targets apply only to EVPN Type 2 and Type 3 routes. See Example: Configuring VNI Route Targets Manually and Example: Configuring VNI Route Targets Automatically with Manual Override for VNI-level route target configuration examples.

In this example we show how to configure auto-derived route targets for EVPN Type 2 and Type 3 routes for all VNIs in an EVPN instance.

Note:

We also include configuring a route target manually to support EVPN Type 1 routes in the instance.

Configuration

To configure the vrf-target statement with the auto option, perform these tasks:

Configuring VNI Route Target Automatic Derivation

Step-by-Step Procedure

To configure the automatic derivation of VNI route targets:

  1. At the [switch-options] hierarchy level, configure the vtep-source-interface, and route-distiguisher statements. Then configure the vrf-import statement with a policy that will be configured in a later step. Next, configure the vrf-target statement with a target and the auto option. Type 1 EVPN routes will use the route target you configure under vrf-target. Type 2 and Type 3 EVPN routes will use the auto-derived route target for export and import for all VNIs.

    content_copy zoom_out_map
    [edit switch-options]
    user@switch# set vtep-source-interface lo0.0
    user@switch# set route-distinguisher 192.0.2.11:1
    user@switch# set vrf-import import-policy
    user@switch# set vrf-target target:1111:11
    user@switch# set vrf-target auto
  2. At the [evpn] hierarchy level, configure the encapsulation and extended-vni-list statements. For the purposes of this example, the extended-vni-list statement will be configured with all, to apply automatic route targets to all VNIs.

    content_copy zoom_out_map
    [edit protocols evpn]
    user@switch# set encapsulation vxlan
    user@switch# set extended-vni-list all
    
  3. Configure a community at the [edit policy-options] hierarchy level named comglobal. Configure an import policy named import-policy at the [edit policy-options policy-statement] hierachy level. This community and this policy function as an import filter that accepts routes with the auto-derived route target. You apply the policy in step 1.

    content_copy zoom_out_map
    [edit policy-options]
    user@switch# set community comglobal members target:1111:11
    content_copy zoom_out_map
    [edit policy-options policy-statement import-policy]
    user@switch# set term 1 from community comglobal
    user@switch# set term 1 then accept
    user@switch# set term 100 then reject

Results

Use the show command to verify the results of your configuration.

content_copy zoom_out_map
user@switch> show configuration switch-options
vtep-source-interface lo0.0;
route-distinguisher 192.0.2.11:1;
vrf-import imp;
vrf-target {
    target:1111:11;
    auto;
}
content_copy zoom_out_map
user@switch> show configuration protocols evpn
encapsulation vxlan;
extended-vni-list all;
content_copy zoom_out_map
user@switch> show configuration policy-options community comglobal
members target:1111:11;
content_copy zoom_out_map
user@switch> show configuration policy-options policy-statement import-policy
term 1{
    from community [ comglobal ];
    then accept;
}
term 100 {
    then reject;
}
footer-navigation