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

There are two application servers(IIS). There is a switch or a virtual IP which load balances requests for the 2 servers.

I need to track requestor(client) IP address from my .NET application.

The code Request.ServerVariables["REMOTE_ADDR"] is giving the switch IP address.

The request first hits switch then request is diverted to either of the server, in this process my application is getting switch IP address for that code and client IP is masked.

how to make the switch populate the x-forwarded-for header?

share|improve this question

closed as off-topic by Ward, masegaloeh, kasperd, MadHatter, Jenny D May 25 '15 at 9:04

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

You're going to have to tell us which product it is that's load balancing the incoming requests. – EightBitTony May 4 '12 at 10:56

By definition, a network switch operates between layers 2 and 3 of the OSI stack. Network switches usually do not touch HTTP header information.

Sounds like you're using a load balancer that operates at layer 7. The load balancer should be able to move the original client IP address to the xff. It's a fairly common feature with most load balancing solutions.

If you need more details, then please add more details to the question.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.