I’m not sure for Mendix 6, but it is possible in Mendix 8.
In Mendix 8 you need to drop into a Java Action. Get the RuntimeRequest for the current context, then check if the X-Forwarded-For header is present. If it isn’t, you can just call getRemoteAddr() on the RuntimeRequest for the IP address. If it is present you need to parse the header to get the IP address.
Hope this helps.