快速配置IPMI
备注
2025年初,将损坏的 HPE ProLiant DL360 Gen9服务器 升级到 HPE ProLiant DL380 Gen9服务器 ,重新配置IPMI。本文为设置笔记兼快速起步手册。综合了 使用IPMI(智能平台管理接口) 的学习笔记和实践经验。
检查当前配置(购买到的二手 HPE ProLiant DL380 Gen9服务器 )
ipmitool lan print
输出 channel 2
ipmitool lan print 2
输出显示:
ipmitool lan print
输出 channel 2
内容Set in Progress : Set Complete
Auth Type Support :
Auth Type Enable : Callback :
: User :
: Operator :
: Admin :
: OEM :
IP Address Source : DHCP Address
IP Address : 0.0.0.0
Subnet Mask : 0.0.0.0
MAC Address : 94:57:a5:68:4b:8e
SNMP Community String :
BMC ARP Control : ARP Responses Enabled, Gratuitous ARP Disabled
Default Gateway IP : 0.0.0.0
802.1q VLAN ID : Disabled
802.1q VLAN Priority : 0
RMCP+ Cipher Suites : 0,1,2,3
Cipher Suite Priv Max : XuuaXXXXXXXXXXX
: X=Cipher Suite Unused
: c=CALLBACK
: u=USER
: o=OPERATOR
: a=ADMIN
: O=OEM
Bad Password Threshold : Not Available
上述是拿到手时候二手服务器初始状态,也就是默认没有配置的出厂状态
检查当前系统中已经具备账号:
当前系统中已经具备账号
ipmitool user list 2
可以看到有2个账号 Administrator
和 root
Administrator
账号名字太长了,修改成admin
:
将
Administrator
改名成 admin
ipmitool user set name 1 admin
将
admin
和root
账号都设置密码:
设置账号密码
# 分别为编号1和2的用户设置密码,也就是admin和root设置密码
ipmitool user set password 1
ipmitool user set password 2
当前只有2个账号,假设设置第3个账号
huatai
,然后为这个账号设置密码并设置能够远程管理服务器:
创建账号并设置权限
# 将第3个账号名设置为huatai
ipmitool user set name 3 huatai
# 为账号huatai设置密码
ipmitool user set password 3
# 设置账号huatai远程管理服务器
# 这里的 2 3 分别表示 channel 2 id 3,也就是刚才设置的huatai账号
ipmitool channel setaccess 2 3 link=on ipmi=on callin=on privilege=4
# 此时提示信息显示 Set User Access (channel 2 id 3) successful.
# 再次检查用户账号
ipmitool user list 2
# 就可以看到现在有3个管理员账号,其中3号账号huatai也成为了系统管理员级别
# 输出类似如下
#ID Name Callin Link Auth IPMI Msg Channel Priv Limit
#1 admin true false true ADMINISTRATOR
#2 root true false true ADMINISTRATOR
#3 huatai true false true ADMINISTRATOR
备注
详细说明见 使用IPMI(智能平台管理接口)
配置一个
monitor
账号赋予较低权限以便能够监控传感器,后续会使用这个账号部署监控ipmi:
配置
monitor
账号ipmitool user set name 6 monitor
ipmitool user set password 6
ipmitool channel setaccess 2 6 link=on ipmi=on callin=on privilege=2
ipmitool user enable 6
最后配置一个IPMI网络,这样就可以远程管理:
配置远程管理网络
ipmitool lan set 2 ipsrc static
ipmitool lan set 2 ipaddr 192.168.7.254
ipmitool lan set 2 netmask 255.255.255.0
#设置网关IP和MAC,现在我不设置
#ipmitool lan set 2 defgw ipaddr 192.168.7.101
#ipmitool lan set 2 defgw macaddr 00:0e:0c:aa:8e:13
ipmitool lan set 2 arp respond on
ipmitool lan set 2 auth ADMIN MD5
# 这步access on有报错
# IPMI command failed: Unknown (0x83)
# Unable to Set Channel Access(non-volatile) for channel 2
ipmitool lan set 2 access on
# 重启mc使配置生效
ipmitool mc reset cold