据我所知,下面的命令将设置自动协商所宣传的速度和双工。
ethtool -s eth0 advertise 0x020其中,0x020根据以下指南指示1000baseT Full:
advertise N
Sets the speed and duplex advertised by autonegotiation. The
argument is a hexadecimal value using one or a combination of
the following values:
0x001 10baseT Half
0x002 10baseT Full
0x004 100baseT Half
0x008 100baseT Full
0x010 1000baseT Half (not supported by IEEE standards)
0x020 1000baseT Full我应用的命令,只广告1000baseT Full。我想知道我是如何设置服务器来同时发布多个链接模式(如1000baseT Full 100baseT Full 100baseT Half )的。
我试着对所需的链接模式逐一应用相同的命令,但是每次新的链接模式替换了当前的模式,而不是添加到它中。
我还提到了链接模式,类似于下面的链接模式,但是它返回一个错误。
ethtool -s eth0 advertise 0x020 0x008 0x004
ethtool: bad command line argument(s)
For more information run ethtool -h当所有的广告都被公布时,它们将显示在ethtool输出中如下所示:
ethtool eth0
Settings for eth0:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Supported pause frame use: No
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full有什么想法吗?
发布于 2021-08-31 09:12:34
把数字加起来。注意到:
0x001是0b000000000001,0x002是0b000000000010,0x004是0b000000000100,依此类推,它们中的每一个都表示某个寄存器中的一个位(标志),该寄存器存储任何启用的模式。你只需要启用所有想要的部分。
在您的例子中,1000baseT Full、100baseT Full和100baseT Half将是0x020 + 0x008 + 0x004 = 0x02c:
ethtool -s eth0 advertise 0x02chttps://serverfault.com/questions/1076124
复制相似问题