Tuesday, April 11, 2017

Command to find your public IP.


If you are behind a router and don't know your public IP.
You could request some website to get your IP using curl or wget. 
Following commands will give you the result.
It returns just the plain text IP, nothing else

  • curl http://checkip.amazonaws.com
  • curl ipinfo.io/ip
  • curl icanhazip.com or wget -qO- icanhazip.com
  • curl ident.me; echo or curl v4.ident.me; echo
  • wget -qO- http://ipecho.net/plain ; echo
  • curl ipecho.net/plain ; echo
  • curl -s checkip.dyndns.org | sed -e 's/.*Current IP Address: //' -e 's/<.*$//'
  • curl ifconfig.me