Linux-4.查看网卡信息,状态

Linux-4.查看网卡信息

1.查看有几张网卡,也能看出网卡控制器的制造商信息
lspci | grep -i -E --color ‘network|ethernet‘

【实例】
[email protected]:~# lspci |grep -i eth
02:00.0 Ethernet controller: Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet (rev 20)
02:00.1 Ethernet controller: Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet (rev 20)
04:00.0 Ethernet controller: Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet (rev 20)
04:00.1 Ethernet controller: Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet (rev 20)
2张网卡

[email protected]:~# lspci |grep -i eth
02:00.0 Ethernet controller: Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet (rev 20)
02:00.1 Ethernet controller: Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet (rev 20)
1张网卡

2.可以使用lshw,
(系统没有自带,需要安装Debian:apt-get install lshw。 Centos: yum install lshw)
lshw -class network

【实例】
[email protected]:~# lshw -class network
  *-network:0             
       description: Ethernet interface
       product: NetXtreme II BCM5716 Gigabit Ethernet
       vendor: Broadcom Corporation
       physical id: 0
       bus info: [email protected]:02:00.0
       logical name: eth0
       version: 20
       serial: 78:2b:cb:58:74:5f
       size: 1GB/s
       capacity: 1GB/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm vpd msi msix pciexpress bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=bnx2 driverversion=2.0.2 duplex=full firmware=5.2.3 NCSI 2.0.11 ip=192.168.4.171 latency=0 link=yes multicast=yes port=twisted pair speed=1GB/s
       resources: irq:16 memory:da000000-dbffffff
  *-network:1 DISABLED
       description: Ethernet interface
       product: NetXtreme II BCM5716 Gigabit Ethernet
       vendor: Broadcom Corporation
       physical id: 0.1
       bus info: [email protected]:02:00.1
       logical name: eth1
       version: 20
       serial: 78:2b:cb:58:74:60
       capacity: 1GB/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm vpd msi msix pciexpress bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=bnx2 driverversion=2.0.2 duplex=half firmware=5.2.3 NCSI 2.0.11 latency=0 link=no multicast=yes port=twisted pair
       resources: irq:17 memory:dc000000-ddffffff
       
[email protected]:~# lshw -class network
  *-network:0             
       description: Ethernet interface
       product: NetXtreme II BCM5709 Gigabit Ethernet
       vendor: Broadcom Corporation
       physical id: 0
       bus info: [email protected]:04:00.0
       logical name: eth0
       version: 20
       serial: 00:10:18:b3:75:ec
       size: 1GB/s
       capacity: 1GB/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm vpd msi msix pciexpress bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=bnx2 driverversion=2.0.2 duplex=full firmware=5.2.3 ip=192.168.4.178 latency=0 link=yes multicast=yes port=twisted pair speed=1GB/s
       resources: irq:16 memory:d6000000-d7ffffff
  *-network:1 DISABLED
       description: Ethernet interface
       product: NetXtreme II BCM5709 Gigabit Ethernet
       vendor: Broadcom Corporation
       physical id: 0.1
       bus info: [email protected]:04:00.1
       logical name: eth1
       version: 20
       serial: 00:10:18:b3:75:ee
       capacity: 1GB/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm vpd msi msix pciexpress bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=bnx2 driverversion=2.0.2 duplex=half firmware=5.2.3 latency=0 link=no multicast=yes port=twisted pair
       resources: irq:17 memory:d8000000-d9ffffff
  *-network:0 DISABLED
       description: Ethernet interface
       product: NetXtreme II BCM5716 Gigabit Ethernet
       vendor: Broadcom Corporation
       physical id: 0
       bus info: [email protected]:02:00.0
       logical name: eth2
       version: 20
       serial: 78:2b:cb:58:76:7d
       capacity: 1GB/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm vpd msi msix pciexpress bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=bnx2 driverversion=2.0.2 duplex=half firmware=5.2.3 NCSI 2.0.11 latency=0 link=no multicast=yes port=twisted pair
       resources: irq:16 memory:da000000-dbffffff
  *-network:1 DISABLED
       description: Ethernet interface
       product: NetXtreme II BCM5716 Gigabit Ethernet
       vendor: Broadcom Corporation
       physical id: 0.1
       bus info: [email protected]:02:00.1
       logical name: eth3
       version: 20
       serial: 78:2b:cb:58:76:7e
       capacity: 1GB/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm vpd msi msix pciexpress bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=bnx2 driverversion=2.0.2 duplex=half firmware=5.2.3 NCSI 2.0.11 latency=0 link=no multicast=yes port=twisted pair
       resources: irq:17 memory:dc000000-ddffffff

