Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We are using a F5 load balancer for our servers. Our VB code is checking the UserHostAddress using HttpContext.Current.Request.UserHostAddress. My question is, will this value return the IP from the load balancer, or does it still have the client IP address?

I will post this on Stack Overflow as well in case this is more of a code issue. Any help would be great. Thanks.

share|improve this question
have you tried the f5 forums? – tony roth Jun 30 '10 at 17:34

If an F5 is configured for Source Address Translation and you look at the client address, you will see a snat address of the f5. If you configure the BigIP virtual server with a profile that inserts the "real" client IP in the X-Forwarded-For header, you can extract that value.

I placed "real" in quotes because this may not be the actual IP address of the user; it could be the address of their external proxy. There could also be multiple values in this header because every device supporting x-forwarded-for will have inserted the client ip that it 'saw' so you could wind up having two or more entries in this header.

If the servers that the F5 are load balanced to are configured to have the F5 be the default gateway or part of the default route, the SNATing may be turned off and the true source address will be exposed directly to the server.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.