Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Relationship between pci's and ip's

Status
Not open for further replies.

Yarka

Technical User
Jan 14, 2007
192
0
0
ES
Hello,

I would like to know how I can relate pci's and ip's on linux.

Thanks in advance.
 
That probably depends on what you are actually referring to as a "pci"

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
I assume by "pci" you mean NICs which are listed in lspci?

ip a will tell you which IP addresses are associated with which network interface, e.g. "eth2".

You can find out which interface name is associated with which PCI device using ls -l /sys/class/net/*/device. For example, in the below "eth2" is the first port in the second dual-port NIC in the system.

Code:
# ls -l /sys/class/net/*/device
lrwxrwxrwx 1 root root 0 Jul  9 02:10 /sys/class/net/eth0/device -> ../../../devices/pci0000:00/0000:00:1c.0/0000:02:00.0
lrwxrwxrwx 1 root root 0 Jul  9 02:10 /sys/class/net/eth1/device -> ../../../devices/pci0000:00/0000:00:1c.0/0000:02:00.1
lrwxrwxrwx 1 root root 0 Jul  9 02:10 /sys/class/net/eth2/device -> ../../../devices/pci0000:00/0000:[red]00:1c.2[/red]/0000:03:00.0
lrwxrwxrwx 1 root root 0 Jul  9 02:10 /sys/class/net/eth3/device -> ../../../devices/pci0000:00/0000:00:1c.2/0000:03:00.1
# lspci
...
00:14.0 PIC: Intel Corporation 5520/5500/X58 I/O Hub System Management Registers (rev 13)
00:14.1 PIC: Intel Corporation 5520/5500/X58 I/O Hub GPIO and Scratch Pad Registers (rev 13)
00:14.2 PIC: Intel Corporation 5520/5500/X58 I/O Hub Control Status and RAS Registers (rev 13)
00:1c.0 PCI bridge: Intel Corporation 82801JI (ICH10 Family) PCI Express Port 1
[red]00:1c.2[/red] PCI bridge: Intel Corporation 82801JI (ICH10 Family) PCI Express Port 3
00:1d.0 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #1
00:1d.1 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #2
...

Annihilannic
[small]tgmlify - code syntax highlighting for your tek-tips posts[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top