【环球速看料】怎么查看linux是不是万兆网

时间:2023-03-22 09:15:28       来源:PHP中文网

本教程操作环境:linux5.9.8系统、Dell G3电脑。


(资料图片仅供参考)

怎么查看linux是不是万兆网?

Linux查看网卡是千兆还是万兆网卡

目前用过的两个命令:

1、ethtool

ethtool 网络接口名

#ethtool em4Settings for em4:Supported ports: [ TP ]Supported link modes: 10baseT/Half 10baseT/Full100baseT/Half 100baseT/Full1000baseT/FullSupports auto-negotiation: YesAdvertised link modes: 10baseT/Half 10baseT/Full100baseT/Half 100baseT/Full1000baseT/FullAdvertised pause frame use: NoAdvertised auto-negotiation: YesSpeed: 1000Mb/sDuplex: FullPort: Twisted PairPHYAD: 1Transceiver: internalAuto-negotiation: onMDI-X: UnknownSupports Wake-on: gWake-on: dLink detected: yes
登录后复制

2、lspci

当前是博通BCM5709千兆网卡Gigabit(万兆网卡显示为10-Gigabit)

#lspci -vvv | grep Ethernet01:00.0 Ethernet controller: Broadcom Corporation NetXtreme II BCM5709 GigabitEthernet (rev 20)Subsystem: Dell PowerEdge R710 BCM5709 Gigabit EthernetProduct Name: Broadcom NetXtreme II Ethernet Controller01:00.1 Ethernet controller: Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet (rev 20)Subsystem: Dell PowerEdge R710 BCM5709 Gigabit EthernetProduct Name: Broadcom NetXtreme II Ethernet Controller02:00.0 Ethernet controller: Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet (rev 20)Subsystem: Dell PowerEdge R710 BCM5709 Gigabit EthernetProduct Name: Broadcom NetXtreme II Ethernet Controller02:00.1 Ethernet controller: Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet (rev 20)Subsystem: Dell PowerEdge R710 BCM5709 Gigabit EthernetProduct Name: Broadcom NetXtreme II Ethernet Controllerpcilib: sysfs_read_vpd: read failed: Connection timed out
登录后复制

小知识:

Gigabit是数据存储的单位,通常用符号Gbit或Gb表示。它的换算公式:1 Gb = 10的9次方 bits = 1,000,000,000 bits 。

另一个常见的单位是Gibibit,gibibit是用来表示二进制换算的,1 gibibit = 2的30次方 bits = 1,073,741,824 bits。

Linux 查看网络带宽是千兆还是万兆

首先查看机器网络端口

[root@namenode ~]# ifconfigeno1: flags=4163  mtu 1500        inet 192.168.60.190  netmask 255.255.255.0  broadcast 192.168.80.255        inet6 fe80::b62e:99ff:fe65:3bd6  prefixlen 64  scopeid 0x20        ether b4:2e:99:65:3b:d6  txqueuelen 1000  (Ethernet)        RX packets 1034361639  bytes 496433512301 (462.3 GiB)        RX errors 0  dropped 144034  overruns 0  frame 0        TX packets 977985340  bytes 163296216477 (152.0 GiB)        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0        device interrupt 16  memory 0xf7200000-f7220000
登录后复制

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

[root@namenode ~]# sudo ethtool eno1Settings for eno1:    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    Advertised link modes:  10baseT/Half 10baseT/Full                             100baseT/Half 100baseT/Full                             1000baseT/Full     Advertised pause frame use: No    Advertised auto-negotiation: Yes    Speed: 1000Mb/s    Duplex: Full    Port: Twisted Pair    PHYAD: 1    Transceiver: internal    Auto-negotiation: on    MDI-X: off (auto)    Supports Wake-on: pumbg    Wake-on: g    Current message level: 0x00000007 (7)                   drv probe link    Link detected: yes
登录后复制

相关推荐:《Linux视频教程》

以上就是怎么查看linux是不是万兆网的详细内容,更多请关注php中文网其它相关文章!

关键词: