Linux 링크 속도 광고

Linux 링크 속도 광고

내가 아는 한, 다음 명령은 자동 협상에서 알리는 속도와 이중을 설정합니다.

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

어떤 아이디어라도 있나요?

답변1

숫자를 더해보세요. 다음 사항을 관찰하세요.

  • 0x001이다 0b000000000001,
  • 0x002이다 0b000000000010,
  • 0x004이다 0b000000000100,

등등, 각각은 활성화된 모드를 저장하는 일부 레지스터의 하나의 비트(플래그)를 나타냅니다. 원하는 모든 비트를 활성화하면 됩니다.

귀하의 경우, 1000baseT Full100baseT Full100baseT Half다음과 같습니다 0x020 + 0x008 + 0x004 = 0x02c.

ethtool -s eth0 advertise 0x02c

관련 정보