3.查看非常详细的信息
lspci -vvv  # 3个小写的v
【实例】
[email protected]:~# lspci -vvv | grep -i -E ‘(net|eth)‘ -A 50
02:00.0 Ethernet controller: Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet (rev 20)
        Subsystem: Dell Device 02a3
        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 0, Cache Line Size: 64 bytes
        Interrupt: pin A routed to IRQ 16
        Region 0: Memory at da000000 (64-bit, non-prefetchable) [size=32M]
        Capabilities: [48] Power Management version 3
                ---下面内容忽略,内容太长
                Kernel driver in use: bnx2  #驱动
--
02:00.1 Ethernet controller: Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet (rev 20)
        Subsystem: Dell Device 02a3
        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 0, Cache Line Size: 64 bytes
        Interrupt: pin B routed to IRQ 17
        Region 0: Memory at dc000000 (64-bit, non-prefetchable) [size=32M]
        Capabilities: [48] Power Management version 3
                ---下面内容忽略,内容太长
                Kernel driver in use: bnx2  #驱动

4.查看网卡当前状态
mii-tool  【通常用于 机房上架后网卡连接的检查】 ,网线是否连接,以及当前传送速度(1000baseT-FD)
【实例】
[email protected]:~# mii-tool  
eth0: negotiated 1000baseT-FD flow-control, link ok
SIOCGMIIPHY on ‘eth1‘ failed: Resource temporarily unavailable
SIOCGMIIPHY on ‘eth2‘ failed: Resource temporarily unavailable
SIOCGMIIPHY on ‘eth3‘ failed: Resource temporarily unavailable

5.查看网卡驱动
ethtool

[email protected]:~# ethtool -i eth0
driver: bnx2
version: 2.0.2
firmware-version: 5.2.3
bus-info: 0000:04:00.0
[email protected]:~# ethtool -i eth2
driver: bnx2
version: 2.0.2
firmware-version: 5.2.3 NCSI 2.0.11
bus-info: 0000:02:00.0

6.从开机信息中查看网卡
# dmesg | grep -i eth
【实例】
[email protected]:/var/log# dmesg | grep -i --color eth
[    1.162042] Broadcom NetXtreme II Gigabit Ethernet Driver bnx2 v2.0.2 (Aug 21, 2009)
[    1.164195] eth0: Broadcom NetXtreme II BCM5709 1000Base-T (C0) PCI Express found at mem d6000000, IRQ 16, node addr 00:10:18:b3:75:ec
[    1.166331] eth1: Broadcom NetXtreme II BCM5709 1000Base-T (C0) PCI Express found at mem d8000000, IRQ 17, node addr 00:10:18:b3:75:ee
[    1.168236] eth2: Broadcom NetXtreme II BCM5716 1000Base-T (C0) PCI Express found at mem da000000, IRQ 16, node addr 78:2b:cb:58:76:7d
[    1.170235] eth3: Broadcom NetXtreme II BCM5716 1000Base-T (C0) PCI Express found at mem dc000000, IRQ 17, node addr 78:2b:cb:58:76:7e
[   12.021967] ACPI Error (psparse-0537): Method parse/execution failed [\_SB_.PMI0._GHL] (Node ffff88023fc2bd40), AE_NOT_EXIST
[   12.021981] ACPI Error (psparse-0537): Method parse/execution failed [\_SB_.PMI0._PMC] (Node ffff88023fc2bcc0), AE_NOT_EXIST
[   41.295829] bnx2: eth0: using MSIX
[   41.296444] ADDRCONF(NETDEV_UP): eth0: link is not ready
[   44.413942] bnx2: eth0 NIC Copper Link is Up, 1000 Mbps full duplex
[   44.414627] ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

===========================
mii-tool,ethtool 详细说明
以及/proc/net/dev
/proc/interrupts | grep ethX
虚拟网卡
网卡参数的修改
网卡流量的查看
会在后面后续文章说到

以上是个人点点总结和理解,水平不高,文笔水平很烂,请各位大大见谅。
可以一起交流学习。

我的QQ:610851588
  可以加入我建的群(现在群人很少,希望慢慢多起来)
  Linux  群:183932302
  Python ,shell 交流群:469094734

时间: 2024-10-10 07:49:16

Linux-4.查看网卡信息,状态的相关文章

linux/centos6 查看SELinux状态 关闭SELinux

