linux 接口速率指的是什么

linux 接口速率指的是什么,第1张

写个脚本查看:脚本如下、加x权限、执行就可看以了

#!/bin/bash

while [ "1" ]

do

eth=$1

RXpre=$(cat /proc/net/dev | grep $eth | tr : " " | awk '{print $2}')

TXpre=$(cat /proc/net/dev | grep $eth | tr : " " | awk '{print $10}')

sleep 1

RXnext=$(cat /proc/net/dev | grep $eth | tr : " " | awk '{print $2}')

TXnext=$(cat /proc/net/dev | grep $eth | tr : " " | awk '{print $10}')

clear

echo -e "\t RX `date +%k:%M:%S` TX"

RX=$((${RXnext}-${RXpre}))

TX=$((${TXnext}-${TXpre}))

if [[ $RX -lt 1024 ]]then

RX="${RX}B/s"

elif [[ $RX -gt 1048576 ]]then

RX=$(echo $RX | awk '{print $1/1048576 "MB/s"}')

else

RX=$(echo $RX | awk '{print $1/1024 "KB/s"}')

fi

if [[ $TX -lt 1024 ]]then

TX="${TX}B/s"

elif [[ $TX -gt 1048576 ]]then

TX=$(echo $TX | awk '{print $1/1048576 "MB/s"}')

else

TX=$(echo $TX | awk '{print $1/1024 "KB/s"}')

fi

echo -e "$eth \t $RX $TX "

done

# 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: Yes

Speed: 10Mb/s

Duplex: Half

Port: MII

PHYAD: 32

Transceiver: internal

Auto-negotiation: on

Supports Wake-on: pumbg

Wake-on: d

Current message level: 0×00000007 (7)

Link detected: yes

# ethtool -s eth0 speed 100 duplex full autoneg off

# 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

Duplex: Full

Port: MII

PHYAD: 32

Transceiver: internal

Auto-negotiation: off

Supports Wake-on: pumbg

Wake-on: d

Current message level: 0×00000007 (7)

Link detected: yes

前两天在51cto 6个豆豆下的资料,挺不错的,匿名,没法给你。。= . =...


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/7331328.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-04
下一篇 2023-04-04

发表评论

登录后才能评论

评论列表(0条)

保存