ON THIS PAGE
Example: Configuring VNI Route Targets Automatically with Manual Override
This example shows how to automatically set route targets for multiple VNIs, and manually override the route target for a single VNI 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 to automatically
derive route targets for each VNI or you can configure route targets
manually. It’s also possible to automatically derive route targets
for VNIs, then manually override the route target for one or more
VNIs. This example explains how to manually override the automatically
assigned route targets for a specific VNI.
Configuration
To manually override an automatically configured VNI route targets, perform these tasks:
Configuring Automatic VNI Route Targets with Manual Override
Step-by-Step Procedure
To configure automatic VNI route targets with manual override:
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 atarget
and theauto
option. The route target configured undervrf-target
will be used by type 1 EVPN routes and all type 2 and 3 EVPN routes for all VLANs except the ones that do not match the VNI undervni-options
in the next step.[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
The
[evpn]
hierarchy level is where you can override the automatic assignment of VNI route targets. Configure thevni-options
statement for VNI 100 with an export target of 1234:11. This route target will be used by type 2 and 3 EVPN routes for all VLANs that match VNI 100. Next, configure theencapsulation
andextended-vni-list
statements. For the purposes of this example, theextended-vni-list
statement will be configured with only 2 VNIs.[edit protocols evpn] user@switch# vni-options vni 100 vrf-target export target:1234:11 user@switch# set encapsulation vxlan user@switch# set extended-vni-list 100 101
Configure three policies at the
[policy-statement]
hierarchy level. The first policy will be namedcomglobal
, the next policy will be namedcom1234
, and the final policy will be namedimport-policy
. These policies function as an import filter that accepts routes using the auto-derived route target and the manual override route target.[edit policy-options policy-statement comglobal] user@switch# set members target:1111:11
[edit policy-options policy-statement com1234] user@switch# set members target:1234:11
[edit policy-options policy-statement import-policy] user@switch# set term 1 from community comglobal com1234 user@switch# set term 1 then accept user@switch# set term 100 then reject
Results
After following the steps above, 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 vni-options { vni 100 { vrf-target export target:1234:11; } } encapsulation vxlan; extended-vni-list [ 100 101 ];
user@switch> show configuration policy-options community comglobal members target:1111:11;
user@switch> show configuration policy-options community com1234 members target:1234:11;
user@switch> show configuration policy-options policy-statement import-policy term 1{ from community [ com1234 comglobal ]; then accept; } term 100 { then reject; }