SELinux(Security-Enhanced Linux) 是美国国家安全局(NSA)对于强制访问控制的实现,是 Linux历史上最杰出的新安全子系统.在这种访问控制体系的限制下,进程只能访问那些在他的任务中所需要文件.SELinux 默认安装在 Fedora 和 Red Hat Enterprise Linux 上. 虽然SELinux很好用,但是在多数情况我们还是将其关闭,因为在不了解其机制的情况下使用SELinux会导致软件安装或者应用部署失败. 以下就是关闭SELinux的方法 系

Linux功能-查看网卡信息

nmcli是一款能够方便我们配置网络的工具,能够轻松的查看网卡信息或网络状态: 实例1:查看网卡信息 [[email protected] ~]# nmcli connection show 名称 UUID 类型 设备 virbr0-nic 7f3a7bb5-a7ab-440c-b87f-d94e6f4dd96b 802-3-ethernet virbr0-nic virbr0 ff7c93dd-05ae-4794-9030-77218b2ad5dd bridge virbr0 eno16777

Linux ifconfig 查看网络接口状态

Linux ifconfig 如果不接任何参数,就会输出当前网络接口的情况: [[email protected] ~]# Linux ifconfig eth0      Link encap:Ethernet  HWaddr 00:C0:9F:94:78:0E inet addr:192.168.1.88  Bcast:192.168.1.255  Mask:255.255.255.0 inet6 addr: fe80::2c0:9fff:fe94:780e/64 Scope:Link UP

linux下查看网卡信息的命令

rhel 内核版本号信息: [[email protected] ~]# uname -a Linux hvrhub 2.6.18-308.el5 #1 SMP Fri Jan 27 17:17:51 EST 2012 x86_64 x86_64 x86_64 GNU/Linux 查看网卡的驱动.制造商等信息: [[email protected] ~]# kudzu --probe --class=network - class: NETWORK bus: PCI detached: 0 de

linux ethtool 查看网卡状态

ethtool 工具关于网络协商功能介绍: ethtool - Display or change ethernet card settings(ethtool 是用来显示和更改网卡设置的工具):这个工具比较复杂,功能也特别多.由于洋文比较难懂.所以我们还是把网络设备协商方式的设置方法说一说. 2.1 ethtool 显示网络端口设置功能: 这个功能比较好办.就是ethtool 后面直接接网絽接口就行:比如下面的例子: [[email protected] ~]# ethtool eth0Set

Linux如何查看端口状态

netstat命令各个参数说明如下: -t : 指明显示TCP端口 -u : 指明显示UDP端口 -l : 仅显示监听套接字(所谓套接字就是使应用程序能够读写与收发通讯协议(protocol)与资料的程序) -p : 显示进程标识符和程序名称,每一个套接字/端口都属于一个程序. -n : 不进行DNS轮询,显示IP(可以加速操作) 即可显示当前服务器上所有端口及进程服务,于grep结合可查看某个具体端口及服务情况·· netstat -ntlp   //查看当前所有tcp端口· netstat

DELL 服务器在LINUX下查看阵列状态命令

omreport 命令需要安装dell的OMSA才可以使用 [[email protected] ~]# omreport storage vdisk controller=0 List of Virtual Disks on Controller PERC H710P Mini (Embedded) Controller PERC H710P Mini (Embedded) ID                                : 0 Status                

10.6 监控io性能 - 10.7 free命令 - 10.8 ps命令 - 10.9 查看网络状态 - 10.10 linux下抓包

- 10.6 监控io性能 - 10.7 free命令 - 10.8 ps命令 - 10.9 查看网络状态 - 10.10 linux下抓包 - 扩展tcp三次握手四次挥手 http://www.doc88.com/p-9913773324388.html  - tshark几个用法:http://www.aminglinux.com/bbs/thread-995-1-1.html  # 10.6 监控io性能 ![mark](http://oqxf7c508.bkt.clouddn.com/b

Linux查看系统状态命令

Linux查看系统状态命令     iostat iostat 命令详细地显示了存储子系统方面的情况.你通常用iostat来监控存储子系统总体上运行状况如何,并且在用户注意到服务器运行缓慢之前提早发现输入/输出缓慢的问题.相信我,你应该在用户发现这些问题之前先发现这些问题! meminfo和free meminfo为你详细显示了内存方面的情况.你通常可以使用另一个程序,比如cat和grep,来访问meminfo的信息.比如说,cat /proc/meminfo为你详细显示了服务器的内存在任何一个