The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > Linux
Google UNIX.COM


Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Network interface Qfe, ce, bge ... unclefab SUN Solaris 1 10-30-2006 05:37 AM
Turning on/off the network interface neked Linux 1 04-11-2006 04:16 PM
Before plumb the network interface..... heero SUN Solaris 7 12-08-2005 10:58 AM
network interface questions 98_1LE UNIX for Dummies Questions & Answers 3 09-25-2001 06:23 AM
Network Interface witt UNIX for Dummies Questions & Answers 4 06-07-2001 03:32 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 06-19-2007
Registered User
 

Join Date: Jun 2007
Posts: 3
Get info on network interface

Hello everybody,

How can link network interface to the output of lspci -vv. Basicly i need to know who is the manufacturer of a specific interface, for example eth0 {Is it an Intel, or Broadcome, or something else}. Is there a way to find that out?

Thanx
Reply With Quote
Forum Sponsor
  #2  
Old 06-19-2007
solfreak's Avatar
Registered User
 

Join Date: Jun 2007
Posts: 35
Get you NIC MAC address using either ifconfig or arp command. Then look it up here:
http://coffer.com/mac_find/
Reply With Quote
  #3  
Old 06-19-2007
Registered User
 

Join Date: Jun 2007
Posts: 3
Problem is, i need to create a script which will run against 3000 servers and check to see if any of them has Broadcome card as eth0 or eth4. Broadcome can be eth1,2,3,5,6 but not eth0 or eth4.
Reply With Quote
  #4  
Old 06-19-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
How about looking for the PCI id?

0x14E4 Broadcom Corporation www.broadcom.com

This should be available in dmesg, may be other places it's available as well.

Eg

Quote:
Run "lspci" and "lspci -n" in an xterminal to find the MANFID number of your card.

If you see 14e4:4318 or 14e4:4320 then your card is Broadcom-based....
Reply With Quote
  #5  
Old 06-19-2007
zazzybob's Avatar
Registered Geek
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
See if you have /proc/net/nicinfo/*.info on your system... will simplify this entire process....

EDIT. Had some more time to work on this. You may find the following useful:
Code:
#!/bin/bash

AWK="/usr/bin/awk"
CURL="/usr/bin/curl"
CUT="/usr/bin/cut"
ECHO="/bin/echo"
GREP="/bin/grep"
IFCONFIG="/sbin/ifconfig"
SED="/usr/bin/sed"
TR="/usr/bin/tr"

URL="http://www.coffer.com/mac_find/?string="

function get_interfaces {
  INTERFACES=$( ${IFCONFIG} -a | ${GREP} "^eth" | ${AWK} '{print $1}' )
}

function get_vendors {
  for INTERFACE in ${INTERFACES}; do
     MAC=$( ${IFCONFIG} ${INTERFACE} | ${GREP} "HWaddr" | ${AWK} '{print $NF}' )
     VENDOR=$( ${ECHO} "${MAC}" | ${CUT} -d":" -f1-3 )
     HTTPVENDOR=$( ${ECHO} "${VENDOR}" | ${SED} 's/:/%3A/g' )
     LOOKUP=$( ${CURL} "${URL}${HTTPVENDOR}" 2>/dev/null | ${SED} -n '/strong>[ ]*MAC Address/,/<\/pre>/ p' | ${GREP} -v '>' | ${TR} -s ' ' )
     ${ECHO} "Interface: ${INTERFACE}  Vendor: ${LOOKUP}"
  done
}

get_interfaces
get_vendors

exit 0
Ran this on a few of my Linux systems:
Code:
# ./get_nic_vendor.sh 
Interface: eth0  Vendor:  00144F Sun Microsystems, Inc
Interface: eth1  Vendor:  00144F Sun Microsystems, Inc
Interface: eth2  Vendor:  00144F Sun Microsystems, Inc
Interface: eth3  Vendor:  00144F Sun Microsystems, Inc
# ./get_nic_vendor.sh 
Interface: eth0  Vendor:  009027 intel corporation
# ./get_nic_vendor.sh 
Interface: eth0  Vendor:  000D56 Dell PCBA Test
Interface: eth1  Vendor:  000D56 Dell PCBA Test
Cheers,
ZB

Last edited by zazzybob; 06-19-2007 at 06:08 PM.
Reply With Quote
  #6  
Old 06-19-2007
Registered User
 

Join Date: Jun 2007
Posts: 3
WOW, this is great. Exactly what i needed.

Thank you.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
linux

Thread Tools
Display Modes




All times are GMT -7. The time now is 11:16 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0