The CLI supports numerous show commands. To view the various show commands that the CLI supports, type show ?.
sonic# show ?
aaa Show aaa info
bfd Bidirection Forwarding Detection
bgp show bgp community, ext community, as list information
image Show image information
interface Show Interface info
ip show IP commands
ipv6 show IP commands
kdump Show kdump status
link Show link state tracking information
lldp Show lldp information
mac Show MAC
mclag Show mclag domain
mirror-session Show Mirror session information
nat Show NAT info
NeighbourSuppressStatus Show arp and nd suppression status
platform Show platform information
PortChannel LAG status and configuration
***** OUTPUT TRUNCATED ******
A user can take advantage of the CLI to access the information and data that is associated with the SONiC NOS and hardware. The following examples depict how the show command gathers system details.
The show system command lists the attributes such as the hostname, boot time, current date and time, and domain name.
sonic# show system
-----------------------------------------------------------
Attribute Value/State
-----------------------------------------------------------
Hostname :Leaf3
Boot Time :1577362334
Current Datetime :2020-01-08T16:44:22Z+00:00
Domain Name :None
The show system memory command provides details on the total available memory and the used memory.
sonic# show system memory
-----------------------------------------------------------
Attribute Value/State
-----------------------------------------------------------
Used :2951756
Total :8162428
The CLI supports many configuration commands. Access the configuration mode by using the command configure terminal.
sonic(config)# ?
aaa AAA configuration
bfd Configure BFD peers
bgp bgp command list
end Exit to the exec Mode
evpn EVPN Global Configuration
exit Exit from current mode
interface Select an interface
ip Global IP configuration subcommands
ipv6 ipv6 prefix-list
kdump kdump command
link Create link state tracking group
mclag domain
mirror-session Mirror session configuration
***** OUTPUT TRUNCATED ******
Various use cases are associated with the Management Framework CLI. The CLI allows a user to configure the Enterprise SONiC Distribution by Dell Technologies for enterprise and scalable use cases. One use case for an enterprise data center uses ZTP to configure several switches simultaneously. To do that, the ZTP service must be enabled on the NOS. The ZTP service is enabled by default when the NOS boots. If the service is disabled, use the ztp enable CLI command to reenable the service.
Another use case example relates to a scalable architecture in the enterprise data center. The Layer 3 leaf-spine architecture model requires the configuration of the leaf and spine switches, with the Layer 2 and Layer 3 boundary defined at the leaf switches.
Figure 10: Assigning IP addresses on switch Leaf1 using the CLI
The following example shows the initial configuration steps for assigning an IP address to a loopback interface, and point-to-point interfaces in switch Leaf 1 within the leaf-spine topology shown in the previous figure.
interface Loopback 0
ip address 10.0.2.1/32
exit
interface Ethernet 0
description To-Spine1
ip address 192.168.1.1/31
no shutdown
exit
interface Ethernet 4
description To-Spine2
ip address 192.168.2.1/31
no shutdown
exit
interface Ethernet 12
description To-Dynamic-neighbor
ip address 50.50.50.2/24
no shutdown
exit