3.2. Basic Commands

CLI Modes

There are several modes in CLI:

View mode

Basic mode with read-only commands available.

Enable mode

A privileged mode of operation with read-only and write commands available.

Configuration mode

Device configuration commands are available in this mode.

View Mode

The following commands are available in the view mode:

enable

Switch to the enable mode.

ping WORD [vrf NAME]
ping management WORD

Send ping requests to the WORD host. Basic command ping works through the data interfaces. To send requests through the management interface the ping management command is used.

traceroute WORD [vrf NAME]
traceroute management WORD

Send traceroute requests to the WORD host. Basic command traceroute works through the data interfaces. To send requests through the management interface the traceroute management command is used.

tcpdump IFNAME

Run the tcpdump utility on the IFNAME interface.

ssh WORD

Connect to the WORD host via the SSH protocol.

telnet WORD [PORT]

Connect to the WORD host’s PORT port via the Telnet protocol.

terminal paginate

Enable paginated output. This mode is enabled by default.

exit
quit

Exit from the command prompt.

There are also many show commands available in this mode to view and clear the system state. Their description is given in the corresponding sections.

Enable Mode

All the view mode commands are available in the enable mode, as well as the following commands:

disable

Switch to the view mode.

configure [terminal]

Switch to the configuration mode.

start-shell [{bash|zsh}]

Enter the operating system shell.

list [permutations]

List all commands available in this mode. With the permutations option commands are listed according to all possible parameters permutations.

find REGEX...

Search for a command in the CLI matching the REGEX... regular expression. The regular expression is entered in the POSIX Extended Regular Expressions format without the quotes. Spaces are allowed.

show running-config

View the running configuration of the system.

show startup-config

View the startup configuration of the system.

show backup-config

View the backup configuration of the system.

copy running-config startup-config
write

Save the running configuration of the system as the startup one. The previous startup configuration is then written as the backup configuration.

copy backup-config startup-config

Restore the system’s startup configuration from the backup.

copy running-config FILENAME

Save the running configuration of the system to the FILENAME file.

copy startup-config FILENAME

Save the system’s startup configuration to the FILENAME file.

copy FILENAME startup-config

Overwrite the system’s startup configuration from the FILENAME file.

vim FILENAME
nano FILENAME

Edit the FILENAME file using the specified editor.

rm FILENAME

Remove the FILENAME file.

ls

List the files in the current working directory.

scp FROM TO

Run the scp utility to copy files from FROM to TO in a secure way.

reboot

Restart the system.

poweroff

Shutdown the system.

exit
quit

Exit the command prompt.

There are also many show and clear commands available in this mode to view and clear the system state. Their description is given in the corresponding sections.

Configuration Mode

The configuration mode is used to change the running system settings. Available configuration commands are described in the corresponding sections. For the most of the configuration commands, a version with the no prefix for the cancellation is also available.

For example, if you entered the ip route 0.0.0.0/0 192.168.1.1 command, use the no prefix to cancel it: no ip route 0.0.0.0/0 192.168.1.1. All commands in the documentation are described without the no prefix.

All commands from the enable mode are available in the configuration mode, use the do prefix to run them. This allows you to quickly check the system state during configuration without exiting configuration mode, for example:

nfware# configure terminal
nfware(config)# interface if0
nfware(config-if)# ip address 192.168.1.100/24
nfware(config-if)# do show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, T - Table, v - VNC,
       V - VNC-Direct,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup

C>* 192.168.1.0/24 is directly connected, if0, 00:00:01

During the configuration process, you can enter deeper configuration modes for the individual parts of the system. For example, the interface configuration mode as shown in the example above. To immediately exit from the configuration mode to the enable mode, use the end command:

end

Pipe Actions

You can perform additional actions with the output of CLI commands using the pipe actions.

... | include REGEX...

Filter the CLI output with the REGEX... regular expression. The regular expression is entered in the POSIX Extended Regular Expressions format without the quotes. Spaces are allowed.