您的位置 首页 > 数码极客

〔linux如何查看接口的速率〕linux查看网卡实时速率!

请关注本头条号,每天坚持更新原创干货技术文章。

如需学习视频,请在微信搜索公众号“智传网优”直接开始自助视频学习

1. ethtool简介

本文主要讲解ethtool的作用与日常使用方法,该工具是Linux运维中最常使用的工具,用来查看网卡的信息、当前工作状态、物理线路质量、流量统计信息。

2. 使用ethtool查询网卡信息

使用ip addr命令找出物理网卡号

2: em1: mtu 1500 qdisc mq state UP

3: em2: mtu 1500 qdisc mq state UP

4: p1p1: mtu 1500 qdisc pfifo_fast

我的服务器里,以上em1、em2、p1p1都是物理网卡号。

先看看这三张网卡的信息:

2.1 查看em1,命令

[root@zcwyou ~]# ethtool em1

输出结果:

Settings for em1:

Supported ports: [ TP ]

Supported link modes: 10baseT/Half 10baseT/Full

100baseT/Half 100baseT/Full 1000baseT/Full

Supported pause frame use: No

Supports auto-negotiation: Yes

Supported FEC modes: Not reported

Advertised link modes: 10baseT/Half 10baseT/Full

100baseT/Half 100baseT/Full

1000baseT/Full

Advertised pause frame use: No

Advertised auto-negotiation: Yes

Advertised FEC modes: Not reported

Speed: 1000Mb/s

Duplex: Full

Port: Twisted Pair

PHYAD: 1

Transceiver: internal

Auto-negotiation: on

MDI-X: off

Supports Wake-on: g

Wake-on: d

Link detected: yes

部分输入信息的解释:

Supported link modes:支持速率

Speed: 当前速率,可以看出这张网卡目前工作在1000M/s模式

Duplex: 双工模式

Port: Twisted Pair,双绞线

Link detected: yes表示有物理连接,no表示没有物理线连接,或者信号有问题。

使用ethtool查看网卡信息

2.2 查看em2,命令

[root@zcwyou ~]# ethtool em2

输出结果:

Settings for em2:

Supported ports: [ FIBRE ]

Supported link modes: 1000baseT/Full

10000baseT/Full

Supported pause frame use: Symmetric

Supports auto-negotiation: Yes

Supported FEC modes: Not reported

Advertised link modes: 1000baseT/Full

10000baseT/Full

Advertised pause frame use: Symmetric

Advertised auto-negotiation: Yes

Advertised FEC modes: Not reported

Speed: 10000Mb/s

Duplex: Full

Port: FIBRE

PHYAD: 0

Transceiver: internal

Auto-negotiation: on

Supports Wake-on: umbg

Wake-on: g

Current message level: 0x00000007 (7)

drv probe link

Link detected: yes

Linux上使用ethtool查看某网卡的信息

可以看出,em2是一张万兆光纤网卡。目前速率为10000M/s

Speed: 10000Mb/s

Port: FIBRE

Link detected: yes表明信号正常。

3. 使用ethtool修改端口速率

例子:把eth0修改为1000M模式

[root@zcwyou ~]# ethtool -s eth0 speed 1000 duplex full autoneg off

文章已经同步到博客站:

点击了解更多,快速查看更多的技术文章列表。

责任编辑: 鲁达

1.内容基于多重复合算法人工智能语言模型创作,旨在以深度学习研究为目的传播信息知识,内容观点与本网站无关,反馈举报请
2.仅供读者参考,本网站未对该内容进行证实,对其原创性、真实性、完整性、及时性不作任何保证;
3.本站属于非营利性站点无毒无广告,请读者放心使用!

“linux如何查看接口的速率,linux查看网卡实时速率,linux,查看接口速率,linux如何查看网卡速率,linux如何查看网络速率”边界阅读