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
The vrf-target
statement can be used to configure
specific route targets for each VNI under vni-options
.
You can configure the vrf-target
statement with the auto
option to automatically derive route targets for each
VNI.
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-distiguisher
statements. Then configure thevrf-import
statement with a policy that will be configured in a later step. Next, configure thevrf-target
statement with a target and theauto
option. The route target configured undervrf-target
will be used by type 1 EVPN routes. Type 2 and type 3 EVPN routes will use the auto-derived per-VNI route target for export and import.[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 theencapsulation
andextended-vni-list
statements. For the purposes of this example, theextended-vni-list
statement 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 two policies at the
[policy-statement]
hierarchy level. The first policy will be namedcomglobal
and the next policy will be namedimport-policy
. These policies function as an import filter that accepts routes with the auto-derived route target.[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; }