Configuring a VRF Instance

A device can be configured with more than one VRF instance. You should define each VRF instance before assigning the VRF to a Layer 3 interface. The range of the instance name is from 1 through 255 alphanumeric characters. Each VRF instance is identified by a unique Route Distinguisher (RD), which is prepended to the address being advertised. Because the RD provides overlapping client address space with a unique identifier, the same IP address can be used for different VRFs without conflict. The RD can be an AS number, followed by a colon (:) and a unique arbitrary number. Alternatively, it can be a local IP address followed by a colon (:) and a unique arbitrary number, as in "1.1.1.1:100." An optional router ID can also be assigned.

Use the address-family command in VRF configuration mode to specify an IPv4 or IPv6 address family. For a specific address family you can also configure static route, static ARP, IGMP, and multicast for IPv4, and static route, IPv6 neighbor, and multicast for IPv6.

Attention: Using the overwrite option while downloading a configuration from a TFTP server to the running-config will lead to the loss of all VRF configurations when a VRF is configured on a routing interface.
  1. Create a VRF instance.
    device(config)# vrf corporate
  2. Assign a Route Distinguisher (RD).
    device(config-vrf-corporate)# rd 11:11
  3. (Optional) Assign a router ID.
    device(config-vrf-corporate)# ip router-id 1.1.1.1
  4. Use the address-family unicast command to configure an address family on the VRF and exit. This example uses IPv4.
    device(config-vrf-corporate)# address-family ipv4 unicast
    device(config-vrf-corporate-ipv4)# exit 
  5. Verify the configuration.
    device(config-vrf-corporate)# show vrf
    
    Total number of VRFs configured: 2
    Status Codes - A:active, D:pending deletion, I:inactive
    Name                 Default RD          vrf|v4|v6 Routes Interfaces
    corporate            11:11               A  | A| I      0
    guest                10:10               A  | A| I      0
    Total number of IPv4 unicast route for all non-default VRF is 0
    Total number of IPv6 unicast route for all non-default VRF is 0