ipmitool

Install

sudo apt-add-repository universe
sudo apt install -y ipmitool
#sudo apt install -y freeipmi-tools

Install ipmitool (IPMI command line client)

#!/bin/bash

sudo apt-get install -y ipmitool

# enable modules for local ipmi access
cat <> /etc/modules
ipmi_devintf
ipmi_msghandler
ipmi_poweroff
ipmi_si
ipmi_watchdog
EOF
>

Configure BMC to DHCP

# show BMC interface informations
ipmitool lan print
 
# set dhcp IP
ipmitool lan set 1 ipsrc dhcp
 
# set static IP
ipmitool lan set 1 ipsrc static
ipmitool lan set 1 ipaddr 10.0.1.11
ipmitool lan set 1 netmask 255.255.255.0
ipmitool lan set 1 defgw ipaddr 10.0.1.252
 
# set VLAN
ipmitool -I lanplus -H ${BMC_IP} -U ${BMC_USER} -P ${BMC_PASS} ipmitool lan set 1 vlan id 1234
ipmitool -I lanplus -H ${BMC_IP} -U ${BMC_USER} -P ${BMC_PASS} ipmitool lan set 1 vlan id off
 
# soft restart BMC 
ipmitool -I lanplus -H ${BMC_IP} -U ${BMC_USER} -P ${BMC_PASS} mc reset warm
 
# hard restart BMC 
ipmitool -I lanplus -H ${BMC_IP} -U ${BMC_USER} -P ${BMC_PASS} mc reset cold

Commands

# get firmware version
ipmitool bmc info
 
# Reset chassis intrusion
ipmitool -I lanplus -H ${BMC_IP} -U ${BMC_USER} -P ${BMC_PASS} raw 0x30 0x03
 
# enable UID light
ipmitool -H ${BMC_IP} -U ${BMC_USER} -P ${BMC_PASS} raw 0x30 0x0d
 
# disable UID light
ipmitool -H ${BMC_IP} -U ${BMC_USER} -P ${BMC_PASS} raw 0x30 0x0e
 
# set ipmi mac address (not tested)
ipmitool lan set <channel number> macaddr <xx:xx:xx:xx:xx:xx>

Configure bmc user

BMC_IP=1.2.3.4
BMC_USER=ADMIN
BMC_PASS=ADMIN
NEW_BMC_USER=devops
NEW_BMC_PASS=pass1234
 
ipmitool -I lanplus -H  ${BMC_IP} -U ${BMC_USER} -P ${BMC_PASS} user list
ipmitool -H ${BMC_IP} -U ${BMC_USER} -P ${BMC_PASS} user set name 2 ${NEW_BMC_USER}
ipmitool -H ${BMC_IP} -U ${NEW_BMC_USER} -P ${BMC_PASS} user set password 2 ${NEW_BMC_PASS}
ipmitool -H ${BMC_IP} -U ${NEW_BMC_USER} -P ${BMC_PASS} user enable 2
 
# set user privilege to administrator
ipmitool channel setaccess 1 3 ipmi=on privilege=4

view sensors readings

ipmitool sdr
 
# howto
# reset BMC
ipmitool -I lan -H ${BMC_HOST} -U ${BMC_USER} -P ${BMC_PASS}  mc reset cold
 
# reset factory defaults (supermicro)
ipmitool -I lan -H ${BMC_HOST} -U ${BMC_USER} -P ${BMC_PASS} raw 0x3c 0x40
 
# power on / off / reset
ipmitool -I lanplus -H ${BMC_IP} -U ${BMC_USER} -P ${BMC_PASS} power status
ipmitool -I lanplus -H ${BMC_IP} -U ${BMC_USER} -P ${BMC_PASS} power on
ipmitool -I lanplus -H ${BMC_IP} -U ${BMC_USER} -P ${BMC_PASS} power off
ipmitool -I lanplus -H ${BMC_IP} -U ${BMC_USER} -P ${BMC_PASS} power reset
 
# get IPMI IP
IPMI_IP=$(ipmitool lan print | grep "IP Address" | grep -v Source | cut -d":" -f2)

FRU

ipmitool -I lanplus -H ${BMC_HOST} -U ${BMC_USER} -P ${BMC_PASS} fru

Configure User
https://docs.oracle.com/en/database/oracle/oracle-database/18/cwlin/example-of-bmc-configuration-using-ipmitool.html#GUID-11E563E0-3688-4FE9-8440-81402A7AC23A
https://www.thomas-krenn.com/de/wiki/IPMI_Konfiguration_unter_Linux_mittels_ipmitool
https://www.thomas-krenn.com/de/wiki/IPMI_Konfiguration_unter_Linux_mittels_ipmitool

Hardware logs

ipmitool -I lanplus -H {BMC_IP} -U ${BMC_USER} -P ${BMC_PASS} sel list

test

ipmitool -I lanplus -H 192.168.1.100 -U ADMIN -P ADMIN sdr
ipmitool -I lan -H 192.168.1.100 -U ADMIN -P ADMIN sdr 

Configure temporary boot device
https://www.thomas-krenn.com/de/wiki/Bootdevice_mit_ipmitool_setzen

Configure Boot device

# legacy boot
ipmitool -I lanplus -H ${BMC_HOST} -U ${BMC_USER} -P ${BMC_PASS} chassis bootdev bios
ipmitool -I lanplus -H ${BMC_HOST} -U ${BMC_USER} -P ${BMC_PASS} power reset
 
# boot to pxe (UEFI)
ipmitool -I lanplus -H ${BMC_HOST} -U ${BMC_USER} -P ${BMC_PASS} chassis bootdev pxe options=efiboot
ipmitool -I lanplus -H ${BMC_HOST} -U ${BMC_USER} -P ${BMC_PASS} power reset
 
# power consumtion data
ipmitool -I lanplus -H ${BMC_HOST} -U ${BMC_USER} -P ${BMC_PASS} dcmi power reading