물론 socket을 건드려야 해서 root 권한으로 해야만 원하는 값을 얻을수 있다.
[링크 : http://www.cyberciti.biz/faq/howto-setup-linux-lan-card-find-out-full-duplex-half-speed-or-mode/]
아래는 C 코드로 작성한 링크 속도 확인방법
[링크 : http://stackoverflow.com/questions/2872058/get-link-speed-programmatically]
$ ethtool eth0
Settings for eth0:
Cannot get device settings: Operation not permitted
Cannot get wake-on-lan settings: Operation not permitted
Current message level: 0x000000ff (255)
Cannot get link status: Operation not permitted
$ sudo ethtool eth0
Settings for eth0:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Advertised pause frame use: No
Advertised auto-negotiation: Yes
Link partner advertised link modes: Not reported
Link partner advertised pause frame use: No
Link partner advertised auto-negotiation: No
Speed: 100Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
MDI-X: Unknown
Supports Wake-on: pg
Wake-on: d
Current message level: 0x000000ff (255)
Link detected: yes |
[링크 : http://www.cyberciti.biz/faq/howto-setup-linux-lan-card-find-out-full-duplex-half-speed-or-mode/]
아래는 C 코드로 작성한 링크 속도 확인방법
[링크 : http://stackoverflow.com/questions/2872058/get-link-speed-programmatically]
'Linux > Ubuntu' 카테고리의 다른 글
여러개의 업링크 / 인터넷 업체를 사용할 경우 라우팅 설정하기 (0) | 2011.12.17 |
---|---|
ifenslave mode 설정하기 (0) | 2011.12.15 |
ubuntu motd (0) | 2011.12.11 |
ubuntu gdm 자동시작 하지 않도록 설정하기 (disable gdm startup) (0) | 2011.12.11 |
ubuntu-desktop 패키지 정보 (0) | 2011.12.11 |