由于办公环境改变,网线不够长,翻箱捣柜找出一个HUB接上。可无论如何也获取不到IP。一看HUB才知道,原来HUB的带宽才10M,而我的网卡是10/100M自适应模式(比较老的网卡自适应能力比较差)。可能是网卡和HUB自适应模式不兼容引起的,网卡速率不能够自动识别,从而无法达到网络通信。因此我的网卡只能设置在10M的环境下才能正常运行。
Windows:
       其实在Windows下解决方法很简单,在“设备管理器”-“网卡属性”-“高级”中的“LinkSpeed/Duplex Mode”设置为10M的就可以了。
Linux:
Linux下的实现方法很多,不过配置起来却很困难,其实只要用mii-tool那实现起来就相当简单了,如下:
 
写一个脚本
********************************
ifconfig eth0 up
mii-tool -F 10baseT-FD
ifup eth0
********************************
然后把脚本加入/etc/rc.d/init.d/,让它开机自动运行就OK了。看,是不是很简单啊!:-)
注:mii-tool -F 10baseT-FD 这句是将网卡的的LinkSpeed改为10M全双工模式
------------------------------------------------------------------------------
------------------------------------------------------------------------------
以下是mii-tool工具的使用方法,从[url]http://linux-ip.net/html/tools-mii-tool.html[/url]上摘抄的,供大家一起学习。
A key tool for determining if you are connected to the Ethernet, and if so, at what speed. The mii-tool program does not support all Ethernet devices, as some Ethernet devices have their own vendor-supplied tools to report the same information. The mii-tool source code is based on a tool called mii-diag which provides slightly more information but is less user friendly.
The information reported by mii-tool is quite terse. The following table should clarify the meaning of the speeds you'll encounter in output from mii-tool(There is a standard speed/Ethernet transmission style supported by mii-tool to which I have not referred. That is 100BaseT4. 100BaseT4 provides support for 100 megabit Ethernet networking over Category 3 rated cable. This is probably not a concern for most recently upgraded network infrastructure. The standard networking cable pulled in new construction and renovation is now Category 5 cable which supports 100Base-Tx-FD and possibly gigabit Ethernet. So, let's relegate 100BaseT4 to this footnote, and resume.)
Table B.2. Ethernet Port Speed Abbreviations
Port Speed Description
10baseT-HD 10 megabit half duplex
10baseT-FD 10 megabit full duplex
100baseTx-HD 100 megabit half duplex
100baseTx-FD 100 megabit full duplex
The raw number indicates the number of bits which can be exchanged between two Ethernet devices over the wire. So 10 megabit Ethernet can support the transmission of ten million bits per second. The suffix to each identifier indicates whether both hosts can send and receive simultaneously or not. Half duplex means that each device can either send or receive in the same instant. Full duplex means that both devices can send and receive simultaneously.
The simplest use of mii-tool reports the link status of all Ethernet devices on a system. Any argument to mii-tool is interpreted as an interface name to query for link status.
Example B.21. Detecting link layer status with mii-tool
[root@tristan]# mii-tooleth0: negotiated 100baseTx-FD, link ok[root@tristan]# mii-tool -veth0: negotiated 100baseTx-FD, link ok
product info: vendor 08:00:17, model 1 rev 0
basic mode:   autonegotiation enabled
basic status: autonegotiation complete, link ok
capabilities: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
advertising:  100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
link partner: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
In the above example, we can infer that tristan has only one Ethernet device (or no Ethernet drivers loaded for any other present Ethernet devices). The first Ethernet device has successfully negotiated a 100 megabit full duplex connection with the device to which it is connected.
Although a great rarity, you may have occasion to dictate to the Ethernet interface the speed at which it should talk to the switch or hub. mii-tool supports a mode of operation under which you indicate supported modes for autonegotiation. Normally, two connected devices will negotiate the fastest possible commonly shared speed. You can select what speeds you want to support on an Ethernet interface by using mii-tool.
Example B.22. Specifying Ethernet port speeds with mii-tool --advertise
[root@tristan]# mii-tool mii-tool --advertise 10baseT-HD,10baseT-FDrestarting autonegotiation...[root@tristan]# mii-tooleth0: negotiated 10baseT-FD, link ok
After we specified that we wished only to support 10baseT-HD and 10baseT-FD as acceptable speeds, mii-tool caused the Ethernet driver to renegotiate port speed with the attached device. Here we selected 10baseT-FD.
Example B.23. Forcing Ethernet port speed with mii-tool --force
[root@tristan]# mii-tool --force 10baseT-FD[root@tristan]# mii-tooleth0: 10 Mbit, full duplex, link ok[root@tristan]# mii-tool --restartrestarting autonegotiation...[root@tristan]# mii-tooleth0: negotiated 100baseTx-FD, link ok
After manipulating the speed at which the Ethernet driver would communicate with the connected device on tristan, we chose to restart the autonegotiation process without forcing a particular speed or advertising a particular speed.
So, if you must know at what speed your linux machine is connected to another device, mii-tool comes to your rescue.

 
本文转自 saturn 51CTO博客,原文链接:http://blog.51cto.com/saturn/33663

