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.
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:~$
sonic-cli
You will enter the SONiC CLI prompt:
sonic#
configure terminal
Prompt changes to:
sonic(config)#interface Management 0
Prompt changes to:
sonic(conf-if-eth0)#
Note:
Management 0corresponds toeth0internally.
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
end
Prompt returns to:
sonic#
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
!
write memory
This ensures the configuration persists after a reboot.
Test connectivity to the gateway:
ping -I eth0 192.168.7.2
Confirm IP address is applied:
show ip interface