DEV Community

Mohammad Waseem Akhtar
Mohammad Waseem Akhtar

Posted on

How to find my public IP?

Hello all, This is my first post.

At times in order to gain access(say SSH) to the AWS EC2 instance, I need to specify a proper rule in the AWS SG(Security group) attached to the AWS account. This rule can't be wide open to all and hence need to be specific because of the IT security policies at my company.

For which I am interested to know my public IP, which is the IP address assigned by my internet service provider to that interface which is public facing in my router.

One of the easiest way to know that is to open the terminal and execute curl ipinfo.io

~ » curl ipinfo.io                                                                                                                                                                                                                  wmohamma@PEM-WMOHAMMA-01
{
  "ip": "28.34.157.23",
  "hostname": "c-24-4-158-230.hsd1.cy.xyz.net",
  "city": "Los Angeles",
  "region": "California",
  "country": "US",
  "loc": "381.3396,-162.011",
  "org": "AS1351 xyz",
  "postal": "96742",
  "timezone": "America/Los_Angeles",
  "readme": "https://ipinfo.io/missingauth"
}% 
Enter fullscreen mode Exit fullscreen mode

Peace !!

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs