Link to home
Start Free TrialLog in
Avatar of amigan_99
amigan_99Flag for United States of America

asked on

How can you tell your public IP address without a browser?

Say you were at a Linux command shell or Windows CMD prompt.. How could you determine the NAT/PAT address that is your effective source address on the Internet without using a browser to say whatismyip.com or similar?
ASKER CERTIFIED SOLUTION
Avatar of Dr. Klahn
Dr. Klahn

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
For Windows:

When the Run window opens (in Windows 10 just press the windows button), enter “cmd” in the Open field then click OK.  In the Command Prompt window, enter “ipconfig/all” then press [Enter]

And for Linux, http://www.wikihow.com/Check-the-IP-Address-in-Linux
Avatar of amigan_99

ASKER

Thanks - that's exactly what I need. That would even work on a Cisco router command prompt which would really be in handy when working in an unfamiliar environment.
Avatar of Dr. Klahn
Dr. Klahn

In the Command Prompt window, enter “ipconfig/all” then press [Enter]

ipconfig /all returns the host's LAN address.  I believe the requester is asking for his internet-facing address -- "your effective source address on the Internet."

User generated image
I think would work as well for Linux: curl http://www.whatismyip.com. Found this in some of my old notes.
For what its worth, curl -k https://www.whatismyip.com returns a 403 error on this computer.
Dave - can you try this..

http://www.whatismyip.com/automation/n09230945.asp

I'm not at a Linux station to try it out. I had assumed I didn't need the asp but perhaps my old notes were more precise than I knew.
That shows 404 Not Found.
Thanks for pointing out my stale tip Dave. If I find a useful URL to add to curl I'll post it back here.