Ethernet Configuration Commands

This chapter contains the following sections:

clear counters

To clear the statistics counters on all interfaces or on a specific interface, use the clear counters Privileged EXEC Mode command.

Syntax

clear counters [interfaces interface-id]

Parameters

interfaces interface-id—(Optional) Specifies an interface ID or a list of interface IDs. The interface ID can be one of these types: Ethernet port or port channel.

Default Configuration

N/A

Command Mode

Privileged EXEC Mode

Example

The following example clears the statistics counters for gi5:

switchxxxxxx# clear counters interfaces gi5

clear etherlike statistics

To clear the Etherlike statistics counters on all interfaces, use the clear etherlike statistics Privileged EXEC Mode command.

Syntax

clear etherlike statistics

Parameters

N/A

Default Configuration

N/A

Command Mode

Privileged EXEC Mode

Example

switchxxxxxx# clear etherlike statistics

default interface

To restore an interface to its default settings, use the default interface Interface Configuration mode command.

Syntax

default interface interface-id

Parameters

interface-id—The Ethernet interface ID.

Default Configuration

N/A

Command Mode

Interface Configuration mode

Example

switchxxxxxx(config)# default interface gi1
Interface gi1 set to default configuration

description

To add a description to an interface, use the description Interface Configuration mode command.

To delete the description of an interface, use the no form of this command.

Syntax

description string

no description

Parameters

string—The description of an interface. (Length: 0 to 32 characters)

Default Configuration

The interface does not have a description.

Command Mode

Interface Configuration (Ethernet, port channel) mode

Example

switchxxxxxx(config)# interface gi5
switchxxxxxx(config-if)# description SW#3

duplex

To configure the full or half duplex operation for a given Ethernet interface when not using auto-negotiation, use the duplex Interface Configuration mode command.

Syntax

duplex {half | full | auto}

Parameters

half—Forces the half-duplex operation.

full—Forces the full-duplex operation.

auto—Enables auto-duplex configuration.

Default Configuration

The interface operates in the full-duplex mode.

Command Mode

Interface Configuration (port channel) mode

Example

The following example configures gi5 to operate in the full-duplex mode:

switchxxxxxx(config)# interface gi5
switchxxxxxx(config-if)# duplex full

errdisable recovery

To enable errdisable recovery from specific causes and set the recovery interval, use the errdisable recovery Global Configuration command.

To revert to its default setting, use the no form of this command.

Syntax

errdisable recovery {cause {all | acl | arp-inspection | bpduguard |
broadcast-flood | dot1x-src-address | dhcp-rate-limit | inline-power |
loopback-detection | psecure-violation | selfloop | unicast-flood |
unknown-multicastflood} | interval interval}

