Showing posts with label find public and static IP. Show all posts
Showing posts with label find public and static IP. Show all posts

Saturday, January 11, 2014

Find the public IP address of the system using command line

Commands to find Static IP address of the server

If you want to find the public IP address of the system. Run following commands.
# wget -q -O - checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'
If this is not working for you, try this.
# curl -s checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'
It does not show you the LAN IP address, it shows the IP address that you can access out side the LAN, if it is static.
# curl ifconfig.me
One of these four should work for you.
# lynx -dump ifconfig.me | grep 'IP Address'