10Mb/s tun/tap .. 100/1000Mb/speed로 변경하는 패치

tun/tap는 10Mb/s 이다.. 다 이유가 있어서.. 10Mb/s로 고정 해났겠지.. ? 뭐 암튼.. https://patchwork.ozlabs.org/patch/439367/ 여기에 패치가 있다고 해서 들러봤다. 어.. ethool로 다이나믹하게 10/100/1000 조절이 되는 패치가 정말 있다. 내 환경은 대부분  centos이기 때문에 내 환경에 맞게 패키징을 해보았다. 이렇게 모듈만 가져다가 설치하게 만들어놓으면  yum등으로 업데이트 될 경우 커널을  다시 컴파일해서 다시 바꾸고 하는 등등.. 쌩고생을 안해도 됨 따라서 yum등으로 커널 업데잍 되는경우 patch.sh를 한번 실행해주면 끝남. 혹시 모르니 /lib/modules/`uname -r`/kernel/drivers/net/tun.ko 파일은 백업해두고 진행. 아래 링크 받아다가 앞축풀어서 ./patch.sh실행만하면 모듈이 설치가 된다. (커널 kernel-headers , kernel-devel은 기본적으로 설치 되어 있어야함.)

ㅌㅔ스트환경은 centos6  이다. 다른 버전은 안되겠지? 따로 패키징하는게 맞을듯. ( 32bit/64bit 테스트완료됨)

ㄷㅏ운로드 –> tun_patch.tar.gz  

사실 openvpn tun/tap가 10Mb/s이기에.. 속도 안습 땀시 접근했던건데.. 이거 바꿧다고 속도가 막? 올라가고 그러진 않았음(내심 기대했는데 ㅎ).. 역시 pc퍼포먼스ㄴㅏ 네트워크에 따라.. 속도가 결정되는게 맞는듯..

패치전 10Mb/s
sh-4.1# ethtool tun0
Settings for tun0:
Supported ports: [ ]
Supported link modes:   Not reported
Supported pause frame use: No
Supports auto-negotiation: No
Advertised link modes:  Not reported
Advertised pause frame use: No
Advertised auto-negotiation: No
Speed: 10Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 0
Transceiver: internal
Auto-negotiation: off
MDI-X: Unknown
Current message level: 0xffffffa1 (-95)
drv ifup tx_err tx_queued intr tx_done rx_status pktdata hw wol 0xffff8000
Link detected: yes

speed 변경 불가능

sh-4.1# ethtool -s  tun0 speed 10
Cannot set new settings: Operation not supported
not setting speed
sh-4.1#
sh-4.1# ethtool -s tun0 speed 100
Cannot set new settings: Operation not supported
not setting speed
sh-4.1#
sh-4.1# ethtool -s tun0 speed 1000
Cannot set new settings: Operation not supported
not setting speed
sh-4.1#
패치후 speed 

sh-4.1# ethtool tun0
Settings for tun0:
Supported ports: [ ]
Supported link modes:   Not reported
Supported pause frame use: No
Supports auto-negotiation: No
Advertised link modes:  Not reported
Advertised pause frame use: No
Advertised auto-negotiation: No
Speed: 1000Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 0
Transceiver: internal
Auto-negotiation: off
MDI-X: Unknown
Current message level: 0xffffffa1 (-95)
drv ifup tx_err tx_queued intr tx_done rx_status pktdata hw wol 0xffff8000
Link detected: yes

패치후 10/100/100으로 speed  변경 가능
sh-4.1# ethtool -s  tun0 speed 100
Settings for tun0:
Supported ports: [ ]
Supported link modes:   Not reported
Supported pause frame use: No
Supports auto-negotiation: No
Advertised link modes:  Not reported
Advertised pause frame use: No
Advertised auto-negotiation: No
Speed: 100Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 0
Transceiver: internal
Auto-negotiation: off
MDI-X: Unknown
Current message level: 0xffffffa1 (-95)
drv ifup tx_err tx_queued intr tx_done rx_status pktdata hw wol 0xffff8000
Link detected: yes

- to blog -

blog built using the cayman-theme by Jason Long. LICENSE