강좌
클라우드/리눅스에 관한 강좌입니다.
리눅스 분류

ethtool을 이용하여 랜카드 속도 및 전송모드 설정변경하기

작성자 정보

  • 관리자 작성
  • 작성일

컨텐츠 정보

본문

ethtool을 이용하여 랜카드 속도 및 전송모드 설정변경하기

 

 

 

 

 

 

 

 

 그렇다면 이렇게 정보를 확인한 다음 설정변경을 하고자 한다면 어떻게 하면 될까요? 이것 역시 ethtool을 이용합니다.

 

 

 

 , ethtool -s라는 옵션을 사용하면 우리가 하고자 하는 설정변경을 할 수 있습니다.

 

 

 

, 리눅스 시스템에서 특정 이더넷의 속도설정과 전송모드 등의 변경은 어떻게 할까요? 이것은 다음과 같은 명령어로 해결할 수 있습니다.

 

 

 

 결론적으로 현재 서버에 설정되어있는 이더넷카드의 속도설정문제와 전송모드(full duplex, half duplex)를 설정하거나 확인할 수 있는 명령어가 바로 ethtool입니다.

 

 

 

 

 

먼저 이 명령어의 사용형식은 다음과 같습니다.

 

 

 

 

 

ethtool -s eth0 [speed 10|100|1000] [duplex half|full] [autoneg on|off]

 

 

 

 

우리는 앞에서 이더넷이 어떤 설정상태인가를 간단히 확인할 수 있었습니다.

 

 

 

 이번에는 eth0이더넷의 상태를 변경하는 예를 보도록 하겠습니다.

 

 

 

 

 

[root@localhost ~]# ethtool eth0

Settings for eth0:

        Supported ports: [ TP MII ]

        Supported link modes:   10baseT/Half 10baseT/Full

                                100baseT/Half 100baseT/Full

        Supports auto-negotiation: Yes

        Advertised link modes:  10baseT/Half 10baseT/Full

                                100baseT/Half 100baseT/Full

        Advertised auto-negotiation: Yes

        Speed: 100Mb/s

        Duplex: Full

        Port: MII

        PHYAD: 1

        Transceiver: internal

        Auto-negotiation: on

        Supports Wake-on: g

        Wake-on: g

        Current message level: 0x00000007 (7)

        Link detected: yes

[root@localhost ~]#

 

 

 

 

앞의 예에서 가장 먼저 현재 설정상태를 확인하기 위하여 “ethtool eth0”을 실행하였습니다.

 

 

 

 그 결과 현재 eth0 이더넷은 속도100M, 전송모드 full duplex(전이중), auto negotiation ON의 설정 값을 가지고 있습니다.

 

 

 

 이것을 다음과 같이 변경하였습니다.

 

 

 

 

 

[root@localhost ~]# ethtool -s eth0 speed 10 duplex half autoneg off

[root@localhost ~]#

[root@localhost ~]# ethtool eth0

Settings for eth0:

        Supported ports: [ TP MII ]

        Supported link modes:   10baseT/Half 10baseT/Full

                                100baseT/Half 100baseT/Full

        Supports auto-negotiation: Yes

        Advertised link modes:  10baseT/Half 10baseT/Full

                                100baseT/Half 100baseT/Full

        Advertised auto-negotiation: No

        Speed: 10Mb/s

        Duplex: Half

        Port: MII

        PHYAD: 1

        Transceiver: internal

        Auto-negotiation: off

        Supports Wake-on: g

        Wake-on: g

        Current message level: 0x00000007 (7)

        Link detected: yes

[root@localhost ~]#

 

 

 

 

, 전송속도는 100M에서 10M로 변경하였고, 전송모드는 전이중(full duplex)에서 반이중(halt duplex)으로 변경하였고, 자동협상기능을 on에서 off로 변경하였습니다.

 

 

 

 

 

 변경한 후에 다시 “ethtool eth0”을 실행하여 변경된 값을 확인하였습니다.

 

 

 

 

 

그리고 이번에는 다시 ethtool을 이용하여 다음과 같이 설정을 변경하였습니다.

 

 

 

 

 

[root@localhost ~]# ethtool -s eth0 speed 100 duplex full autoneg on

[root@localhost ~]#

[root@localhost ~]# ethtool eth0

Settings for eth0:

        Supported ports: [ TP MII ]

        Supported link modes:   10baseT/Half 10baseT/Full

                                100baseT/Half 100baseT/Full

        Supports auto-negotiation: Yes

        Advertised link modes:  100baseT/Full

        Advertised auto-negotiation: Yes

        Speed: 100Mb/s

        Duplex: Full

        Port: MII

        PHYAD: 1

        Transceiver: internal

        Auto-negotiation: on

        Supports Wake-on: g

        Wake-on: g

        Current message level: 0x00000007 (7)

        Link detected: yes

[root@localhost ~]#

 

 

 

 

, 속도를 10M에서 100M로 변경하였고, 전송모드를 half에서 full로 변경하였고, 자동협상기능을 off에서 on으로 활성화하였습니다.

 

 

 

 위의 결과를 확인하시기 바랍니다.

 

 

 

 

 

지금까지 ethtool을 이용하여 특정 이더넷의 설정 값을 확인하고 변경하는 예들을 보았습니다.

 

 

 

 앞서 말씀 드렸듯이 ethtool명령어는 ifconfig명령어와 함께 공부하셔야 하고, 또한 mii-tool이라는 이더넷 관련 유용한 툴이 있습니다.

 

 

 

 이 세가지를 함께 알아두신다면 좋을 것입니다

 

이상으로 ethtool에 대한 설명을 마치면서 여러분들이 관리하는 리눅스 시스템의 이더넷을 확인해 보시기 바랍니다.

 

 

 

 전송속도가 어떻게 설정되어 있는가? 전송모드는 어떤 상태인가? 자동협상기능은 켜져 있는가?등의 설정확인을 할 수 있어야 하고, 필요할 경우에 이 값들을 변경할 수 있는 능력이 있어야 할 것입니다.

 

 

 

 필자는 여러분들께서 이런 능력을 충분히 가지고 계시다고 생각합니다.

 

관련자료

댓글 0
등록된 댓글이 없습니다.

공지사항


뉴스광장


  • 현재 회원수 :  60,074 명
  • 현재 강좌수 :  35,995 개
  • 현재 접속자 :  526 명