Why and how does log show private IP ?

Why and how does log show private IP ?

by Anil Sharma -
Number of replies: 1

I'm facing trouble with people login in as guests and writing unwanted stuff in forums which we normally open for parents.  We would like to track them, if we can get the correct IP address, we can find out which child uses that computer.

While the logs shows the public IP address most of the time, sometimes it shows the private IP address like 172.31.152.36.  How does it log the private IP address - is it possible to be on the net with a private IP address ?

Average of ratings: -
In reply to Anil Sharma

Re: Why and how does log show private IP ?

by Conor Byrne -

Hi Anil,

I'm afraid I'm not au fait with the php behind the logging utility, but I can tell you that traffic from that private IP range will not communicate across the internet unless it is first NATed to a public address. I can also tell you that Apache and IIS logs will only show a private IP address if the network is local.

If there are NAT devices (firewalls/routers) between your Moodle server and the internet, it is possible (but unual) that the source is being NATed to appear as 172.31.152.x by these devices, in which case the 172.31.152.x network would be somewhere on your LAN. I would speak to your network admins and be sure that this is not a local LAN.

If you have non-NATed VPNs to other sites or remote users, they could also appear as private IP addresses and could be considered on the local LAN.

Hope this helps.