Handy 2 line script to lookup Network Card manufacturer by MAC address

665

I have to do this, unforunately, pretty often in my line of work. So, I got tired of always having to fire up my borwser and then getting to an OUI search engine, etc etc. 

 

#!/bin/bash

OUI=$(echo ${1//[:.- ]/} | tr “[a-f]” “[A-F]” | egrep -o “^[0-9A-F]{6}”)

grep $OUI lynx -dump http://standards.ieee.org/regauth/oui/oui.txt

Stick this in a file somewhere in your path (I usually add ~/bin to my PATH in my .bashrc) and make it executable. Then you can do something akin to:
adam@adam-laptop:~$ oui 00:1c:23:b0:88:18 
001C23  Dell Inc
the fancy looking regexes are just to make it accept MAC addresses in a couple of different forms, incluing the way Cisco outputs them, amoung others. 
Enjoy!