ethtool 명령어 사용 방법은 무엇인가요?
💡 요약 정리
- ethtool 명령어는 네트워크 설정 정보를 확인하고 수정할 수 있는 도구입니다.
- 연결 속도, 듀플렉스 모드, 링크 상태 등 다양한 정보를 제공합니다.
ethtool -s명령어로 속도, 통신 방식, 자동 설정 여부를 변경할 수 있습니다.- 여러 포트가 있는 랜카드 식별은
ethtool -p옵션을 사용할 수 있습니다.
1. ethtool 명령어 개요
ethtool 은 네트워크 카드의 설정사항을 보여주거나 변경할 수 있는 명령어입니다.
2. 주요 필드 설명
-
Speed (10 | 100 | 1000Mbps) 케이블이 연결된 속도가 표시됩니다.
-
Duplex (Full | Half Duplex) 통신방식이 표시됩니다.
-
Port (tp | aui | bnc | mii | fibre) Device port 형태가 표시됩니다.
-
Transceiver (internal | external) 송수신 방식이 표시됩니다.
-
Auto-negotiation (on | off) 케이블이 연결되었을 때, 연결된 스위치 장비와의 통신 속도와 통신 방식을 자동으로 맞추어 주는 방식입니다. 스위치 장비의 설정에 맞추어서 자동으로 랜카드의 설정이 적용됩니다.
-
Wake-on (p|u|m|b|a|g|s|d) Wake-on 설정 옵션으로, 랜카드에 따라 지원 가능한 옵션이 다를 수 있습니다. Supports Wake-on 항목에 지원 가능한 옵션이 표시됩니다.
-
Link detected Link 연결상태를 표시해 주는 항목으로, yes 또는 no로 표시됩니다.
3. device 설정사항 확인
[root@localhost ~]# ethtool eth0
Settings for eth0:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised auto-negotiation: Yes
Speed: 1000Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 1
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: pumbg
Wake-on: g
Current message level: 0x00000001 (1)
Link detected: yes
[root@localhost ~]#
위 설정사항으로는 Speed 1000M, Duplex 모드 Full, Auto-negotiation on 상태로 연결이 되어 있습니다. Auto-negotiation 이 on 상태이기 때문에, 연결된 스위치 장비의 설정도 1000M, Full Duplex 임을 짐작할 수 있습니다.
4. 설정 변경 방법
device 설정 변경은 ethtool -s 옵션으로 할 수 있습니다.
ethtool -s 디바이스명 speed (10|100|1000) duplex (half|full) autoneg (on|off)
[root@localhost ~]# ethtool -s eth0 speed 100 duplex full autoneg off
[root@localhost ~]# ethtool eth0
Settings for eth0:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised auto-negotiation: Yes
Speed: 100Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 1
Transceiver: internal
Auto-negotiation: off
Supports Wake-on: pumbg
Wake-on: g
Current message level: 0x00000001 (1)
Link detected: yes
[root@localhost ~]#
5. 여러 포트를 가진 랜카드 식별하기
여러 포트가 있는 랜카드(예: 4포트 랜카드)를 장착하였을 경우, 실제 디바이스명과 매칭되는 포트를 구별하지 못할 수 있습니다.
이런 경우는 ethtool -p 옵션으로 확인이 가능합니다.
ethtool -p eth3
- 위 명령어를 입력하면 해당 포트가 깜빡이며 식별할 수 있습니다. (단, 모듈에 따라 지원되지 않는 랜카드도 있습니다.)