The NVUE CLI has a flat structure rather than a modal structure. You can run all commands from the primary prompt instead of only in a specific mode.
Command Syntax
NVUE commands all begin with nv and fall into one of four syntax categories:
-
Configuration (
nv setandnv unset) -
Monitoring (
nv show) -
Action (
nv action) -
Configuration management (
nv config)
Command Completion
As you enter commands, you can press the Tab key to get help with the valid keywords or options. For example, when you use Tab completion with nv set, NVUE displays the possible options for the command and returns you to the command prompt so that you can complete the command.
admin@nvos:~$ nv set <<press Tab>>
acl interface platform system
Command Question Mark
You can type a question mark (?) after a command to display required information quickly and concisely. When you type ?, NVUE specifies the value type, range, and options with a brief description of each; for example:
admin@nvos:~$ nv set system config auto-save ?
[Enter]
state Enable/Disable configuration automatic save feature
NVUE also indicates whether you need to provide specific values for the command:
admin@nvos:~$ nv set interface ?
<interface-id> Interface (interface-name)
Command Abbreviation
NVUE supports command abbreviation, so you can type the first few characters of each keyword instead of the whole command to speed up CLI interaction. For example, instead of typing nv show interface, you can type nv sh int.
If the command you type is ambiguous, NVUE shows the reason for the ambiguity so that you can correct the shortcut. For example:
admin@nvos:~$ nv s i
Ambiguous Command:
set interface
show interface
Command Help
As you enter commands, you can get help with command syntax by entering -h or --help at various points within a command entry. For example, to examine the options available for nv set interface, enter nv set interface -h or nv set interface --help.
admin@nvos:~$ nv set interface -h
usage:
nv [options] set interface <interface-id>
Description:
interface Update all interfaces. Provide single interface or multiple interfaces using ranging (e.g. sw1-2p1-2 -> sw1p1,sw1p2,sw2p1,sw2p2).
Identifiers:
<interface-id> Interface (interface-name)
General Options:
-h, --help Show help.
Command List
You can list all the NVUE commands by running nv list-commands.
Command History
At the command prompt, press the Up Arrow and Down Arrow keys to move back and forth through the list of commands you entered. When you find the command you want, press Enter to run it. You can also modify the command before you run it.
Command Ranges
You can specify a single interface or multiple interfaces with a range. For example, sw1-2p1-2 specifies sw1p1, sw1p2, sw2p1, and sw2p2.
Examples:
admin@nvos:~$ nv set interface sw1p1s1,sw1p1s2 description TEST
admin@nvos:~$ nv config diff
- set:
interface:
sw1p1s1-2:
description: TEST
type: nvl
admin@nvos:~$ nv set interface sw1p1-2s1 description TEST
admin@nvos:~$ nv config diff
- set:
interface:
sw1p1-2s1,sw2p1-2s1:
description: TEST
type: nvl
Command Categories
The NVUE CLI has a flat structure; however, the commands are in four functional categories:
-
Configuration
-
Monitoring
-
Action
-
Configuration Management
Configuration Commands
The NVUE configuration commands modify the switch configuration. You can set and unset configuration options.
The nv set and nv unset commands are in the following categories. Each command group includes subcommands. Use command completion (press the Tab key) to list the subcommands.
|
Command Group |
Description |
|---|---|
|
|
Configures the switch interfaces. Use this command to configure eth0/eth1/lo/nvl interfaces. |
|
|
Configures the switch hostname, pre-login and post-login messages, log level, users, password-hardening policies, and other system settings. |
|
|
Configures ACLs. |
|
|
Configures the platform firmware settings. |
Monitoring Commands
The NVUE monitoring commands show various parts of the network configuration. For example, you can show the complete network configuration or only interface configuration. The monitoring commands are in the following categories. Each command group includes subcommands. Use command completion (press the Tab key) to list the subcommands.
|
Command Group |
Description |
|---|---|
|
|
Shows the access control list (ACL) configuration. |
|
|
Shows information about action command jobs. |
|
|
Shows interface configuration. |
|
|
Shows platform configuration, such as hardware and software components. |
|
|
Shows global system settings, such as the images, tech-support files, and logs. You can also see system login messages and the switch reboot history. |
|
|
Shows VRF configuration. |
|
|
Shows the system and MGMT GUIDs and LIDs. |
If there are no pending or applied configuration changes, the nv show command shows only the running configuration (under operational).
Additional options are available for the nv show commands. For example, you can choose the configuration you want to show (pending, applied, startup, or operational). You can also turn on colored output and paginate specific output.
|
Option |
Description |
|---|---|
|
|
Shows configuration applied with the |
|
|
Shows help about the |
|
|
Turns colored output on or off. For example, |
|
|
Shows |
|
|
Filters show command output on column data. For example, |
|
|
Shows system configuration for the switch with the specified hostname. For example, |
|
|
Shows the running configuration (the actual system state). For example, |
|
|
Shows command output in table format (auto), |
|
|
Paginates the output. For example, |
|
|
Shows configuration that is |
|
|
Shows a detached pending configuration. See the |
|
|
Shows configuration saved with the |
|
|
Shows information in tab format. For example, |
|
|
Shows different views. A view is a subset of information provided by certain |
Action Commands
The NVUE action commands make immediate changes to the switch.
The nv action commands are in the following categories. Each command group includes subcommands. Use command completion (press the Tab key) to list the subcommands.
|
Command Group |
Description |
|---|---|
|
|
Runs actions on the switch, such as managing the software image, rebooting the system, and generating tech-support files. |
|
|
Runs actions on the switch interfaces, such as clearing counters and renewing the DHCP client on eth0. |
|
|
Runs actions on the platform, such as turning the UID LED on or off. |
Configuration Management Commands
The NVUE configuration management commands manage and apply configurations.
|
Command |
Description |
|---|---|
|
|
Applies the pending configuration (
NVOS applies but does not save the configuration; the configuration does not persist after a reboot. You can also use these apply options:
NVUE can save the pending configuration to the startup configuration automatically when you run |
|
|
Detaches the configuration from the current pending configuration. NVOS names the detached configuration To list all the current detached pending configurations, run |
|
|
Shows differences between configurations, such as the pending configuration and the applied configuration or the detached configuration and the pending configuration. |
|
|
Finds a portion of the applied configuration according to the search string you provide. For example, to find sw1p1 in the applied configuration, run |
|
|
Enables you to keep track of the configuration changes on the switch and shows a table with the configuration revision ID, the date and time of the change, the user account that made the change, and the type of change (such as CLI or REST API). The |
|
|
Updates the pending configuration with the specified YAML configuration file. |
|
|
Replaces the pending configuration with the specified YAML configuration file. |
|
|
Shows all the configuration revisions on the switch. |
|
|
Overwrites the startup configuration with the applied configuration by writing to the |
|
|
Shows the currently applied configuration in |
|
|
Shows the currently applied configuration commands. |
|
|
Shows differences between two configuration revisions. |
List All NVUE Commands
To show the full list of NVUE commands, run nv list-commands. For example:
admin@nvos:~$ nv list-commands
nv show platform environment
nv show platform environment fan
nv show platform environment fan <fan-id>
nv show platform environment temperature
nv show platform environment temperature <sensor-id>
nv show platform environment psu
nv show platform environment psu <psu-id>
nv show platform environment led
nv show platform environment led <led-id>
nv show platform software
nv show platform software installed
nv show platform software installed <installed-id>
...
You can show the list of commands for a command group. For example, to show the list of system commands:
admin@nvos:~$ nv list-commands system
nv show system
nv show system message
nv show system log
nv show system log file
nv show system log file <file-name>
nv show system log file list
nv show system log file follow
nv show system log component
nv show system log component <component-name>
nv show system log component <component-name> file
nv show system log component <component-name> file list
nv show system log component <component-name> file follow
nv show system log component <component-name> file <file-name>
nv show system reboot
nv show system reboot reason
...
Use the Tab key to get help with the command lists you want to see. For example, to show the list of command options available for the eth0 interface, run:
admin@nvos:~$ nv list-commands interface eth0 <<press Tab>>
ip link pluggable
Search for a Specific Configuration
To search for a specific portion of the NVUE configuration, run the nv config find <search string> command. The search shows all items above and below the search string. For example, to search the entire NVUE object model configuration for any mention of ptm:
admin@nvos:~$ nv config find system
- set:
system:
aaa:
authentication:
restrictions:
fail-delay: 0
lockout-state: disabled
user:
admin:
password: '*'
date-time:
timezone: Asia/Jerusalem
Clear Switch Configuration
To apply an empty configuration, run the following command:
admin@nvos:~$ nv config apply empty
This command clears the current configuration, essentially returning the settings to their default values.
ACL assignments to interfaces depend on user configuration, and you can remove them as needed. Applying an empty configuration with nv config apply empty clears all ACL assignments instead of restoring them to their default state. To restore the default ACL assignment, run nv unset interface acl followed by nv config apply, or perform a full factory reset with nv action reset system factory-default.
Example Configuration Commands
This section provides examples of how to configure an NVOS switch with NVUE commands.
Configure the System Hostname
The following example shows the NVUE commands that change the switch hostname to nvos:
admin@nvos:~$ nv set system hostname nvos
admin@nvos:~$ nv config apply
Configure an Interface
The following example shows the NVUE commands that bring up sw1p1:
admin@nvos:~$ nv set interface sw1p1s1 link state up
admin@nvos:~$ nv config apply
Example Monitoring Commands
This section provides monitoring command examples.
Show Installed Software
The following example command lists the software installed on the switch:
admin@nvos:~$ nv show platform software installed
Installed software description package version
---------------------------------------- -------------------------------------------------------------------------------------------- ---------------------------------------- ------------------------------
acl access control list - utilities acl 2.2.53-10
adduser add and remove users and groups adduser 3.118
apparmor user-space parser utility for AppArmor apparmor 2.13.6-10
apt commandline package manager apt 2.2.4
apt-transport-https transitional package for https support apt-transport-https 2.2.4
audisp-tacplus audisp module for TACACS+ accounting audisp-tacplus 1.0.2
auditd User space tools for security auditing auditd 1:3.0-2
base-files Debian base system miscellaneous files base-files 11.1+deb11u3
base-passwd Debian base system master password and group files base-passwd 3.5.51
bash GNU Bourne Again SHell bash 5.1-2+b3
bash-completion programmable completion for the bash shell bash-completion 1:2.11-2
bash-tacplus Bash TACACS+ plugin for per-command TACACS+ authorization. bash-tacplus 1.0.0
bridge-utils Utilities for configuring the Linux Ethernet bridge bridge-utils 1.7-1
bsdextrautils extra utilities from 4.4BSD-Lite bsdextrautils 2.36.1-8+deb11u1
bsdmainutils Transitional package for more utilities from FreeBSD bsdmainutils 12.1.7+nmu3
bsdutils basic utilities from 4.4BSD-Lite bsdutils 1:2.36.1-8+deb11u1
busybox Tiny utilities for small and embedded systems busybox 1:1.30.1-6+b3
ca-certificates Common CA certificates ca-certificates 20210119
...
Show Interface Configuration
The following example command shows the running, applied, and pending sw1p1s1 interface configuration.
admin@nvos::~$ nv show interface sw1p1s1
operational applied
-------------------- ------------------- --------
link
auto-negotiate on on
duplex full
speed auto
counters
in-bytes 0 Bytes
in-pkts 0
in-drops 0
in-errors 0
out-bytes 0 Bytes
out-pkts 0
out-drops 0
out-errors 0
in-symbol-errors 0
out-wait 0
[diagnostics]
mtu 4096
op-vls VL0-VL7
lanes 1X,2X,4X
state down up
supported-speed 800G
max-supported-mtu 4096
physical-state Polling
logical-state Down
supported-lanes 1X,2X,4X
vl-capabilities VL0-VL7
type nvl nvl
Reset NVUE Configuration to Default Values
To reset the NVUE configuration on the switch to the default values, run the following command:
admin@nvos:~$ nv config replace /usr/lib/python3/dist-packages/cue_config_v1/initial.yaml
admin@nvos:~$ nv config apply
Add Configuration Apply Messages
When you run the nv config apply command, you can add a message that describes the configuration updates you make. You can see the message when you run the nv config history command.
To add a configuration apply message, run the nv config apply -m <message> command. If the message includes more than one word, enclose the message in quotes.
admin@nvos:~$ nv config apply -m "this is my message"
Configure Auto Save
By default, when you run the nv config apply command to apply a configuration setting, NVUE applies the pending configuration to become the applied configuration and automatically saves the changes to the startup configuration file (/etc/nvue.d/startup.yaml).
To disable auto save so that NVUE does not save applied configuration changes, run the nv set system config auto-save state disabled command:
admin@nvos:~$ nv set system config auto-save state disabled
admin@nvos:~$ nv config apply
When you disable auto save, you must run the nv config save command to save the applied configuration to the startup configuration so that the changes persist after a reboot.
Example Configuration Management Commands
This section provides examples of how to use the configuration management commands to apply, save, and detach configurations.
Apply and Save a Configuration
The following example command configures the state of the front-panel port interface sw1p1. The configuration is only in a pending state and is not applied. NVUE has not yet made any changes to the running configuration.
admin@nvos:~$ nv set interface sw1p1s1 link state down
To apply the pending configuration to the running configuration, run the nv config apply command. The configuration does not persist after a reboot.
admin@nvos:~$ nv config apply
To save the applied configuration to the startup configuration, run the nv config save command. The configuration persists after a reboot.
admin@nvos:~$ nv config save
Detach a Pending Configuration
The following example configures the IP address of the eth0 interface, then detaches the configuration from the current pending configuration. NVOS saves the detached configuration to a file with a numerical value to distinguish it from other pending configurations.
admin@nvos:~$ nv set interface eth0 ipv4 address 10.10.10.1/24
admin@nvos:~$ nv config detach
View Differences Between Configurations
To view differences between configurations, run the nv config diff command.
To view differences between two detached pending configurations, run the nv config diff command and press Tab to list all the current detached pending configurations. Then run the nv config diff command with the pending configurations you want to compare:
admin@nvos:~$ nv config diff <<press Tab>>
1 2 3 4 5 6 applied empty startup
admin@nvos:~$ nv config diff 1 2
- set:
system:
security:
password-hardening:
state: disabled
To view differences between the applied configuration and the startup configuration:
admin@nvos:~$ nv config diff applied startup
Replace and Patch a Pending Configuration
The following example replaces the pending configuration with the contents of the YAML configuration file called nv-02/13/2021.yaml located in the /deps directory:
admin@nvos:~$ nv config replace /deps/nv-02/13/2021.yaml
The following example patches the pending configuration (runs the set or unset commands from the configuration in the nv-02/13/2021.yaml file located in the /deps directory):
admin@nvos:~$ nv config patch /deps/nv-02/13/2021.yaml
Passwords and Special Characters
If you use certain special characters in a password, you must quote or escape (with a backslash) these characters so that the system understands that they are part of the password.
The following table shows whether you need to quote or escape a special character.
-
Normal Use indicates that you can use the special character without quotes or a backslash.
-
Single Quotes and Double Quotes indicate that you must enclose the entire password in quotes.
|
Special Character |
Normal Use |
Single Quotes ('') |
Double Quotes ("") |
Escape ( |
|---|---|---|---|---|
|
backtick (`) |
x |
✓ |
1 |
✓ |
|
exclamation point ( |
x |
✓ |
x |
✓ |
|
semicolon ( |
x |
✓ |
✓ |
✓ |
|
ampersand ( |
x |
✓ |
✓ |
✓ |
|
question mark ( |
x |
✓ |
✓ |
x |
|
tilde (~) |
x |
✓ |
✓ |
✓ |
|
at-sign ( |
✓ |
✓ |
✓ |
✓ |
|
hash sign ( |
x |
✓ |
✓ |
✓ |
|
dollar sign ( |
x |
✓ |
x |
✓ |
|
percent sign ( |
✓ |
✓ |
✓ |
✓ |
|
caret ( |
✓ |
✓ |
✓ |
✓ |
|
asterisk ( |
✓ |
✓ |
✓ |
✓ |
|
parentheses ( |
x |
✓ |
✓ |
✓ |
|
dash ( |
✓ |
✓ |
✓ |
✓ |
|
underscore ( |
✓ |
✓ |
✓ |
✓ |
|
equals sign ( |
✓ |
✓ |
✓ |
✓ |
|
plus sign ( |
✓ |
✓ |
✓ |
✓ |
|
vertical bar |
x |
✓ |
✓ |
✓ |
|
brackets ( |
✓ |
✓ |
✓ |
✓ |
|
braces ( |
✓ |
✓ |
✓ |
✓ |
|
colon ( |
✓ |
✓ |
✓ |
✓ |
|
single quote ( |
x |
x |
✓ |
✓ |
|
double quote ( |
x |
✓ |
x |
✓ |
|
comma ( |
✓ |
✓ |
✓ |
✓ |
|
angle brackets ( |
x |
✓ |
✓ |
✓ |
|
slash ( |
✓ |
✓ |
✓ |
✓ |
|
dot ( |
2 |
2 |
2 |
2 |
|
white space |
x |
x |
3 |
x |
-
Requires escape (
\) in addition to the double quotes (""). -
You cannot use this character at the beginning of a word.
-
A word cannot consist entirely of white space, even inside double quotes.
The following example shows a password that includes a question mark (?):
nvos@admin:~$ nv set system aaa user nvos password “Hello?world123”
The following example shows a password that includes a dot (.):
nvos@admin:~$ nv set system aaa user nvos password “Hello.world.123”
The following example shows a password that includes a dot (.) and a tilde (~):
nvos@admin:~$ nv set system aaa user nvos password “Hello.world\~123”
You might need to encode special characters in a password, for example, in a URL. The following table shows the special character encoding.
-
✓indicates that encoding is not needed. -
%xxindicates that you need to replace the special character with%xx.
|
Symbol |
Normal |
Single Quotes ('') |
Double Quotes ("") |
Escape ( |
|---|---|---|---|---|
|
backtick (`) |
%60 |
✓ |
%60 |
✓ |
|
exclamation point ( |
%21 |
✓ |
%21 |
✓ |
|
semicolon ( |
%3B |
✓ |
✓ |
✓ |
|
ampersand ( |
%26 |
✓ |
✓ |
✓ |
|
question mark ( |
%3F |
%3F |
%3F |
%3F |
|
tilde (~) |
✓ |
✓ |
✓ |
✓ |
|
at-sign ( |
✓ |
✓ |
✓ |
✓ |
|
hash sign ( |
%23 |
%23 |
%23 |
%23 |
|
dollar sign ( |
%24 |
✓ |
%24 |
✓ |
|
percent sign ( |
✓ |
✓ |
✓ |
✓ |
|
caret ( |
✓ |
✓ |
✓ |
✓ |
|
asterisk ( |
✓ |
✓ |
✓ |
✓ |
|
left parenthesis ( |
%28 |
✓ |
✓ |
✓ |
|
right parenthesis ( |
%29 |
✓ |
✓ |
✓ |
|
dash ( |
✓ |
✓ |
✓ |
✓ |
|
underscore ( |
✓ |
✓ |
✓ |
✓ |
|
equals sign ( |
✓ |
✓ |
✓ |
✓ |
|
plus sign ( |
✓ |
✓ |
✓ |
✓ |
|
vertical bar |
%7C |
✓ |
✓ |
✓ |
|
left bracket ( |
%5B |
%5B |
%5B |
%5B |
|
right bracket ( |
%5D |
%5D |
%5D |
%5D |
|
braces ( |
✓ |
✓ |
✓ |
✓ |
|
colon ( |
✓ |
✓ |
✓ |
✓ |
|
single quote ( |
%27 |
%27 |
✓ |
✓ |
|
double quote ( |
%22 |
✓ |
%22 |
✓ |
|
comma ( |
✓ |
✓ |
✓ |
✓ |
|
left angle bracket ( |
%3C |
✓ |
✓ |
✓ |
|
right angle bracket ( |
%3E |
✓ |
✓ |
✓ |
|
slash ( |
%2F |
%2F |
%2F |
%2F |
|
dot ( |
✓ |
✓ |
✓ |
✓ |
|
white space |
%20 |
✓ |
✓ |
✓ |
The following example fetches an image stored on a device with IP address 10.0.1.251 using the password Pass#pass1 for user1:
nvos@admin:~$ nv action fetch system image scp://user1:Pass1%23pass1@10.0.1.251/host/nos-images/nvos-amd64-25.02.1857.bin
Last updated: