首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Linux速度广告

问Linux速度广告
EN

Server Fault用户
提问于 2021-08-31 08:44:52
回答 1查看 3.6K关注 0票数 0

据我所知,下面的命令将设置自动协商所宣传的速度和双工。

代码语言:javascript
复制
ethtool -s eth0 advertise 0x020

其中,0x020根据以下指南指示1000baseT Full:

代码语言:javascript
复制
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 )的。

我试着对所需的链接模式逐一应用相同的命令,但是每次新的链接模式替换了当前的模式,而不是添加到它中。

我还提到了链接模式,类似于下面的链接模式,但是它返回一个错误。

代码语言:javascript
复制
ethtool -s eth0 advertise 0x020 0x008 0x004
    ethtool: bad command line argument(s)
    For more information run ethtool -h

当所有的广告都被公布时,它们将显示在ethtool输出中如下所示:

代码语言:javascript
复制
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

有什么想法吗?

EN

回答 1

Server Fault用户

回答已采纳

发布于 2021-08-31 09:12:34

把数字加起来。注意到:

  • 0x001是0b000000000001,
  • 0x002是0b000000000010,
  • 0x004是0b000000000100,

依此类推,它们中的每一个都表示某个寄存器中的一个位(标志),该寄存器存储任何启用的模式。你只需要启用所有想要的部分。

在您的例子中,1000baseT Full、100baseT Full和100baseT Half将是0x020 + 0x008 + 0x004 = 0x02c:

代码语言:javascript
复制
ethtool -s eth0 advertise 0x02c
票数 1
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/1076124

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档