Part number: 5998-2073
Software version: Release 1109
Document version: 6W100-20110715
Layer 2 - LAN Switching
Command Reference
Abstract
This document describes the commands and command syntax options available for the HP A Series
products.
This document is intended for network planners, field technical support and servicing engineers, and
network administrators who work with HP A Series products.
No part of this documentation may be reproduced or transmitted in any form or by any means without
prior written consent of Hewlett-Packard Development Company, L.P.
The information contained herein is subject to change without notice.
HEWLETT-PACKARD COMPANY MAKES NO WARRANTY OF ANY KIND WITH REGARD TO THIS
MATERIAL, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. Hewlett-Packard shall not be liable for errors contained
herein or for incidental or consequential damages in connection with the furnishing, performance, or use
of this material.
The only warranties for HP products and services are set forth in the express warranty statements
accompanying such products and services. Nothing herein should be construed as constituting an
additional warranty. HP shall not be liable for technical or editorial errors or omissions contained herein.
mtu ·········································································································································································· 39
Loopback and null interface configuration commands ······························································································ 40
MAC Information configuration commands ················································································································ 58
mac-address information enable (Ethernet interface view) ··············································································· 58
mac-address information enable (system view) ·································································································· 58
mac-address information interval ························································································································· 59
mac-address information mode ··························································································································· 60
mac-address information queue-length ··············································································································· 60
Ethernet link aggregation configuration commands ·································································································· 62
Service loopback group configuration commands ································································································· 234
display service-loopback group ························································································································· 234
port service-loopback group ······························································································································ 235
service-loopback group ······································································································································ 236
Support and other resources ····································································································································· 237
Contacting HP ······························································································································································ 237
Subscription service ············································································································································ 237
Related information ······················································································································································ 237
Index ············································································································································································· 240
v
Ethernet interface configuration commands
CAUTION:
The default command might interrupt ongoing network services. Make sure you are fully
aware of the impacts of this command when you perform it on a live network.
General Ethernet interface configuration commands
default
Description
Use the default command to restore the default settings for an Ethernet interface.
This command might fail to restore the default settings for some commands for reasons such as command
dependencies and system restrictions. You can use the display this command in interface view to check
for these commands, and perform their undo forms or follow the command reference to individually
restore their default settings. If your restoration attempt still fails, follow the error message to resolve the
problem.
Syntax
default
View
Ethernet interface view
Default level
2: System level
Parameters
None
Example
# Restore the default settings for interface GigabitEthernet 1/0/1.
<Sysname> system-view
[Sysname] interface gigabitethernet 1/0/1
[Sysname-GigabitEthernet1/0/1] default
This command will restore the default settings. Continue? [Y/N]:y
description
Description
Use the description command to change the description of the interface.
Use the undo description command to restore the default.
1
The default description of an interface is the interface name plus Interface. For example,
GigabitEthernet1/0/1 Interface.
Related commands: display interface.
Syntax
description text
undo description
View
Ethernet interface view
Default level
2: System level
Parameter
text: Specifies the interface description, a string of 1 to 80 characters. The string can include casesensitive letters, digits, special characters (including ~ ! @ # $ % ^ & * ( ) - _ + = { } [ ] | \ : ; " ' < > , .
/), spaces, and other Unicode characters and symbols.
Each Unicode character takes the space of two regular characters.
To use Unicode characters or symbols in an interface description, install the specific input method editor
and log in to the switch through remote login software that supports the character type.
When the length of a description string reaches or exceeds the maximum line width on the terminal
software, the software starts a new line, possibly breaking a Unicode character into two. As a result,
garbled characters may be displayed at the end of a line.
Example
# Change the description of interface GigabitEthernet 1/0/1 to lanswitch-interface.
Overflow: more than 14 decimal digits(7 digits for column "Err").
--: not supported.
Table 1 Command output
display counters rate
Description
Use the display counters rate command to display traffic rate statistics over the last sampling interval.
3
The statistics cover only interfaces in the up state. If an interface type is specified, the command displays
Field
Description
Interface
Abbreviated interface name
Total (pkts/sec)
Average rate (in packets per second) of receiving or sending packets during
the sampling interval
Broadcast (pkts/sec)
Average rate (packets per second) of receiving or sending broadcast
packets during the sampling interval
traffic rate statistics for all up interfaces of the specified type. If no interface type is specified, the
command displays traffic rate statistics for all up interfaces that have traffic counters.
To set the statistics polling interval, use the flow-interval command. The default statistics polling interval is
five minutes.
Average rate (packets per second) of receiving or sending multicast packets
during the sampling interval
Overflow: more than 14
decimal digits.
The command displays Overflow, if any of the following applies:
The data length of an error statistic is greater than 7 decimal digits The data length of a non-error statistic is greater than 14 decimal digits
--: not supported.
The statistical item is not supported
display interface
Description
Use the display interface command to display Ethernet interface information.
If no interface type is specified, this command displays information about all interfaces.
If an interface type is specified but no interface number is specified, this command displays information
about all interfaces of that type.
Related commands: interface.
Syntax
display interface [ interface-type ] [ brief [ down ] ] [ | { begin | exclude | include } regular-expression ]
display interface interface-type interface-number [ brief ] [ | { begin | exclude | include } regular-
expression ]
View
Any view
Default level
1: Monitor level
Parameters
interface-type interface-number: Specifies an interface type and number.
brief: Displays brief interface information. If you do not specify this parameter, the command displays
detailed interface information.
down: Displays information about interfaces in the down state and the causes. If you do not specify this
parameter, this command displays information about interfaces in all states.
|: Filters command output by specifying a regular expression. For more information about regular
expressions, see Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
exclude: Displays all lines that do not match the specified regular expression.
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.
Examples
# Display information about Layer 3 interface GigabitEthernet 1/0/1.
<Sysname>display interface gigabitethernet 1/0/1
5
GigabitEthernet1/0/1 current state: DOWN
Field
Description
GigabitEthernet1/0/1 current
state
State of the Ethernet interface:
DOWN (Administratively)—Ethernet interface was shut down with the
shutdown command. The interface is down administratively.
DOWN (Link-Aggregation interface down)—Ethernet interface is down
physically because the aggregate interface corresponding to the
aggregation group to which the Ethernet interface belongs was shut
down with the shutdown command.
DOWN—Ethernet interface is up administratively, but down physically
(possibly because no physical link is present or the link has failed).
UP—Ethernet interface is up both administratively and physically.
Line protocol current state: DOWN
Description: GigabitEthernet1/0/1 Interface
The Maximum Transmit Unit is 1500
Internet protocol processing : disabled
IP Packet Frame Type: PKTFMT_ETHNT_2, Hardware Address: 3ce5-a6df-e139
Output queue (current message number in the protocol queue, maximum
number of messages allowed in the protocol queue, and number of
discarded messages).
Output queue (FIFO queuing:
Size/Length/Discards)
Output queue (current message number in the FIFO queue, maximum
number of messages allowed in the FIFO queue, and number of
discarded messages).
Last clearing of counters
Time when the reset counters interface command was last used to clear
the interface statistics. Never indicates the reset counters interface
command was never used on the interface since the switch was started.
Last 300 seconds input rate
Average input rate over the last 300 seconds in Bps, bps, and pps.
Last 300 seconds output rate
Average output rate over the last 300 seconds in Bps, bps, and pps.
Input
Input packets.
Output
Output packets.
# Display detailed information about Layer 2 interface GigabitEthernet 1/0/1.
<Sysname> display interface gigabitethernet 1/0/1
GigabitEthernet1/0/1 current state: DOWN
IP Packet Frame Type: PKTFMT_ETHNT_2, Hardware Address: 3ce5-a6df-e142
Description: GigabitEthernet1/0/1 Interface
Loopback is not set
Media type is twisted pair
Port hardware type is 1000_BASE_T
Unknown-speed mode, unknown-duplex mode
Link speed type is autonegotiation, link duplex type is autonegotiation
The Maximum Frame Length is 9216
Broadcast MAX-ratio: 100%
Unicast MAX-ratio: 100%
Multicast MAX-ratio: 100%
Allow jumbo frame to pass
7
PVID: 1
Field
Description
GigabitEthernet1/0/1 current state
Physical state of the Ethernet interface. For more information, see
Table 5.
IP Packet Frame Type
Ethernet framing format on the interface.
Hardware address
Hardware address of the port.
Description
Description of the interface.
Loopback is not set
Loopback testing function is disabled.
Unknown-speed mode
Port speed is unknown.
unknown-duplex mode
Duplex mode is unknown.
Link speed type is autonegotiation
Interface will negotiate a speed with its peer.
link duplex type is autonegotiation
Interface will negotiate a duplex mode with its peer.
The Maximum Frame Length
Maximum Ethernet frame length allowed on the interface.
Broadcast MAX-ratio
Broadcast suppression threshold as a percentage of the interface
transmission capability. When the threshold is exceeded, the
interface drops broadcast packets.
Unicast MAX-ratio
Unknown unicast suppression threshold as a percentage of the
interface transmission capability. When the threshold is exceeded,
the interface drops unknown unicast packets.
Mdi type: auto
Port link-type: access
Tagged VLAN ID : none
Untagged VLAN ID : 1
Port priority: 0
Last clearing of counters: Never
Peak value of input: 0 bytes/sec, at 2011-05-28 10:02:36
Peak value of output: 0 bytes/sec, at 2011-05-28 10:02:36
Last 300 seconds input: 0 packets/sec 0 bytes/sec -%
Last 300 seconds output: 0 packets/sec 0 bytes/sec -%
0 aborts, 0 deferred, 0 collisions, 0 late collisions
0 lost carrier, - no carrier
Table 4 display interface command (in bridge mode) output description
8
Field
Description
Multicast MAX-ratio
Multicast suppression threshold as a percentage of the interface
transmission capability. When the threshold is exceeded, the
interface drops multicast packets.
Allow jumbo frame to pass
Maximum length of Ethernet frames that are allowed to pass through
the interface.
PVID
Port VLAN ID.
Mdi type
Cable type.
Port link-type
Link type of the interface, which could be access, trunk, or hybrid.
Tagged VLAN ID
VLANs for which the interface sends packets without removing VLAN
tags.
Untagged VLAN ID
VLANs for which the interface sends packets after removing VLAN
tags.
Peak value of input
Peak value of inbound traffic, in Bps.
Peak value of output
Peak value of outbound traffic, in Bps.
Last 300 seconds input: 0
packets/sec 0 bytes/sec
Last 300 seconds output: 0
packets/sec 0 bytes/sec
Average rate of input and output traffic in the last 300 seconds, in
pps and Bps.
Input (total): 0 packets, 0 bytes
0 unicasts, 0 broadcasts, 0
multicasts, 0 pauses
Inbound traffic statistics (in packets and bytes) for the interface. All
inbound normal and abnormal packets (including unicast,
broadcast, and multicast), and pause frames were counted.
Input (normal): 0 packets, - bytes
0 unicasts, 0 broadcasts, 0
multicasts, 0 pauses
Inbound traffic statistics (in packets and bytes) for the interface. All
inbound normal packets (including unicast, broadcast, and
multicast), and pause frames were counted.
input errors
Inbound packets with errors.
runts
Inbound frames shorter than 64 bytes, in correct format, and
containing valid CRCs.
giants
Inbound frames larger than the maximum frame length supported on
the interface.
For an Ethernet interface that does not permit jumbo frames, giants
refer to frames larger than 1536 bytes (without VLAN tags) or 1540
bytes (with VLAN tags).
For an Ethernet interface that permits jumbo frames, giants refer to
frames larger than the maximum length of Ethernet frames that are
allowed to pass through, which is configured when you configure
jumbo frame support on the interface.
- throttles
The number of times that the port shut down due to buffer or CPU
overload.
frame
Total number of inbound frames that contained checksum errors and
a non-integer number of bytes.
- overruns
Number of packet drops because the input rate of the port exceeded
the queuing capability.
9
Field
Description
aborts
Total number of illegal inbound packets:
Fragment frames—CRC error frames shorter than 64 bytes. The
length can be an integral or non-integral value.
Jabber frames—CRC error frames greater than the maximum frame
length supported on the Ethernet interface (with an integral or nonintegral length). For an Ethernet interface that does not permit jumbo
frames, jabber frames refer to CRC error frames greater than 1518
bytes (without VLAN tags) or 1522 bytes (with VLAN tags). For an
Ethernet interface that permits jumbo frames, jabber frames refer to
CRC error frames greater than the maximum length of Ethernet
frames that are allowed to pass through the interface (which is
configured when you configure jumbo frame support on the
interface).
Symbol error frames—Frames that contained at least one undefined
symbol.
Unknown operation code frames—Non-pause MAC control frames
Length error frames—Frames whose 802.3 length fields did not
accord with the actual frame length (46 to 1500 bytes).
ignored
Number of inbound frames dropped because the receive buffer of
the port ran low.
Outbound traffic statistics (in packets and bytes) for the port. All
outbound normal and abnormal packets (including unicast,
broadcast, and multicast), and pause frames were counted.
Outbound normal traffic (including unicast, broadcast, and multicast)
and pause frame statistics (in packets and bytes) for the interface.
output errors
Outbound packets with errors.
- underruns
Number of packet drops because the output rate of the interface
exceeded the output queuing capability. This is a low-probability
hardware anomaly.
- buffer failures
Number of packets dropped because the transmit buffer of the
interface ran low.
aborts
Number of packets that failed to be transmitted, for example,
because of Ethernet collisions.
deferred
Number of frames that the interface deferred to transmit because of
detected collisions.
collisions
Number of frames that the interface stopped transmitting because
Ethernet collisions were detected during transmission.
late collisions
Number of frames that the interface deferred to transmit after
transmitting their first 512 bits, because of detected collisions.
lost carrier
Number of carrier losses during transmission. This counter applies to
serial WAN interfaces.
10
Field
Description
- no carrier
Number of times that the port failed to detect the carrier when
attempting to send frames. This counter applies to serial WAN
interfaces.
NOTE:
If an output field is not available, a hyphen (-) is displayed.
Field
Description
UP
Interface is up physically.
DOWN
Interface is down physically because no physical connection exists. Possible
reason: The network cable is disconnected or faulty.
DOWN (Administratively)
Interface is down physically because it was shut down with the shutdown
command. To restore its physical state, use the undo shutdown command.
DOWN (Link-Aggregation
interface down)
Interface is down physically because the aggregate interface corresponding
to the aggregation group to which it belongs was shut down with the
shutdown command.
DOWN ( OAM connection
failure )
Interface is down physically because an OAM connection fails to be
established on it or the OAM connection is disconnected.
DOWN ( DLDP connection
failure )
Interface is down physically because a DLDP connection fails to be
established on it or the DLDP connection is disconnected.
DOWN ( Loopback
detection-protected )
Interface is shut down because a loop is detected on it.
DOWN ( BPDU-protected )
Interface is shut down by the BPDU guard function.
DOWN ( Monitor-Link uplink
down )
Interface is down physically because the uplink of the monitor link group to
which it belongs is down.
Table 5 Description on the possible physical states of a Layer 2 Ethernet interface
# Display brief information about all interfaces.
<Sysname> display interface brief
The brief information of interface(s) under route mode:
Link: ADM - administratively down; Stby - standby
Protocol: (s) - spoofing
Interface Link Protocol Main IP Description
M-GE0/0/0 DOWN DOWN --
NULL0 UP UP(s) --
Vlan1 UP UP 192.168.0.59
The brief information of interface(s) under bridge mode:
Link: ADM - administratively down; Stby - standby
Speed or Duplex: (a)/A - auto; H - half; F - full
Type: A - access; T - trunk; H - hybrid
Interface Link Speed Duplex Type PVID Description
GE1/0/2 DOWN auto A A 1
11
GE1/0/3 DOWN auto A A 1
Field
Description
The brief information of
interfaces under route
mode:
Command displays brief information about Layer 3 interfaces.
Link: ADM administratively down;
Stby - standby
ADM—Interface has been shut down by the network administrator. To recover
its physical layer state, perform the undo shutdown command.
Stby—Interface is a standby interface. You can use the display standby state
command to check the corresponding primary interface.
GE1/0/4 DOWN auto A A 1
GE1/0/5 DOWN auto A A 1
GE1/0/6 DOWN auto A A 1
GE1/0/7 DOWN auto A A 1
GE1/0/8 DOWN auto A A 1
GE1/0/9 DOWN auto A A 1
GE1/0/10 DOWN auto A A 1
GE1/0/11 DOWN auto A A 1
# Filter the brief interface information to display the line starting with the (s) string and all subsequent
lines.
<Sysname> display interface brief | begin (s)
The brief information of interface(s) under route mode:
Link: ADM - administratively down; Stby - standby
Protocol: (s) - spoofing
Interface Link Protocol Main IP Description
NULL0 UP UP(s) --
Vlan1 UP UP 192.168.0.59
When you use the begin parameter to filter the output, the system only searches the Layer 3 interface list
or the Layer 2 interface list. If regular-expression is on the Layer 3 interface list, the system only displays
the line that contains regular-expression, and all subsequent lines on the Layer 3 interface list.
<Sysname> display interface brief down
The brief information of interface(s) under route mode:
Link: ADM - administratively down; Stby - standby
Interface Link Cause
M-GE0/0/0 DOWN Not connected
GE1/0/8 DOWN Not connected
The brief information of interface(s) under bridge mode:
If the network layer protocol state of an interface is shown as UP, but its link is
an on-demand link or not present at all, its protocol attribute includes the
spoofing flag (an s in parentheses). This attribute is typical of interface Null 0
and the loopback interfaces.
Interface
Interface name.
Link
Physical link state of the interface:
UP—Link is up. DOWN—Link is down physically. ADM—Link has been shut down administratively. To recover its physical
state, perform the undo shutdown command.
Stby—Interface is a standby interface.
Protocol
Protocol connection state of the interface, which can be UP, DOWN, or UP(s).
The brief information of
interfaces under bridge
mode:
Brief information about Layer 2 interfaces.
Speed or Duplex: (a)/A auto; H - half; F - full
If the speed of an interface is negotiated automatically, its speed attribute
includes the auto negotiation flag, letter a in parentheses.
If the duplex mode of an interface is negotiated automatically, its duplex mode
attribute includes the following options:
Packets dropped by GBP full or insufficient bandwidth: 301
Packets dropped by FFP: 261
Packets dropped by STP non-forwarding state: 321
Table 8 Command output
display packet-drop summary
Description
Use the display packet-drop summary command to display summary information about dropped packets
on all interfaces.
Syntax
display packet-drop summary [ | { begin | exclude | include } regular-expression ]
View
Any view
Default level
1: Monitor level
Parameters
|: Filters command output by specifying a regular expression. For more information about regular
expressions, see Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
exclude: Displays all lines that do not match the specified regular expression.
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.
Example
# Display information about dropped packets on all interfaces.
<Sysname> display packet-drop summary
All interfaces:
Packets dropped by GBP full or insufficient bandwidth: 301
Packets dropped by FFP: 261
Packets dropped by STP non-forwarding state: 321
15
For the description of some fields in the output, see Table 8.
Field
Description
Combo-group
Combo interfaces of the switch, represented by combo interface numbers that are
generated by the system
Active
Ports of the combo interfaces that are active
Inactive
Ports of the combo interfaces that are inactive
display port combo
Description
Use the display portcombo command to display the combo interfaces of the switch and the fiber and
copper combo ports.
Syntax
display port combo [ | { begin | exclude | include } regular-expression ]
View
Any view
Default level
1: Monitor level
Parameters
|: Filters command output by specifying a regular expression. For more information about regular
expressions, see Fundamentals Configuration Guide.
begin: Displays the first line that matches the specified regular expression and all lines that follow.
Example
exclude: Displays all lines that do not match the specified regular expression.
include: Displays all lines that match the specified regular expression.
regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.
# Display the combo interfaces of the switch and the fiber and copper combo ports.
<Sysname> display port combo
Combo-group Active Inactive
1 GigabitEthernet1/0/47 GigabitEthernet1/0/49
2 GigabitEthernet1/0/48 GigabitEthernet1/0/50
Table 9 Command output
In a combo interface, the fiber or copper combo port with the smaller port number is active by default.
You can determine whether a port is a fiber combo port or a copper combo port by checking the ―Media type is‖ field of the display interface command.
duplex
Description
Use the duplex command to set the duplex mode for an Ethernet interface.
16
Use the undo duplex command to restore the default duplex mode of the Ethernet interface.
By default, Ethernet interfaces operate in auto-negotiation mode.
Related commands: speed.
Syntax
duplex { auto | full | half }
undo duplex
View
Ethernet interface view
Default level
2: System level
Parameters
auto: Sets the interface to operate in auto-negotiation mode.
full: Sets the interface to operate in full duplex mode.
half: Sets the interface to operate in half-duplex mode. This parameter is not available for Ethernet
copper ports that are configured with a 1000-mbps port speed and fiber ports.
Example
# Configure the interface GigabitEthernet 1/0/1 to operate in full-duplex mode.
<Sysname> system-view
[Sysname] interface gigabitethernet 1/0/1
[Sysname-GigabitEthernet1/0/1] duplex full
flow-interval
Description
Use the flow-interval command to set the interface statistics polling interval.
Use the undo flow-interval command to restore the default interval.
In system view, use the flow-interval command to set the statistics polling interval for all interfaces.
In Ethernet interface view, use the flow-interval command to set the statistics polling interval for the
interface.
Syntax
flow-interval interval
undo flow-interval
View
Ethernet interface view
Default level
2: System level
17
Parameter
interval: Sets the statistics polling interval, in seconds. It ranges from 5 to 300 and must be a multiple of
5.
Example
# Set the statistics polling interval to 100 seconds on GigabitEthernet 1/0/1.
<Sysname> system-view
[Sysname] interface gigabitethernet 1/0/1
[Sysname-GigabitEthernet1/0/1] flow-interval 100
interface
Description
Use the interface command to enter interface view.
Syntax
interface interface-typeinterface-number
View
System view
Default level
2: System level
Parameter
interface-type interface-number: Specifies an interface type and number.
Example
# Enter GigabitEthernet 1/0/1 interface view (assuming that the interface is an Ethernet interface).
<Sysname> system-view
[Sysname] interface gigabitethernet 1/0/1
[Sysname-GigabitEthernet1/0/1]
jumboframe enable
Description
Use the jumboframe enable command to allow jumbo frames within the specified length to pass through
one or multiple Ethernet interfaces.
Use the undo jumboframe enable command to prevent jumbo frames from passing through one or
multiple Ethernet interfaces.
By default, the switch allows jumbo frames within 9216 bytes to pass through Ethernet interfaces.
In Ethernet interface view, the command applies only to the current Ethernet interface.
Syntax
In port group view, the command applies to every Ethernet interface in the port group.
jumboframe enable [ value ]
undo jumboframe enable
18
View
Ethernet interface view, port group view
Default level
2: System level
Parameter
value: Sets the maximum length of Ethernet frames that are allowed to pass through, ranging from 1536
to 9216 bytes. If you set the value parameter multiple times, the latest configuration takes effect.
Example
# Configure the switch to allow jumbo frames within 9216 bytes to pass through GigabitEthernet 1/0/1.
<Sysname> system-view
[Sysname] interface gigabitethernet 1/0/1
[Sysname-GigabitEthernet1/0/1] jumboframe enable
link-delay
Description
Use the link-delay command to set the physical state change suppression interval on an Ethernet
interface.
Use the undo link-delay command to restore the default.
By default, physical state change suppression is disabled on Ethernet interfaces.
Do not use this command on Ethernet interfaces with RRPP, MSTP, or Smart Link enabled.
This command does not apply to ports that are shut down administratively (with the shutdown command).
Syntax
link-delay delay-time
undo link-delay
View
Ethernet interface view
Default level
2: System level
Parameter
delay-time: Sets the physical state change suppression interval on the Ethernet interface, ranging from 2
to 10 seconds.
Example
# Enable physical state change suppression on GigabitEthernet 1/0/1, setting the suppression interval to
8 seconds.
<Sysname> system-view
[Sysname] interface gigabitethernet 1/0/1
[Sysname-GigabitEthernet1/0/1] link-delay 8
19
loopback
Description
Use the loopback command to enable loopback testing on an Ethernet interface.
By default, loopback testing is disabled on Ethernet interfaces.
Enable loopback testing for troubleshooting purposes, such as identifying an Ethernet problem.
During loopback testing, the speed, duplex, mdi, and shutdown commands are not available. In
addition, the port is operating in full duplex mode, regardless of its duplex configuration. After loopback
testing is disabled, the duplex configuration of the port is restored.
Loopback testing is a one-time operation, and is not recorded in the configuration file.
Syntax
loopback { external | internal }
View
Ethernet interface view
Default level
2: System level
Parameters
external: Enables external loopback testing to test all on-chip functions related to Ethernet interfaces.
internal: Enables internal loopback testing to test the hardware of Ethernet interfaces.
Example
# Enable internal loopback testing on GigabitEthernet 1/0/1.
<Sysname> system-view
[Sysname] interface gigabitethernet 1/0/1
[Sysname-GigabitEthernet1/0/1] loopback internal
port link-mode
Description
Use the port link-mode command to change the link mode of an Ethernet interface.
Use the undo port link-mode command to restore the default.
By default, Ethernet interfaces operate in Layer 2 mode.
To meet networking requirements, you can change the link mode of a port, so it can operate as a Layer 2
Ethernet interface (in bridge mode) or Layer 3 Ethernet interface (in route mode).
When you change the link mode of an Ethernet interface, all the settings of the Ethernet interface are
restored to their defaults under the new link mode.
Syntax
Related commands: port link-mode interface-list.
port link-mode { bridge | route }
undo port link-mode
20
View
NOTE:
The display this command displays the configuration that takes effect in the current view.
Ethernet interface view
Default level
2: System level
Parameters
bridge: Specifies the Layer 2 mode.
route: Specifies the Layer 3 mode.
Example
# Configure GigabitEthernet 1/0/1 to operate in Layer 2 mode.
<Sysname> system-view
[Sysname] interface gigabitethernet 1/0/1
[Sysname-GigabitEthernet1/0/1] display this
#
interface GigabitEthernet1/0/1
port link-mode route
#
Return
The output shows that GigabitEthernet 1/0/1 operates in route mode.
[Sysname-GigabitEthernet1/0/1] port link-mode bridge
[Sysname-GigabitEthernet1/0/1] display this
#
interface GigabitEthernet1/0/1
port link-mode bridge
#
Return
The output shows that GigabitEthernet 1/0/1 is now operating in bridge mode.
port link-mode interface-list
Description
Use the port link-mode interface-list command to change the link mode of Ethernet interfaces.
To meet networking requirements, you can change the link mode of a port, so it can operate as a Layer 2
Ethernet interface (in bridge mode) or Layer 3 Ethernet interface (in route mode).
Configuring the port link-mode interface-list command in system view and configuring the port link-mode
command in Ethernet interface view lead to the same result. The difference between the two commands is
that the former changes the link mode of multiple Ethernet interfaces in batch, and the latter changes the
link mode of one Ethernet interface at a time.
When you change the link mode of an Ethernet interface, all the settings of the Ethernet interface are
restored to their defaults under the new link mode.
21
The link mode configuration for an Ethernet interface in system view and that in interface view supersede
each other. The command that is configured last takes effect.
Syntax
port link-mode { bridge | route } interface-list
View
System view
Default level
2: System level
Parameters
bridge: Specifies the Layer 2 mode.
route: Specifies the Layer 3 mode.
interface-list: Specifies an Ethernet interface list, in the format of interface-type interface-number [ to
interface-type interface-number ] &<1-10>, where &<1-10> indicates that you can specify up to 10
interfaces or interface ranges.
Examples
# Configure GigabitEthernet 1/0/1 through GigabitEthernet 1/0/5 to operate in Layer 2 mode.
<Sysname> system-view
[Sysname] port link-mode bridge gigabitethernet 1/0/1 to gigabitethernet 1/0/5
# Configure GigabitEthernet 1/0/1 through GigabitEthernet 1/0/5 to operate in Layer 3 mode.
<Sysname> system-view
[Sysname] port link-mode route gigabitethernet 1/0/1 to gigabitethernet 1/0/5
reset counters interface
Description
Use the reset counters interface command to clear the Ethernet interface statistics.
Before collecting traffic statistics for a specific period of time on an interface, clear the old statistics first.
If no interface type is specified, this command clears statistics for all interfaces.
If only the interface type is specified, this command clears statistics for all interfaces of that type.