본문 바로가기
+ OS/Linux & Unix

[Linux] ethtool 명령어를 이용한 NIC(Network Interface Controller) 정보 확인 방법

by :: Teacher :: 2021. 8. 23.
728x90
반응형

리눅스(Linux)에서 ethtool 명령어를 사용하여 NIC Card(네트워크 카드, 랜카드)의 여러 정보를 확인할 수 있다. 

간혹 현재 사용하고 있는 NIC Card의 지원 속도가 얼마인지 혹은 해당 NIC Card의 모델, 드라이버 등을 확인할 수 있다.

그럼 ethtool 명령어를 통해서 어떻게 확인할 수 있는지 알아보도록 하자.

 1. 현재 사용하는 NIC Card 찾기

일단 ethtool 명령어를 사용하기 전에 현재 사용하고 있는 네트워크 인터페이스명을 확인해야 한다. 

이때 사용하는 명령어는 ifconfig로 흔히 IP를 확인할 때 많이 사용하는 명령어이다. 

  • $ ifconfig
# ifconfig [옵션]

$ ifconfig -a
enp0s31f6: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.20  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::4dc1:b18b:78ef:3959  prefixlen 64  scopeid 0x20<link>
        ether 70:85:c2:2b:d9:h3  txqueuelen 1000  (Ethernet)
        RX packets 269601  bytes 402677694 (384.0 MiB)
        RX errors 0  dropped 1550  overruns 0  frame 0
        TX packets 70014  bytes 5039884 (4.8 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 16  memory 0xdf000000-df020000
        
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 64  bytes 5705 (5.5 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 64  bytes 5705 (5.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255
        ether 52:54:00:65:65:af  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0-nic: flags=4098<BROADCAST,MULTICAST>  mtu 1500
        ether 52:54:00:65:65:af  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
728x90

2. ethtool 명령어 설치 및 버전 확인하기

ethtool 명령어는 NIC Card의 설정값 및 정보를 확인할 수 있는 명령어이다. 

대부분 리눅스(Linux)에 설치되어 있으나, 먼저 설치 여부 및 버전을 알아보도록 하자. 

  • $ rpm -qa | grep ethtool
  • $ ethtool --version
# rpm을 통한 설치 여부 확인

$ rpm -qa | grep ethtool
ethtool-5.0-2.el8.x86_64


# ethtool Version 확인

$ ethtool --version
ethtool version 5.0

3. NIC Card 드라이버 정보 확인하기

이제 사용하는 NIC Card의 네트워크 인터페이스명과 ethtool 명령어 설치됨을 확인하였다. 

확인된 인터페이스명을 통해서 ethtool 명령어에 -i 옵션을 통해서 드라이버 정보 및 Bus, 인터베이스에서 지원하는 정보를 확인할 수 있다. 

  • $ ethtool -i enp0s31f6
# ethtool 명령어로 드라이버 정보 확인하기

$ ethtool -i enp0s31f6
driver: e1000e
version: 3.2.6-k
firmware-version: 0.2-4
expansion-rom-version:
bus-info: 0000:00:1f.6
supports-statistics: yes
supports-test: yes
supports-eeprom-access: yes
supports-register-dump: yes
supports-priv-flags: no

enp0s31f6 인터페이스에서 사용되는 드라이버(driver)는 e1000e이고, 드라이버 버전(version)은 3.2.6-k이고, 현재 펌웨어 버전(firmware-version)은 0.2-4이다. 

반응형

4. NIC Card 상세 정보 확인 하기

이번에는 현재 사용되고 있는 NIC Card의 지원 속도 등 자세한 정보를 알아보도록 하자. 

  • $ ethtool enp0s31f6
# ethtool 명령어로 여러 정보 확인하기

$ ethtool enp0s31f6
Settings for enp0s31f6:
	Supported ports: [ TP ]
	Supported link modes:   10baseT/Half 10baseT/Full
	                        100baseT/Half 100baseT/Full
	                        1000baseT/Full
	Supported pause frame use: No
	Supports auto-negotiation: Yes
	Supported FEC modes: Not reported
	Advertised link modes:  10baseT/Half 10baseT/Full
	                        100baseT/Half 100baseT/Full
	                        1000baseT/Full
	Advertised pause frame use: No
	Advertised auto-negotiation: Yes
	Advertised FEC modes: Not reported
	Speed: 1000Mb/s
	Duplex: Full
	Port: Twisted Pair
	PHYAD: 1
	Transceiver: internal
	Auto-negotiation: on
	MDI-X: on (auto)
Cannot get wake-on-lan settings: Operation not permitted
	Current message level: 0x00000007 (7)
			       drv probe link
	Link detected: yes

enp0s31f6 인터페이스에서 사용되는 Port Type은 TP(Twisted Pair) Type이고, 사용되는 Link 속도는 1000Mb/s (1G)이고, Duplex는 Full이다. 

여러 정보가 있지만 그 부분은 한번 더 나중에 더 알아보도록 하자.

이중 해당 NIC Card가 지원하는 Link 속도는 10 baseT/Half, 10 baseT/Full, 100 baseT/Half, 100 baseT/Full, 1000 baseT/Full와 같다.

연결하는 회선 속도에 따라서 변경이 가능하나 대부분은 자동적으로 최상의 값으로 설정되나, 추후 속도가 너무 느리다면 한번 정도 확인해 볼 필요는 있다. 

5. NIC Card 제조사 확인하기

ifconfig를 통해서 확인된 Mac Address정보를 통해서 해당 NIC Card의 제조사를 알 수 있는 방법이 있다. 

해당 방법은 예전 작성해놓았으니, 참고하면 좋을 것 같다.

 

[MAC Address] 제조회사별 맥 주소 확인 방법(How to check MAC address by manufacturer)

MAC Address(맥 주소)란  컴퓨터 네트워킹에서의 이더넷의 물리적인 주소를 지칭한다. 그중 네트워크 어댑터(NIC)에 부착된 준 고유 식별자로 특정한 어댑터의 이름같이 동작하는 숫자, 문자이다. M

info-lab.tistory.com

또 다른 방법은 아래와 같이 lspic, lshw 명령어를 통해서 확인할 수 있다. 

  • $ lspci | grep Ethernet
  • $ lshw -c network
# lspci 명령어도 NIC Card 드라이버 제조사 확인

$ lspci | grep Ethernet
00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection (2) I219-V


# lshw 명령어도 NIC Card 드라이버 제조사 확인

$ sudo lshw -c network
  *-network
       description: Ethernet interface
       product: Ethernet Connection (2) I219-V
       vendor: Intel Corporation
       physical id: 1f.6
       bus info: pci@0000:00:1f.6
       logical name: enp0s31f6
       version: 00
       serial: 70:85:c2:2b:d9:h3
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 32 bits
       clock: 33MHz
       capabilities: pm msi bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=e1000e driverversion=3.2.6-k duplex=full firmware=0.2-4 ip=192.168.0.20 latency=0 link=yes multicast=yes port=twisted pair speed=1Gbit/s
       resources: irq:125 memory:df000000-df01ffff

위에 내용을 모두 참고해보면 ASRock에서 Intel 사에서 제조된 NIC Card 칩셋을 탑재하여 사용되는 것으로 확인된다. 

이제 리눅스에서 사용하는 NIC Card 여러 정보에 대해서 확인하는 방법을 알아보았다. 

 

 

728x90
반응형

댓글


loading