1

When I go to http://www.whatismyip.com/ I get an IP address of 203.39.136.200 but if I use php/apache I get:

HTTP_CLIENT_IP = ""
HTTP_FORWARDED_FOR = ""
REMOTE_ADDR = 10.15.60.84 //IP of my machine

We are introducing geo-sensitive content into one of our sites and have the necessary lookup Web Services ready to go but as you can imagine using the local IP of the machine (10.15.60.84) produces no results so I need to work out a way to retrieve 203.39.136.200.

Cheers Rob

S L
  • 14,262
  • 17
  • 77
  • 116
Rob
  • 10,004
  • 5
  • 61
  • 91

1 Answers1

2

If you are accessing the server from the local network then you will get the local address, even if you access the server using an address bound to an external interface. You can get around this by adding routing rules to your default gateway to route packets to the remote side of the Internet link your company uses, but this will cause extra traffic on the link since the packets will now have to go across it to get outside and then back in again.

Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358
  • This was the problem - it seems that our Dev Virtual Servers are on the same network as our development machines - fortunately we were able to perform testing still as our primary staging server is not on the same network :-) – Rob Mar 21 '11 at 05:17