ON THIS PAGE
Example: Configuring VNI Route Targets Automatically
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.
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:
-
At the
[switch-options]hierarchy level, configure thevtep-source-interface, androute-distiguisherstatements. Then configure thevrf-importstatement with a policy that will be configured in a later step. Next, configure thevrf-targetstatement with a target and theautooption. Type 1 EVPN routes will use the route target you configure undervrf-target. Type 2 and Type 3 EVPN routes will use the auto-derived route target for export and import for all VNIs.[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
-
At the
[evpn]hierarchy level, configure theencapsulationandextended-vni-liststatements. For the purposes of this example, theextended-vni-liststatement will be configured withall, to apply automatic route targets to all VNIs.[edit protocols evpn] user@switch# set encapsulation vxlan user@switch# set extended-vni-list all
-
Configure a community at the [edit policy-options] hierarchy level named
comglobal. Configure an import policy namedimport-policyat the[edit policy-options policy-statement]hierarchy 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.[edit policy-options] user@switch# set community comglobal members target:1111:11
[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.
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;
}
user@switch> show configuration protocols evpn encapsulation vxlan; extended-vni-list all;
user@switch> show configuration policy-options community comglobal members target:1111:11;
user@switch> show configuration policy-options policy-statement import-policy
term 1{
from community [ comglobal ];
then accept;
}
term 100 {
then reject;
}