Configuration Guide
Basic Configuration
Getting Familiar with Using CISCO-LIKE Command Line
7 min
how to enter the command line view how to enter the command line view operation command description enter the cli view sonic cli by default, upon logging into the device, you will automatically enter the command line view exit the cli view system bash use the 'exit' command to return to the command line configuration interface commond keywords commond keywords keywords description no cancel or disable a specific setting show this display the current configuration of the current view configure terminal enter the system configuration mode delete delete a configuration file reboot reboot the device write save the current configuration shutdown disable or turn off a port exit exit to the previous level or log out do ignore view execution commands end return directly to the system view command line usage assistance command line usage assistance when entering an incomplete keyword, pressing the tab or space key will automatically complete the keyword if you encounter issues while using the command line, you can utilize the help function to get assistance, eliminating the need to memorize extensive and intricate commands while entering a command, pressing the tab key will display a list of matching keywords entering "?" will provide hints for relevant keywords or explanations of parameters sonic# show \<tab> acl arp counters history image interface link aggregation lldp mac address platform running config startup config sub interface traffic sonic# configure terminal sonic(config)# access list l3 test ingress \<tab> \<cr> sonic(config)# access list l3 test \<enter> syntax error the command is not completed sonic(config)# access list l3 test1 ingress sonic(config l3 acl test1)# ? end exit to the exec mode exit exit from current mode no negate a command or set its defaults rule add an access list entry show show running config sonic(config l3 acl test1)# rule ? rule id (0 500) sonic(config l3 acl test1)# rule 1 ? source mac specify source mac address destination mac specify destination mac address ethernet type specify ethernet protocol type outer vlan specify outer vlan id vlan pri specify outer vlan priority configuration file management configuration file management the configuration files for this series of switches are in json (javascript object notation) format json is a lightweight data interchange format, and its file extension is typically json viewing configuration file viewing configuration file by default, the system configuration files are stored in the /etc/sonic directory the default system configuration file is named config db json when performing configuration saving or restoration operations, it's this file that gets modified, determining the initial configuration upon the device's next startup additionally, this directory also contains backups of configuration files, labeled with timestamps, which facilitates configuration recovery for users every time the "write" command is executed, a new config db json file is generated to save the current configuration, and the original file's name is modified to the format config bd +timestamp configuration saving configuration saving after a user logs into the device, configurations made through command line operations or other means are temporary if you require persistent configurations, you should manually save the modified settings this involves updating the current configuration to the default configuration file, config db json if you don't save the configurations, the device's settings will revert to their state before modifications after a reboot operationmaintenance interface command description save configuration write display startup configuration show startup config configuration rollback configuration rollback users can roll back the switch configuration using the configuration file according to the timestamp identifier for example, you need to roll back the configuration to config db json 2026 01 08 02 41 28 admin\@sonic /etc/sonic$ sudo cp config db json 2026 01 08 02 41 28 config db json # overwrite the current configuration with the configuration file that needs to be rolled back admin\@sonic /etc/sonic$ sudo reboot # take effect after restarting the device
