Command Line Reference
System Configuration
System Status
28 min
basic information view basic information view table 1 basic information view command purpose show version display version info show platform {fan|psu status|ssd health|summary|sys eeprom|temperature} display system platform information show image display the installed image of the system show history \[ all ] display history commands show system processes {cpu|memory| summary} display information about system processes show system {users|reboot cause|uptime|memory} display system related information show patches \[ detail ] display the patches already installed show version show version \[command] show version \[purpose] display version info \[view] privileged user view \[notes] this command displays the version information including software, description, kernel, create, and image \[use cases] sonic# show version asterfusion asternos software, version 3 1, r0402p01 sonic software version sonic 202111 r0402p01 distribution debian 11 7 kernel 5 10 0 8 2 amd64 build commit 77b733bbf build date tue jul 25 07 54 52 utc 2023 built by jenkins\@sonic super server platform x86 64 asterfusion cx532p n r0 hwsku cx532p n asic innovium asic count 1 serial number f023529a054 model number le5032c hardware revision 1 uptime 10 00 19 up 8 20, 9 users, load average 0 79, 1 15, 1 14 docker images repository tag image id size docker dhcp relay latest b579bf4af4f4 452mb docker teamd 202111 r0402p01 740816f290c6 463mb docker teamd latest 740816f290c6 463mb docker sonic mgmt framework 202111 r0402p01 fab89648d04e 675mb docker sonic mgmt framework latest fab89648d04e 675mb docker slad 202111 r0402p01 fe39ccd088a5 472mb docker slad latest fe39ccd088a5 472mb docker sflow 202111 r0402p01 e092a98e73b8 464mb docker sflow latest e092a98e73b8 464mb docker orchagent 202111 r0402p01 a494ff09a565 484mb docker orchagent latest a494ff09a565 484mb docker neighbor proxy 202111 r0402p01 22c393e97052 463mb docker neighbor proxy latest 22c393e97052 463mb docker nat 202111 r0402p01 14d147def064 466mb docker nat latest 14d147def064 466mb docker mstpd 202111 r0402p01 366d8236220e 485mb docker mstpd latest 366d8236220e 485mb docker macsec 202111 r0402p01 24c53be62fa6 468mb docker macsec latest 24c53be62fa6 468mb docker lldp 202111 r0402p01 d2d41b9d8918 505mb docker lldp latest d2d41b9d8918 505mb docker iccpd 202111 r0402p01 a6e24b2dc581 466mb docker iccpd latest a6e24b2dc581 466mb docker fpm frr 202111 r0402p01 954d87aafa63 492mb docker fpm frr latest 954d87aafa63 492mb docker cluster 202111 r0402p01 96e50ff3edc4 892mb docker cluster latest 96e50ff3edc4 892mb docker syncd invm 202111 r0402p01 c940e72b0685 826mb docker syncd invm latest c940e72b0685 826mb docker web server 202111 r0402p01 e53911947b43 477mb docker web server latest e53911947b43 477mb docker sonic telemetry 202111 r0402p01 f4ab4ab9acef 516mb docker sonic telemetry latest f4ab4ab9acef 516mb docker snmp 202111 r0402p01 217730a11313 483mb docker snmp latest 217730a11313 483mb docker router advertiser 202111 r0402p01 585724965c6d 438mb docker router advertiser latest 585724965c6d 438mb docker platform monitor 202111 r0402p01 d38c88b80d5b 561mb docker platform monitor latest d38c88b80d5b 561mb docker mux 202111 r0402p01 faacdde8a401 486mb docker mux latest faacdde8a401 486mb docker database 202111 r0402p01 dc3502d3da31 438mb docker database latest dc3502d3da31 438mb show platform {fan|psu status|ssd health|summary|sys eeprom|temperature} show platform {fan|psu status|ssd health|summary|sys eeprom|temperature} \[command] show platform { fan | psu status | ssd health | summary | sys eeprom | temperature } \[purpose] display system platform information \[view] privileged user view \[notes] this command displays information including psu status, hardware platform summary, system eeprom, fan, temperature, and system ssd device health \[use cases] display hardware platform summary information, including device model, serial number, and other related details sonic# show platform summary platform x86 64 asterfusion cx532p n r0 hwsku cx532p n asic marvell asic count 1 serial number f023529a054 model number cx532p n hardware revision 1 display information such as the number, status, and speed of fans sonic# show platform fan fan speed direction presence status timestamp \ fan1 9120rpm exhaust present ok 2025 01 24 06 52 16 fan2 9120rpm exhaust present ok 2025 01 24 06 52 17 fan3 9120rpm exhaust present ok 2025 01 24 06 52 17 fan4 9120rpm exhaust present ok 2025 01 24 06 52 18 display psu power status and power information sonic# show platform psu status psu voltagein(v) currentin(a) powerin(w) voltageout(v) currentout(a) powerout(w) direction status warning direction warning \ psu 1 234 50 3 40 819 00 12 30 63 10 777 00 exhaust ok false false psu 2 0 00 0 00 0 00 0 00 0 00 0 00 exhaust not ok false false display device temperature information sonic# show platform temperature sensor temperature high th low th crit high th crit low th warning timestamp \ core 0 52 90 00 n/a 100 00 n/a false 2025 01 24 06 54 56 core 1 53 90 00 n/a 100 00 n/a false 2025 01 24 06 54 56 core 2 52 90 00 n/a 100 00 n/a false 2025 01 24 06 54 56 core 3 54 90 00 n/a 100 00 n/a false 2025 01 24 06 54 56 cpu 0 54 n/a n/a n/a n/a false 2025 01 24 06 54 56 left fan board 36 n/a n/a n/a n/a false 2025 01 24 06 54 56 left main board 34 n/a n/a n/a n/a false 2025 01 24 06 54 56 main temp 50 n/a n/a n/a n/a false 2025 01 24 06 54 56 physical id 0 54 90 00 n/a 100 00 n/a false 2025 01 24 06 54 56 right fan board 37 n/a n/a n/a n/a false 2025 01 24 06 54 56 right main board 34 n/a n/a n/a n/a false 2025 01 24 06 54 56 display system eeprom information sonic# show platform sys eeprom tlvinfo header id string tlvinfo version 1 total length 247 tlv name code len value \ product name 0x21 12 cx864e n ac part number 0x22 19 onbp2u n 2x64e a ac serial number 0x23 11 f02524bb889 base mac address 0x24 6 60\ eb 5a 00 11 22 manufacture date 0x25 19 10/31/2024 23 59 59 device version 0x26 1 1 label revision 0x27 1 0 platform name 0x28 30 x86 64 asterfusion cx864e n r0 onie version 0x29 14 2019 05 v1 0 6 mac addresses 0x2a 2 2 manufacturer 0x2b 11 asterfusion manufacture country 0x2c 2 cn vendor name 0x2d 11 asterfusion diag version 0x2e 3 1 0 service tag 0x2f 1 x crc 32 0xfe 4 0x92dd741d display health information of ssd devices in the system, including hard drive model information sonic# show platform ssd health device model saturn nct 624xn 256gb health n/a temperature old age show image show image \[command] show image \[purpose] display the installed image of the system \[view] privileged user view \[use cases] sonic# show image current sonic os 202111 r0402p01 next sonic os 202111 r0402p01 available sonic os 202111 r0402p01 sonic os 202111 r0402p01t02 show history \[all] show history \[all] \[command] show history \[all] \[purpose] display history commands \[view] privileged user view \[notes] when the all parameter is not included, only the current session history commands are viewed when the all parameter is included, all history commands are viewed \[use cases] sonic# show history all number date time user privilege tty result command 1 2024 10 18 09 58 51 195 root sys admin /dev/pts/1 success startup 2 2024 10 18 09 58 52 083 root sys admin /dev/pts/1 success show running config 3 2024 10 18 09 59 09 158 root sys admin /dev/pts/1 success startup 4 2024 10 18 09 59 09 945 root sys admin /dev/pts/1 success show running config 5 2024 10 18 09 59 23 923 admin sys admin /dev/pts/2 success startup sonic# show history 1 show version 2 show mclag state 3 show dhcp pool info 4 show ip route show system processes {cpu|memory|summary} show system processes {cpu|memory|summary} \[command] show system processes {cpu|memory|summary} \[purpose] display information about system processes \[view] privileged user view \[use cases] sonic# show system processes cpu top 17 24 07 up 6 10, 4 users, load average 2 08, 1 62, 1 15 tasks 301 total, 1 running, 299 sleeping, 0 stopped, 1 zombie %cpu(s) 11 8 us, 3 2 sy, 0 0 ni, 84 6 id, 0 0 wa, 0 0 hi, 0 3 si, 0 0 st kib mem 16416408 total, 12812084 free, 2342092 used, 1262232 buff/cache kib swap 0 total, 0 free, 0 used 13738596 avail mem pid user pr ni virt res shr s %cpu %mem time+ command 3519 root 20 0 74032 18700 10384 s 6 2 0 1 0 16 59 syseepromd 25105 root 20 0 43564 3700 3020 r 6 2 0 0 0 00 02 top 1 root 20 0 57640 7576 5432 s 0 0 0 0 0 03 07 systemd 2 root 20 0 0 0 0 s 0 0 0 0 0 00 00 kthreadd 3 root 20 0 0 0 0 s 0 0 0 0 0 01 39 ksoftirqd/0 5 root 0 20 0 0 0 s 0 0 0 0 0 00 00 kworker/0 0h 7 root 20 0 0 0 0 s 0 0 0 0 0 22 04 rcu sched 8 root 20 0 0 0 0 s 0 0 0 0 0 00 00 rcu bh 9 root rt 0 0 0 0 s 0 0 0 0 0 00 65 migration/0 10 root 0 20 0 0 0 s 0 0 0 0 0 00 00 lru add drain 11 root rt 0 0 0 0 s 0 0 0 0 0 00 04 watchdog/0 12 root 20 0 0 0 0 s 0 0 0 0 0 00 00 cpuhp/0 13 root 20 0 0 0 0 s 0 0 0 0 0 00 00 cpuhp/1 14 root rt 0 0 0 0 s 0 0 0 0 0 00 04 watchdog/1 15 root rt 0 0 0 0 s 0 0 0 0 0 00 72 migration/1 16 root 20 0 0 0 0 s 0 0 0 0 0 00 88 ksoftirqd/1 18 root 0 20 0 0 0 s 0 0 0 0 0 00 00 kworker/1 0h 19 root 20 0 0 0 0 s 0 0 0 0 0 00 00 cpuhp/2 20 root rt 0 0 0 0 s 0 0 0 0 0 00 05 watchdog/2 21 root rt 0 0 0 0 s 0 0 0 0 0 00 44 migration/2 22 root 20 0 0 0 0 s 0 0 0 0 0 00 86 ksoftirqd/2 24 root 0 20 0 0 0 s 0 0 0 0 0 00 00 kworker/2 0h 25 root 20 0 0 0 0 s 0 0 0 0 0 00 00 cpuhp/3 26 root rt 0 0 0 0 s 0 0 0 0 0 00 04 watchdog/3 27 root rt 0 0 0 0 s 0 0 0 0 0 00 41 migration/3 28 root 20 0 0 0 0 s 0 0 0 0 0 00 66 ksoftirqd/3 30 root 0 20 0 0 0 s 0 0 0 0 0 00 00 kworker/3 0h 31 root 20 0 0 0 0 s 0 0 0 0 0 00 00 kdevtmpfs 32 root 0 20 0 0 0 s 0 0 0 0 0 00 00 netns 33 root 20 0 0 0 0 s 0 0 0 0 0 00 02 khungtaskd 34 root 20 0 0 0 0 s 0 0 0 0 0 00 00 oom reaper 35 root 0 20 0 0 0 s 0 0 0 0 0 00 00 writeback 36 root 20 0 0 0 0 s 0 0 0 0 0 00 00 kcompactd0 38 root 25 5 0 0 0 s 0 0 0 0 0 00 00 ksmd 39 root 39 19 0 0 0 s 0 0 0 0 0 00 04 khugepaged show system {users|reboot cause|uptime|memory} show system {users|reboot cause|uptime|memory} \[command] show system {users|reboot cause|uptime|memory} \[purpose] display system related information \[view] privileged user view \[use cases] sonic# show system users admin pts/0 2022 07 27 16 45 (192 168 30 185) admin pts/1 2022 07 27 14 17 (192 168 30 184) admin pts/2 2022 07 27 15 01 (192 168 30 184) admin pts/3 2022 07 27 15 13 (192 168 20 28) show patches \[detail] show patches \[detail] \[command] show patches \[ detail ] \[purpose] display the patches already installed \[view] privileged user view \[use cases] sonic# show patches patch id name created time install time operator \ configuration view configuration view table 2 configure information view command purpose show running config display configuration running currently show startup config display startup configuration show this display configuration of current view show running config show running config \[command] show running config \[purpose] display configuration running currently \[view] privileged user view \[use cases] sonic# show running config ! vlan range 10,20,30,107,200,2013 2016,2019 2020 ! interface mgmt 0 ip address 10 250 0 163/24 gw 10 250 0 254 exit ! interface ethernet 0/0 mtu 9216 no fec speed 10000 switchport access vlan 200 exit ! interface ethernet 0/1 fec rs mtu 9216 speed 25000 exit ! interface ethernet 0/2 fec rs mtu 9216 speed 25000 exit ! interface ethernet 0/3 fec rs mtu 9216 speed 25000 exit ! interface ethernet 0/4 fec rs mtu 9216 speed 25000 exit ! …… show startup config show startup config \[command] show startup config \[purpose] display startup configuration \[view] privileged user view \[use cases] sonic# show startup config ! vlan range 10,20,30,107,200,2013 2016,2019 2020 ! interface mgmt 0 ip address 10 250 0 163/24 gw 10 250 0 254 exit ! interface ethernet 0/0 mtu 9216 no fec speed 10000 switchport access vlan 200 exit ! interface ethernet 0/1 fec rs mtu 9216 speed 25000 exit ! interface ethernet 0/2 fec rs mtu 9216 speed 25000 exit ! interface ethernet 0/3 fec rs mtu 9216 speed 25000 exit ! interface ethernet 0/4 fec rs mtu 9216 speed 25000 exit ! …… show this show this \[command] show this \[purpose] display configuration of current view \[view] all configuration views except global configuration view \[use cases] sonic(config)# interface ethernet 0/16 sonic(config if 0/16)# show this ! interface ethernet 0/16 fec rs mtu 9216 speed 25000 sonic(config if 0/16)# sonic(config if 0/16)# exit sonic(config)# router bgp 65207 sonic(config router)# show this ! router bgp 65207 no bgp ebgp requires policy bgp graceful reload neighbor 199 0 3 2 remote as 65209 neighbor 199 0 3 2 bfd neighbor 199 0 7 2 remote as 65209 neighbor 199 0 7 2 bfd ! address family ipv4 unicast network 10 1 0 34/32 exit address family ! address family l2vpn evpn neighbor 199 0 3 2 activate neighbor 199 0 7 2 activate advertise all vni exit address family exit system config system config table 3 system config table 3 system config command purpose configure terminal enter global configuration view reboot reboot the system reload reload the system write save the configuration hostname hostname modify the hostname of the switch image switch image version switch the system image image update bin file upgrade the system image ping ip address ping traceroute ip address route tracking delete startup config \[ reserve mgmt ] restore to the default configuration terminal rich output enable paging and colorizing when printing to the terminal configure terminal configure terminal \[command] configure terminal \[purpose] enter global configuration view \[view] privileged user view \[use cases] sonic# configure terminal sonic(config)# reboot reboot \[command] reboot \[purpose] reboot the system \[view] privileged user view \[use cases] sonic# reboot do you want to reboot? \[y/n] y reload reload \[command] reload \[purpose] reload the system \[view] privileged user view \[use cases] sonic# reload clear current config and reload config in config db format from the default config file(s) ? \[y/n] y write write \[command] write \[purpose] save the configuration \[view] privileged user view \[use cases] sonic# write save running config existing files will be overwritten, continue? \[y/n] y hostname hostname hostname \[command] hostname hostname \[purpose] modify the hostname of the switch \[parameters] parameter description hostname specify the hostname in string form, up to 64 characters, including only " ", " ", "a z", "a z" and "0 9" it cannot begin with " " , " " and no " " \[view] privileged user view \[notes] you need to manually save the configuration after modification, and re enter after exiting klish to take effect \[use cases] sonic# hostname sonic 226 running command service hostname config restart reloading monit configuration reinitializing monit daemon image switch image switch image version \[command] image switch image version \[purpose] switch the system image \[parameters] parameter description image name of the image \[view] privileged user view \[use cases] sonic# show image current sonic os v3 1r0402p02t06 next sonic os v3 1r0402p02t06 available sonic os v3 1r0402p02t06 sonic os v3 1r0402p02t05 sonic# image switch sonic os v3 1r0402p02t05 command grub set default boot directory=/host 1 image update image update bin file \[command] image update bin file \[purpose] upgrade the system image \[parameters] parameter description bin file the image bin file \[view] privileged user view \[use cases] sonic# image update sonic innovium bin ping ping ip address \[command] ping \[ ip | ipv6 | arp ] ip address \[ vrf vrf name ] \[ src a b c d/a b ] \[ interface { ethernet interface name | link aggregation interface name | vlan vlan id }] \[ repeat count ] \[ size size ]\[ interval interval ] \[purpose] ping \[parameters] parameter description ip send icmp ipv4 messages, default is ipv4 ipv6 send icmp ipv6 messages arp send arp requests ip address specify the destination ip address vrf name specify the source vrf vlan id vlan id, the range is \[1,4094] interface name specify source interface name count stop after count replies, the default is 5 size specify the number of data bytes to be sent interval specify the interval in seconds the default is 1 \[view] privileged user view \[use cases] sonic# ping 10 250 0 242 ping 10 250 0 242 (10 250 0 242) 56(84) bytes of data 64 bytes from 10 250 0 242 icmp seq=1 ttl=63 time=2 47 ms 64 bytes from 10 250 0 242 icmp seq=2 ttl=63 time=0 164 ms 64 bytes from 10 250 0 242 icmp seq=3 ttl=63 time=0 154 ms 64 bytes from 10 250 0 242 icmp seq=4 ttl=63 time=0 168 ms 64 bytes from 10 250 0 242 icmp seq=5 ttl=63 time=0 144 ms \ 10 250 0 242 ping statistics 5 packets transmitted, 5 received, 0% packet loss, time 4049ms rtt min/avg/max/mdev = 0 144/0 619/2 467/0 923 ms traceroute traceroute ip address \[command] traceroute \[ ip | ipv6 ] ip address \[ vrf vrf name ] \[ src a b c d/a b ] \[ interface { ethernet interface name | link aggregation interface name | vlan vlan id }] \[purpose] route tracking \[parameters] parameter description ip send icmp ipv4 messages, default is ipv4 ipv6 send icmp ipv6 messages ip address specify the destination ip address vrf name specify the source vrf a b c d/a b specify the source ip address vlan id vlan id, the range is \[1,4094] interface name specify source interface name \[view] privileged user view \[use cases] sonic# traceroute ip 60 0 0 1 traceroute to 60 0 0 1 (60 0 0 1), 30 hops max, 60 byte packets 1 10 250 0 254 0 889 ms 1 066 ms 1 174 ms 2 172 16 1 1 0 907 ms 1 005 ms 172 16 1 2 0 801 ms 3 172 16 11 34 0 188 ms 0 165 ms 0 187 ms 4 100 68 128 1 3 902 ms 3 968 ms 3 992 ms 5 220 249 83 105 3 744 ms 4 175 ms 4 100 ms 6 58 19 158 97 3 811 ms 7 8 61 182 183 138 27 232 ms 61 182 183 142 29 072 ms 61 182 183 214 29 369 ms 9 60 0 0 1 33 401 ms 34 328 ms 34 045 ms delete startup config \[reserve mgmt] delete startup config \[reserve mgmt] \[command] delete startup config \[ reserve mgmt ] \[purpose] restore to the default configuration \[parameters] parameter description reserve mgmt this option preserves the management interface ip configuration, which is not preserved by default \[view] privileged user view \[use cases] sonic# delete startup config reserve mgmt load default settings is executing generating config db file running command /usr/local/bin/sonic cfggen h k cx308p 48y n preset none > /tmp/ config db json running command /usr/local/bin/sonic cfggen j /tmp/ config db json t /usr/share/sonic/device/x86 64 asterfusion cx308p 48y n r0/cx308p 48y n/buffers json j2 >/tmp/buffers json running command /usr/local/bin/sonic cfggen j /tmp/ config db json t /usr/share/sonic/device/x86 64 asterfusion cx308p 48y n r0/cx308p 48y n/qos json j2 y /etc/sonic/sonic version yml >/tmp/qos json running command /usr/local/bin/sonic cfggen j /tmp/qos json j /tmp/buffers json j /tmp/ config db json print data > /etc/sonic/config db json running command /usr/local/bin/sonic cfggen j /tmp/qos json j /tmp/buffers json j /tmp/ config db json print data > /etc/sonic/config db json inherit eth0 ip address, mask and gateway running command /usr/local/bin/sonic cfggen j /tmp/mgmt ip json j /etc/sonic/config db json print data > /tmp/config db json running command cp /tmp/config db json /etc/sonic/config db json the configuration has been restored please reload it to take effect terminal rich output terminal rich output \[command] terminal rich output \[purpose] enable paging and colorizing when printing to the terminal \[view] privileged user view \[notes] enabled by default run command terminal raw output to disable paging and colorizing when printing to the terminal \[use cases] sonic# terminal rich output
