Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3964102
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T03:17:38+00:00 2026-05-20T03:17:38+00:00

I have an intranet ASP.NET web application in which I need to get the

  • 0

I have an intranet ASP.NET web application in which I need to get the IP of the client’s machine. I do this vis the following code:

HttpContext.Current.Request.ServerVariables.Item("REMOTE_HOST")

It used to work when my ASP.NET site was only hosted on a single server. However once we got the load balancer installed and migrated our apps to a web farm, the code above returns the IP of the Load Balancer device and not of the client anymore.

I am working with the networking folks to determine what can be configured differently with the load balancer, but in the meantime I was wondering if there was another way I could get the client’s IP other than using that IIS Server Variable? Or any other suggestions?

Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T03:17:38+00:00Added an answer on May 20, 2026 at 3:17 am

    Which load balancer are you using? It sounds as if your load balancer is acting as a proxy for the web traffic, hence the reason the source appears to come from the LB. Most hardware load balancers are built on Linux platforms and there is provision for transparency if the kernel supports it:
    http://www.mjmwired.net/kernel/Documentation/networking/tproxy.txt
    However, this would probably require root access to the unit and some downtime. But it is something that may be worth mentioning to the vendor’s support team if they don’t have any ideas.

    Another (hopefully much easier) option: You may be able to configure the load balancer’s proxy to write the client’s source IP in the HTTP x-forwarded-for header:
    http://en.wikipedia.org/wiki/X-Forwarded-For
    And then you’ll be able to read this header via ASP.net in a similar way:

    Request.ServerVariables("X-Forwarded-For")
    

    This may already work if the proxy is already doing this.

    Really your options depend on what your load balancer is capable of, and what is configurable. Note the list of common hardware vendors at the bottom of the wiki page above.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have an intranet asp.net web application which uses the OOTB ASP.net membership and
I have created an ASP.NET Webforms web application which basically inetracts with the code
I'm working on an ASP.NET web application for our corporate intranet users. I have
I have an asp.net intranet application for booking jobs and a phone index. Now
I have a ASP.NET intranet application that has a document library section. The user
I am developing an ASP.NET intranet application that needs to have an interactive map
I'm building an ASP .NET 2.0 (C#) based web application, which is primarily intended
I have a PHP web application on an intranet that can extract the IP
We currently have a corporate intranet built with ASP.NET and originally designed for IE.
I have a ASP .Net web appliaction written in Visual Basic .Net running on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.