linux下,獲取網路介面的傳輸速率

2021-05-05 07:22:31 字數 4110 閱讀 7502

1樓:shine雪瑞

ethtool eth0

[root@voipack ~]# ethtool eth0settings for eth0:

supported ports: [ tp ]supported link modes: 10baset/half 10baset/full

100baset/half 100baset/full1000baset/full

supports auto-negotiation: yesadvertised link modes: 10baset/half 10baset/full

100baset/half 100baset/full1000baset/full

advertised auto-negotiation: yesspeed: 100mb/s

duplex: full

port: twisted pair

phyad: 0

transceiver: internalauto-negotiation: on

supports wake-on: umbgwake-on: g

current message level: 0x00000007 (7)

link detected: yes

2樓:

不知道ioctl()函式可不可以,我之用ioctl 獲得網絡卡的ip地址和廣播地址,至於網路速率還不知道可不可以獲得,不過看網上說好像用ioctl可以得到類似ifconfig所列的資訊, ifconfig中好像有介面速率吧~~~

具體我也不太清楚了

在linux下怎麼檢視網路介面的速率?

3樓:匿名使用者

# 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個豆豆下的資料,挺不錯的,匿名,沒法給你。。= . =...

在linux下怎麼檢視網路介面的速率?

4樓:狐哥看電影

寫個指令碼檢視:指令碼如下、加x許可權、執行就可看以了

#!/bin/bash

while [ "1" ]

doeth=$1

rxpre=$(cat /proc/net/dev | grep $eth | tr : " " | awk '')

txpre=$(cat /proc/net/dev | grep $eth | tr : " " | awk '')

sleep 1

rxnext=$(cat /proc/net/dev | grep $eth | tr : " " | awk '')

txnext=$(cat /proc/net/dev | grep $eth | tr : " " | awk '')

clear

echo -e "\t rx `date +%k:%m:%s` tx"

rx=$(($-$))

tx=$(($-$))

if [[ $rx -lt 1024 ]];then

rx="$b/s"

elif [[ $rx -gt 1048576 ]];then

rx=$(echo $rx | awk '')

else

rx=$(echo $rx | awk '')

fiif [[ $tx -lt 1024 ]];then

tx="$b/s"

elif [[ $tx -gt 1048576 ]];then

tx=$(echo $tx | awk '')

else

tx=$(echo $tx | awk '')

fiecho -e "$eth \t $rx $tx "

done

5樓:匿名使用者

ethtool eth0

[root@voipack ~]# ethtool eth0settings for eth0:

supported ports: [ tp ]supported link modes: 10baset/half 10baset/full

100baset/half 100baset/full1000baset/full

supports auto-negotiation: yesadvertised link modes: 10baset/half 10baset/full

100baset/half 100baset/full1000baset/full

advertised auto-negotiation: yesspeed: 100mb/s

duplex: full

port: twisted pair

phyad: 0

transceiver: internalauto-negotiation: on

supports wake-on: umbgwake-on: g

current message level: 0x00000007 (7)

link detected: yes

6樓:匿名使用者

mii-tool -v

可以看到很多你想要的資訊。

linux 系統 上下行網路傳輸速度該如何檢視

7樓:匿名使用者

iptraf 這個軟體

8樓:匿名使用者

用ifstat命令可以看,

linux下怎麼判斷網絡卡速率

9樓:匿名使用者

ethtool eth0 |grep speed

如果你的網絡卡不是eth0則要改為相應的裝置名,用ifconfig檢視正確的裝置名。

怎麼使用linux獲取本機的網路介面eth1的ip地址和ma

方法一 sbin ifconfig ethx awk inet addr cut f2 d 方法二 sbin ifconfig ethx awk inet addr awk f 方法三 sbin ifconfig ethx sed ne s addr digit 2 p 把ethx中的x替換為需要檢...

linux的兩個疑問,linux下怎麼獲取兩個不同字元之間的內容?

哎,你要知道在bash中 的意思!filename arguments source filename arguments read and execute commands from filename in the current shell environment and return the ...

linux下root許可權無法獲取,su和su root都沒用

重啟系統,進入grub選單,在kernel行尾新增 rw init bin bash回車,按b啟動進入shell,切換到 etc目錄下編輯passwd檔案,儲存並重啟 重啟進入單使用者模式修改 或者啟動livecd進去修改 linux下root許可權無法獲取,su和su root都沒用 重啟復系統,...