-1

I am working on a server that has multiple dual port NIC cards. Each port has a different address on the PCI bus.

I'm using nping to send packets through network interfaces given their logical names (such as eth0), but I want to be able to send packets through an interface given its PCI address (such as 0000:00:07.0). How can I achieve it ?

sudo lshw -C network gives:

*-network:0 UNCLAIMED
description: Ethernet controller

   product: 82599ES 10-Gigabit SFI/SFP+ Network Connection
   vendor: Intel Corporation
   physical id: 0
   bus info: pci@0000:01:00.0
   version: 01
   width: 64 bits
   clock: 33MHz
   capabilities: pm msi msix pciexpress vpd bus_master cap_list
   configuration: latency=0
   resources: memory:dfd20000-dfd3ffff ioport:8020(size=32) memory:dfd44000-dfd47fff memory:def00000-deffffff memory:dee00000-deefffff

1 Answers1

0

You'll have to map the pci address to its logical name. Frankly, I've done that, but it seems that lshw does the trick.

Run sudo lshw -C network

You should get something like this (source):

*-network
       description: Wireless interface
       product: AR5212 802.11abg NIC
       vendor: Atheros Communications, Inc.
       physical id: 1
       bus info: pci@03:00.0
       logical name: ath0
       version: 01
       serial: 00:11:95:50:be:62
       width: 32 bits
       clock: 33MHz
       capabilities: bus_master cap_list ethernet physical wireless
       configuration: broadcast=yes driver=ath_pci driverversion=0.9.6.0 (EXPERIMENTAL) ip=192.168.1.12 multicast=yes wireless=IEEE 802.11g
       resources: iomemory:10800000-1080ffff irq:11

Here you have both the interface's name (logical name: ath0) and its bus info, including address (bus info: pci@03:00.0). Now all you have to do is to parse both, and lookup the logical name of the pci address that interests you.

Malt
  • 28,965
  • 9
  • 65
  • 105
  • The logical name is not displayed for the particular pci address. I have updated the question showing the output of the command given by you. Thanks. – user3324317 Feb 06 '15 at 06:35