rvokal (rvokal) wrote,

How do I figure out my public IP from cmd line?

So I need to quickly figure out my public IP from cmdline to allow access to different box. I could look thru the logs on the machine I was accessing but I had only access to its web ui. I need the public IP of my test box and from terminal. Honestly, I couldn't figure it out, from open connections or traceroute I could only see the internal IP, not the public one on NAT. I found this quick hack curl -s checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'

Do you know something nicer?
  • Post a new comment


    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.