Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

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

 
discard

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