ESXi主机安装好后发现BMC地址、iDRAC(服务器硬件管理口)地址没配...想想还得跑机房,一声无耐的叹气!于是偷懒想通过ssh工具连接ESXi主机来配置服务器的管理口地址。
前提条件:
ESXi主机开启ssh服务,选中某台主机,配置,服务,找到ssh,点击启动如下图:
通过root账户登录ESXi主机后,需要安装一个ipmi工具
ipmitool vib for ESXi It will work on ESXi 6.x and 7.x hosts only.
下载地址:
https://vswitchzero.files.wordpress.com/2019/08/ipmitool-esxi-vib-1.8.11-2.zip
1、安装
esxcli software acceptance set --level=CommunitySupported
esxcli software vib install -v /tmp/ipmitool-1.8.11-2.x86_64.vib
2、使用
/opt/ipmitool/ipmitool
3、常见用法
查询BMC地址:
esxcli hardware ipmi bmc get
4、修改IP地址、网关等操作
To get the current IPMI IP Details
#/ipmitool lan print 1
[root@esxi]# /opt/ipmitool/ipmitool lan set 1 ipsrc static
[root@esxi]# /opt/ipmitool/ipmitool lan set 1 ipaddr x.x.x.x
Setting LAN IP Address to x.x.x.x
[root@esxi]# /ipmitool lan set 1 netmask x.x.x.x
Setting LAN Subnet Mask to x.x.x.x
[root@esxi]# /ipmitool lan set 1 defgw ipaddr x.x.x.x
Setting LAN Default Gateway IP to x.x.x.x
[root@esxi]# /ipmitool lan set 1 defgw macaddr xx:xx:xx:xx:xx:xx
Setting LAN Default Gateway MAC to xx:xx:xx:xx:xx:xx
[root@esxi]# /ipmitool lan set 1 arp respond on
Enabling BMC-generated ARP responses
[root@esxi]# /ipmitool lan set 1 snmp public
Setting LAN SNMP Community String to public
root@esxi]# /ipmitool user list (Note down the user ID in mycase it is 2)
[root@esxi]# /ipmitool user set password 2
[root@esxi]# /ipmitool lan set 1 access on