2010年7月7日 星期三

利用ethtool對網卡限速

因架設Lustre環境,想確認分散式架構對performance是否真的有助益,但沒有10G或InfiniBand等架構,效能都卡在網路頻寬,故想到用降低網路速率來測分散式是否真有助益...


網路上查了一下,可以使用ethtool工具進行..
---------------------
#ethtool
Settings for eth0:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised auto-negotiation: Yes
Speed: 1000Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 1
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: umbg
Wake-on: g
Current message level: 0x00000003 (3)
Link detected: yes
----------------------

目前的網路速度為1000Mb/s。

於是下達
ifdown eth0;ethtool -s eth0 speed 10;ifup eth0

結果失敗,速度仍為1000。
於是修改網卡配置文件
#vi /etc/sysconfig/network-scripts/ifcfg-eth0
添加一行
ETHTOOL_OPTS="speed 10 duplex full autoneg off"

就搞定.
--------------------
Settings for eth0:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: Not reported
Advertised auto-negotiation: No
Speed: 10Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 1
Transceiver: internal
Auto-negotiation: off
Supports Wake-on: umbg
Wake-on: g
Current message level: 0x00000003 (3)
Link detected: yes
--------------------

參考至Lyychee's Blog


....繼續閱讀

2010年2月16日 星期二

今天嘗鮮灌了win7+ubuntu 9.10來玩,ubuntu在首次開機並設定透過wireless連線pppoe後,重新開機後,GNOME的NetworkManager發現就不work了, 點擊NM, 是show "裝置無法管理",
google了一下...參閱自MacBlog
---------------------------------------------------------------------
因為 Debian and Ubuntu 有改過 NetworkManager 的程式碼,所以…
因此,傳統的 ifconfig or NetworkManager 只能二選一
若要用 ifconfig 來設定網路,那在 /etc/network/interfaces 裡就會有:

auto eth0
iface eth0 inet dhcp
auto eth1
iface eth1 inet dhcp
wireless-essid myap

若這樣,NetworkManager 就不會去管 eth0 eth1 這兩張網卡了

因此,若你想要讓 eth1 這張無線網卡交給 NetworkManager 來管理
就要把 eth1 的部份註解掉

#auto eth1
#iface eth1 inet dhcp
#wireless-essid myap

Debian and Ubuntu modified NetworkManager so that it would not manage any devices listed in /etc/network/interfaces. If you open this file and comment out the lines for the interfaces you want to manage and reboot NetworkManager will see them. **Do not comment out l0**

Devices which are automatically configured on boot will not be available in NetworkManager. To allow network manager to use all of your devices remove instances of auto in /etc/network/interfaces. (apart from the “auto lo” line, which is needed for the loopback interface)

....繼續閱讀