VRF
Table 1 VRF View
| Command | Purpose |
|---|---|
| show vrf brief | Display VRF configuration. |
| show vrf interface | Display the binding relationship between VRFs and interfaces. |
| show interface mgmt vrf | Display VRF configuration of management port. |
show vrf brief
Section titled “show vrf brief”[Command] show vrf brief
[Purpose] Display VRF configuration.
[View] Privileged User View
[Use Cases]
sonic# show vrf brief+------------+-------+-----------+| vrf name | vni | src_mac |+============+=======+===========+| 100 | | |+------------+-------+-----------+| 101 | | |+------------+-------+-----------+| 200 | 2000 | |+------------+-------+-----------+show vrf interface
Section titled “show vrf interface”[Command] show vrf interface
[Purpose] Display the binding relationship between VRFs and interfaces.
[View] Privileged User View
[Use Cases]
sonic# show vrf interface+------------+--------------+| vrf name | interfaces |+============+==============+| 200 | vlan 227 || | vlan 237 |+------------+--------------+| 101 | loopback 1 |+------------+--------------+show interface mgmt vrf
Section titled “show interface mgmt vrf”[Command] show interface mgmt vrf
[Purpose] Display VRF configuration of management port.
[View] Privileged User View
[Use Cases]
sonic# show interface mgmt vrfManagementVRF : DisabledVRF Config
Section titled “VRF Config”Table 2 VRF Config
| Command | Purpose |
|---|---|
| vrf mgmt | Set the VRF of mgmt. |
| vrf vrf_name (Global Configuration View) | Create a VRF. |
| vrf vrf_name (Interface View) | Bind the interface to the VRF. |
| mac HH:HH:HH:HH:HH:HH | Configure the MAC address of VRF. |
| ip route A.B.C.D/M A.B.C.D | Add routes for VRFs. |
vrf mgmt
Section titled “vrf mgmt”[Command] vrf mgmt
[Purpose] Set the VRF of mgmt.
[View] Management Port Configuration View
[Notes] Run command no vrf mgmt to delete Management Interface VRF configuration.
[Use Cases]
sonic# configure terminalsonic(config)# interface mgmt 0sonic(config-mgmt-0)# vrf mgmt[Command] vrf vrf_name
[Purpose] Create a VRF.
[Parameters]
| Parameter | Description |
|---|---|
| vrf_name | Specify the VRF name, the default VRF is default. |
[View] Global Configuration View
[Notes] Run command no vrf vrf_name to delete VRF
[Use Cases]
sonic# configure terminalsonic(config)# vrf 123[Command] vrf vrf_name
[Purpose] Bind the interface to the VRF.
[Parameters]
| Parameter | Description |
|---|---|
| vrf_name | Specify the VRF name, the default VRF is default. |
[View] Physical Interface/VLANIF/LAGIF/Loopback Interface Configuration View
[Notes] Loopback0 is not allowed to bind VRFs. Run command no vrf Unbind the interface from the VRF.
[Use Cases]
sonic# configure terminalsonic(config)# interface loopback 1sonic(config-loif-1)# vrf 123[Command] mac HH:HH:HH:HH:HH:HH
[Purpose] Configure the MAC address of VRF.
[Parameters]
| Parameter | Description |
|---|---|
| HH:HH:HH:HH:HH:HH | MAC address. |
[View] VRF Configuration View
[Notes] Run command no mac to delete VRF MAC address configuration.
[Use Cases]
sonic# configure terminalsonic(config)# vrf 123sonic(config-vrf)# mac 00:a0:23:12:23:53ip route
Section titled “ip route”[Command] ip route A.B.C.D/M {A.B.C.D|interface-type interface-name}[distance][description description] [track track-id] [bfd] [nexthop-vrf vrf]
[Purpose] Configure static routes for VRF.
[Parameters]
| Parameter | Description |
|---|---|
| A.B.C.D/M | Specify the destination network segment for routing. |
| A.B.C.D | Specify the IP address of next hop of the route. |
| interface-type | The next-hop interface type. Optional parameters include ethernet, vlan, and link-aggregation. |
| interface-name | Next-hop interface name. |
| distance | Static route distance value,range from 1-255. Default value: 1. |
| description | Specify the description for the route. In string form. |
| track_id | Track ID, range from [1,4294967295]. |
| bfd | Configure static route and BFD linkage. |
| vrf | Name of the VRF where the next-hop interface resides. |
[View] VRF Configuration View
[Notes] Run command no ip route A.B.C.D/M {A.B.C.D|interface-type interface-name}[distance][description description] [track track-id] [bfd] [nexthop-vrf vrf] to delete static routes configuration.
[Use Cases]
sonic# configure terminalsonic(config)# vrf 123sonic(config-vrf)# ip route 10.0.0.0/24 20.0.0.2