Her I’m going to show you a little trick off a way to get you public IP when you just have a command line interface.
This can be done in any equipment with telnet like a:
- Linux Server
How To Do It – Site: Check IP
gives out you public IP on a Browser, so what we are going to do is to open the Web Page on the HTTP Port (Port 80), and get a response from the webpage with you Public IP.
This Web Page does not need you to send HTML to pretend that your telnet is a Web Browser (like the IP Echo Website bellow)
To do it:
telnet checkip.dyndns.org 80
telnet 126.96.36.199 80
if you don’t have DNS configured, and then do as soon as it connects press:
- ENTER (one or two times)
and it will give you the output bellow.
How To Do It – Site: IP Echo
gives out you public IP on a Browser, so what we are going to do is to open the Web Page on the HTTP Port (Port 80), and then send some HTML code to pretend that your telnet is a Web Browser to get the HTML response from the webpage with you Public IP.
To do it:
telnet ipecho.net 80
telnet 188.8.131.52 80
if you don’t have DNS configured, and then paste the following HTML code
GET / HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)
and press Enter, and you get this:
rigth here you can see you IP.
See Public IP on a Browser
In both methods/sites if you want, you can see the IP in a more pretty way, just copy the HTML code the Web Page returned (this output is from the IP Echo site):
to a text file with the “.html” extension in the computer you are using, I named mine index.html
save it and double click in the index.html which will open on your default browser, and show the HTML you copied from the command line: