![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here! |
|
|
||||
| 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 |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
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 |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Get you NIC MAC address using either ifconfig or arp command. Then look it up here:
http://coffer.com/mac_find/ |
|
#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.
|
|
#4
|
|||
|
|||
|
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:
|
|
#5
|
||||
|
||||
|
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
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 ZB Last edited by zazzybob; 06-19-2007 at 06:08 PM. |
|
#6
|
|||
|
|||
|
WOW, this is great. Exactly what i needed.
Thank you. |
|||
| Google The UNIX and Linux Forums |