C Commands

This chapter describes the Cisco NX-OS Ethernet and virtual Ethernet commands that begin with C.

capability (virtual Ethernet interface)

To set a profile capability for a virtual Ethernet interface, use the capability command. To remove the profile capability of an interface, use the no form of this command.

profile capability iscsi-multipath

no profile capability iscsi-multipath

 
Syntax Description

iscsi-multipath

Configure an iSCSI multipath profile.

 
Command Default

None

 
Command Modes

Virtual Ethernet interface configuration mode

 
Command History

Release
Modification

5.1(3)N1(1)

This command was introduced.

Examples

This example shows how to set the profile capability for a specific virtual Ethernet interface:

switch# configure terminal
switch(config)# interface vethernet 1
switch(config-if)# capability iscsi-multipath
switch(config-if)#
 

 
Related Commands

Command
Description

interface vethernet

Configures a virtual Ethernet interface.

show interface vethernet

Displays the specified virtual Ethernet interface, attributes, and status.

show running-config interface

Displays the running configuration of an interface.

 

carrier-delay

To set the carrier delay on a serial interface, use the carrier-delay command. To return to the default carrier delay value, use the no form of this command.

carrier-delay { delay-seconds | msec milliseconds }

no carrier-delay

 
Syntax Description

delay-seconds

Time, in seconds, to wait for the system to change states. Enter an integer in the range 0 to 60.

msec

Specifies the delay time in milliseconds.

milliseconds

Time, in milliseconds, to wait for the system to change states. Enter an integer in the range 0 to 1000.

 
Command Default

None

 
Command Modes

Interface configuration mode

 
Command History

Release
Modification

5.1(3)N1(1)

This command was introduced.

 
Usage Guidelines

You can use this command on a VLAN interface.

If a link goes down and comes back up before the carrier delay timer expires, the down state is effectively filtered, and the rest of the software on the switch is not aware that a link-down event occurred. Therefore, a large carrier delay timer results in fewer link-up/link-down events being detected. Setting the carrier delay time to 0 means that every link-up/link-down event is detected.

This command does not require a license.

Examples

This example shows how to change the carrier delay to 10 seconds:

switch# configure terminal
switch(config)# interface vlan 5
switch(config-if)# carrier-delay 10
switch(config-if)#
 

This example shows how to revert to the default carrier delay value:

switch# configure terminal
switch(config)# interface vlan 5
switch(config-if)# no carrier-delay
switch(config-if)#
 

 
Related Commands

Command
Description

show running-config interface

Displays the running configuration information for an interface.

 

cdp

To enable the Cisco Discovery Protocol (CDP) and configure CDP attributes, use the cdp command. To disable CDP or reset CDP attributes, use the no form of this command.

cdp { advertise { v1 | v2 } | enable | format device-id { mac-address | serial-number | system-name } | holdtime seconds | timer seconds }

no cdp { advertise | enable | format device-id { mac-address | serial-number | system-name } | holdtime seconds | timer seconds }

 
Syntax Description

advertise { v1 | v2 }

Configures the version to use to send CDP advertisements. Version-2 is the default state.

enable

Enables CDP for all Ethernet interfaces.

format device-id

Configures the format of the CDP device ID.

mac-address

Uses the MAC address as the CDP device ID.

serial-number

Uses the serial number as the CDP device ID.

system-name

Uses the system name, which can be expressed as a fully qualified domain name, as the CDP device ID. This is the default.

holdtime seconds

Specifies the amount of time a receiver should hold CDP information before discarding it. The range is from 10 to 255 seconds; the default is 180 seconds.

timer seconds

Sets the transmission frequency of CDP updates in seconds. The range is from 5 to 254; the default is 60 seconds.

 
Command Default

None

 
Command Modes

Global configuration mode

 
Command History

Release
Modification

4.0(0)N1(1a)

This command was introduced.

Examples

This example shows how to enable CDP on all Ethernet interfaces:

switch# configure terminal
switch(config)# cdp enable
 

This example shows how to configure the MAC address as the CDP device ID:

switch# configure terminal
switch(config)# cdp format device-id mac-address
 

This example shows how to disable CDP on all Ethernet interfaces:

