Configuring Management Interface 0 (eth0) on SONiC 4.5.0 Switch via SONiC CLI

Configuring Management Interface 0 (eth0) on SONiC 4.5.0 Switch via SONiC CLI


Purpose:
This article provides step-by-step instructions to configure the management interface (Management 0 / eth0) on a SONiC 4.5.0 switch with a static IP and default gateway using the SONiC CLI.

Scope:
Applicable to Edgecore S-series switches running SONiC 4.5.0 starting from factory-default settings.

Steps to Configure Management Interface

1. Access the Switch Console

  • Connect to the console port or use an existing management IP.

  • Log in with default credentials:

sonic login: admin
Password: YourPaSsWoRd
  • You will see the Debian GNU/Linux console prompt:

admin@sonic:~$

2. Launch the SONiC CLI

sonic-cli

You will enter the SONiC CLI prompt:

sonic#

3. Enter Configuration Mode

configure terminal

Prompt changes to:

sonic(config)#

4. Select the Management Interface

interface Management 0

Prompt changes to:

sonic(conf-if-eth0)#

Note: Management 0 corresponds to eth0 internally.

5. Configure Static IP and Default Gateway

ip address 192.168.7.171/24 gwaddr 192.168.7.2
  • 192.168.7.171/24 → desired management IP

  • 192.168.7.2 → default gateway for the management network

6. Exit Configuration Mode

end

Prompt returns to:

sonic#

7. Verify Configuration

show running-configuration interface Management 0

Example expected output:

!
interface Management 0
 description Management0
 mtu 1500
 autoneg on
 speed 1000
 ip address 192.168.7.171/24 gwaddr 192.168.7.2
!

8. Save Configuration

write memory

This ensures the configuration persists after a reboot.

9. Optional Verification

  • Test connectivity to the gateway:

ping -I eth0 192.168.7.2
  • Confirm IP address is applied:

show ip interface

    • Related Articles

    • How to configure EdgeCore Switch and Access point (Basic Configurations)

      Edge Core 10-port PoE Access Switch (ECS4125-10P) The Edge core ECS4125-10P switch is a 2.5 Gigabit Ethernet access switch with two 10G uplink ports. The switch is an ideal 2.5 Gigabit PoE access switch for SMB, enterprise, and campus networks. The ...
    • Configuring BMC in ASUS Server

      To configure the Baseboard Management Controller (BMC) IP address on an ASUS server, initially access the server's BIOS/UEFI settings and then configure the BMC network settings. Here's a step-by-step instructions Server BMC Configuration preparation ...
    • Fixing "Cable Data Invalid EEPROM" Error on NVIDIA QM9700 InfiniBand Switch

      Issue On NVIDIA QM9700 InfiniBand switches, some ports may appear down and show an error such as: This issue is often caused by outdated CPLD firmware and can be resolved by updating the CPLD version on the switch. Root Cause The EEPROM error is ...
    • How to Enable Split Port on NVIDIA QM9700 Switch

      Overview This guide explains how to enable split ports on the NVIDIA QM9700 InfiniBand switch, using both the Web GUI and CLI methods. Split ports allow a single high-speed port to be divided into multiple lower-speed logical ports, providing greater ...
    • How to configure NTP Server on Mellanox Infiniband QM9700 Switch

      Overview Configuring NTP (Network Time Protocol) ensures that the QM9700 switch maintains accurate system time. This is critical for logging, monitoring, and coordination with other devices in the fabric. Prerequisites Access to the QM9700 switch Web ...