메뉴 닫기

리눅스에서 ethtool로 대역폭 조절.

리눅스 사용자라면 네트웍 디바이스의 링크 상태 및 속도 체크를 위해 ethtool을 
많이 사용 해보셨을 겁니다.

root@ubuntu:~# ethtool eth4
Settings for eth4:
 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
 Advertised link modes: 10baseT/Half 10baseT/Full 
 100baseT/Half 100baseT/Full 
 1000baseT/Full 
 Advertised pause frame use: No
 Advertised auto-negotiation: Yes
 Speed: 1000Mb/s                          --> 현재 대역폭을 나타낸다
 Duplex: Full
 Port: Twisted Pair
 PHYAD: 1
 Transceiver: internal
 Auto-negotiation: on
 MDI-X: on (auto)
 Supports Wake-on: pumbg
 Wake-on: g
 Current message level: 0x00000007 (7)
 drv probe link
 Link detected: yes

 

하지만 대부분의 사람들이 ethtool로 상태만 확인하지 네트웍크 대역폭 조절이 가능
한지 모르고 있습니다.

하지만 ethtool로 간단히 네트웍 속도를 조절 할수 있습니다.

root@ubuntu:~# ethtool -s eth4 speed 100 duplex full autoneg off
root@ubuntu:~# ethtool eth4
Settings for eth4:
	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
	Advertised link modes:  Not reported
	Advertised pause frame use: No
	Advertised auto-negotiation: No
	Speed: 100Mb/s                          --> 현재 대역폭이 100Mbit로 변경.
	Duplex: Full
	Port: Twisted Pair
	PHYAD: 1
	Transceiver: internal
	Auto-negotiation: off
	MDI-X: off (auto)
	Supports Wake-on: pumbg
	Wake-on: g
	Current message level: 0x00000007 (7)
			       drv probe link
	Link detected: yes

※ ethtool명령어로 auto-negotiation을 off 하고 설정이 가능합니다.
   하지만 단점은 10, 100, 1000, 10000요런식으로 10단위로 설정이 지원되니
   저 값 이외의 값을 설정할려면 tc를 설치 하거나 스위치에서 제어해야
   합니다.

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 항목은 *(으)로 표시합니다