How to Configure Basic VRF Management

How to Configure Basic VRF Management

VRF Management 

Objective 

This document explains how to configure Basic VRF (Virtual Routing and Forwarding) Management on SONiC-OS-4.4.2-Enterprise_Base. Management VRF provides a separate routing table specifically for out-of-band management traffic, isolating it from the in-band data plane network and ensuring dedicated management connectivity. 

Prerequisites 

Hardware: 

  • Switches or routers that support VLANs 
    (e.g., edgecore, ufispace) 

Software: 

  • Network operating systems that support VLAN configuration 
    (e.g., SONiC-OS-4.4.0-Enterprise_Base, SONiC-OS-4.4.2-Enterprise_Base) 

Access: 

  • Administrative or privileged CLI access 

Network: 

  • Ethernet management port (typically mgmt0 or equivalent). 

  • Management IP address, subnet, gateway, DNS servers. 

Topology Diagram 

Picture 

 
 

Example: 

Management VRF routes only through mgmt Ethernet interface, separate from data-plane ports. 

Basic Configuration Steps 

1. Define the Management VRF 

Enable or confirm the presence of the mgmt VRF, which is usually a special. 

Syntax: 

sonic# configure terminal 
sonic(config)# vrf mgmt  

 

Example: 

sonic(config)# vrf mgmt 

2. Assign IP to Management Interface 

Configure the IP address on the dedicated management Ethernet port under the mgmt VRF. 

Syntax: 

sonic# configure terminal 
sonic(config)# interface Management 0 
sonic(config-if-Management0)# ip address <mgmt_ip> 

 

Example: 

sonic(config)# interface Management 0 
sonic(config-if-Management0)# ip address 172.26.1.1/24 

 

3. Set Default Gateway for Management VRF 

Assign the management default route (0.0.0.0/0) through the mgmt VRF. 

Syntax: 

sonic# configure terminal 
sonic(config)# ip route vrf mgmt 0.0.0.0/0 <next_hop> interface <interface_name> 

 

Example: 

sonic# configure terminal 
sonic(config)# ip route vrf mgmt 0.0.0.0/0 172.26.1.100 interface Management 0 

 

Example Configuration (DUT_1 and DUT_2) 

 

DUT_1 

configure terminal 
vrf mgmt 
 
interface Management 0 
ip address 172.26.1.1/24 
exit 

 

ip route vrf mgmt 0.0.0.0/0 172.26.1.100 interface Management 0 
 

 

Verification 

show vrf #shows list of vrf present in that device  

show ip route vrf mgmt       #shows routes present under mgmt vrf  

ping vrf mgmt 8.8.8.8        #Check the internet is accessible. 

 

 

Troubleshooting Tips 

  • Verify that the management port is physically connected and link is up. 

  • Ensure the mgmt VRF has the correct IP and subnet configured. 

  • Use traceroute with the VRF context to diagnose routing problems.