The documentation set for this product strives to use bias-free language. For the purposes of this documentation set, bias-free is defined as language that does not imply discrimination based on age, disability, gender, racial identity, ethnic identity, sexual orientation, socioeconomic status, and intersectionality. Exceptions may be present in the documentation due to language that is hardcoded in the user interfaces of the product software, language used based on RFP documentation, or language that is used by a referenced third-party product. Learn more about how Cisco is using Inclusive Language.
This chapter contains the following sections:
To access VSG, you can SSH into the management IP. After you have successfully accessed the system, the CLI prompt displays in the terminal window of remote workstation, as follows:
vsg#
Note | Use show host name command to display the existing hostname of the switch. |
Command Modes
The CLI is divided into command modes that define the actions available to the user. Command modes are “nested” and are accessed in sequence. When you first log in, you are placed in CLI EXEC mode.
As you navigate from EXEC mode to global configuration mode, a larger set of commands is available to you. To transition to global configuration mode, enter the following command:
configure terminal
The following table shows how command access builds from user EXEC to global configuration mode.
Command Mode | Prompt | Description |
---|---|---|
EXEC |
firewall# |
|
Global configuration |
firewall(config)# |
|
When you first log in, you are placed into EXEC mode. The commands available in EXEC mode include the show commands that display device status and configuration information, the clear commands, and other commands that perform actions that you do not save in the device configuration.
Global configuration mode provides access to the widest range of commands, including those commands used to make configuration changes that are saved by the device and can be stored and applied when the device is rebooted.
Commands entered in global configuration mode update the running configuration file as soon as they are entered but must also be saved into the startup configuration file by using the following command:
copy running-config startup-config
In global configuration mode, you can access protocol-specific, platform-specific, and feature-specific configuration modes.
To exit from any configuration mode, use one of the following commands:
Command | Purpose | Example | ||
---|---|---|---|---|
exit |
Exits from the current configuration command mode and returns to the previous configuration command mode. |
vsg(config-rule)# exitvsg(config)# |
||
end |
Exits from the configuration command mode and returns to EXEC mode. |
vsg(config)# endvsg# |
||
Ctrl-Z |
Exits the current configuration command mode and returns to EXEC mode.
|
vsg(config)# ^z vsg# |
Mode | Access Method | Prompt | Exit Method |
---|---|---|---|
EXEC |
From the login prompt, enter your username and password. |
VSG# |
To exit to the login prompt, use the exit command. |
Global configuration |
From EXEC mode, enter the configure command. |
VSG (config)# |
To exit to EXEC mode, use the end or exit command or press Ctrl-Z. |
Zone configuration |
From global configuration mode, enter the zone zone-name command. |
VSG (config-zone)# |
To exit to global configuration mode, use the exit command. To exit to EXEC mode, use the end command or press Ctrl-Z. |
data0 interface configuration |
From global configuration mode, enter the interface data0 command. |
VSG (config-if)# |
To exit to global configuration mode, use the exit command. To exit to EXEC mode, use the end command or press Ctrl-Z. |
Saving CLI Configuration Changes
The running configuration is the configuration that is currently running on the device. It includes configuration changes from commands entered since the last time the device was restarted. If the device is restarted, the running configuration is replaced with a copy of the startup configuration. Any changes that were made to the running configuration but were not copied to the startup configuration are discarded.
The startup configuration is the configuration that is saved and that will be used by the device when you restart it. When you make configuration changes to the device, they are automatically saved in the running configuration. If you want configuration changes saved permanently, you must copy them to the startup configuration so that they are preserved when the device is rebooted or restarted.
To copy changes you have made to the running configuration into the startup configuration so that they are saved persistently through reboots and restarts, use the following command:
vsg(config)#copy running-config startup-config
The following table lists the characters that have special meaning in text strings and should be used only in regular expressions or other special contexts.
Character | Description |
---|---|
| | Vertical bar |
< > | Less than or greater than |
The following lists command key combinations that can be used in both EXEC and configuration modes.
Key(s) | Description |
---|---|
Ctrl-A |
Moves the cursor to the beginning of the line. |
Ctrl-B |
Moves the cursor one character to the left. When you enter a command that extends beyond a single line, you can press the Left Arrow or Ctrl-B keys repeatedly to scroll back toward the system prompt and verify the beginning of the command entry, or you can press the Ctrl-A key combination. |
Ctrl-C |
Cancels the command and returns to the command prompt. |
Ctrl-D |
Deletes the character at the cursor. |
Ctrl-E |
Moves the cursor to the end of the line. |
Ctrl-F |
Moves the cursor one character to the right. |
Ctrl-G |
Exits to the previous command mode without removing the command string. |
Ctrl-K |
Deletes all characters from the cursor to the end of the command line. |
Ctrl-L |
Redisplays the current command line. |
Ctrl-R |
Redisplays the current command line. |
Ctrl-T |
Transposes the character to the left of the cursor with the character located to the right of the cursor. |
Ctrl-U |
Deletes all characters from the cursor to the beginning of the command line. |
Ctrl-W |
Deletes the word to the left of the cursor. |
Ctrl-X, H |
Lists history. When using this key combination, press and release the Ctrl and X keys together before pressing H. |
Ctrl-Y |
Recalls the most recent entry in the buffer (press keys simultaneously). |
Ctrl-Z |
Ends a configuration session, and returns you to EXEC mode. When used at the end of a command line in which a valid command has been typed, the resulting configuration is first added to the running configuration file. |
UP arrow key |
Displays the previous command in the command history. |
Down arrow key |
Displays the next command in the command history. |
Right arrow key and Left arrow key |
Moves your cursor through the command history directionally to locate a command string. |
? |
Displays a list of available commands. |
Tab |
Completes the word for you after you enter the first characters of the word and then press the Tab key. All options that match are presented. This example shows how to use the tab keystroke: firewall(config)# xm<Tab> firewall(config)# xml <Tab> firewall(config)# xml server This example shows how to use the tab keystroke: firewall(config)# ns<Tab> nsc-policy-agent vns-binding firewall(config)# security-pr<Tab> firewall(config)# security-profile |
You can abbreviate commands and keywords by entering the first few characters of a command. The abbreviation must include enough characters to make it unique from other commands or keywords. If you are having trouble entering a command, check the system prompt and enter the question mark (?) for a list of available commands. You might be in the wrong command mode or using incorrect syntax.
The following table lists examples of command abbreviations.
Command | Abbreviation |
---|---|
configure |
conf |
show running-config |
sho run |
Almost every configuration command has a no form that can be used to disable a feature or function. For example, to remove a VLAN, use the no vlan command. To reenable it, use the vlan command form.
For example, if you use the boot command in global configuration mode, you can then use the no boot command to undo the results:
vsg(config)# boot system bootflash: svs1.bin vsg(config)# no boot system bootflash: svs1.bin
The CLI provides the following help features.
Feature | Description |
---|---|
? |
Type the question mark (?) to list the valid input options. |
^ |
The CLI prints the caret (^) symbol below a line of syntax to point to an input error in the command string, keyword, or argument. |
UP arrow key |
Use the UP arrow to have the CLI display the previous command you entered so that you can correct an error. |
The following table describes the commands for syntax error isolation and context-sensitive help.
Command | Purpose |
---|---|
show interface ? |
Displays the optional parameters used with the show interface command in EXEC mode. |
show interface module ? |
Displays an invalid command error message and points (^) to the syntax error. |
Ctrl-P or the Up Arrow |
Displays the previous command you entered so that you can correct the error. |
show interface data ? |
Displays the syntax for showing a data interface (data0). |
show interface data0 |
Displays the data interface (data0). |
This example shows how to use syntax error isolation and context-sensitive help.
firewall-40# show interface data 0 data0 Link encap:Ethernet HWaddr 3a:00:02:00:00:0a inet addr:70.10.10.10 Bcast:70.10.10.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1352 Metric:1 RX packets:2258 errors:0 dropped:0 overruns:0 frame:0 TX packets:2255 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:165730 (165.7 KB) TX bytes:211984 (211.9 KB) firewall-40#