From owner-freebsd-net@freebsd.org Tue Mar 29 22:56:04 2016 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42DDDAE0B8E for ; Tue, 29 Mar 2016 22:56:04 +0000 (UTC) (envelope-from lists@jnielsen.net) Received: from webmail2.jnielsen.NET (webmail2.jnielsen.net [50.114.224.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "webmail2.jnielsen.net", Issuer "freebsdsolutions.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 0DBC01CE4 for ; Tue, 29 Mar 2016 22:56:03 +0000 (UTC) (envelope-from lists@jnielsen.net) Received: from chads-iphone.domo.com (50-207-241-62-static.hfc.comcastbusiness.net [50.207.241.62]) (authenticated bits=0) by webmail2.jnielsen.NET (8.15.2/8.15.1) with ESMTPSA id u2TMuLIq007931 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 29 Mar 2016 16:56:24 -0600 (MDT) (envelope-from lists@jnielsen.net) X-Authentication-Warning: webmail2.jnielsen.NET: Host 50-207-241-62-static.hfc.comcastbusiness.net [50.207.241.62] claimed to be chads-iphone.domo.com Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: Identify physical port given a network interface name on Dell PowerEdge servers? From: John Nielsen In-Reply-To: <5FABB126-8926-40FF-915E-8F7BC0181314@jnielsen.net> Date: Tue, 29 Mar 2016 16:55:59 -0600 Cc: "freebsd-net@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <7101EBFF-0D3B-4BE3-976F-06DBF76EB5B8@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> To: Pallav Bose X-Mailer: Apple Mail (2.3124) X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2016 22:56:04 -0000 > On Mar 29, 2016, at 4:44 PM, John Nielsen wrote: >=20 >=20 >> On Mar 29, 2016, at 3:42 PM, Pallav Bose via freebsd-net = 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 [...]