以H3C S5120-25P-SI 为例
端口双工模式及速率配置
端口的双工模式时存在三种情况:
1、端口在发送数据包的同时可以接收数据包,可以将端口设置为全双工(full)属性;
2、端口同一时刻只能发送数据包或接收数据包时,可以将端口设置为半双工(half)属
3、端口为自协商(auto)状态时,端口的双工状态由本端口和对端端口自动协商而定。
设置端口的速率时,当设置端口速率为自协商(auto)状态时,端口的速率由本端口和对端端口双方自动协商而定。对于千兆二层以太网端口,可以根据端口的速率自协商能力,指定自协商速率,让速率在指定范围内协商。
端口配置常用命令

通常情况下,设备以太网端口速率是通过和对端自协商决定的。协商得到的速率是双方支持的最高速率。通过配置自协商速率可以让以太网端口在能力范围内只协商部分速率,从而可以控制速率的协商。

如上图所示,
服务器群(Server 1、Server 2和Server 3)网卡速率为1000Mbps
服务器群与外部网络相连端口(GigabitEthernet1/0/4)的速率也为1000Mbps。
如果在设备上不指定自协商速率范围,则端口(GigabitEthernet1/0/1、GigabitEthernet1/0/2和GigabitEthernet1/0/3)和服务器速率协商的结果将为1000Mbps,这样就可能造成出端口(GigabitEthernet1/0/4)拥塞。此时可以设置端口GigabitEthernet1/0/1、GigabitEthernet1/0/2和GigabitEthernet1/0/3的自协商速率范围为100Mbps,来避免出端口的拥塞。
端口速率配置教程
1、已通过Console口登录交换机
2、输入 system-view,进入用户视图

3、输入 interface GigabitEthernet 1/0/1

注:该命令格式如下:interface interface-type interface-number
interface-type 表示端口类型,取值如下(机型不一样,参数则也不一定相同,可以使用 interface-type ? 命令查看相关参数):
Bridge-Aggregation
GigabitEthernet
LoopBack
Null
Vlan-interface
interface-number表示端口编号
端口编号说明
端口均采用3位编号方式,格式如下:interface type A/B/C。
A表示设备的编号,取值为1。
B表示设备上的槽位号,取值为0。
C表示端口编号
4、配置端口速率
如端口配置为100M速率,则输入:speed 100

交换机端口1状态如下:

如端口配置1000M速率,则输入:speed 1000
交换机端口1状态如下:

如端口配置为自动速率,则输入:speed auto
交换机端口1状态如下:

如与交换机连接的设备端口速度为100M,而将交换机端口设为1000M,则会因速率不匹配,造成网络不通信,提示端口下线

交换机端口1状态如下

配置完成后,输入save保存配置失效
注:关闭网络端口,使用 shutdown
启用网络端口,使用 undo shutdown