Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Mar 2016 16:55:59 -0600
From:      John Nielsen <lists@jnielsen.net>
To:        Pallav Bose <pallav_bose@yahoo.com>
Cc:        "freebsd-net@freebsd.org" <freebsd-net@freebsd.org>
Subject:   Re: Identify physical port given a network interface name on Dell PowerEdge servers?
Message-ID:  <7101EBFF-0D3B-4BE3-976F-06DBF76EB5B8@jnielsen.net>
In-Reply-To: <5FABB126-8926-40FF-915E-8F7BC0181314@jnielsen.net>
References:  <1143344414.2163848.1459287753408.JavaMail.yahoo.ref@mail.yahoo.com> <1143344414.2163848.1459287753408.JavaMail.yahoo@mail.yahoo.com> <5FABB126-8926-40FF-915E-8F7BC0181314@jnielsen.net>

next in thread | previous in thread | raw e-mail | index | archive | help

> On Mar 29, 2016, at 4:44 PM, John Nielsen <lists@jnielsen.net> wrote:
>=20
>=20
>> On Mar 29, 2016, at 3:42 PM, Pallav Bose via freebsd-net =
<freebsd-net@freebsd.org> wrote:
>>=20
>> 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.
>>=20
>> LOM stands for LAN On Motherboard.
>=20
> 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:
>=20
> http://linux.dell.com/git/biosdevname.git/

See also:
=
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/h=
tml/Networking_Guide/sec-Consistent_Network_Device_Naming_Using_biosdevnam=
e.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                         =20=

	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                         =20=

	Type: Ethernet
	Status: Enabled
	Type Instance: 2
	Bus Address: 0000:01:00.1
[...]




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7101EBFF-0D3B-4BE3-976F-06DBF76EB5B8>