- Table of Contents
-
- 03-Layer 2 Configuration Guide
- 00-Preface
- 01-Ethernet Interface Configuration
- 02-Loopback and Null Interface Configuration
- 03-MAC Address Table Configuration
- 04-Spanning Tree Configuration
- 05-Loopback Detection Configuration
- 06-VLAN Configuration
- 07-Layer 2 Forwarding Configuration
- 08-PPP Configuration
- 09-Ethernet Link Aggregation Configuration
- 10-DCC Configuration
- Related Documents
-
Title | Size | Download |
---|---|---|
01-Ethernet Interface Configuration | 125.23 KB |
Configuring Ethernet interfaces
Configuring basic settings of an Ethernet interface
Shutting down an Ethernet interface
Configuring flow control on an Ethernet interface
Configuring loopback testing on an Ethernet interface
Setting a statistics polling interval
Enabling loopback detection on an Ethernet interface
Displaying and maintaining an Ethernet interface
All configuration tasks in this chapter are independent and optional. You can perform these configuration tasks in any order.
Overview
Ethernet is the most widespread wired LAN technology due to its flexibility, simplicity, and easy implementation. Your device supports only Layer 2 Ethernet interfaces.
Layer 2 Ethernet interfaces are physical Ethernet interfaces operating at the data link layer (Layer 2) to forward traffic within a subnet between hosts.
Configuring basic settings of an Ethernet interface
You can configure an Ethernet interface to operate in one of these duplex modes:
· Full-duplex mode (full)—Interfaces that operate in this mode can send and receive packets simultaneously.
· Half-duplex mode (half)—Interfaces that operate in this mode cannot send and receive packets simultaneously.
· Auto-negotiation mode (auto)—Interfaces that operate in this mode negotiate a duplex mode with their peers.
You can set the speed of an Ethernet interface or enable it to automatically negotiate a speed with its peer.
To configure an Ethernet interface:
Step |
Command |
Remarks |
1. Enter system view. |
system-view |
N/A |
1. Enter Ethernet interface view. |
interface interface-type interface-number |
N/A |
2. Set the interface description. |
description text |
Optional. By default, the description of an interface is in the format of interface-name Interface. For example, GigabitEthernet1/0/1 Interface. |
3. Set the duplex mode of the interface. |
duplex { auto | full | half } |
Optional. By default, the duplex mode is auto for Ethernet interfaces. |
4. Set the port speed. |
speed { 10 | 100 | 1000 | auto } |
Optional. By default, an Ethernet interface automatically negotiates a speed with its peer port. |
5. Restore the default settings for the interface. |
default |
Optional. |
Shutting down an Ethernet interface
|
CAUTION: Use this command with caution. After you manually shut down an Ethernet interface, the Ethernet interface cannot forward packets even if it is physically connected. |
You might need to shut down and then bring up an Ethernet interface to activate some configuration changes, for example, the speed or duplex mode changes.
To shut down an Ethernet interface:
Step |
Command |
Remarks |
1. Enter system view. |
system-view |
N/A |
2. Enter Ethernet interface view or port group view. |
·
Enter Ethernet interface view: ·
Enter port group view: |
Use either command. To shut down an Ethernet interface, enter Ethernet interface view. To shut down all Ethernet interfaces in a port group, enter port group view. |
3. Shut down the Ethernet interface. |
shutdown |
By default, Ethernet interfaces are up. |
Configuring flow control on an Ethernet interface
To avoid packet drops on a link, you can enable flow control at both ends of the link. When traffic congestion occurs at the receiving end, the receiving end sends a flow control (Pause) frame to ask the sending end to suspend sending packets
With the flow-control command configured, an interface can both send and receive flow control frames: When congested, the interface sends a flow control frame to its peer. Upon receiving a flow control frame from the peer, the interface suspends sending packets.
To enable flow control on an Ethernet interface:
Step |
Command |
Remarks |
1. Enter system view. |
system-view |
N/A |
2. Enter Ethernet interface view. |
interface interface-type interface-number |
N/A |
3. Enable flow control. |
flow-control |
By default, Rx flow control is disabled on an Ethernet interface. |
Configuring loopback testing on an Ethernet interface
If an Ethernet interface does not work normally, you can enable loopback testing on it to identify the problem. An Ethernet interface in a loopback test does not forward data traffic.
Loopback testing has the following types:
· Internal loopback testing—Tests all on-chip functions related to Ethernet interfaces.
· External loopback testing—Tests hardware of Ethernet interfaces. To perform external loopback testing on an Ethernet interface, connect a loopback plug to the Ethernet interface. The device sends test packets out of the interface, which are expected to loop over the plug and back to the interface. If the interface fails to receive any test packets, the hardware of the interface is faulty.
Configuration restrictions and guidelines
· On an interface that is physically down, you can only perform internal loopback testing. On an interface administratively shut down, you cannot perform internal or external loopback testing.
· The speed, duplex, and shutdown commands are not available during loopback testing.
· During loopback testing, the Ethernet interface operates in full duplex mode. When you disable loopback testing, the port returns to its duplex setting.
Configuration procedure
To enable loopback testing on an Ethernet interface:
Step |
Command |
Remarks |
1. Enter system view. |
system-view |
N/A |
2. Enter Ethernet interface view. |
interface interface-type interface-number |
N/A |
3. Enable loopback testing. |
loopback { external | internal } |
By default, loopback testing is disabled. |
Setting a statistics polling interval
You can set an interface statistics polling interval. To display the interface statistics collected in the last polling interval, use the display interface command.
To set the statistics polling interval:
Step |
Command |
Remarks |
1. Enter system view. |
system-view |
N/A |
2. Set the statistics polling interval. |
flow-interval interval |
By default, the statistics polling interval is 300 seconds. |
Configuring a port group
Some interfaces on your device might use the same set of settings. To configure these interfaces in bulk rather than one by one, you can assign them to a port group.
You create port groups manually. All settings made for a port group apply to all the member ports of the group. For example, you can configure a traffic suppression threshold (see "Configuring storm suppression") for multiple interfaces in bulk by assigning these interfaces to a port group.
Even though the settings are made on the port group, they are saved on each interface basis rather than on a port group basis. You can only view the settings in the view of each interface by using the display current-configuration or display this command.
To configure a manual port group:
Step |
Command |
Remarks |
1. Enter system view. |
system-view |
N/A |
2. Create a manual port group and enter manual port group view. |
port-group manual port-group-name |
N/A |
3. Assign Ethernet interfaces to the manual port group. |
group-member interface-list |
If you use the group-member interface-type interface-start-number to interface-type interface-end-number command to add multiple ports in batch to the specified port group, make sure all these ports are of the same type and on the same interface card, and the interface-end-number argument must be greater than the interface-start-number argument. |
Configuring storm suppression
You can use the storm suppression function to limit the size of a particular type of traffic (broadcast, multicast, or unknown unicast traffic) that can be received as a whole globally in system view or on a per-interface basis in Ethernet interface view or port group view, as follows:
· In system view, you set the maximum size of broadcast, multicast, or unknown unicast traffic allowed to be received as a whole. When the sum of broadcast, multicast, or unknown unicast traffic received on all interfaces of the system exceeds this threshold, the system discards packets until the traffic drops below this threshold.
· In interface or port group view, you set the maximum size of broadcast, multicast or unknown unicast traffic allowed to be received on an interface or each interface in a port group. When the broadcast, multicast, or unknown unicast traffic received on the interface exceeds this threshold, the system discards packets until the traffic drops below this threshold.
If you set a traffic suppression threshold for an Ethernet interface that belongs to a port group in both Ethernet interface view and port group view, the threshold configured last takes effect.
To set storm suppression thresholds:
Step |
Command |
Remarks |
1. Enter system view. |
system-view |
N/A |
2. Enter Ethernet interface view or port group view. |
·
Enter Ethernet interface view: ·
Enter port group view: |
Use either command. To configure storm suppression on an Ethernet interface, enter Ethernet interface view. To configure storm suppression on a group of Ethernet interfaces, enter port group view. |
3. Set the broadcast suppression threshold ratio. |
broadcast-suppression { ratio | pps max-pps } |
Optional. By default, broadcast traffic is allowed to pass through an interface. |
4. Set the multicast suppression threshold ratio. |
multicast-suppression { ratio | pps max-pps } |
Optional. By default, multicast traffic is allowed to pass through an interface. |
5. Set the unknown unicast suppression threshold ratio. |
unicast-suppression { ratio | pps max-pps } |
Optional. By default, unknown unicast traffic is allowed to pass through an interface. |
Enabling loopback detection on an Ethernet interface
|
IMPORTANT: The device supports only single-port loopback. |
If a device receives a packet that it sent, a loop has occurred to the device. Loops might cause broadcast storms, which degrade network performance. You can use this feature to detect whether a loop has occurred.
Depending on whether the receiving interface is the same as the sending interface, loops fall into the following types:
· Single-port loopback—Single-port loopback occurs when an interface receives a packet that it sent and the receiving interface is the same as the sending interface, as shown in Figure 1.
· Multi-port loopback—Multi-port loopback occurs when a device receives a packet that it sent but the receiving interface might not be the sending interface, as shown in Figure 2.
You can enable loopback detection to detect loops on an interface and the device takes the actions in Table 1 to alleviate the impact of the loop condition.
Table 1 Actions to take upon detection of a loop condition
Port type |
Actions |
Access port |
· Place the receiving interface in controlled mode. The interface discards all incoming packets, but still forwards outgoing packets. · Generate traps. · Delete all MAC address entries of the interface. |
Hybrid or trunk port |
· Generate traps. · If loopback detection control is enabled, place the receiving interface in controlled mode. The interface discards all incoming packets, but still forwards outgoing packets. · Delete all MAC address entries of the interface. |
Configuration restrictions and guidelines
· To use loopback detection on an Ethernet interface, you must enable the function both globally and on the interface.
· To disable loopback detection on all interfaces, run the undo loopback-detection enable command in system view.
· To enable a hybrid or trunk port to take the administratively specified protective action, you must use the loopback-detection control enable command on the port.
· When you change the link type of an Ethernet interface by using the port link-type command, the device removes the protective action configured on the interface. For more information about the port link-type command, see Layer 2 Command Reference.
Configuration procedure
To configure loopback detection:
Step |
Command |
Remarks |
1. Enter system view. |
system-view |
N/A |
2. Enable global loopback detection. |
loopback-detection enable |
By default, global loopback detection is disabled. |
3. Set the loopback detection interval. |
loopback-detection interval-time time |
Optional. The default setting is 30 seconds. |
4. Enter Ethernet interface view or port group view. |
·
Enter Ethernet interface view: ·
Enter port group view: |
Use either command. To configure loopback detection on one interface, enter Ethernet interface view. To configure loopback detection on a group of Ethernet interfaces, enter port group view. |
5. Enable loopback detection on the interface. |
loopback-detection enable |
By default, loopback detection is disabled. |
6. Enable loopback detection control on a trunk port or a hybrid port. |
loopback-detection control enable |
Optional. By default, loopback detection control is disabled. |
Displaying and maintaining an Ethernet interface
Task |
Command |
Remarks |
Display Ethernet interface information. |
display interface [ interface-type ] brief [ down ] [ | { begin | exclude | include } regular-expression ] display interface interface-type interface-number } [ brief ] [ | { begin | exclude | include } regular-expression ] |
Available in any view. |
Display information about a manual port group or all manual port groups. |
display port-group manual [ all | name port-group-name ] [ | { begin | exclude | include } regular-expression ] |
Available in any view. |
Display information about the loopback function. |
display loopback-detection [ | { begin | exclude | include } regular-expression ] |
Available in any view. |
Clear the interface statistics. |
reset counters interface [ interface-type [ interface-number ] ] |
Available in user view. |