Configuring VRFs
For complete syntax and usage information for the commands, see the switch command reference for this
release and the Cisco IOS Switching Services Command Reference.
Procedure
PurposeCommand or Action
Enters the global configuration mode.configure terminal
Example:
Device# configure terminal
Step 1
Enables IP routing.ip routing
Example:
Device(config)# ip routing
Step 2
Names the VRF, and enter VRF configuration mode.
ip vrf vrf-name
Example:
Device(config)# ip vrf vpn1
Step 3
Creates a VRF table by specifying a route
distinguisher. Enter either an AS number and an
rd route-distinguisher
Example:
Device(config-vrf)# rd 100:2
Step 4
arbitrary number (xxx:y) or an IP address and
arbitrary number (A.B.C.D:y)
Creates a list of import, export, or import and export
route target communities for the specified VRF.
route-target {export | import | both}
route-target-ext-community
Step 5
Enter either an AS system number and an arbitrary
Example:
Device(config-vrf)# route-target
both 100:2
number (xxx:y) or an IP address and an arbitrary
number (A.B.C.D:y). The
route-target-ext-community should be the same as
the route-distinguisher entered in Step 4.
(Optional) Associates a route map with the VRF.
import map route-map
Example:
Device(config-vrf)# import map
importmap1
Step 6
Specifies the Layer 3 interface to be associated with
the VRF, and enter interface configuration mode.
The interface can be a routed port or SVI.
interface interface-id
Example:
Device(config-vrf)# interface
gigabitethernet 1/0/1
Step 7
Associates the VRF with the Layer 3 interface.
ip vrf forwarding vrf-name
Step 8
Routing Configuration Guide, Cisco IOS XE Everest 16.6.x (Catalyst 9500 Switches)
163
Configuring IP Unicast Routing
Configuring VRFs