switch# configure terminal
switch(config)# no cdp enable

 
Related Commands

Command
Description

show cdp

Displays Cisco Discovery Protocol (CDP) information.

 

cdp enable

To enable the Cisco Discovery Protocol (CDP) on an interface, use the cdp enable command. To disable CDP on the interface, use the no form of this command.

cdp enable

no cdp enable

 
Syntax Description

This command has no arguments or keywords.

 
Command Default

None

 
Command Modes

Interface configuration mode
Virtual Ethernet interface configuration mode

 
Command History

Release
Modification

4.0(0)N1(1a)

This command was introduced.

5.1(3)N1(1)

Support was added for virtual Ethernet (vEth) interfaces.

 
Usage Guidelines

You can use this command on the following interfaces:

  • Ethernet interface
  • Management interface
  • Virtual Ethernet interface

Examples

This example shows how to enable CDP on an Ethernet interface:

switch# configure terminal
switch(config)# interface ethernet 1/1
switch(config-if)# cdp enable
 

This example shows how to enable CDP on a specific virtual Ethernet interface:

switch# configure terminal
switch(config)# interface vethernet 1
switch(config-if)# cdp enable
 

This example shows how to disable CDP on a specific virtual Ethernet interface:

switch# configure terminal
switch(config)# interface vethernet 1
switch(config-if)# no cdp enable
 

 
Related Commands

Command
Description

show cdp

Displays Cisco Discovery Protocol (CDP) information.

show interface

Displays the interface configuration information.

 

channel-group (Ethernet)

To assign and configure a physical interface to an EtherChannel, use the channel-group command. To remove the channel group configuration from the interface, use the no form of this command.

channel-group number [ force ] [ mode { active | on | passive }]

no channel-group [ number ]

 
Syntax Description

number

Number of channel group. The number range is from 1 to 4096. Cisco NX-OS creates the EtherChannel associated with this channel group if the EtherChannel does not already exist.

force

(Optional) Specifies that the LAN port be forcefully added to the channel group.

mode

(Optional) Specifies the EtherChannel mode of the interface.

active

Specifies that when you enable the Link Aggregation Control Protocol (LACP), this command enables LACP on the specified interface. The interface is in an active negotiating state, in which the port initiates negotiations with other ports by sending LACP packets.

on

This is the default channel mode. Specifies that all EtherChannels that are not running LACP remain in this mode. If you attempt to change the channel mode to active or passive before enabling LACP, the switch returns an error message.

After you enable LACP globally, by using the feature lacp command, you enable LACP on each channel by configuring the channel mode as either active or passive. An interface in this mode does not initiate or respond to LACP packets. When an LACP attempts to negotiate with an interface in the on state, it does not receive any LACP packets and becomes an individual link with that interface; it does not join the channel group.

The default mode is on.

passive

Specifies that when you enable LACP, this command enables LACP only if an LACP device is detected. The interface is in a passive negotiation state, in which the port responds to LACP packets that it receives but does not initiate LACP negotiation.

 
Command Default

None

 
Command Modes

Interface configuration mode

 
Command History

Release
Modification

4.0(0)N1(1a)

This command was introduced.

5.0(2)N2(1)

The force keyword was added.

 
Usage Guidelines

Use this command to create a channel group that includes the interface that you are working on and to add or remove specific interfaces from the channel group. Use this command to move a port from one channel group to another. You enter the channel group that you want the port to move to; the switch automatically removes the specified port from its present channel group and adds it to the specified channel group.

Use the force keyword to force the addition of the interface into the specified channel group.

After you enable LACP globally, by using the feature lacp command, you enable LACP on each channel by configuring the channel mode as either active or passive. An EtherChannel in the on channel mode is a pure EtherChannel and can aggregate a maximum of eight ports. The EtherChannel does not run LACP.

You cannot change the mode for an existing EtherChannel or any of its interfaces if that EtherChannel is not running LACP; the channel mode remains as on. The system returns an error message if you attempt to change the mode.

Use the no form of this command to remove the physical interface from the EtherChannel. When you delete the last physical interface from an EtherChannel, the EtherChannel remains. To delete the EtherChannel completely, use the no form of the interface port-channel command.

