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 -|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'
If this is not working for you, try this.
# curl -s|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
One of these four should work for you.
# lynx -dump | grep 'IP Address'

1 comment:

  1. Nice information. I had checked my External ip address using this site


Related Posts Plugin for WordPress, Blogger...