
該工具lshw
報告有關所有連接硬體的資訊。
有些報告的選項和功能夠簡單易懂,而有些則不然。
一個例子:
sudo lshw -C net
*-usb:1
description: Wireless interface
product: USB2.0 WLAN
vendor: ATHEROS
physical id: 3
bus info: usb@1:1.3
logical name: wlan2
version: 1.08
serial: 12345
capabilities: usb-2.00 ethernet physical wireless
configuration: broadcast=yes driver=ath9k_htc driverversion=4.9.35-v7+ firmware=1.3 ip=192.168.2.254 link=yes maxpower=500mA multicast=yes speed=480Mbit/s wireless=IEEE 802.11
*-usb:2
description: Wireless interface
product: 802.11n NIC
vendor: Realtek
physical id: 4
bus info: usb@1:1.4
logical name: wlan1
version: 0.00
serial: 123456
capabilities: usb-2.00 ethernet physical wireless
configuration: broadcast=yes driver=rtl8812au ip=192.168.1.254 maxpower=500mA multicast=yes speed=480Mbit/s wireless=IEEE 802.11AC
*-network:0
description: Wireless interface
physical id: 2
logical name: wlan0
serial: b8:27:eb:b0:32:ae
capabilities: ethernet physical wireless
configuration: broadcast=yes driver=brcmfmac driverversion=7.45.41.26 firmware=01-df77e4a7 ip=192.168.8.254 multicast=yes wireless=IEEE 802.11
*-network:1
description: Ethernet interface
physical id: 3
logical name: eth0
serial: b8:27:eb:e5:67:fb
size: 100Mbit/s
capacity: 100Mbit/s
capabilities: ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=smsc95xx driverversion=22-Aug-2005 duplex=full firmware=smsc95xx USB 2.0 Ethernet ip=192.168.0.254 link=yes multicast=yes port=MII speed=100Mbit/s
透過查看每個 NIC,我們可以推斷出以下內容:
網路卡有4個,其中2個是USB網路卡
可以看到連結速度、實體位址、IP位址、邏輯名稱、驅動程式名稱等。
此外,如果適配器支援多播、廣播等。
問題:
然而,像(可能還有其他)這樣的選項link
尚不清楚或無法理解,任何文件中也沒有給出任何定義或描述。
這些配置/功能的描述記錄在哪裡?
答案1
找到了“能力”
命令:lshw -class network -json
"capabilities" : {
"pm" : "Power Management",
"msi" : "Message Signalled Interrupts",
"msix" : "MSI-X",
"pciexpress" : "PCI Express",
"bus_master" : "bus mastering",
"cap_list" : "PCI capabilities listing",
"rom" : "extension ROM",
"ethernet" : true,
"physical" : "Physical interface",
"tp" : "twisted pair",
"10bt-fd" : "10Mbit/s (full duplex)",
"100bt-fd" : "100Mbit/s (full duplex)",
"1000bt-fd" : "1Gbit/s (full duplex)",
"autonegotiation" : "Auto-negotiation"}