
私の知る限り、次のコマンドは、自動ネゴシエーションによってアドバタイズされる速度とデュプレックスを設定します。
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
必要なリンク モードに対して同じコマンドを 1 つずつ適用してみましたが、そのたびに新しいリンク モードが現在のモードを置き換えてしまい、現在のモードに追加されません。
以下のようにリンクモードの16進コードを連続して指定しましたが、エラーが返されます。
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
、
など、それぞれがレジスタ内の 1 ビット (フラグ) を表し、有効になっているモードが格納されます。必要なビットをすべて有効にするだけで済みます。
あなたの場合、1000baseT Full
および100baseT Full
は100baseT Half
次のようになります0x020 + 0x008 + 0x004 = 0x02c
:
ethtool -s eth0 advertise 0x02c