IT 정보/리눅스

Linux 인터페이스 확인 및 설정 변경 ethtool 명령어

DONOT 2023. 5. 23. 14:55

네트워크 인테페이스 정보를 확인 및 설정 변경 할려면 ethtool 명령어를 사용

 

먼저 사용 방법은 ethtool -[옵션] [인터페이스 네임] 사용 가능합니다.

 

물리적인(LAN CARD) 정보 확인

[root@ablecube1 ~]# ethtool -i enx4
driver: ixgbe
version: 5.19.3-1.el8.elrepo.x86_64
firmware-version: 0x800003df
expansion-rom-version: 
bus-info: 0000:3b:00.0
supports-statistics: yes
supports-test: yes
supports-eeprom-access: yes
supports-register-dump: yes
supports-priv-flags: yes

 

인터페이스 정보 확인

[root@ablecube1 ~]# ethtool enx4
Settings for enx4: Supported ports: [ FIBRE ]  
Supported link modes: 10000baseT/Full
Supported pause frame use: Symmetric
Supports auto-negotiation: No
Supported FEC modes: Not reported
Advertised link modes: 10000baseT/Full
Advertised pause frame use: Symmetric Advertised auto-negotiation: No
Advertised FEC modes: Not reported
Speed: 10000Mb/s <-----속도 10G
Duplex: Full  <------ 풀듀플렉스
Auto-negotiation: off <------ 오토네고 OFF
Port: FIBRE  <----- 포트 타입 광
PHYAD: 0
Transceiver: internal
Supports Wake-on: d
Wake-on: d
Current message level: 0x00000007 (7)
                                           drv probe
link Link detected: yes <----- 링크 연결중

 

인터페이스 속도 및 듀블렉스 오토네고 변경

# ethtool -s enx4 autoneg off
# ethtool -s enx4 speed 1000 duplex half

 

인터페이스 통계 정보

[root@ablecube1 ~]# ethtool -S enx4
NIC statistics:
     rx_packets: 2995652
     tx_packets: 5772285
     rx_bytes: 636642990
     tx_bytes: 6841972530
     rx_pkts_nic: 2995650
     tx_pkts_nic: 5772282
     rx_bytes_nic: 648625441
     tx_bytes_nic: 6866899853
     lsc_int: 3
     tx_busy: 0
     non_eop_descs: 0
     rx_errors: 0
     tx_errors: 0
     rx_dropped: 25805
     tx_dropped: 0
     multicast: 465041
     broadcast: 796264
     rx_no_buffer_count: 0
     collisions: 0
     rx_over_errors: 0
     rx_crc_errors: 0
     rx_frame_errors: 0

 

리눅스 서버에 많은 LAN 카드가  실장되어 있을 시 네트워크 인터페이스 이름에 맞는 LAN 카드 포트에 LED 점등해서 찮기

[root@ablecube1 ~]# ethtool -p enx4

 

LAN CARD 종류에 따라 버퍼 크기가 다른데 리눅스 설치시 MAX 값 으로  TX ,RX 버퍼 크기가 설정이 안되어 있거나 통계정보에(rx_missed_errors, tx_missed_errors) 손실이 있으면 버퍼 크기 확인 후 최대 값으로 변경

 

네트워크 인터페이스 버퍼 확인

[root@ablecube1 ~]# ethtool -g enx4
Ring parameters for enx4:
Pre-set maximums:
RX:             4096
RX Mini:        n/a
RX Jumbo:       n/a
TX:             4096
Current hardware settings:
RX:             512
RX Mini:        n/a
RX Jumbo:       n/a
TX:            512

 

네트워크 인터페이스 버퍼 변경

[root@ablecube1 ~]# ethtool -G enx4 rx 4096 tx 4096
Ring parameters for enx4:
Pre-set maximums:
RX: 4096
RX Mini: n/a
RX Jumbo: n/a
TX: 4096
Current hardware settings:
RX: 4096
RX Mini: n/a
RX Jumbo: n/a
TX: 4096

 

필요한 설정을 변경하고 재 부팅 하면 초기화됩니다. 변경된 정보로 부팅 방법

[root@ablecube1 ~]# vi /etc/rc.local
ethtool -G enx4 rx 4096 tx 4096 <---- 추가 후 저장
반응형