SONiC Operation and Commands - amybuck/SONiC-NAS GitHub Wiki
This information describes the standard Linux Debian distribution operation and commands for the SONiC Host-Adapter package.
Log into Switch
The default admin username is part of the Linux sudo
group for executing privilege commands. The default password is admin but you must change the password the first-time you log into the device. Before continuing, verify you have connected to the serial console on the device.
Mangement Interface
The Management port name is eth0, and the Management interface is configured to automatically obtain its IP address using DHCP by default. You can change the behavior by modify the /etc/network/interfaces
file with the following parameters:
auto eth0
iface eth0
inet static address 10.11.133.40
netmask 255.255.0.0
gateway 10.11.133.254
After modifying the interfaces file, restart the networking service:
$ service networking restart
Manage System Services
Use the service _servicename_ status
command to check the status of the service. The command output indicates if the service is up and running or inactive. You can also use the systemctl
command to check the service status.
$ service snmpd status
snmpd.service - LSB: SNMP agents
Loaded: loaded (/etc/init.d/snmpd)
Active: active (running) since Wed 2016-02-17 02:16:06 UTC; 2h 39min ago
CGroup: /system.slice/snmpd.service
└─930 /usr/sbin/snmpd -Lsd -Lf /dev/null -u snmp -g snmp -I -smux ...
Stop Service
$ service snmpd stop
$ service snmpd status
snmpd.service - LSB: SNMP agents
Loaded: loaded (/etc/init.d/snmpd)
Active: inactive (dead) since Wed 2016-02-17 05:00:27 UTC; 3s ago
Process: 3370 ExecStop=/etc/init.d/snmpd stop (code=exited, status=0/SUCCESS)
Start Service
$ service snmpd start
$ service snmpd status
snmpd.service - LSB: SNMP agents
Loaded: loaded (/etc/init.d/snmpd)
Active: active (running) since Wed 2016-02-17 05:00:39 UTC; 1s ago
Process: 3370 ExecStop=/etc/init.d/snmpd stop (code=exited, status=0/SUCCESS)
Process: 3395 ExecStart=/etc/init.d/snmpd start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/snmpd.service
└─3399 /usr/sbin/snmpd -Lsd -Lf /dev/null -u snmp -g snmp -I -smux...
Restart Service
$ service snmpd restart
$ service snmpd status
snmpd.service - LSB: SNMP agents
Loaded: loaded (/etc/init.d/snmpd)
Active: active (running) since Wed 2016-02-17 05:00:46 UTC; 1s ago
Process: 3407 ExecStop=/etc/init.d/snmpd stop (code=exited, status=0/SUCCESS)
Process: 3412 ExecStart=/etc/init.d/snmpd start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/snmpd.service
└─3416 /usr/sbin/snmpd -Lsd -Lf /dev/null -u snmp -g snmp -I -smux..
SONiC Utility Commands
View interface statistics and transceiver information
$ sonic-ethtool
View detailed statistics of a physical port
$ sonic-show-stats
Fan-out native 40G ports to 4x10G interfaces
$ sonic-config-fanout
Run NPU diagnostic commands for Broadcom NPU platforms (using the Broadcom shell)
$ sonic-switch-shell
Configure set and get values for different switching entities
$ sonic-config-switch
Where To Go Next
Now that you've finished the basics, see CPS API Network Configuration to understand the available network features for your application needs.