0% found this document useful (0 votes)
6 views4 pages

VyOS CLI: Operational & Configuration Modes

The VyOS CLI consists of operational and configuration modes, with operational mode allowing users to perform system tasks and view statuses, while configuration mode is for modifying system settings. The CLI features a help system for command assistance and command families that indicate the potential impact of commands, such as clear, reset, and restart. Users can navigate outputs using various keys and enter configuration mode with the 'configure' command, indicated by a change in the command prompt.

Uploaded by

宋飞
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views4 pages

VyOS CLI: Operational & Configuration Modes

The VyOS CLI consists of operational and configuration modes, with operational mode allowing users to perform system tasks and view statuses, while configuration mode is for modifying system settings. The CLI features a help system for command assistance and command families that indicate the potential impact of commands, such as clear, reset, and restart. Users can navigate outputs using various keys and enter configuration mode with the 'configure' command, indicated by a change in the command prompt.

Uploaded by

宋飞
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

CHAPTER

SIX

COMMAND LINE INTERFACE

The VyOS CLI (Command-Line Interface) comprises an operational and a configuration mode.

6.1 Operational Mode

Operational mode allows for commands to perform operational system tasks and view system and service status, while
configuration mode allows for the modification of system configuration.
The CLI provides a built-in help system. In the CLI the ? key may be used to display available commands. The TAB
key can be used to auto-complete commands and will present the help system upon a conflict or unknown value.
For example typing sh followed by the TAB key will complete to show. Pressing TAB a second time will display the
possible sub-commands of the show command.

vyos@vyos:~$ s[tab]
set show

Example showing possible show commands:

vyos@vyos:~$ show [tab]


Possible completions:
arp Show Address Resolution Protocol (ARP) information
bridge Show bridging information
cluster Show clustering information
configuration Show running configuration
conntrack Show conntrack entries in the conntrack table
conntrack-sync
Show connection syncing information
date Show system date and time
dhcp Show Dynamic Host Configuration Protocol (DHCP) information
dhcpv6 Show status related to DHCPv6
disk Show status of disk device
dns Show Domain Name Server (DNS) information
file Show files for a particular image
firewall Show firewall information
flow-accounting
Show flow accounting statistics
hardware Show system hardware details
history show command history
host Show host information
(continues on next page)

174
VyOS Documentation, Release 1.5.x (circinus)

(continued from previous page)


incoming Show ethernet input-policy information
: q

You can scroll up with the keys [Shift]+[PageUp] and scroll down with [Shift]+[PageDown].
When the output of a command results in more lines than can be displayed on the terminal screen the output is paginated
as indicated by a : prompt.
When viewing in page mode the following commands are available:
• q key can be used to cancel output
• space will scroll down one page
• b will scroll back one page
• return will scroll down one line
• up-arrow and down-arrow will scroll up or down one line at a time respectively
• left-arrow and right-arrow can be used to scroll left or right in the event that the output has lines
which exceed the terminal size.

6.1.1 Operational mode command families

Many operational mode commands in VyOS are placed in families such as show, clear, or reset. Every such family
has a specific meaning to allow the user to guess how the command is going to behave — in particular, whether it will
be disruptive to the system or not.
Note that this convention was not always followed with perfect consistency and some commands may still be in wrong
families, so you should always check the command help and documentation if you are not sure what exactly it does.

clear

“Clear” commands are completely non-disruptive to any system operations. Generally, they can be used freely without
hesitation.
Most often their purpose is to remove or reset various debug and diagnostic information such as system logs and packet
counters.
Examples:
• clear console — clears the screen.
• clear interfaces ethernet eth0 counters — zeroes packet counters on eth0.
• clear log — deletes all system log entries.

6.1. Operational Mode 175


VyOS Documentation, Release 1.5.x (circinus)

reset

“Reset” commands can be locally-disruptive. They may, for example, terminate a single user session or a session with
a dynamic routing protocol peer.
They should be used with caution since they may have a significant impact on a particular users in the network.
• reset pppoe-server username jsmith — terminate all PPPoE sessions from user jsmith.
• reset bgp [Link] — terminates the BGP session with neighbor [Link].
• reset vpn ipsec site-to-site peer [Link] — terminates IPsec tunnels to [Link].
com.
• reset session tty1 — terminates the TTY user session tty1

restart

“Restart” operations may disrupt an entire subsystem. Most often they initiate a restart of a server process, which
causes it to be unavailable for a brief period and resets all the process state.
They should be used with extreme caution.
• restart dhcp server — restarts the IPv4 DHCP server process (DHCP requests are not served while it is
restarting).
• restart ipsec — restarts the IPsec process (which forces all sessions and all IPsec process state to reset).

force

“Force” commands force the system to perform an action that it might perform by itself at a later point.
Examples:
• force arp request interface eth1 address [Link] — send a gratuitious ARP request.
• force root-partition-auto-resize — grow the root filesystem to the size of the system partition (this is
also done on startup, but this command can do it without a reboot).

execute

“Execute” commands are for executing various diagnostic and auxilliary actions that the system would never perform
by itself.
Examples:
• execute wake-on-lan interface <intf> host <MAC> — send a Wake-On-LAN packet to a host.

6.1. Operational Mode 176


VyOS Documentation, Release 1.5.x (circinus)

show

“Show” commands display various system information. They may occasionally use a pager for long outputs, that you
can quit by pressing the Q button. Their output is always finite, however.
Examples:
• show system login — displays current system users.
• show ip route — displays the IPv4 routing table.

monitor

“Monitor” commands initiate various monitoring operations that may output information continuously, until terminated
with Ctrl-C or disabled.
Examples:
• monitor log — continuously outputs latest system logs.

6.2 Configuration Mode

To enter configuration mode use the configure command:

vyos@vyos:~$ configure
[edit]
vyos@vyos:~#

Note: Prompt changes from $ to #. To exit configuration mode, type exit.

vyos@vyos:~# exit
exit
vyos@vyos:~$

See the configuration section of this document for more information on configuration mode.

6.2. Configuration Mode 177

You might also like