萬盛學電腦網

您现在的位置: 萬盛學電腦網 >> 作業系統 >  >> Linux 教學

Linux 命令列配置 IPMI 完整指南:ipmitool LAN 設定、使用者管理與固件更新

IPMI (Intelligent Platform Management Interface) 提供伺服器帶外管理能力。本文說明在 Linux 作業系統下使用 ipmitool 配置 LAN 參數、建立使用者、配置 SNMP/Alerting 及固件更新的標準流程。

前置需求

  • 硬體支援 IPMI (BMC/iDRAC/iLO/RSA 等)
  • 核心載入模組:modprobe ipmi_devintf ipmi_si ipmi_msghandler
  • 安裝工具:yum/dnf/apt install ipmitool
  • 啟動服務:systemctl start ipmi 或 service ipmi start

LAN 網路配置 (通道 1 為專用管理埠)

# 設定靜態 IP
ipmitool lan set 1 ipsrc static
ipmitool lan set 1 ipaddr 192.168.1.100
ipmitool lan set 1 netmask 255.255.255.0
ipmitool lan set 1 defgw 192.168.1.254

# 或設定 DHCP
ipmitool lan set 1 ipsrc dhcp

# 查看配置
ipmitool lan print 1

多通道管理

  • 大多數伺服器:Channel 1 = 專用管理埠
  • 部分雙埠機種 (如 Inspur):Channel 1 + Channel 3
  • 僅使用一通道時,需停用另一通道避免 IP 衝突:
    ipmitool lan set 3 access off
    

使用者帳號管理

# 列出使用者槽位 (通常 1=root, 2~10 可用)
ipmitool user list 1

# 設定使用者名稱 (ID 2)
ipmitool user set name 2 admin

# 設定密碼
ipmitool user set password 2 StrongPass123

# 啟用使用者 & 賦予權限 (4=Administrator)
ipmitool user enable 2
ipmitool channel setaccess 1 2 link=on ipmi=on callin=on privilege=4

# 設定 SOL (Serial over LAN) 權限
ipmitool sol payload enable 1 2

SNMP 與 Alerting 配置

# 設定 SNMP Community
ipmitool lan set 1 snmp public

# 設定目的地 IP (陷阱接收器)
ipmitool lan set 1 dest_addr 1 192.168.1.200

# 啟用 Alerting
ipmitool lan set 1 alerting on

固件更新 (以 Dell iDRAC 為例)

# 取得固件檔案 (.img 或 .exe 解壓後)
# 透過 IPMI 更新 (需 BMC 支援)
ipmitool -I lanplus -H  -U admin -P pass \
    hpm upgrade firmware.img force

# 或使用廠商專用工具 (racadm, hponcfg, ipmicfg 等)

常用維運指令速查

功能指令
系統電源控制ipmitool -I lanplus -H -U -P

power on/off/reset/status

硬體感測器讀取ipmitool -I lanplus -H -U -P

sensor list

系統事件日誌 (SEL)ipmitool -I lanplus -H -U -P

sel list / sel clear

Serial Over LAN 連線ipmitool -I lanplus -H -U -P

sol activate

取得 FRU 資訊ipmitool -I lanplus -H -U -P

fru print

IPMI 配置示意

安全性強化建議

  • 管理網路與業務網路物理/邏輯隔離 (VLAN)
  • 停用匿名登入:ipmitool user disable 1 (預設 root/calvin)
  • 強制複雜密碼、定期輪換、啟用 IPMI over LAN 加密 (IPMI 2.0 RMCP+)
  • 限制存取來源 IP (防火牆/交換器 ACL)
  • 監控 SEL 異常事件並整合至 SIEM

掌握 ipmitool 完整配置能力,是資料中心伺服器生命週期管理 (部署、監控、故障排除、退役) 的核心技能。

copyright © 萬盛學電腦網 all rights reserved