linux ipmitool配置机器的BMC(服务器管理后台)

前置:mgnt口和网卡1连接入内网,并分配静态ip

1. 安装 ipmitool

Debian/Ubuntu:

sudo apt-get update
sudo apt-get install ipmitool

CentOS/RHEL:

sudo yum install ipmitool

2. 配置 BMC 的 IP 地址

#打印当前ipmi 地址配置信息。
ipmitool lan print 1 

# 设置 id 1 为静态IP地址。
ipmitool lan set 1 ipsrc static  

# 设置 IPMI 地址。
ipmitool lan set 1 ipaddr xx.xx.xx.xx

# 设置 IPMI 子网掩码。
ipmitool lan set 1 netmask xxx.xxx.xxx.xxx 

# 设置 IPMI 网关。
ipmitool lan set 1 defgw ipaddr xx.xx.xx.xx

3. 配置 BMC 用户登录账户密码。

# 显示 IPMI 用户列表。
ipmitool user list 1  


# 修改改密码
ipmitool user set password <id> <新密码>


# 启用用户
ipmitool user enable <id>

4. 查看 BMC 配置信息

sudo ipmitool lan print 1

这将显示 BMC 网络配置、IP 地址、网关、子网掩码等信息。

5. 重启 BMC

sudo ipmitool power reset

6. 查看 BMC 状态

sudo ipmitool bmc info

这将显示 BMC 固件版本、IP 地址、状态等信息。

7. 启用IPMI-over-LAN功能

使用ipmitool channel info <通道号>命令检查BMC所在通道的IPMI-over-LAN功能是否已经启用。如果未启用,可以使用以下命令启用

ipmitool channel setaccess <通道号> 2 ipmi=on auth=off link=on privilege=4

这将启用指定通道的IPMI-over-LAN功能,并使得通过此通道的IPMI会话的权限级别为4(ADMINISTRATOR级别)。

8. 连接到远程BMC

使用以下命令连接到远程BMC:

ipmitool -H <BMC IP地址> -U <用户名> -P <密码> -I lanplus <命令>

注意,这里使用了-I lanplus选项,以使用基于LAN的IPMI协议。<命令>是您要执行的ipmitool命令。例如,要获取传感器信息,可以使用以下命令:

ipmitool -H xx.xx.xx.xx -U admin -P password -I lanplus sensor list

完成✅

> 局域网内https://设置的ip即可访问,前提是ip得ping得通

> 单线连接:电脑连接服务器mgnt口,服务器脱离网线,电脑设置和bmc通个ip段即可访问

重置:

ipmitool  raw  0x32  0x22

冷重启的方式重置BMC

ipmitool mc reset cold
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值