Assigning a Layer 3 interface to a VRF

The following example illustrates how a virtual Ethernet (VE) interface is assigned to a VRF, and how IP addresses and the OSPF protocol are configured.

Attention: After you configure a VRF instance on the device, you must assign one or more Layer 3 interfaces (physical or virtual Ethernet) to the VRF. When you do this, all existing IP addresses are deleted; this action also triggers cache deletion, route deletion, and associated cleanup. After you assign an interface to the VRF, you must reconfigure the IP address and interface properties.

  1. Enter global configuration mode.
    device# configure terminal
     
  2. In global configuration mode, enter the interface ve command to create a VE interface.
    device(config)# interface ve 10
     
  3. In VE configuration mode, enable forwarding for the VRF "guest".
    device(config-vif-10)# vrf forwarding guest
    Warning: All IPv4 and IPv6 addresses (including link-local) on this interface have been removed
    have been removed
  4. Configure an IPv4 address and mask on the VE interface.
    device(config-vif-10)# ip address 192.168.1.254/24
  5. Enable OSPF Area 0.
    device(config-vif-10)# ip ospf area 0
  6. Configure the interface as passive.
    device(config-vif-10)# ip ospf passive
    device(config-vif-10)# exit
  7. Exit the configuration.
    device(config-vif-10)# exit