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
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 Pulblic IP.
To do it:
telnet ipecho.net 80
telnet 126.96.36.199 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.
But if you want to see it in a more pretty way, copy the HTML code the Web Page returned:
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: