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 describes the Cisco Nexus Virtual Services Appliance commands that begin with the letter C.
To change to a different directory from the one you are currently working in, use the cd command.
cd [filesystem:[//directory] | directory]
filesystem: |
(Optional) Name of the file system. Valid file systems are bootflash and volatile. |
//directory |
(Optional) Name of the directory. The directory name is case sensitive. |
bootflash
Any command mode
network-admin
|
|
---|---|
4.0(4)SP1(1) |
This command was introduced. |
You can only change to the directories that are on the active VSM.
Use the present working directory (pwd) command to verify the name of the directory you are currently working in.
This example shows how to change to a different directory on the current file system:
n1010# cd my-scripts
This example shows how to change from the file system you are currently working in to a different file system:
n1010# cd volatile:
This example shows how to revert back to the default directory, bootflash:
n1010# cd
|
|
---|---|
pwd |
Displays the name of the directory you are currently working in. |
To specify the Cisco Discovery Protocol (CDP) version to advertise, use the cdp advertise command. To remove the cdp advertise configuration, use the no form of this command.
cdp advertise {v1 | v2}
no cdp advertise [v1 | v2]
v1 |
CDP Version 1. |
v2 |
CDP Version 2. |
CDP Version 2
Global configuration (config)
network-admin
|
|
4.0(4)SP1(1) |
This command was introduced. |
This example shows how to set CDP Version 1 as the version to advertise:
n1010(
config)#
cdp advertise v1
This example shows how to remove CDP Version 1 as the configuration to advertise:
n1010(
config)#
no cdp advertise v1
|
|
---|---|
show cdp |
Displays the CDP configuration. |
To enable the Cisco Discovery Protocol (CDP) globally on all interfaces and port channels, use the cdp enable command. To disable CDP globally, use the no form of this command.
cdp enable
no cdp enable
This command has no arguments or keywords.
Enabled on all interfaces and port channels
Global configuration (config)
network-admin
|
|
4.0(4)SP1(1) |
This command was introduced. |
CDP can only be configured on physical interfaces and port channels.
This example shows how to enable CDP globally and then show the CDP configuration:
n1010# configure terminal
n1010(config)# cdp enable
n1010(config)# show cdp global
Global CDP information:
CDP enabled globally
Refresh time is 60 seconds
Hold time is 180 seconds
CDPv2 advertisements is enabled
DeviceID TLV in System-Name(Default) Format
This example shows how to disable CDP globally and then show the CDP configuration:
n1010(
config)#
no cdp enable
n1010# show cdp global
Global CDP information:
CDP disabled globally
Refresh time is 60 seconds
Hold time is 180 seconds
CDPv2 advertisements is enabled
DeviceID TLV in System-Name(Default) Format
n1010(config)#
|
|
---|---|
cdp enable (interface or port channel) |
Enables CDP on an interface or port channel. |
show cdp |
Displays the CDP configuration. |
To enable the Cisco Discovery Protocol (CDP) on an interface or port channel, use the cdp enable command. To disable it, use the no form of this command.
cdp enable
no cdp enable
This command has no arguments or keywords.
None
Interface configuration (config-if)
network-admin
|
|
4.0(4)SP1(1) |
This command was introduced. |
CDP can only be configured on physical interfaces and port channels.
This example shows how to enable CDP on port channel 2:
n1010# configure terminal
n1010(config)# interface port-channel2
n1010(config-if)# cdp enable
n1010(config-if)#
This example shows how to disable CDP on mgmt0:
n1010# configure terminal
n1010(config)# interface mgmt0
n1010(config-if)# no cdp enable
n1010(config-if)# show cdp interface mgmt0
mgmt0 is up
CDP disabled on interface
Sending CDP packets every 60 seconds
Holdtime is 180 seconds
n1010(config-if)#
To specify the device ID format for Cisco Discovery Protocol (CDP), use the cdp format device-id command. To remove it, use the no form of this command.
cdp format device-id {mac-address | serial-number | system-name}
no cdp format device-id {mac-address | serial-number | system-name}
mac-address |
Specifies the MAC address of the Chassis. |
serial-number |
Specifies the Chassis serial number. |
system-name |
Specifies the System name/Fully Qualified Domain Name (default). |
System name/Fully Qualified Domain Name
Global configuration (config)
network-admin
|
|
4.0(4)SP1(1) |
This command was introduced. |
CDP must be enabled globally before you configure the device ID format.
You can configure CDP on physical interfaces and port channels only.
This example shows how to configure the CDP device ID with the MAC address format and then display the configuration:
n1010(
config)#
cdp format device-id mac-address
n1010
(config)# show cdp global
Global CDP information:
CDP enabled globally
Sending CDP packets every 5 seconds
Sending a holdtime value of 10 seconds
Sending CDPv2 advertisements is disabled
Sending DeviceID TLV in Mac Address Format
This example shows how to remove the CDP device ID MAC address format from the configuration:
n1010(
config)#
no cdp format device-id mac-address
To set the maximum amount of time that Cisco Discovery Protocol (CDP) holds onto neighbor information before discarding it, use the cdp holdtime command. To remove the CDP holdtime configuration, use the no form of this command.
cdp holdtime seconds
no cdp holdtime seconds
seconds |
Maximum time that CDP holds on to neighbor information. The range is from 10 to 255 seconds. |
180 seconds
Global configuration (config)
network-admin
|
|
4.0(4)SP1(1) |
This command was introduced. |
CDP must be enabled globally before you configure the device ID format.
You can configure CDP on physical interfaces and port channels only.
This example shows how to set the CDP holdtime to 10 second:
n1010(
config)#
cdp holdtime 10
This example shows how to remove the CDP holdtime configuration:
n1010(
config)#
no cdp holdtime 10
|
|
---|---|
show cdp |
Displays the CDP configuration. |
show cdp neighbors |
Displays the upstream device from your device. |
To set the refresh time for Cisco Discovery Protocol (CDP) to send advertisements to neighbors, use the cdp timer command. To remove the CDP timer configuration, use the no form of this command.
cdp timer seconds
no cdp timer seconds
seconds |
Time before CDP sends advertisements to neighbors. The range is from 5 to 254 seconds. |
60 seconds
Global configuration (config)
network-admin
|
|
4.0(4)SP1(1) |
This command was introduced. |
This example shows how to configure the CDP timer to 10 seconds:
n1010(
config)#
cdp timer 10
This example shows how to remove the CDP timer configuration:
n1010(
config)#
no cdp timer 10
|
|
---|---|
show cdp |
Displays the CDP configuration. |
show cdp neighbors |
Displays the upstream device from your device. |
To move an interface from one port channel group to another, use the channel-group command. To remove the interface, use the no form of this command.
channel-group id mode {ha | active}
no channel-group [id]
id |
Specifies the port channel id of the interface. The valid port channel ID range is 1-6. |
mode |
Specifies the port channel mode of the interface. The mode can be either HA or Active. |
None
Interface Configuration (config-if)
network-admin
|
|
4.2(1)SP1(4) |
This command was introduced. |
This example shows how to add an interface to channel group 1 in active mode:
n1010# configure terminal
n1010(config)# interface GigabitEthernet4
n1010(config-if)# channel-group 1 mode active
n1010(config-if)#
|
|
---|---|
show network port-channel summary |
Displays summary information on the port channel. |
To check the compactFlash, use the check logflash command.
check logflash [bad-blocks]
bad-blocks |
(Optional) Finds bad blocks in compactFlash. |
None
Any command mode
network-admin
|
|
4.0(4)SP1(1) |
This command was introduced. |
This example shows how to check compactFlash:
n1010# check logflash
To clear the accounting log, use the clear accounting log command.
clear accounting log
This command has no arguments or keywords.
None
Any command mode
network-admin
|
|
4.0(4)SP1(1) |
This command was introduced. |
This example shows how to clear the accounting log:
n1010# clear accounting log
|
|
---|---|
show accounting log |
Displays the accounting log contents. |
To clear the Cisco Discovery Protocol (CDP) information on an interface, use the clear cdp command.
clear cdp {counters [interface slot/port] | table [interface slot/port]}
None
Any command mode
network-admin
network-operator
|
|
4.0(4)SP1(1) |
This command was introduced. |
This example shows how to clear CDP counters on all interfaces:
n1010#
clear cdp counters
This example shows how to clear the CDP cache on all interfaces:
n1010#
clear cdp table
|
|
---|---|
show cdp |
Displays the CDP configuration. |
show cdp neighbor |
Displays the CDP configuration. |
To clear the history of commands you have entered into the CLI, use the clear cli history command.
clear cli history
This command has no arguments or keywords.
None
Any command mode
network-admin
|
|
---|---|
4.0(4)SP1(1) |
This command was introduced. |
Use the show cli history command to display the history of the commands that you entered at the CLI.
This example shows how to clear the command history:
n1010# clear cli history
|
|
---|---|
show cli history |
Displays the command history. |
To clear the core files, use the clear cores command.
clear cores [archive]
archive |
(Optional) Clears the core file on the logflash file system. |
None
Any command mode
network-admin
|
|
---|---|
4.0(4)SP1(1) |
This command was introduced. |
Use the show system cores command to display information about the core files.
This example shows how to clear the core file:
n1010# clear cores
This example shows how to clear the core on the logflash file system:
n1010# clear cores archive
|
|
---|---|
check logflash |
Checks the compactFlash. |
To clear interface counters, use the clear counters command.
clear counters [interface {all | ethernet slot/port | loopback virtual-interface-number | mgmt | port-channel port-channel-number | vethernet interface-number}]
None
Any command mode
network-admin
network-operator
|
|
4.0(4)SP1(1) |
This command was introduced. |
This example shows how to clear the Ethernet interface counters:
n1010(
config)#
clear counters ethernet 2/1
|
|
---|---|
show interface counters |
Displays the interface status, which includes the counters. |
To clear the contents of the debug logfile, use the clear debug-logfile command.
clear debug-logfile filename
filename |
Name of the debug logfile to clear. |
None
Any command mode
network-admin
|
|
---|---|
4.0(4)SP1(1) |
This command was introduced. |
This example shows how to clear the debug logfile:
n1010# clear debug-logfile syslogd_debugs
|
|
---|---|
debug logfile |
Configures a debug logging file. |
debug logging |
Enable debug logging. |
show debug logfile |
Displays the contents of the debug logfile. |
To end a session on a specified virtual tty (vty), use the clear line command.
clear line word
word |
vty name. |
None
Any command mode
network-admin
network-operator
|
|
4.0(4)SP1(1) |
This command was introduced. |
This example shows how to end a session on a specified vty:
n1010(
config)#
clear line
|
|
---|---|
show users |
Displays active user sessions. |
To clear messages from the logging file, use the clear logging logfile command.
clear logging logfile
This command has no arguments or keywords.
None
Any command mode
Super user
|
|
4.0(4)SP1(1) |
This command was introduced. |
This example shows how to clear messages from the logging file:
n1010# clear logging logfile
n1010#
|
|
---|---|
show logging logfile |
Displays the logs in the local log file. |
To clear the current logging session, use the clear logging session command.
clear logging session
This command has no arguments or keywords.
None
Any command mode
Super user
|
|
4.0(4)SP1(1) |
This command was introduced. |
This example shows how to clear the current logging session:
n1010# clear logging session
n1010#
To clear the Network Time Protocol (NTP) statistics, use the clear ntp statistics command.
clear ntp statistics {all-peers | io | local | memory}
all-peers |
Clears statistics for all NTP peers. |
io |
Clears IO statistics. |
local |
Clears local statistics. |
memory |
Clears memory statistics. |
None
Any command mode
network-admin
network-operator
|
|
4.0(4)SP1(1) |
This command was introduced. |
This example shows how to clear statistics for all NTP peers:
n1010(
config)#
clear ntp statistics all-peers
|
|
---|---|
show ntp peers |
Displays information about NTP peers. |
To clear the Secure Shell (SSH) host sessions, use the clear ssh hosts command.
clear ssh hosts
This command has no arguments or keywords.
None
Any command mode
network-admin
|
|
4.0(4)SP1(1) |
This command was introduced. |
This example shows how to clear all SSH host sessions:
n1010# clear ssh hosts
|
|
---|---|
ssh server enable |
Enables the SSH server. |
To clear the switch reset-reason history, use the clear system reset-reason command.
clear system reset-reason
This command has no arguments or keywords.
None
Any command mode
network-admin
|
|
---|---|
4.0(4)SP1(1) |
This command was introduced. |
This example shows how to clear the reset-reason history for the switch:
n1010# clear system reset-reason
|
|
---|---|
show system resources |
Displays system-related CPU and memory statistics. |
To clear a user session, use the clear user command.
clear user user-id
user-id |
User identifier. |
None
Any command mode
network-admin
|
|
4.0(4)SP1(1) |
This command was introduced. |
Use the show users command to display the current user sessions on the switch.
This example shows how to clear all SSH host sessions:
n1010# clear user user1
|
|
---|---|
show users |
Displays the user session information. |
To define a CLI variable for a terminal session, use the cli var name command. To remove the CLI variable, use the no form of this command.
cli var name variable-name variable-text
cli no var name variable-name
None
Any command mode
network-admin
|
|
---|---|
4.0(4)SP1(1) |
This command was introduced. |
You can reference a CLI variable using the following syntax:
$(variable-name)
Instances where you can use variables in include the following:
•Command scripts
•Filenames
You cannot reference a variable in the definition of another variable.
You can use the predefined variable, TIMESTAMP, to insert the time of day. You cannot change or remove the TIMESTAMP CLI variable.
You must remove a CLI variable before you can change its definition.
This example shows how to define a CLI variable:
n1010# cli var name testinterface interface 2/3
This example shows how to reference the TIMESTAMP variable:
n1010# copy running-config > bootflash:run-config-$(TIMESTAMP).cnfg
This example shows how to remove a CLI variable:
n1010# cli no var name testinterface interface 2/3
|
|
---|---|
show cli variables |
Displays the CLI variables. |
To manually set the clock, use the clock set command.
clock set time day month year
None
Any command mode
network-admin
|
|
---|---|
4.0(4)SP1(1) |
This command was introduced. |
Use the clock set command when you cannot synchronize your device with an outside clock source, such as NTP.
This example shows how to manually set the clock:
n1010# clock set 9:00:00 1 June 2008
|
|
---|---|
clock summer-time |
Configures the summer-time (daylight saving time) offset. |
clock timezone |
Configures the time zone offset from Coordinated Universal Time (UTC). |
To configure the summer-time (daylight saving time) offset, use the clock summer-time command. To revert to the default, use the no form of this command.
clock summer-time zone-name start-week start-day start-month start-time end-week end-day end-month end-time offset-minutes
no clock summer-time
None
Global configuration (config)
network-admin
|
|
---|---|
4.0(4)SP1(1) |
This command was introduced. |
This example shows how to configure the offset for summer-time or daylight saving time:
n1010# configure terminal
n1010(config)# clock summer-time PDT 1 Sunday March 02:00 1 Sunday November 02:00 60
This example shows how to remove the summer-time offset:
n1010# configure terminal
n1010(config)# no clock summer-time
|
|
---|---|
clock set |
Sets the clock, manually. |
clock timezone |
Configures the time zone offset from Coordinated Universal Time (UTC). |
To configure the time zone offset from Coordinated Universal Time (UTC), use the clock timezone command. To revert to the default, use the no form of this command.
clock timezone zone-name offset-hours offset-minutes
no clock timezone
None
Any command mode
network-admin
|
|
---|---|
4.0(4)SP1(1) |
This command was introduced. |
This example shows how to configure the time zone offset from UTC:
n1010# clock timezone EST 5 0
This example shows how to remove the time zone offset:
n1010# no clock timezone
|
|
---|---|
clock set |
Sets the clock, manually. |
clock summer-time |
Configures the summer-time (daylight saving time) offset. |
To enter global configuration mode, use the configure terminal command.
configure terminal
This command has no arguments or keywords
None
Any command mode
network-admin
|
|
4.0(4)SP1(1) |
This command was introduced. |
The configuration changes you make in the Global configuration mode are saved in the running configuration file. To save these changes persistently across reboots and restarts, you must copy them to the startup configuration file using the copy running-config startup-config command.
This example shows how to enter global configuration mode:
n1010#
configure terminal
n1010(
config)#
|
|
---|---|
copy running-config startup-config |
Copies the running configuration to the startup configuration. |
exit |
Exits a configuration mode. |
To modify the default control traffic interface name in the flexible network uplink type, use the control uplink command.
control uplink interface name
interface name |
The name of the control uplink interface. Interface names can be GigabitEthernet interfaces or Portchannel interfaces. |
None
SVS domain configuration (config-svs-domain)
network-admin
|
|
4.2(1)SP1(4) |
This command was introduced. |
This example shows how to modify the control traffic interface name:
n1010#
configure terminal
n1010(
config)#
svs-domain
n1010(config-svs-domain)# control uplink GigabitEthernet1
n1010(config-svs-domain)#
|
|
---|---|
network uplink type |
Modifies the network uplink type. |
show network-uplink type |
Displays the uplink configuration. |
To modify the VLAN ID of the Virtual Supervisor Module (VSM) domain control VLAN, use the control vlan command.
control vlan vlan-id
vlan-id |
Number that identifies the VSM domain control VLAN. The range is from 1 to 3967 and 4048 to 4093. |
None
SVS domain configuration (config-svs-domain)
network-admin
|
|
4.0(4)SP1(1) |
This command was introduced. |
This example shows how to modify the VLAN ID of the VSM domain control VLAN to be 1116:
n1010#
configure terminal
n1010(
config)#
svs-domain
n1010(config-svs-domain)#
control vlan 1116
To copy a file from a source to a destination, use the copy command.
copy source-url destination-url
The format of the source and destination URLs varies according to the file or directory location. You may enter either a CLI variable for a directory or a filename that follows the Cisco NX-OS file system syntax (filesystem:[/directory][/filename]).
The following tables list URL prefix keywords by the file system type. If you do not specify a URL prefix keyword, the device looks for the file in the current directory.
Table 1 lists URL prefix keywords for bootflash and remote writable storage file systems.
Table 2 lists the URL prefix keywords for nonwritable file systems.
The default name for the destination file is the source filename.
Any command mode
network-admin
|
|
---|---|
4.0(4)SP1(1) |
This command was introduced. |
The entire copying process may take several minutes, depending on the network conditions and the size of the file, and differs from protocol to protocol and from network to network.
The colon character (:) is required after the file system URL prefix keywords (such as bootflash).
In the URL syntax for ftp:, scp:, sftp:, and tftp:, the server is either an IP address or a hostname.
This example shows how to copy a file within the same directory:
n1010# copy file1 file2
This example shows how to copy a file to another directory:
n1010# copy file1 my_files:file2
This example shows how to copy a file to another VSM:
n1010# copy file1 bootflash://sup-remote/file1.bak
This example shows how to copy a file from a remote server:
n1010# copy scp://10.10.1.1/image-file.bin bootflash:image-file.bin
To copy the running configuration to the startup configuration, use the copy running-configuration startup-configuration command.
copy running-configuration startup-configuration
This command has no arguments or keywords
None
Any command mode
network-admin
|
|
4.0(4)SP1(1) |
This command was introduced. |
Use the copy running-configuration startup-configuration command to save configuration changes in the running configuration to the startup configuration in persistent memory. When a device reload or switchover occurs, the saved configuration is applied.
This example shows how to copy the running configuration to the startup configuration:
n1010# copy running-config startup-config
[########################################] 100%
Note This example also shows how to use a shortened version of the copy running-configuration startup-configuration command