0

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.

1
  • have you tried the f5 forums?
    – tony roth
    Jun 30 '10 at 17:34
4

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy