Troupe75
asked on
Obtaining public and private ip addresses
When I go to: http://www.whatismyip.com/ I get my public ip address 69.132.x.x (the ip address that is assigned to the public interface on my router. When I go to: http://whatismyip.org/ I get my DHCP assigned private ip address of 192.168.1.41 (this is the address actually assigned to my computer's ethernet card).
I know how to get my public ip address using server side scripting in JSP, PHP or cgi scripts, but I don't know how to get my private ip address. Originally I thought the only way to do this was with some type of client side scripting, but http://whatismyip.org/ appears to be retrieving the client side ip address using only server side scripting.
How is this done?
I know how to get my public ip address using server side scripting in JSP, PHP or cgi scripts, but I don't know how to get my private ip address. Originally I thought the only way to do this was with some type of client side scripting, but http://whatismyip.org/ appears to be retrieving the client side ip address using only server side scripting.
How is this done?
ASKER
I've tried it with Firefox, Safari, and curl so I don't think it is coming from the web browser. I'm not using the LiveHTTPHeaders add-on in Firefox.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Last login: Wed Oct 15 18:51:33 on console
~ $ nslookup whatismyip.org
Server: 192.168.1.6
Address: 192.168.1.6#53
Non-authoritative answer:
Name: whatismyip.org
Address: 206.176.224.3
I have a DHCP assigned address. The network goes through a Barracuda content filter and then Nat through a Firebox firewall to a T1.
I'm not sure how the private address is getting passed out. When I go one of my websites and look at the logs, it show my public ip (the one on the firebox). I'm not sure if there is a way to run Apache in a mode that will show the full request headers.
~ $ nslookup whatismyip.org
Server: 192.168.1.6
Address: 192.168.1.6#53
Non-authoritative answer:
Name: whatismyip.org
Address: 206.176.224.3
I have a DHCP assigned address. The network goes through a Barracuda content filter and then Nat through a Firebox firewall to a T1.
I'm not sure how the private address is getting passed out. When I go one of my websites and look at the logs, it show my public ip (the one on the firebox). I'm not sure if there is a way to run Apache in a mode that will show the full request headers.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Yes, that must be it. I don't think you could use that very reliably, as I don't think most NAT boxes will add it.
It may be that your web client is providing the information in a header. What web client are you using? Can you try using FireFox with the LiveHTTPHeaders add-on? This will tell you if your web client is providing the information.