/**/
お問い合わせ

BLOG技術者ブログ

> > Linux(RHEL系)コマンド「ethtool」について

Linux(RHEL系)コマンド「ethtool」について

2022/08/13

こんにちは。キャリエ社員のTKです。

今回はLinux(RHEL系)のコマンド「ethtool」をご紹介します。
このコマンドはサーバ等のinterfaceの状態を確認できます。

■コマンド実行例
NIC(Network Interface Card)のデバイス名を引数として指定します。

1.interfaceにネットワークケーブルが接続されている場合
 ※デバイス名がeth0の場合

[root@localhost ~]# ethtool eth0
Settings for eth0:
        Supported ports: [ FIBRE ]
        Supported link modes:   1000baseT/Full
                                10000baseT/Full
        Supported pause frame use:Symmetric Receve-only
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  1000baseT/Full
                                10000baseT/Full
        Advertised pause frame use: No
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Speed: 1000Mb/s
        Duplex: Full
        Port: None
        PHYAD: 1
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: d
        Wake-on: d
        Current message level: 0x00000000 (0)

        Link detected: yes

2.interfaceにネットワークケーブルが接続されていない場合

[root@localhost ~]# ethtool eth0
Settings for eth0:
        Supported ports: [ FIBRE ]
        Supported link modes:   1000baseT/Full
                                10000baseT/Full
        Supported pause frame use:Symmetric Receve-only
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  1000baseT/Full
                                10000baseT/Full
        Advertised pause frame use: No
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Speed: Unknown!
        Duplex: Unknown! (255)
        Port: None
        PHYAD: 1
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: d
        Wake-on: d
        Current message level: 0x00000000 (0)

        Link detected: no

上記の「Link detected:」の項目がyes/noと表示されており、ネットワークケーブルの
接続の有無を確認できます。

その他に確認できるinterfaceの状態として、NICが対応しているネットワークケーブルの
種類(Supported ports:)、NICが対応している接続速度(Supported link modes)、
現在の接続速度(Speed)、現在の接続が全二重通信か半二重通信か(Duplex:Full/Harf)、
などの状態が確認できます。

また、ethtoolコマンドは多数のオプションを有しており、たとえば「#ethtool -i eth0」のように
「-i」オプションを使用することで、NICに適用されているドライバ名やバージョン、デバイスの
バス番号を表示させることができます。


なお、ethtoolがインストールされていないOSパッケージもあります。

常駐先環境機器へのインストール際には事前にお客様に説明して
同意を得てから行いましょう。

それでは。