Linux(Windows)下如何改变网卡的LinkSpeed工作模式相关推荐

  1. Windows下笔记本双网卡同时上网设置方法

    Windows下笔记本双网卡同时上网设置方法 配置如下: 外网网关为:192.168.8.1 内网网关为:192.168.1.1 内网环境下需要访问的其他IP为:180.167.245.170 以管理 ...

  2. windows 打包 python 然后linux执行_使用pyinstaller打包python源代码,成为linux/windows下可执行文件...

    pyinstaller,打包python源代码,成为linux/windows下可执行文件,多平台 下载:http://www.pyinstaller.org/static/ http://www.p ...

  3. Linux/Windows下 C/C++开发的差异

    1. 平台差异简介 Windows 和Unix是当前两大主流操作系统平台,基于C/C++的开发人员经常会面临这两个平台之间的移植的问题.Unix作为一个开发式的系统,其下有出现了很 多个分支,包括Su ...

  4. windows 连Linux,Windows下访问Linux资源

    Windows下访问Linux资源 在Red Hat Linux中,借助Samba服务在Windows下访问Linux的资源也是很容易的,依次单击"主菜单" "系统设置& ...

  5. windows7 telnet linux,Windows下通过Telnet连接linux

    <Windows下通过Telnet连接linux>由会员分享,可在线阅读,更多相关<Windows下通过Telnet连接linux(1页珍藏版)>请在人人文库网上搜索. 1.W ...

  6. linux/windows下安装scala

    为什么80%的码农都做不了架构师?>>>    一.linux下安装scala 1.保证jdk安装成功,版本在1.5或者更改版本,java和javac均可用. 2.官网下载scala ...

  7. linux非权限安装bioperl,BioPerl安装指南:Unix/Linux/Windows下的安装

    其实BioPerl的功能很强大.但是用的人却不多.最根本的原因可能是,太多数人都还是新手,相对而言Perl很难懂,不懂Perl的人根本搞不懂BioPerl.而且BioPerl安装也很复杂.又不像Per ...

  8. linux/windows下查看目标文件.a/.lib的函数符号名称

    1.linux下 (1). objdump -t 查看对象文件所有的符号列表:例如 objdump -t libtest.o (2).nm列出目标文件(.o)的符号清单:例如 nm -s filena ...

  9. linux 网卡驱动编译,在linux系统下安装编译网卡驱动的方法

    安装linux操作系统后发现没有网卡驱动,表现为 system → Administration → Network下Hardware列表为空. 以下为安装编译网卡驱动的过程,本人是菜鸟,以下是我从网 ...

最新文章

  1. java调用ffmpeg,mencoder进行视频转换,读取时长等
  2. python trim函数_python strip()函数 介绍
  3. sklearn pipeline_sklearn基础
  4. Spring MVC实现文件下载
  5. MATLAB 命令 BOXPLOT
  6. Python 基础 函数
  7. make、make是什么??
  8. spring容器的懒加载
  9. json 插入数据_MongoDB如何一次插入多条json数据
  10. Latex 资料汇总(持续更新)
  11. bash脚本基础概念注意点
  12. LVS+KeepAlived,RabbitMQ高可用负载均衡
  13. 一年级下册健康教育教案
  14. html5常用的小控件,收藏了
  15. 【C++】在线IDE
  16. MATLAB对CT图读取,写入
  17. iOS 跑马灯带图片可点击
  18. 一小心删除了系统文件NTDETECT.COM怎么办
  19. net中winform教程 ListView控件如何实现分组?
  20. PHPNOW安装及使用

热门文章

  1. 假期只是玩就没意思了!告诉你一个学习麻省理工大学所有课程的好地方
  2. 还在用Spring Security?推荐你一款使用简单、功能强大的权限认证框架
  3. 别再用 BeanUtils 了,这款 PO VO DTO 转换神器不香么?
  4. MySQL 批量插入:如何不插入重复数据?
  5. 关于UUID的二三事
  6. 为什么RedisCluster会设计成16384个槽呢?
  7. 求求你们了,别再写满屏的 try catch 了!!
  8. 知乎千万级高性能长连接网关是如何搭建的
  9. 百度开放AI应用学习!
  10. DeepMind“钓鱼执法”:让AI引诱AI说错话,发现数以万计危险言论