Creating a VLAN on SONiC Switch (SONiC-CLI)

Creating a VLAN on SONiC Switch (SONiC-CLI)

Title: How to Create a VLAN on a SONiC Switch

Purpose: This guide explains how to create a VLAN on a SONiC switch using SONiC-CLI.

Applicable Products: EdgecoreSONiC Enterprise v 4.4.3

Steps

  1. Access SONiC CLI:

sonic-cli
  1. Enter configuration mode:

configure terminal
  1. Create a VLAN:

interface Vlan <VLAN_ID> exit

Example:

interface Vlan100 exit
  1. Assign an IP address and MTU (optional, for Layer 3):

interface Vlan100 ip address 10.1.1.1/24 mtu 9100 no shutdown exit
  1. Verify VLAN creation:

show vlan show ip interface

6. Assign Port
# VLAN100 access ports interface Ethernet0 switchport access Vlan100 description "Node1 HSN-A" exit

Notes:

  • VLAN IDs range from 1 to 4094.

  • MTU should match the connected interfaces if using high-speed links (e.g., 9100 for RDMA/ROCE).

  • Use no interface Vlan <VLAN_ID> to remove a VLAN.