The compatibility check includes the following operational attributes:

  • Port mode
  • Access VLAN
  • Trunk native VLAN
  • Tagged or untagged
  • Allowed VLAN list
  • Switched Port Analyzer (SPAN) (cannot be SPAN source or destination port)
  • Storm control

Use the show port-channel compatibility-parameters command to see the full list of compatibility checks that Cisco NX-OS uses.

You can only add interfaces configured with the channel mode set to on for static EtherChannels, that is, without a configured aggregation protocol. You can only add interfaces configured with the channel mode as active or passive to EtherChannels that are running LACP.

You can configure these attributes on an individual member port. If you configure a member port with an incompatible attribute, Cisco NX-OS suspends that port in the EtherChannel.

When the interface joins an EtherChannel, some of its individual parameters are overridden with the values on the EtherChannel, as follows:

  • MAC address
  • Spanning Tree Protocol (STP)
  • Service policy
  • Quality of service (QoS)
  • Access control lists (ACLs)

Interface parameters, such as the following, remain unaffected when the interface joins or leaves a EtherChannel:

  • Description
  • Cisco Discovery Protocol (CDP)
  • LACP port priority
  • Debounce
  • Rate mode
  • Shutdown
  • SNMP trap

If interfaces are configured for the EtherChannel interface and a member port is removed from the EtherChannel, the configuration of the EtherChannel interface is not propagated to the member ports.

Any configuration changes that you make in any of the compatibility parameters to the EtherChannel interface are propagated to all interfaces within the same channel group as the EtherChannel (for example, configuration changes are also propagated to the physical interfaces that are not part of the EtherChannel but are part of the channel group).

Examples

This example shows how to add an interface to LACP channel group 5 in active mode:

switch(config)# interface ethernet 1/1
switch(config-if)# channel-group 5 mode active
switch(config-if)#
 

This example shows how to forcefully add an interface to the channel group 5:

switch(config)# interface ethernet 1/1
switch(config-if)# channel-group 5 force
switch(config-if)#
 

 
Related Commands

Command
Description

show interface port-channel

Displays information about the traffic on the specified EtherChannel interface.

show lacp

Displays LACP information.

show port-channel summary

Displays information on the EtherChannels.

 

clear lacp counters

To clear the Link Aggregation Control Protocol (LACP) counters, use the clear lacp counters command.

clear lacp counters [ interface port-channel channel-num ]

 
Syntax Description

interface

(Optional) Clears the LACP counters of a specific interface.

port-channel channel-num

(Optional) Specifies a port channel interface. The range is from 1 to 4096.

 
Command Default

None

 
Command Modes

EXEC mode

 
Command History

Release
Modification

4.0(0)N1(1a)

This command was introduced.

 
Usage Guidelines

This command does not require a license.

Examples

This example shows how to clear all LACP counters:

switch# clear lacp counters
 

This example shows how to clear the LACP on a port channel:

switch# clear lacp counters interface port-channel 100
 

 
Related Commands

Command
Description

show lacp

Displays LACP information.

 

clear mac access-list counters

To clear statistical information from the access list, use the clear mac access-list counters command.

clear mac access-list counters [ name ]

 
Syntax Description

name

(Optional) Name of a specific counter to clear. The name can be a maximum of 64 characters.

 
Command Default

None

 
Command Modes

EXEC mode

 
Command History

Release
Modification

4.0(0)N1(1a)

This command was introduced.

Examples

This example shows how to clear statistical information from the access list:

switch# clear mac access-list counters
 

 
Related Commands

Command
Description

show mac access-lists

Displays the information about the MAC address table.

clear mac address-table dynamic

To clear the dynamic address entries from the MAC address table, use the clear mac address-table dynamic command.

clear mac address-table dynamic [[ address mac-addr ] | [ interface { ethernet slot / port | port-channel number }]] [ vlan vlan-id ]

 
Syntax Description

address mac-addr

(Optional) Specifies the MAC address to remove from the table. Use the format EEEE.EEEE.EEEE.

interface

(Optional) Specifies the interface for which MAC addresses should be removed from the table. T he type can be either Ethernet or EtherChannel.

