linux 查看网卡_Linux怎么查看网卡的硬件参数

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

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

1. ethtool简介

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

438baad461d54a5eac0e671d79cf5707.png

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表示没有物理线连接,或者信号有问题。

8ceb498abd62f9eeb994331ca03d08db.png

使用ethtool查看网卡信息

5b1664b6a25d927bd35816048e0e9f67.png

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

4a2c87b36ca1b0a285c843a5a8634f8e.png

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

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

Speed: 10000Mb/s

Port: FIBRE

Link detected: yes表明信号正常。

c032f5505bcab2e87465ea688b67a756.png

3. 使用ethtool修改端口速率

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

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

文章已经同步到博客站:

https://www.linuxrumen.com/cyml/446.html

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

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值