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 命令管理使用者、通道、许可权的时候,务必理解使用者许可权管理是基于通道的,同一个使用者可以被授权使用某个通道而被禁止使用其他通道。