I have one IIS 6.0 web server on Windows Server 2003. There is one simple page(x.aspx) in the web server, and one major function of the page is "show the client ip in the page content". The question is the server is behind a NAT. When I use the code below, the NAT's ip always shown instead. Is there any method to get the real client IP in this web server. Thanks for your reading.
// First method
Request.UserHostAddress = NAT's IP
// Second method
Request.ServerVariables["REMOTE_ADDR"].ToString() = NAT's IP
// Third method
Request.ServerVariables["HTTP_X_FORWARDED_FOR"].ToString() = NAT's IP