Virtual Routing and Forwarding

Virtual Routing and Forwarding (VRF) is a networking technology that

  • allows multiple instances of a routing table to coexist within the same router at the same time, and
  • enables network paths to be segmented without requiring multiple devices.

Configure a new VRF with this command.

admin@sonic:~$ sudo config vrf add -h
Usage: config vrf add [OPTIONS] <vrf_name>

  Add vrf

Options:
  -h, -?, --help  Show this message and exit.

For example, run this command, to create a VRF called Vrf-blue.

sudo config vrf add Vrf-blue

Note: All VRF names must begin with "Vrf-"

Run the config interface vrf bind command, to add an interface to a particular VRF.

admin@sonic:~$ sudo config interface vrf bind -h
Usage: config interface vrf bind [OPTIONS] <interface_name> <vrf_name>

  Bind the interface to VRF

Options:
  -h, -?, --help  Show this message and exit.

For example, run this command to add the Ethernet0 interface to Vrf-blue:

sudo config interface vrf bind Ethernet0 Vrf-blue

NOTE: Adding an interface in a VRF will remove any existing Layer 3 configuration

Run the config interface vrf unbind command, to remove an interface from its VRF.

admin@sonic:~$ sudo config interface vrf unbind -h
Usage: config interface vrf unbind [OPTIONS] <interface_name>

  Unbind the interface to VRF

Options:
  -h, -?, --help  Show this message and exit.

For example, run this command to remove Ethernet0 from its vrf:

sudo config interface vrf unbind Ethernet0