Linux-4.查看网卡信息,状态
Linux-4.查看网卡信息
1.查看有几张网卡,也能看出网卡控制器的制造商信息
lspci | grep -i -E --color 'network|ethernet'
【实例】
root@demohost:~# 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张网卡
root@Yuanji-Debian-171:~# 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
【实例】
root@Yuanji-Debian-171:~# lshw -class network
*-network:0
description: Ethernet interface
product: NetXtreme II BCM5716 Gigabit Ethernet
vendor: Broadcom Corporation
physical id: 0
bus info: pci@0000: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: pci@0000: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
root@demohost:~# lshw -class network
*-network:0
description: Ethernet interface
product: NetXtreme II BCM5709 Gigabit Ethernet
vendor: Broadcom Corporation
physical id: 0
bus info: pci@0000: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: pci@0000: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: pci@0000: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: pci@0000: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
【个人常用】
-html output hardware tree as HTML
-xml output hardware tree as XML
lshw -html > /home/hwinfo.html
lshw -xml > /home/info.xml
【实例】
使用脚本,每天凌晨自动执行lshw -xml > /home/info+`date +%Y%m%d-%H%M%S`.xml
1>备份最原始的xml 作为资产管理
2>脚本对比当天和昨天的 XXX.xml
3>如果有不同,将信息传回到公司,资产日志更新
3.查看非常详细的信息
lspci -vvv # 3个小写的v
【实例】
root@Yuanji-Debian-171:~# 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)
【实例】
root@demohost:~# 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
root@demohost:~# ethtool -i eth0
driver: bnx2
version: 2.0.2
firmware-version: 5.2.3
bus-info: 0000:04:00.0
root@demohost:~# 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
【实例】
root@demohost:/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
转载于:https://blog.51cto.com/yuanji6699/1773866
Linux-4.查看网卡信息,状态相关推荐
- Linux下查看网卡信息及确定网卡位置以及更改网卡名称
转载链接 : Linux下查看网卡信息及确定网卡位置 https://blog.51cto.com/liuqun/1981915 查看Linux网卡访问流量的方法 安装iftop命令(基于epel源) ...
- linux查看php端口,Linux如何查看端口状态
Linux如何查看端口状态,相信大家应该都知道我们有的时候需要进行查看当前系统开放了哪些端口,这样子可以查看我们的服务是否正常运行,所以今天小魏给大家分享下在linux服务器下怎么来查看端口的情况. ...
- linux6 防火墙状态,linux 6 查看防火墙状态及开启关闭命令
linux 6查看防火墙状态及开启关闭命令 存在以下两种方式: 一.service方式 查看防火墙状态: [root@centos6 ~]# service iptables status iptab ...
- linux下查看防火墙状态、关闭防火墙、开放关闭端口等
linux下查看防火墙状态.关闭防火墙.开放关闭端口等 1. 查看防火墙状态 2. 关闭防火墙 3. 开启防火墙 4. 关闭.开启防火墙示例看图 5. 查看防火墙开放的端口.设置开放端口 5.1 查看 ...
- Linux下 启动SELinux命令,Linux下查看SELinux状态和关闭SELinux的方法命令是什么
Linux继承了Unix以网络为核心的设计思想,是一个性能稳定的多用户网络操作系统.对于SELinux状态可能很多用户不知道怎么设置,这篇文章主要介绍了Linux下查看SELinux状态和关闭SELi ...
- php显示网卡信息,linux如何查看网卡信息
1.使用ifconfig命令查看网卡信息 ifconfig是linux中用于显示或配置网络设备(网络接口卡)的命令,英文全称是network interfaces configuring.ifconf ...
- linux 查看san链路状态,Linux下查看网络状态的方法
当我的设备在机房,懒得去查看网线连接情况:或者设备在远端,没有条件让眼睛亲临现场,我需要在终端查看设备网络接口的物理连接状态.基于此种场景,我就了解了几种关于命令查看网络状态的方法. 1. ifcon ...
- linux 查看was端口,Linux如何查看端口状态
查看并发状态 # netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}' 这条语句返回结果如下 LAST_ACK 5 ...
- Linux查看PHP的端口号,linux如何查看端口状态
linux查看端口状态使用netstat命令. netstat命令各个参数说明如下: -a:列出所有网络状态,包括 Socket 程序: -c秒数:指定每隔几秒刷新一次网络状态: -n:使用 IP 地 ...
最新文章
- 使用消息队列实现分布式事务-公认较为理想的分布式事务解决方案(转)
- Enterprise Solution 2.2 Feature List
- 客户端版本和服务器版本上传软件
- UI\UX实用素材模板|电子商务企业设计十大趋势
- NFC:Arduino、Android与PhoneGap近场通信
- mvcframeworkProgramming ASP.NET MVC-Fundamentals of ASP.NET MVC(四)Controller
- emq mysql消息存储_EMQ X 规则引擎系列(二)存储消息到 MySQL 数据库
- Mac上的UML建模工具
- 安卓磁链搜索下载播放和原理探索
- APS高级计划排程系统的基本原理和排程步骤
- Fibonacci数列的递推公式为:Fn=Fn-1+Fn-2,其中F1=F2=1。 当n比较大时,Fn也非常大,现在我们想知道,Fn除以10007的余数是多少(蓝桥基础实战)
- html页面整体隐藏,三种隐藏 HTML 元素的方式
- hp-unix操作系统root账号被锁定的两种解决方法:
- 怎么上传云班课的计算机作业,云班课作业怎么提交_作业提交方法_咖绿茵手游站...
- memcacheredis构建缓存服务器
- 电脑重装系统简单小白教程
- 公共经济学(开卷)期末复习题
- 爱普生Epson SureColor T5480 打印机驱动
- VS2017配置OpenCV4.0(Win10环境)
- php16进制转换源码,php16进制转换