ethernet slot / port

(Optional) Specifies the Ethernet interface and the slot number and port number. The slot number is from 1 to 255, and the port number is from 1 to 128.

port-channel number

(Optional) Specifies the EtherChannel for which MAC addresses should be removed from the table. Use the EtherChannel number. The number range is from 1 to 4096.

vlan vlan-id

(Optional) Specifies the VLAN from which MAC addresses should be removed from the table. The range is from 1 to 3967 and from 4049 to 4093.

 
Command Default

None

 
Command Modes

EXEC mode

 
Command History

Release
Modification

4.0(0)N1(1a)

This command was introduced.

4.2(1)N1(1)

The command syntax is changed to clear mac address-table dynamic.

 
Usage Guidelines

Use the clear mac address-table dynamic command with no arguments to remove all dynamic entries from the table.

To clear static MAC addresses from the table, use the no mac address-table static command.

If the clear mac address-table dynamic command is entered with no options, all dynamic addresses are removed. If you specify an address but do not specify an interface, the address is deleted from all interfaces. If you specify an interface but do not specify an address, the switch removes all addresses on the specified interfaces.

Examples

This example shows how to clear all the dynamic entries from the MAC address table:

switch# clear mac address-table dynamic
 

This example shows how to clear all the dynamic entries from the MAC address table for VLAN 2:

switch# clear mac address-table dynamic vlan 2
 

 
Related Commands

Command
Description

show mac address-table

Displays the information about the MAC address table.

 

clear port-security dynamic

To clear port security information, use the clear port-security dynamic command.

clear port-security dynamic { address MAC-addr vlan vlan-ID | interface { ethernet slot / port [ vlan vlan-ID ] | port-channel channel-num [ vlan vlan-ID ]}}

 
Syntax Description

address MAC-addr

Clears all dynamically secured MAC address information. The MAC address can be in the format E. E. E.

vlan vlan-ID

Clears all dynamically secured VLAN information. The range is from 1 to 4094.

interface

Clears all dynamically secured addresses on a port.

ethernet slot / port

Clears all dynamically secured addresses from an Ethernet port. The slot number is from 1 to 255 and the port number is form 1 to 128.

port-channel channel-num

Clears all dynamically secured addresses from an EtherChannel. The range is from 1 to 4096.

 
Command Default

None

 
Command Modes

EXEC mode

 
Command History

Release
Modification

5.1(3)N1(1)

This command was introduced.

 
Usage Guidelines

This command does not require a license.

Examples

This example shows how to clear the dynamically secured MAC address information:

switch# clear port-security dynamic address 0050.3e8d.6400 vlan 1
switch#
 

 
Related Commands

Command
Description

show port-security

Displays the port security configuration information.

switchport port-security

Configures the switchport parameters to establish port security.

 

clear spanning-tree counters

To clear the counters for the Spanning Tree Protocol (STP), use the clear spanning-tree counters command.

clear spanning-tree counters [ interface { ethernet slot / port | port-channel channel }] [ vlan vlan-id ]

 
Syntax Description

interface

(Optional) Specifies the interface type.

ethernet slot/port

Specifies the Ethernet interface slot and port number. The slot number is from 1 to 255, and the port number is from 1 to 128.

port-channel channel

Specifies the EtherChannel number. The number range is from 1 to 4096.

vlan vlan-id

(Optional) Specifies the VLAN. The range is from 1 to 3967 and from 4049 to 4093.

 
Command Default

None

 
Command Modes

EXEC mode

 
Command History

Release
Modification

4.0(0)N1(1a)

This command was introduced.

 
Usage Guidelines

You can clear all the STP counters on the entire switch, per VLAN, or per interface.

Examples

This example shows how to clear the STP counters for VLAN 5:

switch# clear spanning-tree counters vlan 5
 

 
Related Commands

Command
Description

show spanning-tree

Displays information about the spanning tree state.

clear spanning-tree detected-protocol

To restart the protocol migration, use the clear spanning-tree detected-protocol command. With no arguments, the command is applied to every port of the switch.

clear spanning-tree detected-protocol [ interface { ethernet slot / port | port-channel channel }]

 
Syntax Description