no errdisable recovery {cause {all | acl | arp-inspection | bpduguard |
broadcast-flood | dot1x-src-address | dhcp-rate-limit | inline-power |
loopback-detection | psecure-violation | selfloop | unicast-flood |
unknown-multicastflood}

Parameters

cause—Enables errdisable recovery from a specific cause. The available options are:

  • all—Enables the timer to recover from all causes.

  • acl—Enables the timer to recover from the ACL causes.

  • arp-inspection—Enables the timer to recover from the ARP inspection causes.

  • bpduguard—Enables the timer to recover from the BPDU Guard causes.

  • broadcast-flood—Enables the timer to recover from the flood causes.

  • dhcp-rate-limit—Enables the timer to recover from the DHCP rate limit causes.

  • dot1x-src-address—Enables the timer to recover from the 802.1X single host mode violation causes.

  • inline-power—Enables the timer to recover from the inline-power causes.

  • loopback-detection—Enables the timer to recover from the loopback-detection causes.

  • psecure-violation—Enables the timer to recover from the port security causes.

  • selfloop—Enables the timer to recover from the self-loop causes.

  • unicast-flood—Enables the timer to recover from the unicast flood causes.

  • unknown-multicast-flood—Enables the timer to recover from the unknown multicast flood causes.

    interval interval—Specifies the time to recover from a specific error-disable state. The same interval is applied to all causes. (Range: 30 to 86400 seconds, default: 300 seconds)

Default Configuration

Errdisable recovery is disabled for all causes.

Command Mode

Global Configuration mode

Example

switchxxxxxx(config)# errdisable recovery cause all
switchxxxxxx(config)# errdisable recovery interval 64

flowcontrol

To configure flow control on a given interface, use the flowcontrol Interface Configuration mode command.

To disable flow control on an interface, use the no form of this command.

Syntax

flowcontrol {auto | on | off}

no flowcontrol

Parameters

auto—Automatically enables or disables flow control on the interface.

on—Enables flow control on the interface.

off—Disables flow control on the interface.

Default Configuration

Flow control is disabled.

Command Mode

Interface Configuration (Ethernet, port channel) mode

Example

switchxxxxxx(config)# interface gi1
switchxxxxxx(config-if)# flowcontrol on

interface

To enter the Interface Configuration mode in order to configure an interface, use the interface Global Configuration mode command.

Syntax

interface interface-id

Parameters

interface-id—The interface ID can be one of these types: Ethernet port, port channel, VLAN, range, IP interface, or tunnel.

Default Configuration

N/A

Command Mode

Interface Configuration (Ethernet, port channel, VLAN, Range) mode

Examples

Example 1—The following example enters the Interface Configuration mode in order to configure a Gigabit Ethernet port:

switchxxxxxx(config)# interface gi1
switchxxxxxx(config-if)#

Example 2—The following example enters the Interface Configuration mode in order to configure a Fast Ethernet port:

switchxxxxxx(config)# interface fa1
switchxxxxxx(config-if)#

Example 3 - The following example enters the Interface Configuration mode in order to configure a port channel (LAG):

switchxxxxxx(config)# interface po1
switchxxxxxx(config-if)#

interface range

To execute a command on multiple interfaces simultaneously, use the interface range command.

Syntax

interface range interface-list

Parameters

interface-list—A list of interface IDs. The interface ID can be one of these types: Ethernet port, VLAN, or port channel.

Default Configuration

N/A

Command Mode

Interface Configuration (Ethernet, port channel, or VLAN) mode

User Guidelines

The commands under the interface range are executed independently on each interface in the range. If the command returns an error on one of the interfaces, it does not stop the execution of the command on other interfaces.

Example

switchxxxxxx(config)# interface range gi1-20
switchxxxxxx(config-if-range)#

jumbo-frame

To enable jumbo frames on the switch and set the maximum frame size supported by the switch, use the jumbo-frame Global Configuration mode command.

To disable jumbo frames on the switch, use the no form of this command.

Syntax

jumbo-frame frame-size

no jumbo-frame

Parameters

frame-size—Maximum size of packet in bytes that the switch can support. (Range: 1518 to 10000 bytes, default: 1522 bytes)

Default Configuration

Jumbo frames are disabled on the switch.

Command Mode

Global Configuration mode

User Guidelines

This command takes effect only after resetting the switch.

Example

The following example enables jumbo frames on the switch and sets the maximum frame size to 1538 bytes:

switchxxxxxx(config)# jumbo-frame 1538

operation time-range

To control the time that the port is up, use the operation time-range Interface Configuration mode command. To cancel the time range for the port operation time, use the no form of this command.

Syntax

operation time-range NAME

no operation time-range

Parameters

NAME—Specify the name of time-range settings. (Range: 1–32 characters.)

Default Configuration

N/A

Command Mode

Interface Configuration (Ethernet, Port Channel) mode

User Guidelines

Use the operation time-range NAME command to bind a time-range profile to interfaces. Use the no operation time-range to reset the time-range.

Example

The following example shows how to apply the workhour time-range to an interface and how to verify the configuration:

Switch(config)# interface fa1
Switch(config-if)# operation time-range workhour
Switch(config-if)# do show interface status fa1
Port  Name       Status      Vlan  Duplex  Speed    Type
fa1              connected   1     a-full  a-100M   Copper
Port Working Time Range               Status
---- -------------------------------- --------
fa1  workhour                         Active

show errdisable recovery

To show the error-disable recovery status and the interfaces in the error-disabled state, use the show errdisable recovery Privileged EXEC Mode command.

Syntax

show errdisable recovery

Parameters

N/A

Default Configuration

N/A

Command Mode

Privileged EXEC Mode

Example

switchxxxxxx# show errdisable recovery
ErrDisable Reason        | Timer Status
--------------------------+---------------
                bpduguard | disabled
                 selfloop | disabled
          broadcast-flood | disabled
  unknown-multicast-flood | disabled
            unicast-flood | disabled
                      acl | disabled
        psecure-violation | disabled
          dhcp-rate-limit | disabled
           arp-inspection | disabled
Timer Interval : 300 seconds
Interfaces that will be enabled at the next timeout:
Port |  Error Disable Reason    | Time Left
-----+--------------------------+------------

show interface status

To show the status for all interfaces or for a specific interface, use the show interface status Privileged EXEC Mode command.

Syntax

show interface status [interface-id]

Parameters

interface-id—The interface ID or a list of interface IDs. The interface ID can be one of these types: Ethernet port or port channel.

Command Mode

Privileged EXEC Mode

Default Configuration

N/A

Example

switchxxxxxx# show interfaces status gi1-10
Port  Name                 Status      Vlan  Duplex  Speed    Type
gi1                        notconnect  1     auto    auto     Copper
gi2                        notconnect  1     auto    auto     Copper
gi3                        notconnect  1     auto    auto     Copper
gi4                        notconnect  1     auto    auto     Copper
gi5   swx3                 notconnect  1     auto    auto     Copper
gi6                        notconnect  1     auto    auto     Copper
gi7                        notconnect  1     auto    auto     Copper
gi8                        notconnect  1     auto    auto     Copper
gi9                        notconnect  1     auto    auto     Copper
gi10                       connected  1      a-full  a-1000M  Copper
Port Time Range             Status
---- -------------------------------- --------
gi1
gi2
gi3
gi4  Weekend               Inactive
gi5
gi6
gi7
gi8  Weekday               Active
gi9
gi10

show storm-control

To show the storm control settings for all interfaces or for a specific interface, use the show storm-control Privileged EXEC mode command.

Syntax

show storm-control [interfaces interface-id]

Parameters

interfaces interface-id—(Optional) Specifies an interface ID or a list of interface IDs. The interface ID can be one of these types: Ethernet port or port channel.

Default Configuration

N/A

Command Mode

Privileged EXEC mode

Example

switchxxxxxx# show storm-control
Storm control preamble and IFG: Excluded
  Storm control unit: bps
  Port    | State |  Broadcast  |  Unkown-Multicast  | Unknown-Unicast |   Action
          |       |     kbps    |        kbps        |      kbps       |
----------+-------+-------------+--------------------+-----------------|-----------
  gi1      disable Off(  10000)   Off(  10000)         Off(  10000)          Drop
  gi2      disable Off(  10000)   Off(  10000)         Off(  10000)          Drop
  gi3      disable Off(  10000)   Off(  10000)         Off(  10000)          Drop
  gi4      disable Off(  10000)   Off(  10000)         Off(  10000)          Drop
  gi5      disable Off(  10000)   Off(  10000)         Off(  10000)          Drop
  gi6      disable Off(  10000)   Off(  10000)         Off(  10000)          Drop
  gi7      disable Off(  10000)   Off(  10000)         Off(  10000)          Drop
  gi8      disable Off(  10000)   Off(  10000)         Off(  10000)          Drop
  gi9      disable Off(  10000)   Off(  10000)         Off(  10000)          Drop
  gi10     disable Off(  10000)   Off(  10000)         Off(  10000)          Drop
  gi11     disable Off(  10000)   Off(  10000)         Off(  10000)          Drop
  gi12     disable Off(  10000)   Off(  10000)         Off(  10000)          Drop
  gi13     disable Off(  10000)   Off(  10000)         Off(  10000)          Drop
  gi14     disable Off(  10000)   Off(  10000)         Off(  10000)          Drop
  gi15     disable Off(  10000)   Off(  10000)         Off(  10000)          Drop
  gi16     disable Off(  10000)   Off(  10000)         Off(  10000)          Drop
  gi17     disable Off(  10000)   Off(  10000)         Off(  10000)          Drop
  gi18     disable Off(  10000)   Off(  10000)         Off(  10000)          Drop
  gi19     disable Off(  10000)   Off(  10000)         Off(  10000)          Drop
  gi20     disable Off(  10000)   Off(  10000)         Off(  10000)          Drop
  gi21     disable Off(  10000)   Off(  10000)         Off(  10000)          Drop
  gi22     disable Off(  10000)   Off(  10000)         Off(  10000)          Drop
  gi23     disable Off(  10000)   Off(  10000)         Off(  10000)          Drop
  gi24     disable Off(  10000)   Off(  10000)         Off(  10000)          Drop
  gi25     disable Off(  10000)   Off(  10000)         Off(  10000)          Drop
  gi26     disable Off(  10000)   Off(  10000)         Off(  10000)          Drop
  gi27     disable Off(  10000)   Off(  10000)         Off(  10000)          Drop
  gi28     disable Off(  10000)   Off(  10000)         Off(  10000)          Drop

shutdown

To disable an interface, use the shutdown Interface Configuration mode command.

To restart a disabled interface, use the no form of this command.

Syntax

shutdown

no shutdown

Parameters

N/A

Default Configuration

All interfaces are enabled.

Command Mode

Interface Configuration (Ethernet, port channel) mode

Examples

Example 1—The following example disables the Ethernet port gi5:

switchxxxxxx(config)# interface gi5
switchxxxxxx(config-if)# shutdown

Example 2—The following example restarts the disabled Ethernet port gi5:

switchxxxxxx(config)# interface gi5
switchxxxxxx(config-if)# no shutdown

speed

To configure the speed for a given Ethernet interface when not using
auto-negotiation, use the speed Interface Configuration mode command.

Syntax

speed {10 | 100 | 1000 | 10000 | auto}

Parameters

10—Enables 10-Mbps operation.

100—Enables 100-Mbps operation.

1000—Enables 1000-Mbps operation.

10000—Enables 10000-Mbps operation.

Auto—Enables auto speed configuration. The port automatically detects the speed at which it should run at based on the port at the other end of the link. If you use the 10, 100, or 1000 keywords with the auto keyword, the port only auto-negotiates at the specified speed.

Default Configuration

The port operates at its maximum speed capability.

Command Mode

Interface Configuration (Ethernet, port channel) mode

User Guidelines

For 10/100-Mbps ports, if both speed and duplex are set to specific values, the link operates at the negotiated speed and duplex value.

For 10/100/1000-Mbps ports, if both the speed and duplex are set to specific values, autonegotiation is disabled.

You can configure the Fast Ethernet port speed as either 10 or 100 Mbps. You cannot configure the speed on the SFP module ports, but you can configure the speed to not negotiate (nonegotiate) if it is connected to a device that does not support autonegotiation. However, when a 1000BASE-T SFP module is inserted into the SFP module port, you can configure the speed as 10, 100, 1000 Mbps, or auto.

If the speed is set to auto, the switch negotiates with the device at the other end of the link for the speed setting and then forces the speed setting to the negotiated value. The duplex setting remains as configured on each end of the link, which could result in a duplex setting mismatch.

If both ends of the line support autonegotiation, we highly recommend that you use the default autonegotiation settings. If one interface supports autonegotiation and the other end does not, you must manually configure the duplex and speed settings on the other side.

Example

The following example configures the speed of fa5 to 100 Mbps:

switchxxxxxx(config)# interface gi5
switchxxxxxx(config-if)# speed 100

storm-control action

To set the action when the received storm control packets exceed the maximum rate on an interface, use the storm-control action Interface Configuration mode command.

To disable the storm control action, use the no form of this command.

Syntax

storm-control action {drop | shutdown}

no storm-control action

Parameters

drop—Drops incoming packets when the received packets exceed the maximum rate on an interface.

shutdown—Shuts down the interface when the received packets exceed the maximum rate on an interface.

Default Configuration

The default action is drop.

Command Mode

Interface Configuration (Ethernet) mode

Example

switchxxxxxx(config)# interface gi5
switchxxxxxx(config-if)# storm-control action drop

storm-control broadcast

To enable storm control of broadcast traffic on an interface, use the storm-control broadcast Interface Configuration mode command.

To disable storm control of broadcast traffic, use the no form of this command.

Syntax

storm-control broadcast

no storm-control broadcast

Parameters

N/A

Default Configuration

Disabled

Command Mode

Interface Configuration (Ethernet) mode

Example

switchxxxxxx(config)# interface fa5
switchxxxxxx(config-if)# storm-control broadcast

storm-control broadcast level

To configure the maximum rate of broadcast traffic on an interface, use the storm-control broadcast level Interface Configuration mode command.

To revert to its default setting, use the no form of this command.

Syntax

storm-control broadcast level {pps | kbps}

no storm-control broadcast level

Parameters

{pps | kbps}—Specifies the maximum rate of broadcast traffic on a port. The unit of this rate depends on the settings in the storm-control unit command. (Range: 1 to 262134 pps or 16 to 1000000 kbps)

Default Configuration

10000

Command Mode

Interface Configuration (Ethernet) mode

User Guidelines

Use the storm-control broadcast level command to enable storm control of broadcast traffic on an interface.

The calculated rate includes the 20 bytes of Ethernet framing overhead (preamble+SFD+IPG).

Example

switchxxxxxx(config)# interface gi1
switchxxxxxx(config-if)# storm-control broadcast level 12345

storm-control enable

To enable storm control on an interface, use the storm-control enable Interface Configuration mode command.

To disable storm control, use the no form of this command.

Syntax

storm-control enable

no storm-control enable

Parameters

N/A

Default Configuration

Disabled

Command Mode

Interface Configuration mode

Example

switchxxxxxx(config)# interface gi11
switchxxxxxx(config-if)# storm-control enable

storm-control ifg

To set the interframe configuration of storm control counting, use the storm-control ifg Global Configuration command.

Syntax

storm-control ifg {include | exclude}

Parameters

include—Includes preamble and IFG.

exclude—Excludes preamble and IFG.

Default Configuration

Exclude

Command Mode

Global Configuration mode

Example

switchxxxxxx(config)# storm-control ifg include

storm-control unit

To set the unit of storm control counting, use the storm-control unit Global Configuration command.

Syntax

storm-control unit {bps | pps}

Parameters

bps—Specifies the unit as bits per second.

pps—Specifies the unit as packets per second.

Default Configuration

The default is bps.

Command Mode

Global Configuration mode

Example

switchxxxxxx(config)# storm-control unit pps

storm-control unknown-multicast

To enable storm control for unknown multicast traffic on an interface, use the storm-control unknown-multicast Interface Configuration mode command.

To disable storm control for unknown multicast traffic, use the no form of this command.

Syntax

storm-control unknown-multicast

no storm-control unknown-multicast

Parameters

N/A

Default Configuration

Disabled

Command Mode

Interface Configuration (Ethernet) mode

Example

switchxxxxxx(config)# interface gi5
switchxxxxxx(config-if)# storm-control unknown-multicast

storm-control unknown-multicast level

To configure the maximum rate of unknown multicast traffic on an interface, use the storm-control unknown-multicast level Interface Configuration mode command.

To revert to its default setting, use the no form of this command.

Syntax

storm-control unknown-multicast level {pps | kbps}

no storm-control unknown-multicast level

Parameters

{pps | kbps}—Specifies the maximum rate of unknown multicast traffic on an interface. The unit of this rate depends on the settings in the storm-control unit Global Configuration mode command. (Range: 1 to 262134 pps or 16 to 1000000 kbps)

Default Configuration

10000

Command Mode

Interface Configuration (Ethernet) mode

User Guidelines

Use the storm-control unknown-multicast level Interface Configuration mode command to enable storm control of unknown multicast traffic on an interface.

The calculated rate includes the 20 bytes of Ethernet framing overhead (preamble+SFD+IPG).

Example

switchxxxxxx(config)# interface gi1
switchxxxxxx(config-if)# storm-control unknown-multicast level 12345

storm-control unknown-unicast

To enable storm control for unknown unicast traffic on an interface, use the storm-control unknown-unicast Interface Configuration mode command.

To disable storm control for unknown unicast traffic, use the no form of this command.

Syntax

storm-control unknown-unicast

no storm-control unknown-unicast

Parameters

N/A

Default Configuration

Disabled

Command Mode

Interface Configuration (Ethernet) mode

Example

switchxxxxxx(config)# interface gi5
switchxxxxxx(config-if)# storm-control unknown-unicast

storm-control unknown-unicast level

To configure the maximum rate of unknown unicast traffic on an interface, use the storm-control unknown-unicast level Interface Configuration mode command.

To revert to its default setting, use the no form of this command.

Syntax

storm-control unknown-unicast level {pps | kbps}

no storm-control unknown-unicast level

Parameters

{pps | kbps}—Specifies the maximum rate of unknown unicast traffic on an interface. The unit of this rate depends on the settings in the storm-control unit Global Configuration mode command. (Range: 1 to 262134 pps or 16 to 1000000 kbps)

Default Configuration

10000

Command Mode

Interface Configuration (Ethernet) mode

User Guidelines

Use the storm-control unknown-unicast level Interface Configuration command to enable storm control for unknown unicast traffic on an interface.

The calculated rate includes the 20 bytes of Ethernet framing overhead (preamble+SFD+IPG).

Example

switchxxxxxx(config)# interface fa1
switchxxxxxx(config-if)# storm-control unknown-unicast level 12345