Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Pull the LAN1/eth0 MAC address from SuperMicro IPMI

You can find the MAC address for LAN1/eth0 (not the BMC MAC) via the SuperMicro IPMI interface by running the following command:

$ ipmitool -U $IPMI_USER -P $IPMI_PASS -H $IPMI_HOST raw 0x30 0x21 | tail -c 18

The eth0 MAC address will be output in this format:

00 25 90 f0 be ef
@tapanswain

This comment has been minimized.

Copy link

@tapanswain tapanswain commented Feb 25, 2015

cool it works

@violetbp

This comment has been minimized.

Copy link

@violetbp violetbp commented Sep 30, 2016

Just for clarity, only use the first line. its not all one line with wrapping.

@DavidWittman

This comment has been minimized.

Copy link
Owner Author

@DavidWittman DavidWittman commented Oct 25, 2016

Thanks @mookie1097. I just edited this Gist to avoid any confusion.

@Goorzhel

This comment has been minimized.

Copy link

@Goorzhel Goorzhel commented Nov 10, 2016

This is pretty neat. Is there a way to get the BMC MAC via ipmitool though? I landed here from Google looking for the solution to that.

@dmick

This comment has been minimized.

Copy link

@dmick dmick commented Jan 17, 2017

@GA114: well, you could get it from your ARP table, but yeah, lan print will show a bunch of stuff including MAC

@Vishesh-GIT

This comment has been minimized.

Copy link

@Vishesh-GIT Vishesh-GIT commented Feb 1, 2017

not working for me on intel's S2600TP server board, giving some random number which doesn't match any of the mac

@lurkalicious

This comment has been minimized.

Copy link

@lurkalicious lurkalicious commented Feb 10, 2017

To get BMC MAC:

$ ipmitool -U $IPMI_USER -P $IPMI_PASS -H $IPMI_HOST lan print | grep "MAC Address"
or
$ ipmitool -U $IPMI_USER -P $IPMI_PASS -H $IPMI_HOST raw 0x0c 0x02 0x01 0x05 0x00 0x00

@exodusftw

This comment has been minimized.

Copy link

@exodusftw exodusftw commented Jul 1, 2017

anyone know if it's possible to use ipmitool to grab the additional LAN MAC addresses - for example, Lan1/2/3/4 or even pushing into non-embedded PCI-e fiber NIC's?

@boxrick

This comment has been minimized.

Copy link

@boxrick boxrick commented Dec 5, 2017

exodusftw: And for other people looking at this in the future

raw 0x30 0x9F - will display LAN2 and any ONBOARD NICs onwards, you cannot use this method for PCI-E based NIC. Also a bit of reference here.

Hopefully help someone out in the future, had to do a little digging for this.

http://www.supermicro.co.uk/support/faqs/faq.cfm?faq=14914

@Gnossos

This comment has been minimized.

Copy link

@Gnossos Gnossos commented May 16, 2018

I found this discussion, but it took me about an hour to implement it. To save others time, here are the most important lessons:

  1. On a Supermicro motherboard, if you know the MAC address of LAN 1, just add 1 to the last byte of the address. See http://www.supermicro.com/support/faqs/faq.cfm?faq=14914. (I know, boxrick just referenced this page, but knowing the MAC addresses are sequential might save you the trouble of looking this up.)

  2. On an Apple Mac, use Homebrew to install ipmitool. Open a terminal window, and enter "brew install ipmitool". If you don't have Homebrew installed yet, use this command first:
    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null
    See macappstore.org/ipmitool/.

@Goorzhel

This comment has been minimized.

Copy link

@Goorzhel Goorzhel commented Jun 12, 2018

lan print was it. Thanks, dmick and lurkalicious!

@logan2211

This comment has been minimized.

Copy link

@logan2211 logan2211 commented Jun 19, 2018

Has anyone had luck pulling AOC MAC addresses? Somehow the BMC is showing them in the webpage.

ie.

BMC MAC Address: ac:1f:6b:62:e7:ca
System LAN1 MAC address :ac:1f:6b:62:ea:e8
System LAN2 MAC address :ac:1f:6b:62:ea:e9
AOC LAN1 MAC address :ac:1f:6b:81:b6:ca
AOC LAN2 MAC address :ac:1f:6b:81:b6:cb

The AOC LAN are a PCI-E NIC.

@davidcarver

This comment has been minimized.

Copy link

@davidcarver davidcarver commented Oct 16, 2019

Nice! Here is a small suggestion, because I'm a lazy dog

ipmitool -U $IPMI_USER -P $IPMI_PASS -H $IPMI_HOST raw 0x30 0x21 | tail -c 18 | sed 's/ /:/g'

00:25:90:f0:be:ef

@cavus700

This comment has been minimized.

Copy link

@cavus700 cavus700 commented May 6, 2021

Does anyone know where to find some documentation about the raw hexcodes like 0x30 0x21 ?

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