linux查看网卡是100M还是1000M

可以使用 ethtool 命令进行查看,使用格式:ethtool 网络接口名

以下为例,使用 ifconfig 查看当前使用的网卡,获取网卡名字:enp2s0

复制代码
root@U-NAS:~# ifconfig
enp2s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.8  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::2e0:70ff:fe86:cf8c  prefixlen 64  scopeid 0x20<link>
        ether 00:e0:70:86:cf:8c  txqueuelen 1000  (Ethernet)
        RX packets 403272  bytes 400480688 (381.9 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 352875  bytes 233242041 (222.4 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1  (Local Loopback)
        RX packets 1250  bytes 11161999 (10.6 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1250  bytes 11161999 (10.6 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

root@U-NAS:~#

使用 ethtool enp2s0 命令进行查看

复制代码
root@U-NAS:~# ethtool enp2s0
Settings for enp2s0:
        Supported ports: [ TP MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Half 1000baseT/Full
        Supported pause frame use: No
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Half 1000baseT/Full
        Advertised pause frame use: Symmetric Receive-only
        Advertised auto-negotiation: Yes
        Link partner advertised link modes:  10baseT/Half 10baseT/Full
                                             100baseT/Half 100baseT/Full
        Link partner advertised pause frame use: Symmetric Receive-only
        Link partner 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)
                               drv probe ifdown ifup
        Link detected: yes
root@U-NAS:~#

Speed 表示网卡带宽,Duplex 表示工作模式,Supported link modes 表示支持的工作模式。

扩展资料:

ethtool命令的其它用法:

**Ps:**以下示例,网卡名为eth0

1、查询网络端口位置:ethtool -p ethX

这个命令多用于管理多网口的服务器主机,由于背板的网络端口数量大,有时候不知道那个物理端口对应eth0或其他设备号,我们就可以使用这个命令来查询。

**用法:**ethtool -p eth0

**效果:**设备号eth0对应的物理端口的两个指示灯会闪烁

2、修改网络端口速率:ethtool -s

这个命令多用于手工设置网络速率,一般千兆网卡支持10|100|1000三个速率,单位是Mbps。

**用法:**ethtool -s eth0 speed 1000 duplex full autoneg off

**效果:**将设备号eth0对应的物理端口设置为速率为1000Mbps,全双工工作模式,同时关闭自动协商。

相关推荐
众趣科技1 小时前
数字孪生重构智慧园区:众趣科技何以成为 VR 园区领域标杆
人工智能·3d·智慧城市·空间计算
心勤则明2 小时前
Spring AI 会话记忆实战:从内存存储到 MySQL + Redis 双层缓存架构
人工智能·spring·缓存
迎風吹頭髮3 小时前
UNIX下C语言编程与实践58-UNIX TCP 连接处理:accept 函数与新套接字创建
c语言·网络·unix
ARM+FPGA+AI工业主板定制专家4 小时前
基于GPS/PTP/gPTP的自动驾驶数据同步授时方案
人工智能·机器学习·自动驾驶
长鸳词羡4 小时前
wordpiece、unigram、sentencepiece基本原理
人工智能
ㄣ知冷煖★4 小时前
【GPT5系列】ChatGPT5 提示词工程指南
人工智能
科士威传动4 小时前
丝杆支撑座在印刷设备如何精准运行?
人工智能·科技·自动化·制造
IT成长日记5 小时前
【Nginx开荒攻略】Nginx虚拟主机配置:从域名、端口到IP的完整指南
linux·运维·服务器·nginx·虚拟主机
taxunjishu5 小时前
DeviceNet 转 Modbus TCP 协议转换在 S7-1200 PLC化工反应釜中的应用
运维·人工智能·物联网·自动化·区块链
kalvin_y_liu6 小时前
智能体框架大PK!谷歌ADK VS 微软Semantic Kernel
人工智能·microsoft·谷歌·智能体