Skip to main content
Inspiring
December 21, 2006
Question

capture IP that are behind a firewall

  • December 21, 2006
  • 5 replies
  • 597 views
Is there a way to capture the IP of someone behind a firewall.

I've tried CGI.REMOTE_ADDR, CGI.REMOTE_HOST, CGI.HTTP_X_Forwarded_For even:

<cfset net = createObject('java','java.net.NetworkInterface')> <cfset interfaces = net.getNetworkInterfaces()>

Is it even possible?
This topic has been closed for replies.

5 replies

tclaremont
Inspiring
December 26, 2006
I mininterpretted the question. As Dan says, if the server and the client are behind the SAME firewall, this will work. If your network is using static IPs, this will prove to be quite reliable.

For some reason, I jumped to the conclusion that you were attempting to retrieve the IP from behind someone else's firewall.
Inspiring
December 22, 2006
If your server is behind the same firewall, the ip address is available.
Inspiring
December 21, 2006
This is for IP range from a specific network witihin a firewall.
tclaremont
Inspiring
December 21, 2006
Just out of curiosity, what would you do withthe IP address once you had it? With the common use of dynamic IP addresses nowadays, it seems hard to picture a reliable usage for recording the IP.
Participating Frequently
December 21, 2006
nope...cgi.remote_addr would return the external interface ip of the firewall. Because CF executes on the web server and not the client then you won't be using CF - maybe javascript but i'm not sure if that has access to the IP level of info,