Mapping nic hardware address to PCI address

When logged into an ESX host the following command will list out all your nics with their PCI address. As you can see I have quite a few active ports on this box. Specifically I have two onboard ports and two quad port cards.

esxcfg-nics -l

vmnic0  0d:00.00 e1000       Up   100Mbps  Full   1500   Intel Corporation Intel PRO/1000 PT Low Profile Quad Port PCIe Gigabit Ethernet Controller
vmnic5  0e:00.01 e1000       Up   1000Mbps Full   1500   Intel Corporation Intel PRO/1000 PT Low Profile Quad Port PCIe Gigabit Ethernet Controller
vmnic8  12:00.00 e1000       Up   1000Mbps Full   1500   Intel Corporation Intel PRO/1000 PT Low Profile Quad Port PCIe Gigabit Ethernet Controller
vmnic2  05:00.00 bnx2        Up   1000Mbps Full   1500   Broadcom Corporation Broadcom NetXtreme II BCM5708 1000Base-T
vmnic4  0e:00.00 e1000       Up   1000Mbps Full   1500   Intel Corporation Intel PRO/1000 PT Low Profile Quad Port PCIe Gigabit Ethernet Controller
vmnic1  03:00.00 bnx2        Up   1000Mbps Full   1500   Broadcom Corporation Broadcom NetXtreme II BCM5708 1000Base-T
vmnic3  0d:00.01 e1000       Up   1000Mbps Full   1500   Intel Corporation Intel PRO/1000 PT Low Profile Quad Port PCIe Gigabit Ethernet Controller
vmnic6  11:00.00 e1000       Up   1000Mbps Full   1500   Intel Corporation Intel PRO/1000 PT Low Profile Quad Port PCIe Gigabit Ethernet Controller
vmnic7  11:00.01 e1000       Up   1000Mbps Full   1500   Intel Corporation Intel PRO/1000 PT Low Profile Quad Port PCIe Gigabit Ethernet Controller
vmnic9  12:00.01 e1000       Up   1000Mbps Full   1500   Intel Corporation Intel PRO/1000 PT Low Profile Quad Port PCIe Gigabit Ethernet Controller

While this information is helpful, it does not tell me which ports are on the same card. However the following command gives me the mac addresses of each port, so I can figure out which ports are on the same quad port nic by comparing similar macs, I have highlighed the ports that are on the same card as vmnic9

grep "/net/pnic" /etc/vmware/esx.conf

root@rhost11 log]# grep "/net/pnic" /etc/vmware/esx.conf
/net/pnic/child[0000]/mac = "00:1c:c4:ec:65:58"
/net/pnic/child[0000]/name = "vmnic1"
/net/pnic/child[0000]/virtualMac = "00:50:56:5c:65:58"
/net/pnic/child[0001]/mac = "00:1c:c4:ec:65:56"
/net/pnic/child[0001]/name = "vmnic2"
/net/pnic/child[0001]/virtualMac = "00:50:56:5c:65:56"
/net/pnic/child[0002]/mac = "00:18:fe:2e:1b:21"
/net/pnic/child[0002]/name = "vmnic0"
/net/pnic/child[0002]/virtualMac = "00:50:56:5e:1b:21"
/net/pnic/child[0003]/mac = "00:18:fe:2e:1b:20"
/net/pnic/child[0003]/name = "vmnic3"
/net/pnic/child[0003]/virtualMac = "00:50:56:5e:1b:20"
/net/pnic/child[0004]/mac = "00:18:fe:2e:1b:23"
/net/pnic/child[0004]/name = "vmnic4"
/net/pnic/child[0004]/virtualMac = "00:50:56:5e:1b:23"
/net/pnic/child[0005]/mac = "00:18:fe:2e:1b:22"
/net/pnic/child[0005]/name = "vmnic5"
/net/pnic/child[0005]/virtualMac = "00:50:56:5e:1b:22"
/net/pnic/child[0006]/mac = "00:18:fe:2e:b3:91"
/net/pnic/child[0006]/name = "vmnic6"
/net/pnic/child[0006]/virtualMac = "00:50:56:5e:b3:91"
/net/pnic/child[0007]/mac = "00:18:fe:2e:b3:90"
/net/pnic/child[0007]/name = "vmnic7"
/net/pnic/child[0007]/virtualMac = "00:50:56:5e:b3:90"
/net/pnic/child[0008]/mac = "00:18:fe:2e:b3:93"
/net/pnic/child[0008]/name = "vmnic8"
/net/pnic/child[0008]/virtualMac = "00:50:56:5e:b3:93"
/net/pnic/child[0009]/mac = "00:18:fe:2e:b3:92"
/net/pnic/child[0009]/name = "vmnic9"
/net/pnic/child[0009]/virtualMac = "00:50:56:5e:b3:92"

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.