interface

(Optional) Specifies the interface type.

ethernet slot / port

Specifies the Ethernet interface and the slot number and port number. The slot number is from 1 to 255, and the port number is from 1 to 128.

port-channel channel

Specifies the EtherChannel number. The number range is from 1 to 4096.

 
Command Default

None

 
Command Modes

EXEC mode

 
Command History

Release
Modification

4.0(0)N1(1a)

This command was introduced.

 
Usage Guidelines

Rapid per VLAN Spanning Tree Plus (Rapid PVST+) and Multiple Spanning Tree (MST) have built-in compatibility mechanisms that allow them to interact properly with other versions of IEEE spanning tree or other regions. For example, a switch running Rapid PVST+ can send 802.1D bridge protocol data units (BPDUs) on one of its ports when it is connected to a legacy device. An MST switch can detect that a port is at the boundary of a region when it receives a legacy BPDU or an MST BPDU that is associated with a different region.

These mechanisms are not always able to revert to the most efficient mode. For example, a Rapid PVST+ switch that is designated for a legacy 802.1D bridge stays in 802.1D mode even after the legacy bridge has been removed from the link. Similarly, an MST port assumes that it is a boundary port when the bridges to which it is connected have joined the same region.

To force a port to renegotiate with its neighbors, enter the clear spanning-tree detected-protocol command.

Examples

This example shows how to restart the protocol migration on a specific interface:

switch# clear spanning-tree detected-protocol interface ethernet 1/4
 

 
Related Commands

Command
Description

show spanning-tree

Displays information about the spanning tree state.

clear vtp counters

To clear VLAN Trunking Protocol (VTP) counters, use the clear vtp counters command.

clear vtp counters

 
Syntax Description

This command has no arguments or keywords.

 
Command Default

None

 
Command Modes

EXEC mode

 
Command History

Release
Modification

4.2(1)N1(1)

This command was introduced.

 
Usage Guidelines

Use this command to clear the VTP statistics, such as the VTP requests, VTP advertisements, and configuration revisions.

Examples

This example shows how to clear the VTP counters:

switch# clear vtp counters
switch#
 

 
Related Commands

Command
Description

show vtp counters

Displays VTP counters.

show vtp status

Displays VTP information.

 

clock protocol

To set the synchronization protocol for the clock to a protocol, use the clock protocol command. To remove the clock protocol, use the no form of this command.

clock protocol { none | ntp }

no clock protocol { none | ntp }

 
Syntax Description

none

Specifies that the clock can be set manually.

ntp

Specifies that the clock be set to the Network Time Protocol (NTP).

 
Command Default

None

 
Command Modes

Global configuration mode

 
Command History

Release
Modification

5.1(3)N1(1)

This command was introduced.

 
Usage Guidelines

This command does not require a license.

Examples

This example shows how to set the synchronization protocol for the clock to NTP:

switch# configure terminal
switch(config)# clock protocol ntp
switch(config)#
 

 
Related Commands

Command
Description

show running-config

Displays the running system configuration information.

 

connect

To initiate a connection with a vCenter Server, use the connect command. To disconnect from a vCenter Server, use the no form of this command.

connect

no connect

 
Syntax Description

This command has no arguments or keywords.

 
Command Default

No connection with a vCenter Server

 
Command Modes

SVS connection configuration mode

 
Command History

Release
Modification

5.1(3)N1(1)

This command was introduced.

 
Usage Guidelines

There can be only one active connection at a time.

This command does not require a license.

Examples

This example shows how to connect to a vCenter Server:

switch# configure terminal
switch(config)# svs connection SVSConn
switch(config-svs-conn)# protocol vmware-vim
switch(config-svs-conn)# remote hostname vcMain
switch(config-svs-conn)# vmware dvs datacenter-name DemoDC
switch(config-svs-conn)# connect
switch(config-svs-conn)#
 

This example shows how to disconnect from a vCenter Server:

switch# configure terminal
switch(config)# svs connection SVSConn
switch(config-svs-conn)# no connect
switch(config-svs-conn)#
 

 
Related Commands

Command
Description

show svs connections

Displays SVS connection information.

svs connection

Enables an SVS connection.