1. 現象
IPMI lan 介面無法訪問,具體如下面命令執行後出現的錯誤提示:
[root@localhost ~]# ipmitool -I lanplus -H 10.10.77.48 -U ADMIN -P ADMIN sel list
Error: Unable to establish IPMI v2 / RMCP+ session
Get SEL Info command failed
You have new mail in /var/spool/mail/root
登入到 10.10.77.48 上去檢查下, 在本地通過 KCS 介面執行的情況,發現都成功:
[root@localhost ~]# ipmitool user list
ID Name Callin Link Auth IPMI Msg Channel Priv Limit
2 ADMIN true false false Unknown (0x00)
You have new mail in /var/spool/mail/root
[root@localhost ~]# ipmitool user list 1
ID Name Callin Link Auth IPMI Msg Channel Priv Limit
2 ADMIN false false true ADMINISTRATOR
[root@localhost ~]# ipmitool -I lanplus -H 10.10.77.48 -U ADMIN -P ADMIN sel list
1 | 08/03/2017 | 17:26:02 | Unknown #0xff | | Asserted
2 | 08/03/2017 | 17:26:38 | Power Supply #0xc8 | Power Supply AC lost | Asserted
3 | 08/03/2017 | 17:30:38 | Unknown #0xff | | Asserted
4 | 08/03/2017 | 17:31:13 | Power Supply #0xc8 | Power Supply AC lost | Asserted
5 | 08/03/2017 | 17:43:33 | Unknown #0xff | | Asserted
You have new mail in /var/spool/mail/root
2 解決過程
2.1 和正確配置、能訪問的比較互聯網:都 OK
2.2 檢查使用者並刪去不用的使用者
2.3 得到 LAN interface 的 channel 編號
2.4 授權使用者通過這個 channel 可以登入
2.5 測試。
前面兩步直接執行相應的命令就好了,我們從第三步開始看具體怎麼執行。可以看到’ipmitool channel info” 在此種模式下顯示預設的 KCS channel:
[root@localhost ~]# ipmitool channel info
Channel 0xf info:
Channel Medium Type : System Interface
Channel Protocol Type : KCS
Session Support : session-less
Active Session Count : 0
Protocol Vendor ID : 7154
但我們是不的是 LAN interface, 繼續往下逐一測試, 找到 Lan interface 對應的 channel ID:
[root@localhost ~]# ipmitool channel info 1
Channel 0x1 info:
Channel Medium Type : 802.3 LAN
Channel Protocol Type : IPMB-1.0
Session Support : multi-session
Active Session Count : 0
Protocol Vendor ID : 7154
Volatile(active) Settings
Alerting : enabled
Per-message Auth : enabled
User Level Auth : enabled
Access Mode : always available
Non-Volatile Settings
Alerting : enabled
Per-message Auth : enabled
User Level Auth : enabled
Access Mode : always available
通過上面命令可以看到, LAN interface 對應的 channel ID 為 1,因為只有它的 Medium Type 是 802.3 LAN 。
2.2 向 LAN channel 新增使用者:
很容易犯錯的地方出現在這裏,以為下面的命令列出的頁是 Lan channel 看到的使用者。
[root@localhost ~]# ipmitool user list
ID Name Callin Link Auth IPMI Msg Channel Priv Limit
2 ADMIN true false false Unknown (0x00)
3 true true true OPERATOR
4 true true true OPERATOR
其實不然,上面預設看到是被授權使用 KCS channel 的使用者,要檢視 Lan channel 的使用者資訊,要用下面的命令:
[root@localhost ~]# ipmitool user list 1
ID Name Callin Link Auth IPMI Msg Channel Priv Limit
2 ADMIN true false true ADMINISTRATOR
然後新增許可權:
[root@localhost ~]# ipmitool user enable 2
[root@localhost ~]# ipmitool user priv 2 4 1
[root@localhost ~]# ipmitool user set name ADMIN
本地測試通過,通過 LAN interface 遠端登入也通過:
[root@localhost ~]# ipmitool user set password 2 ADMIN
[root@localhost ~]# ipmitool user test 2 16
Password for user 2:
Success
You have new mail in /var/spool/mail/root
[root@localhost ~]# ipmitool user test 2 20
Password for user 2:
Set User Password command failed (user 2): Unknown (0x80)
Failure: password incorrect
[root@localhost ~]# ipmitool user test 2 20
Password for user 2:
Success
3. 總結
使用 IPMI 命令管理使用者、通道、許可權的時候,務必理解使用者許可權管理是基於通道的,同一個使用者可以被授權使用某個通道而被禁止使用其他通道。