Chinaunix

标题: 网卡速率问题 [打印本页]

作者: xuledw    时间: 2009-09-23 11:44
标题: 网卡速率问题
centos
# uname -a
Linux zhangxu 2.6.9-42.ELsmp #1 SMP Sat Aug 12 09:39:11 CDT 2006 i686 i686 i386 GNU/Linux
日志中报:
kernel: bnx2: eth1 NIC Link is Down
kernel: bnx2: eth1 NIC Link is Up, 100 Mbps full duplex, receive & transmit flow control ON
这样千M的网卡就变成百兆的了,如下:
# ethtool eth1
Settings for eth1:
        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: 100Mb/s 注意这里
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 1
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: d
        Wake-on: d
        Link detected: yes
只有/etc/init.d/netwrok restat之后才能到1000M
ethtool eth1
Settings for eth1:
        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: d
        Wake-on: d
        Link detected: yes
麻烦各位帮忙分析下什么原因,或者怎么能让其启动的时候直接不自适应
附# cat /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
BOOTPROTO=static
BROADCAST=192.168.2.255
HWADDR=00:1D:09:16:34:70
IPADDR=192.168.2.19
NETMASK=255.255.255.0
NETWORK=192.168.2.0
ONBOOT=yes
TYPE=Ethernet
作者: vermouth    时间: 2009-09-23 12:24
试试 mii-tool 命令,ifconfig 好像也可以改的。
作者: xuledw    时间: 2009-09-23 14:35
原帖由 vermouth 于 2009-9-23 12:24 发表
试试 mii-tool 命令,ifconfig 好像也可以改的。

我的意思是
kernel: bnx2: eth1 NIC Link is Down
kernel: bnx2: eth1 NIC Link is Up, 100 Mbps full duplex, receive & transmit flow control ON
当日志中Down之后 让起启动的时候直接就不是自适应
默认应该是加在/etc/sysconfig/network-scripts/ifcfg-eth1中的

ethtool工具来禁用网卡eth0驱动模块的网卡自适应特性
# ethtool -s eth0 autoneg off speed 1000 duplex full

[ 本帖最后由 xuledw 于 2009-9-23 14:52 编辑 ]
作者: xuledw    时间: 2009-09-23 15:10
测试机中加入/etc/sysconfig/network-scripts/ifcfg-eth1中加入
ETHTOOL_OPTS="speed 1000 duplex full autoneg off
没有问题 但是在服务器
# ethtool -s eth1 speed 1000 duplex full autoneg off
Cannot set new settings: Invalid argument
  not setting speed
  not setting duplex
  not setting autoneg
就报这个 郁闷了
作者: marsaber    时间: 2009-09-26 13:01
原帖由 vermouth 于 2009-9-23 12:24 发表
试试 mii-tool 命令,ifconfig 好像也可以改的。

mii-tool是不支持千M网卡的。
要用ethtool
作者: marsaber    时间: 2009-09-26 13:01
标题: 回复 #4 xuledw 的帖子
你的交换机是千M的吗?
作者: kns1024wh    时间: 2009-09-27 13:36
标题: 回复 #1 xuledw 的帖子
如果驱动正确 网卡应该是不会反复如此的
看看系统的messages的日志信息




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2