Get info on network interface


 
Thread Tools Search this Thread
Operating Systems Linux Get info on network interface
# 1  
Old 06-19-2007
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
# 2  
Old 06-19-2007
Get you NIC MAC address using either ifconfig or arp command. Then look it up here:
http://coffer.com/mac_find/
# 3  
Old 06-19-2007
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  
Old 06-19-2007
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....
# 5  
Old 06-19-2007
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 10:08 PM..
# 6  
Old 06-20-2007
WOW, this is great. Exactly what i needed.

Thank you.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Adding a network interface to a bonded interface

I have a RHEL 5 system with a bonded interface configure using only one network port (eth0). So I have config file for ifcfg-bond0 and ifcfg-eth. I'd like to configure eth5 to be the second SLAVE in the bond. My question is, after I modify ifcfg-eth5, can I add eth5 to the bond0 interface without... (1 Reply)
Discussion started by: westmoreland
1 Replies

2. Solaris

No network cable But Network interface is UP and Running

I've one Netra 240 After changing main board and system configuration card reader, Network is not accessible any more, Network interfaces are always UP and Running even when there is no cable connected to Network interfaces. I tried to restart and plumb/unplumb with no luck. ifconfig -a... (7 Replies)
Discussion started by: samer.odeh
7 Replies

3. IP Networking

network interface -

Hello, Please, how can i create a network interface with a routable IP address on linux (ubuntu) ? AND How can i desactivate an interface? Thank you so much for help. (1 Reply)
Discussion started by: chercheur857
1 Replies

4. IP Networking

Network interface-

Hello, Please what's the difference between: AND Thank you so much (3 Replies)
Discussion started by: chercheur857
3 Replies

5. UNIX and Linux Applications

Access to network interface (Mac-network)

Hi, I'm a italian student. For my thesis I develop a gateway with protocol 6lowpan. For that I must access to network interface to develope my personal stack based on standard 802.15.4. Can you help me? I need an explanation for that. (0 Replies)
Discussion started by: berny88
0 Replies

6. Solaris

configure zones to have different network interface and network

i need to configure a zone to use different interface (bge2) than global and have connected to completely different network switch & to use its own defaultrouter and hosts file .. is it possible ..if so ..how ? Thanks (9 Replies)
Discussion started by: skamal4u
9 Replies

7. IP Networking

How to activate a network interface?

What are the steps between "ifconfig eth0 UP" and "net_device->open"? ifconfig eth0 UP => ioctl(skfd, SIOCSIFFLAGS, &ifr) (ifr.ifr_flags = IFF_UP | IFF_RUNNING) => ????? => what are these steps? net_device->open Thanks! (1 Reply)
Discussion started by: samuncle
1 Replies

8. UNIX for Advanced & Expert Users

network interface problem

Hi expert, Need some help on network interface issue.. I have added 2 x NIC card onto the Ultra 2 system recently and configured as hme1 and hme2. I have unconfigured the onboard hme0 network interface and it was running fine till few days later, i keep recieving error messages showing hme0... (6 Replies)
Discussion started by: sc2005
6 Replies

9. UNIX for Dummies Questions & Answers

network interface questions

I can't remember or figure out how to do this. What is the command(s) in Solaris 8 sparc to show the values operating a NIC, specifically the negotiated transfer rate (10/100) and mode (full/half duplex)? Also, how can I force 100 Mb full (the network is just a crossover cable, and the other box is... (3 Replies)
Discussion started by: 98_1LE
3 Replies

10. UNIX for Dummies Questions & Answers

Network Interface

Hi ! Does anyone know how can i get information about my network interface ... if it works in half or full duplex mode !! Thx in adivance ! Witt (4 Replies)
Discussion started by: witt
4 Replies
Login or Register to Ask a Question