在 Linux 中升级端口速度
使用以下信息在 Linux中更新端口速度。
以下命令会影响服务器的连接。 始终通过首先连接到未使用的 IP 来管理网络连接。
可以通过运行以下命令来检查连接的当前速度:
# ethtool eth# (eth1 for public, eth0 for private)
输出显示该连接的当前配置:
root@noc-training-linux [~]# ethtool eth1
eth1 的设置:
Supported ports: [ MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised auto-negotiation: Yes
Speed: 100Mb/s
Duplex: Full
Port: MII
PHYAD: 3
Transceiver: external
Auto-negotiation: on
Supports Wake-on: g
Wake-on: d
Link detected: yes
root@noc-training-linux [~]#
要更改速度,请使用您喜爱的文本编辑器编辑以下文件:
/etc/sysconfig/network-scripts/ifcfg-eth# (ifcfg-eth1 for public, ifcfg-eth0 for private)
您将看到以下行:
ETHTOOL_OPTS="autoneg off speed 100 duplex full"
此条目允许在引导时强制自动协商,速度和双工,通过重新启动保持一致的配置。 可以修改速度以与新的端口速度相匹配。 此修改需要在应用新速度之前重新启动网络。
如果强制使所有连接为 1000 Mbps,那么必须在 ifcfg-eth# 文件中启用 autoneg。