Test SONiC Linux in Virtual Datacenter

SONiC Cheat Sheet

Discover essential SONiC commands to enhance your networking skills. Perfect for both beginners and pros, start exploring now!

SONiC Cheat Sheet Commands

Network Engineers and System Administrators frequently rely on these essential operating system commands in their daily routines and critical operational tasks.

To assist you, we have created this SONiC Cheat Sheet, which you can use during your network or system management activities. You no longer need to search the internet for SONiC commands, as you will find everything you need in this comprehensive cheat sheet.  This cheat sheet will help you perform configuration tasks efficiently, much like other resources such as Linux or ONiE Cheat Sheets.

Configuration commands

A tool that allows users to interact with a SONiC switch through the command line
Enters configuration mode, allowing you to make changes to the device’s configuration
Enters interface configuration mode for the specified interface, where you can configure interface-specific settings such as IP addresses and VLANs
Saves the current configuration to non-volatile memory, ensuring that it is saved even after a reboot or power loss
Reloads the system, allowing you to restart the device and apply any changes to the configuration

Tech Support Commands

Generates a detailed report of the system’s current configuration and status. It can be useful for providing system information to support personnel
Creates a core dump of the current state of the system. This can be useful for analyzing system crashes and diagnosing issues
Displays detailed information about the hardware platform, including the CPU, memory, and other components
Shows the system log, which contains messages and events generated by the system
Runs the “show log” command and redirects its output to the specified file, which is “/var/log/sonic/sonic.log” in this case
Display the contents of the log file on the terminal

Show Commands

Shows information about the SONiC software version running on the device, including the version number, build date, and other details
Displays the current configuration of the device, including any changes that have been made since the last reboot
Displays the amount of time since the device was last rebooted
Displays information about the network interfaces on the device, including their status, MAC addresses, IP addresses, and other details
Displays detailed information about a specific network interface, including its status, MAC address, IP address, and configuration
Shows the status of all interfaces on the device, including whether they are up or down, connected or disconnected, and the speed and duplex settings
Shows the status of all Border Gateway Protocol (BGP) sessions, including the number of established and active sessions, as well as any errors/warnings
Displays the current routing table, including all routes and their associated next-hop addresses
Shows the current VLAN configuration, including all configured VLANs and their associated interfaces
Sends a ping packet to a specified destination, allowing you to test network connectivity
Traces the route that packets take to reach a specified destination, showing each hop along the way
Displays information about the neighbors discovered through the Link Layer Discovery Protocol (LLDP), including their device ID, port ID, and capabilities

What is SONiC?

SONiC (Software for Open Networking in the Cloud) is an open source network operating system that provides a fully-featured network stack that can run on various commodity hardware. SONiC is designed to be flexible and modular, allowing it to support a wide range of networking devices and configurations. Here are some common SONiC commands used in the management of network operating systems:

How to Get Broadcom SONiC Access?

To access the Broadcom SONiC CLI, you first need to log into a device running SONiC using a secure shell (SSH) client such as PuTTY or OpenSSH.
Here are the steps to access the Broadcom SONiC CLI:

1. Connect to your SONiC device’s use IP address, hostname or serial com cable
2. Enter your username and password to log in. Use the default username and password for SONiC
3. Once you have logged in, you can access the Broadcom SONiC CLI by typing “sonic-cli” on the command line.

You should now be in the Broadcom SONiC CLI and can start using the available commands

SONiC Community

Join our SONiC Technical Community Network on LinkedIn! Connect with industry experts, share knowledge, and collaborate on innovative open-source networking solutions. Stay updated with the latest developments, participate in discussions, and enhance your professional growth. Be a part of our vibrant community today!

Share the Knowledge: Spread the Word About Our SONiC Cheat Sheet!

If you find this page helpful for your networking knowledge and skills, please consider sharing it with your friends, colleagues, and social media followers. Your support helps us create more valuable resources and enhance our courses.

You can share this page on your social media accounts like Facebook, LinkedIn, Twitter, and any related networking and programming forums or blogs. By sharing, you assist other networking enthusiasts in their learning journey, making their work easier and more efficient. So, if you’d like to help others, kindly share this page.

For more in-depth networking knowledge, visit our route2open courses.