文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>改变网络接口的速度和协商方式的工具 miitool 和..

改变网络接口的速度和协商方式的工具 miitool 和..

时间:2009-04-30  来源:h_xin8211

############
#
#   声明
#
############

# 作者:北南南北
# 来自:LinuxSir.Org


###########################################
#
#   mii-tool 配置网络设备协商方式的工具
#
###########################################

############
#
#   用法
#
############

#  mii-tool  --help
usage: mii-tool [-VvRrwl] [-A media,... | -F media] [interface ...]
       -V, --version               display version information
       -v, --verbose               more verbose output 注:显示网络接口的信息;
       -R, --reset                 reset MII to poweron state 注:重设MII到开启状态;
       -r, --restart               restart autonegotiation 注:重启自动协商模式;
       -w, --watch                 monitor for link status changes 注:查看网络接口连接的状态变化;
       -l, --log                   with -w, write events to syslog 注:写入事件到系统日志;
       -A, --advertise=media,...   advertise only specified media 注:指令特定的网络接口;
       -F, --force=media           force specified media technology 注:更改网络接口协商方式;
media: 100baseT4, 100baseTx-FD, 100baseTx-HD, 10baseT-FD, 10baseT-HD,
       (to advertise both HD and FD) 100baseTx, 10baseT

##########
#
#  例 1
#
##########

# 查看网络接口的协商状态

# mii-tool -v eth0
eth0: negotiated 100baseTx-FD, link ok
  product info: vendor 00:00:00, model 0 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

##########
#
#  例 2
#
##########

# 更改网络接口协商方式

# 把网络接口eth0改为 1000Mb/s全双工的模式应该怎么办呢?

# mii-tool -v eth0
eth0: 100 Mbit, full duplex, link ok
  product info: vendor 00:00:00, model 0 rev 0
  basic mode:   100 Mbit, full duplex
  basic status: link ok
  capabilities: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
  advertising:  100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD

# ethtool 工具来更改
# ethtool -s eth0 speed 100 duplex full

 


###########################################
#
#   ethtool 工具关于网络协商功能介绍
#
###########################################

############
#
#   用法
#
############

# ethtool eth0
Settings for eth0:
        Supported ports: [ TP MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
        Advertised auto-negotiation: No            # 注:自动协商关闭
        Speed: 100Mb/s                             # 注:速度 100Mb
        Duplex: Full                               # 注:全双工
        Port: MII
        PHYAD: 32
        Transceiver: internal
        Auto-negotiation: off
        Supports Wake-on: pumbg
        Wake-on: d
        Current message level: 0x00000007 (7)
        Link detected: yes                          # 注:eth0已经激活;

##############################
#
#  ethtool 设置网卡的协商模式
#
##############################

# ethtool -s DEVNAME \
                [ speed 10|100|1000 ] \
                [ duplex half|full ]    \
                [ port tp|aui|bnc|mii|fibre ] \
                [ autoneg on|off ] \

##########
#
#  例 1
#
##########

# 网卡eth0 速度改为10Mb/s,采用半双工

# ethtool -s eth1 speed 10 duplex half
# ethtool eth1
Settings for eth1:
        Supported ports: [ TP MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
        Advertised auto-negotiation: No
        Speed: 10Mb/s                           # 注:速度 10M/s
        Duplex: Half                            # 注:半双工
        Port: MII
        PHYAD: 32
        Transceiver: internal
        Auto-negotiation: off
        Supports Wake-on: pumbg
        Wake-on: d
        Current message level: 0x00000007 (7)
        Link detected: no                       # 注:eth1没有激活;

##########
#
#  例 2
#
##########

# 网卡eth0 速度改为100Mb/s,采用全双工

# ethtool -s eth1 speed 100 duplex full
# ethtool eth1
Settings for eth1:
        Supported ports: [ TP MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
        Advertised auto-negotiation: No
        Speed: 100Mb/s                             # 注:速度 100M/s
        Duplex: Full                               # 注:全双工
        Port: MII
        PHYAD: 32
        Transceiver: internal
        Auto-negotiation: off
        Supports Wake-on: pumbg
        Wake-on: d
        Current message level: 0x00000007 (7)
        Link detected: no                           # 注:eth1网卡没有激活

 

 

 

 

 

相关阅读 更多 +
排行榜 更多 +
摆个车游戏

摆个车游戏

休闲益智 下载
哈基跑酷最新版

哈基跑酷最新版

休闲益智 下载
冷血射手最新版

冷血射手最新版

休闲益智 下载