NVUE CLI Overview
The NVUE CLI has a flat structure as opposed to a modal structure. This means that you can run all commands from the primary prompt instead of only in a specific mode.
NVUE commands all begin with nv
and fall into one of four syntax categories:
Configuration (
nv set
andnv unset
)Monitoring (
nv show
)Action commands (
nv action
)Configuration management (
nv config
).
As you enter commands, you can get help with the valid keywords or options using the Tab key. For example, using Tab completion with nv set
displays the possible options for the command and returns you to the command prompt to complete the command.
admin@nvos
:~$ nv set <<press Tab>>
acl interface
platform system
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 if you need to provide specific values for the command:
admin@nvos
:~$ nv set interface
?
<interface
-id> Interface (interface
-name)
NVUE supports command abbreviation, where you can type a certain number of characters instead of a 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
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.
You can list all the NVUE commands by running nv list-commands
.
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 a given command, you can run the command by pressing Enter. Optionally, you can modify the command before you run it.
A single interface or multiple interfaces can be provided using a range such as sw1-2p1-2 -> sw1p1,sw1p2,sw2p1,sw2p2.
Example:
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
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 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 hostname of the switch, pre and post login messages, log level, users, password-hardening policies etc. |
| Configures ACLs. |
| Configures the platform firmware configuration. |
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 Access Control List configuration. |
| Shows information about the action commands job. |
| Shows interface configuration. |
| Shows platform configuration, such as hardware and software components. |
| Shows global system settings, such as the images, tech-support files and log . You can also see system login messages and switch reboot history. |
| Shows VRF configuration. |
| Shows system and MGMT GUIDs and LIDs |
If there are no pending or applied configuration changes, the nv show
command only shows 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, the
To filter on multiple column outputs, enclose the filter types in parentheses; for example,
You can use wildcards; for example,
You can filter on all revisions (operational, applied, and pending); 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 |
|
Show 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 run immediate change in the switch.
The nv action
command is in the following categories. Each command group includes subcommands. Use command completion (Tab key) to list the subcommands.
Command Group | Description |
| Run some actions on the switch. managing the software image, reboot the system ,generate tech-support etc. |
| Run some actions on the switch. Clear counters, renew the DHCP-client on eth0 etc. |
| Run some actions on the platform. turn-on or turn-off the UID led etc. |
Configuration Management Commands
The NVUE configuration management commands manage and apply configurations.
Command | Description |
|
Applies the pending configuration (
You can also use these prompt options:
Note
NVOS applies but does not save the configuration; the configuration does not persist after a reboot.
You can also use these apply options:
To 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 swp1 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 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 grouping. 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 files
nv show system log files <file-name>
nv show system log component
nv show system log component <component-name>
nv show system debug-log
nv show system debug-log files
nv show system debug-log files <file-name>
nv show system reboot
nv show system reboot reason
...
Use the Tab key to get help for the command lists you want to see. For example, to show the list of command options available for the interface eth0, run:
admin@nvos
:~$ nv list-commands interface
eth0 <<press Tab>>
ip link pluggable
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: '*'
timezone: Asia/Jerusalem
To reset the configuration on the switch back to the factory defaults, run the following command:
admin@nvos
:~$ nv config apply empty
This section provides examples of how to configure a NVOS switch using NVUE commands.
Configure the System Hostname
The example below shows the NVUE commands required to change the hostname for the switch to nvos:
admin@nvos
:~$ nv set system hostname nvos
admin@nvos
:~$ nv config apply
Configure an Interface
The example below shows the NVUE commands required to bring up sw1p1.
admin@nvos
:~$ nv set interface
sw1p1s1 link state up
admin@nvos
:~$ nv config apply
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
To reset the NVUE configuration on the switch back 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
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"
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 enable off
command:
admin@nvos
:~$ nv set system config auto-save enable off
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.
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 front panel port interfaces sw1p1 state. The configuration is only in a pending configuration state. The configuration 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 ip address 10.10
.10.1
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
«TAB» command to list all the current detached pending configurations, then run the nv config diff
command with the pending configurations you want to diff:
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
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 if 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 the entire password needs to be enclosed 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 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.%xx
indicates 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