LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1986|回复: 11

在Linux下调整网卡的工作模式

[复制链接]
发表于 2004-7-22 02:02:21 | 显示全部楼层 |阅读模式
转自www.fengnet.com,希望对兄弟们有帮助

在Linux下调整网卡的工作模式




现在的网卡一般都是10/100M自适应工作模式,在配置网卡参数时我们很少考虑它的工作模式,但是在路由器、交换机、代理服务器等通信量比较大的关键设备上,我们应该为它指定正确的工作模式,这样可以提高通信效率。在Linux环境下,我们可以使用系统自带的工具mii-tool(这是专门设置网卡工作模式的命令)来配置网卡工作模式。下面我们具体来谈一下它的使用方法。


1. 查看网卡的工作模式,输入命令:


#mii-tool -v
eth0: negotiated 100baseTx-FD,link ok
product info:Vendor 00:05:be,model 8 rev 0
basic status: autonegotiation complete,link ok
basic mode:autonegotiation enabled.
Capabilities: ..............




从以上信息中可以看出,这块网卡工作在100M全双工自适应模式下,“100BaseTx-FD”意为100M Full Duplex。


2. 更改网卡的工作模式,输入命令:


#mii-tool -F media [interface]


media可选的模式有100baseTx-FD、100baseTx-HD、10baseT-FD、10baseT-HD等。 Interface代表所选择的网卡,如eth0、eth1等,默认为eth0。


例如,设置网卡工作在10M半双工模式下,输入命令:
#mii-tool -F 10baseT-HD eth0


3. 恢复网卡的自适应工作模式,输入命令:


#mii-tool -r eth0


更详细的使用方法可以用mii-tool -h来获得。
发表于 2004-7-25 09:03:39 | 显示全部楼层
SIOCGMIIPHY on 'eth0' failed: Operation not supported
no MII interfaces found
这个显示信息说明什么意思??
发表于 2004-7-25 14:35:26 | 显示全部楼层
为什么我的Linux没有上面的一些命令啊?晕~~~~~~
#mii-tool -v
#mii-tool -F media [interface]
都没有啊?我的是Linux Red Hat 9
发表于 2004-7-25 17:19:22 | 显示全部楼层
GOOGLE搜一下,我昨天还在网上下了一个
 楼主| 发表于 2004-7-25 18:55:43 | 显示全部楼层
MII-TOOL(8)                                                        MII-TOOL(8)



NAME
       mii-tool - view, manipulate media-independent interface status


SYNOPSIS
       mii-tool  [-v, --verbose] [-V, --version] [-R, --reset] [-r, --restart]
       [-w,   --watch]   [-l,   --log]   [-A,   --advertise=media,...]    [-F,
       --force=media] [interface ...]


DESCRIPTION
       This  utility  checks or sets the status of a network interface's Media
       Independent Interface (MII) unit.  Most fast ethernet adapters  use  an
       MII to autonegotiate link speed and duplex setting.

       Most  intelligent  network  devices  use an autonegotiation protocol to
       communicate what media technologies they support, and then  select  the
       fastest  mutually  supported  media  technology.  The -A or --advertise
       options can be used to tell the MII to only advertise a subset  of  its
       capabilities.   Some  passive  devices,  such as single-speed hubs, are
       unable to autonegotiate.  To handle such devices, the MII protocol also
       allows  for establishing a link by simply detecting either a 10baseT or
       100baseT link beat.  The -F or --force options can be used to force the
       MII  to operate in one mode, instead of autonegotiating.  The -A and -F
       options are mutually exclusive.

       The default short output reports the negotiated  link  speed  and  link
       status for each interface.  If an interface or interfaces are not spec-
       ified on the command line,  then  mii-tool  will  check  any  available
       interfaces from eth0 through eth7.

OPTIONS
       -v, --verbose
              Display  more  detailed  MII status information.  If used twice,
              also display raw MII register contents.

       -V, --version
              Display program version information.

       -R, --reset
              Reset the MII to its default configuration.

       -r, --restart
              Restart autonegotiation.

       -w, --watch
              Watch interface(s) and report changes in link status.   The  MII
              interfaces are polled at one second intervals.

       -l, --log
              Used  with  -w,  records  link  status changes in the system log
              instead of printing on standard output.

       -F media, --force=media
              Disable autonegotiation, and force the MII to either  100baseTx-
              FD, 100baseTx-HD, 10baseT-FD, or 10baseT-HD operation.

       -A media,..., --advertise=media,...
              Enable and restart autonegotiation, and advertise only the spec-
              ified media technologies.  Multiple technologies should be sepa-
              rated  by  commas.   Valid  media  are  100baseT4, 100baseTx-FD,
              100baseTx-HD, 10baseT-FD, and 10baseT-HD.


AUTHORS
       David Hinds - dhinds@pcmcia.sourceforge.org
       Donald Becker - becker@scyld.com



net-tools                     2000/04/25 22:58:19                  MII-TOOL(8)
发表于 2004-7-26 09:31:05 | 显示全部楼层
嘿!这篇文章我首先发表在电脑教育报上,我也是在linuxsir上获得的这些知识,我也是linuxsir上的一员,这篇文章可以作为linuxsir的自己的东西,取之于民用之于民吗!
发表于 2004-11-22 21:11:01 | 显示全部楼层
SIOCGMIIPHY on 'eth0' failed: Operation not supported
的错误到底应该怎么解决呢?
发表于 2004-11-23 16:37:17 | 显示全部楼层
从错误表象来看是你的网卡不支持该功能。
 楼主| 发表于 2004-12-10 02:27:14 | 显示全部楼层
最初由 lin_lin13 发表
嘿!这篇文章我首先发表在电脑教育报上,我也是在linuxsir上获得的这些知识,我也是linuxsir上的一员,这篇文章可以作为linuxsir的自己的东西,取之于民用之于民吗!




上边“转”字很大 , 意思就是转载,不懂我在这里解释
发表于 2004-12-10 16:43:40 | 显示全部楼层
涨学问,谢谢了
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表