Skip to content

Instantly share code, notes, and snippets.

@DavidWittman
Last active August 17, 2023 08:05
Show Gist options
  • Star 21 You must be signed in to star a gist
  • Fork 11 You must be signed in to fork a gist
  • Save DavidWittman/b7a509632ed92fccf237 to your computer and use it in GitHub Desktop.
Save DavidWittman/b7a509632ed92fccf237 to your computer and use it in GitHub Desktop.
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
@Goorzhel
Copy link

lan print was it. Thanks, dmick and lurkalicious!

@logan2211
Copy link

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
Copy link

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
Copy link

cavus700 commented May 6, 2021

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

@olivergs
Copy link

A fast search lead me to https://www.supermicro.com/support/faqs/faq.cfm?faq=25788

But right now I can't see the contents of the page.

In the search engine cache it shows this:

# ipmitool raw 0x30 0x21 // Data5-10: LAN1 MAC Address Get onboard LAN MAC Address (start from 2nd). # ipmitool raw 0x30 0x9f // Data2-7: LAN2 MAC Address // Data8-13: LAN3 MAC Address // … Note, above commands are for X10 and later generations.

There is also: https://www.supermicro.com/support/faqs/faq.cfm?faq=14914

Or, you can use ipmitool raw command "ipmitool raw 0x30 0x21" to get the system LAN1 and LAN2 MAC addresses. This command will return 10 bytes, read just the last 6 bytes and that would be the MAC address of LAN1. For LAN2, just add 1 to the last bit of the last byte from LAN1. Example: if the command returns 00 00 2b 35 00 25 b3 83 f2 9a, the ...

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