The SonicWall NSv command-line interface (CLI) lets administrators directly configure, monitor, and troubleshoot the firewall. The CLI is most useful during initial setup, recovery, and advanced administration.
Prerequisites
Before launching the NSv CLI using SSH, ensure the following:
Ensure that an SSH client is available on the system
Use VM console access when SSH is not enabled
To launch the NSv CLI using SSH
Launch the SSH client.
In the Host Name (or IP address) field, enter the public IP address of the NSv.
In the Port field, enter 22 if it is not already set.
Using an SSH port other than 22 can block access because SonicCoreX only listens on port 22, and NSv uses the same SSH entry point for both the SonicCoreX console and the SonicOS CLI. If you change the SSH port in SonicOS, SonicCoreX cannot use it, and you may lose access to both consoles.
For Connection type, ensure that SSH is selected. This option is selected automatically when you specify port 22.
Click Open.
At the login prompt, enter the SonicOS administrator credentials.
The following table describe the CLI commands and their usage.
The command syntax, usage, and description can be displayed by typing the command in the SonicCoreX CLI console, followed by a space and a question mark (?).
| Command | Syntax | Description | Example |
|---|---|---|---|
| date |
|
Sets and Displays the current date. |
date set "02/12/2023 12:23:12" OR date read |
| dhcp | dhcp interface <interface name> | Enables dhcp on an interface in safe mode. | dhcp interface X1 |
| dns |
|
Configures DNS server in safe mode |
dns primary 8.8.8.8 OR dns primary 8.8.8.8 secondary 8.8.4.4 |
| dns-lookup | dns-lookup <string> | Runs the DNS query for the Domain given as a parameter. | dns-lookup www.google.com |
| exit | exit | Exits the SonicCoreX with CLI console and switch to safemode menu. | exit |
| help | help | It shows the default help of the SonicCoreX with CLI console. | help |
| network | network interface <interface name> ip <ip address> netmask <netmask> gateway <gateway ip> | Configures network in safemode. |
network interface enp11s0 ip 10.203.78.81 netmask 255.255.255.0 gateway 10.203.78.1 |
| ping |
|
Runs the ping command on the mentioned IP address or String |
ping google.com OR ping ip google.com OR ping ip6 <ipv6 address> |
| restart | restart |
|
restart OR restart enter-safemode |
| safemode | safemode | Restarts the firewall in safemode. | safemode |
| show (normal mode) |
|
|
show system OR show sonicos OR show network OR show dns OR show logs |
| shutdown | shutdown | Shuts down the firewall. | shutdown |
| support-data | support-data | Sends logs to support. | support-data |
| update |
|
Checks, downloads, and installs an available update. |
update check OR update download OR update install |
| update-channel |
|
It is used to modify/read/restore the update channel to deliver updates. |
update-channel read OR update-channel set <channel name> OR update-channel restore |