Skip to content

Instantly share code, notes, and snippets.

@xanderlent
Created May 21, 2019 03:17
Show Gist options
  • Save xanderlent/6cccc51e46009fba3fec17e345dd0be5 to your computer and use it in GitHub Desktop.
Save xanderlent/6cccc51e46009fba3fec17e345dd0be5 to your computer and use it in GitHub Desktop.
Ethernet OUIs from the command line

Ethernet OUIs from the command line

(Something I cooked up out of curiosity on 2019-05-20...)

You want a list of OUIs?
Have a list of (Ethernet) OUIs (on Linux): ip l | grep link/ether | tr -s ' ' '\t' | cut -f 3 | cut -d: -f 1-3
or ifconfig | grep HWaddr | tr -s ' ' | cut -d ' ' -f 5 | cut -d: -f 1-3

Here’s macOS: ifconfig | grep ether | tr ' ' '\t' | cut -f 3 | cut -d: -f 1-3

These are all quick and dirty. There’s probably a better way to do this than scraping CLI output...

@xanderlent
Copy link
Author

An update: The ifconfig snippets don't seem to work on current Linux distributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment