Changing IP of HPE ILO 4 via CLI (SSH) and without need of hptool.
It was time to pull the 'not so old' HPE ProLiant 380 Gen9 server out of storage, as it had found a use for it as a backup test server.
The ILO was statically configured on a subnet that I didn't happen to be using. Nor did I have a monitor at hand. I also didn't remember very well which network was used there. All that was left was to plug in the ilo port and watch on my NetBSD router what would show up in the logs (make your router, seriously, it helps a lot). After all it is Integrated Lights-OUT, so it meant to be managed without monitor and keyboard, right?
Thanks to arpwatch (which can be installed from net/arpwatch in pkgsrc), I was able to see what is on iLO port. So there is a 192.168.111.0 network in use and 192.168.111.101 address of iLO card. Nice.
Now accessing this network from the router is quite easy, as we can add more IP addresses as aliases on the fly, so let's add random access to the internal NIC:
dom # ifconfig xennet1 alias 192.168.111.200 netmask 255.255.255.0 up dom # ping 192.168.111.101 PING 192.168.111.101 (192.168.111.101): 56 data bytes 64 bytes from 192.168.111.101: icmp_seq=0 ttl=255 time=1.139458 ms 64 bytes from 192.168.111.101: icmp_seq=1 ttl=255 time=0.595159 ms ^C
Nice, alias is working, we have icmp ping response!
I almost started to create a new nat to access ILO from my PC, but hey, isn't there ssh open in ILO?
Of course it is.
dom # nmap 192.168.111.101 Starting Nmap 7.93 ( https://nmap.org ) at 2023-04-14 16:15 CEST Nmap scan report for 192.168.111.101 Host is up (0.00068s latency). Not shown: 996 closed tcp ports (reset) PORT STATE SERVICE 22/tcp open ssh 80/tcp open http 443/tcp open https 17988/tcp open unknown MAC Address: 14:02:EC:3B:FD:AE (Hewlett Packard Enterprise)
I logged in from my router's ssh without problems (knowing the password was a server serial number).
dom # ssh Administrator@192.168.111.101 Administrator@192.168.111.101's password: User:Administrator logged-in to b-MLTA-xen01.(192.168.111.101 / FE80::1602:ECFF:FE3B:FDAE) iLO Advanced 2.78 at Apr 28 2021 Server Name: Server Power: Off </>hpiLO->
There is some good help, and tasks such as controlling power or blinking LEDs, or even managing virtual images are easy to do, but managing ILO settings is not so easy from this level.
The first command I found that worked was to show the current IP:
</>hpiLO-> show /map1/enetport1/lanendpt1/ipendpt1 status=0 status_tag=COMMAND COMPLETED Thu Jan 1 00:10:21 1970 /map1/enetport1/lanendpt1/ipendpt1 Targets Properties IPv4Address=192.168.111.101 SubnetMask=255.255.255.0 AddressOrigin=Static Verbs cd version exit show set
And it only shows IP and netmask, to show gateway you have to change the command to show gateway1. I will not use this here as I only need to put ilo on the same network as my PC. So to change IP of ILO the command I used is:
</>hpiLO-> set /map1/enetport1/lanendpt1/ipendpt1 IPv4Address=10.1.78.111 status=0 status_tag=COMMAND COMPLETED Thu Jan 1 00:11:35 1970 Network settings change applied. Settings change applied, iLO 4 will now be reset. Logged Out: It may take several minutes before you can log back in. CLI session stopped client_loop: send disconnect: Broken pipe
It temporarily disconnected me, as changing the IP requires ILO to restart. However, after a few seconds ILO came back on my local LAN IP address!
I then tried logging into the new address from the browser and it just worked. From GUI I could easily adjust all settings without fiddling in CLI.