Using the Command Line Interface Flashcards
What are the two modes of vyos CLI?
operational mode ($) configuration mode (#)
What is operational mode used for?
perform operational system tasks and view system and service status
What is configuration mode used for?
allows for the modification of system configuration
How to get auto-complete for a command?
hit the tab key. 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.
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
incoming Show ethernet input-policy information
: q
vyos@vyos:~$
How to enter configuration mode?
$ configure.
Note that the prompt changes from $ to #.
How to exit configuration mode?
# exit Note that the prompt changes from # to $
How to commit changes?
# commit Note that once you enter on commit, the changes are active. BUT, if the router is rebooted, the changes are gone. If want changes even after a reboot, need to run # save
How to save changes even after a router reboot
save
How to show all configuration commands from operational mode?
$ show configuration commands
ex: vyos@vyos:~$ show configuration commands
set interfaces ethernet eth0 address ‘dhcp’
set interfaces ethernet eth0 hw-id ‘00:0c:29:44:3b:0f’
set interfaces loopback ‘lo’
set service ssh port ‘22’
set system config-management commit-revisions ‘20’
set system console device ttyS0 speed ‘9600’
set system login user vyos authentication encrypted-password ‘’
set system login user vyos level ‘admin’
set system ntp server ‘0.pool.ntp.org’
set system ntp server ‘1.pool.ntp.org’
set system ntp server ‘2.pool.ntp.org’
set system syslog global facility all level ‘notice’
set system syslog global facility protocols level ‘debug’
vyos@vyos:~$
How to exit configuration mode without applying changes
# exit discard Note that configuration mode can not be exited while uncommitted changes exist.
In which file are all configurations stored?
config.boot
Note: This allows for easy template creation, backup, and replication of system configuration.
Configuration changes are mode primarily by two commands. What are they?
set and delete
Basically to view what is there, use Show
To add configuration, use set
To remove configuration, use delete
Once done making configuration changes, what are the three main commands to run
# commit # save # exit Note: Configuration mode can not be exited while uncommitted changes exist. To exit configuration mode without applying changes, the # exit discard command can be used.