Identify physical port given a network interface name on Dell PowerEdge servers?

John Nielsen lists at jnielsen.net
Tue Mar 29 22:56:04 UTC 2016


> On Mar 29, 2016, at 4:44 PM, John Nielsen <lists at jnielsen.net> wrote:
> 
> 
>> On Mar 29, 2016, at 3:42 PM, Pallav Bose via freebsd-net <freebsd-net at freebsd.org> wrote:
>> 
>> Is there a way for me to identify which physical port corresponds to a given interface name? For example, the input to my script/program is the network interface name, like bge0/ix0, and the output is the physical port which maps to this interface, like, LOM1/LOM2 or NIC1 port 1 (in case a NIC card is attached via the PCI bus). This program/script will run on a Dell PowerEdge server.
>> 
>> LOM stands for LAN On Motherboard.
> 
> It sounds like you're looking for something like Dell's biosdevname for Linux. I don't think such a thing exists on FreeBSD, but if you can figure out how to get it the same data should be available from the BIOS. I would start by scrutinizing the output of "dmidecode"; if it's in there then you can just parse it out for your script. If not, you can always dive through the source of biosdevname:
> 
> http://linux.dell.com/git/biosdevname.git/

See also:
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Networking_Guide/sec-Consistent_Network_Device_Naming_Using_biosdevname.html#sec-Consistent_Network_Device_Naming-System_Requirements

I don't have access to a Dell box running FreeBSD but on a PowerEdge server running CentOS 6 this command looks like it returned all the raw info you would need to implement your own "biosdevname-lite". Specifically you could map the NIC number from the "Reference Designation" to its PCI bus address and then call it whatever you wanted:

# dmidecode -t 41
# dmidecode 2.12
SMBIOS 2.6 present.

Handle 0x2900, DMI type 41, 11 bytes
Onboard Device
	Reference Designation: Embedded NIC 1                          
	Type: Ethernet
	Status: Enabled
	Type Instance: 1
	Bus Address: 0000:01:00.0

Handle 0x2901, DMI type 41, 11 bytes
Onboard Device
	Reference Designation: Embedded NIC 2                          
	Type: Ethernet
	Status: Enabled
	Type Instance: 2
	Bus Address: 0000:01:00.1
[...]



More information about the freebsd-net mailing list