title: C# Do really need external ip for max mind services
body: <p>We are using maxmind geo ip location service in our web application. Utilizing this maxmind we need ipaddress to give as input.</p>
  
  <p>We are following below snippet to get Ip address.</p>
  
  <pre><code>var ip = Request.UserHostAddress;
  if (Request.Headers["X-Forwarded-For"] != null)
  {
      ip = Request.Headers["X-Forwarded-For"];
      Console.WriteLine(ip + "|X-Forwarded-For");
  }
  else if (Request.Headers["REMOTE_ADDR"] != null)
  {
      ip = Request.Headers["REMOTE_ADDR"];
      Console.WriteLine(ip + "|REMOTE_ADDR");
  }
  </code></pre>
  
  <p>We are under corprate network, So in local environment as well as development environment we are used to get private ip address like this 10.X.X.X.</p>
  
  <p>Using this address we always fails to locate the client location.</p>
  
  <p>So real problem is when you passing external/public ip(190.X.X.X) to maxmind then only its working.</p>
  
  <p>Do we really need to  get external/public ips to give input to maxmind services.</p>