You will need a MOD to log the guests IP, this is a popular one that does it.
Feel free to ask around in the MOD requests forum.
However, that may not be necessary, as there are other ways to deal with bot registrations. One is to install the visual confirmation addon (which is in the phpBB2 full package download in the 'contrib' folder). This should prevent nearly any bot from registering on your forum.
A couple IP addresses have been posted in this thread,