In general you will want the replacement controller to have the same IP address as the original one, so that the HMI and any other devices that communicate with it still can.
Finding the target IP address for the HMI is one way, and using Wireshark is another.
If you have the serial port available, you can connect using RSLinx Classic and browse through the controller's virtual backplane to the Ethernet daughtercard, then right-click and select module properties (I think that's the phrase; there are only a few options). That's where the IP address, subnet mask, and default gateway are configured for all CompactLogix family controllers.
Unlike the SLC/PLC/MicroLogix, the IP address is not necessarily configured inside the controller program itself. Users often enter the address into the fields for the Ethernet daughtercard, but it's not necessary.