Configuring basic settings of an Ethernet interface or subinterface
You can configure an Ethernet interface to operate in one of the following duplex modes:
Full-duplex mode—The interface can send and receive packets simultaneously.
Half-duplex mode—The interface can only send or receive packets at a given time.
Autonegotiation mode—The interface negotiates a duplex mode with its peer.
You can set the speed of an Ethernet interface or enable it to automatically negotiate a speed with its peer.
Configuring 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. Set the description for the Ethernet interface. | description text | The default setting is interface-name Interface. For example, GigabitEthernet2/1/1 Interface. |
4. Set the duplex mode for the Ethernet interface. | duplex { auto | full | half } | By default:
Fiber ports do not support the half keyword. 10-GE interfaces only support the auto keyword. |
5. Set the speed for the Ethernet interface. | speed { 10 | 100 | 1000 | auto } | The default speed of an Ethernet interface is set to auto. |
6. Set the expected bandwidth for the Ethernet interface. | bandwidth bandwidth-value | By default, the expected bandwidth (in kbps) is the interface baud rate divided by 1000. |
7. Restore the default settings for the Ethernet interface. | default | N/A |
8. Bring up the Ethernet interface. | undo shutdown | By default, an Ethernet interface is enabled. The shutdown and loopback commands are mutually exclusive. |
Configuring an Ethernet subinterface
When you configure an Ethernet subinterface, follow these restrictions and guidelines:
To transmit and receive packets through an Ethernet subinterface, you must associate it with a VLAN. For more information, see Layer 2—LAN Switching Configuration Guide.
To transmit packets between a local Ethernet subinterface and a remote Ethernet subinterface, configure them with the same subinterface number and VLAN ID.
To configure an Ethernet subinterface:
Step | Command | Remarks |
---|---|---|
1. Enter system view. | system-view | N/A |
2. Create an Ethernet subinterface. | interface interface-type interface-number.subnumber | N/A |
3. Set the description for the Ethernet subinterface. | description text | The default setting is interface-name Interface. For example, GigabitEthernet2/1/1.1 Interface. |
4. Restore the default settings for the Ethernet subinterface. | default | N/A |
5. Set the expected bandwidth for the Ethernet subinterface. | bandwidth bandwidth-value | By default, the expected bandwidth (in kbps) is the interface baud rate divided by 1000. |
6. Bring up the Ethernet subinterface. | undo shutdown | By default, an Ethernet subinterface is enabled. The shutdown and loopback commands are mutually exclusive. |