How to find PCI address of an ethernet interface?

lshw and lspci are both capable of showing that information. As you have found out already, you can do lshw -class network -businfo. For instance, here's my output:

$ sudo lshw -c network -businfo                                                                                                                    
Bus info          Device      Class       Description
=====================================================
pci@0000:0e:00.0  wlan0       network     RTL8187SE Wireless LAN Controller
pci@0000:14:00.0  eth0        network     RTL8101E/RTL8102E PCI Express Fast Ethernet controller

What you also could use is lspci -D and pipe it to grep to filter out the ethernet controller specifically. Here's my example:

$ lspci -D | grep 'Network\|Ethernet'                                                                                                              
    0000:0e:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8187SE Wireless LAN Controller (rev 22)
    0000:14:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 02)

Note that with the transition to systemd, one could use of Predictable Interface Naming to just look at the interface name to find out PCI information.


This information is available in sysfs, no helpers like lshw / lspci / ethtool / udevadm are needed:

$ grep PCI_SLOT_NAME /sys/class/net/*/device/uevent
/sys/class/net/enp4s0/device/uevent:PCI_SLOT_NAME=0000:04:00.0
/sys/class/net/wlp2s0/device/uevent:PCI_SLOT_NAME=0000:02:00.0

ethtool will also show you pci for an interface (bus-info:)

me@ubuntu:~$ ethtool -i eth0
driver: i40e
version: 1.5.16
firmware-version: 5.04 0x800024cd 0.0.0
bus-info: 0000:06:00.0
supports-statistics: yes
supports-test: yes
supports-eeprom-access: yes
supports-register-dump: yes

Tags:

Ethernet

Pci