CentOS網卡狀態查看及設置

問題

偶然發現實驗室有一臺作存儲的服務器局域網內的連接速度只有100M,但是實驗室用的是千兆交換機服務器也是千兆網卡並且其它同類型同用途的服務器局域網速度都達到了千兆, 因此一個問題就出來了,怎樣查看服務器的網卡設備,當前連接速度,速度怎麼調節?相關文檔網卡已經有許多,我也就不哆嗦了,這裏列幾篇供參考:

http://www.lishiming.net/thread-826-1-1.html

http://blog.chinaunix.net/uid-20149676-id-1733254.html

http://tonychiu.blog.51cto.com/656605/425391

解決過程

服務器網卡信息如下,從這裏我們看到網卡是支持千兆的,但實際的連接速度只有百兆,作爲存儲服務器,這損失大了去了。

[root@store3 ~]# ethtool eth0
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 pause frame use: No
        Advertised auto-negotiation: Yes
        Speed: 100Mb/s
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 1
        Transceiver: internal
        Auto-negotiation: on
        MDI-X: Unknown
        Supports Wake-on: g
        Wake-on: g
        Link detected: yes

這裏我主要使用ethtool進行設置,可是設置完成後速度並沒有變化

[root@store3 ~]# ethtool -s eth0 speed 1000
[root@store3 ~]# ethtool eth0
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 pause frame use: No
        Advertised auto-negotiation: Yes
        Speed: 100Mb/s
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 1
        Transceiver: internal
        Auto-negotiation: on
        MDI-X: Unknown
        Supports Wake-on: g
        Wake-on: g
        Link detected: yes

使用命令ethtool -s eth0 duplex full autoneg off speed 1000報參數錯誤,多次折騰後發現使用ethtool -s eth0 autoeng off後可以設置使用命令 ethtool -s eth0 speed N設置網速爲10或100,但改爲1000時報參數錯誤。經過多次嘗試,最後的最後竟然發現是網線的問題!!!換完網速就上去了,無語。 雖然最後問題是出在了網線上,但至少還是學會了怎麼查看網卡狀態及簡單的設置,還是值得記錄一下的。

北方工業大學 | 雲計算研究中心 | 姜永

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章