关于linux下如何看网卡是千兆还是百兆的

关于linux下如何看网卡是千兆还是百兆的,第1张

使用ethtool命令。

ethtool是Linux下用于查询设置网卡参数的命令。

举例:

[root@hvrhub ~]# 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: 100Mb/s ------------------------------------>网卡速度

Duplex: Full

Port: MII

PHYAD: 0

Transceiver: internal

Auto-negotiation: on

Supports Wake-on: pumbg

Wake-on: g

Current message level: 0x00000033 (51)

Link detected: yes

详细参数参考:(//后面是注释,是原文的译文)

ethtool ethX /

ethtool –h //显示ethtool的命令帮助(help)

ethtool –i ethX //查询ethX网口的相关信息

ethtool –d ethX //查询ethX网口注册性信息

ethtool –r ethX //重置ethX网口到自适应模式

ethtool –S ethX //查询ethX网口收发包统计

ethtool –s ethX [speed 10|100|1000]\ //设置网口速率10/100/1000M

[duplex half|full]\ //设置网口半/全双工

[autoneg on|off]\ //设置网口是否自协商

[port tp|aui|bnc|mii]\ //设置网口类型

查看机器网络端口

[trafodion@n12 ~]$ ifconfig

eth1 Link encap:Ethernet HWaddr 5C:B9:01:9A:48:5D

inet addr:10.10.11.12 Bcast:10.10.11.255 Mask:255.255.255.0

inet6 addr: fe80::5eb9:1ff:fe9a:485d/64 Scope:Link

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

RX packets:18033924355 errors:0 dropped:857504 overruns:0 frame:0

TX packets:52425526574 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:66937144646066 (60.8 TiB) TX bytes:60037314294532 (54.6 TiB)

loLink encap:Local Loopback

inet addr:127.0.0.1 Mask:255.0.0.0

inet6 addr: ::1/128 Scope:Host

UP LOOPBACK RUNNING MTU:65536 Metric:1

RX packets:1192347276 errors:0 dropped:0 overruns:0 frame:0

TX packets:1192347276 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:0

RX bytes:9188133537474 (8.3 TiB) TX bytes:9188133537474 (8.3 TiB)

查看端口带宽(root或sudo权限),通过下面输出可以看到speed那一行,表示万兆网。

[trafodion@n12 ~]$ sudo ethtool eth1

Settings for eth1:

Supported ports: [ FIBRE ]

Supported link modes: 10000baseT/Full

Supported pause frame use: No

Supports auto-negotiation: No

Advertised link modes: 10000baseT/Full

Advertised pause frame use: No

Advertised auto-negotiation: No

Speed: 10000Mb/s

Duplex: Full

Port: FIBRE

PHYAD: 0

Transceiver: external

Auto-negotiation: off

Supports Wake-on: d

Wake-on: d

Current message level: 0x00000007 (7)

drv probe link

Link detected: yes


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

原文地址: https://outofmemory.cn/yw/8544147.html

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

发表评论

登录后才能评论

评论列表(0条)

保存