How do I learn my instance's private IP address and other info?

You can learn your instance’s private IP address with the ip command.

You can learn what ports are open on your instance with the nmap command.

Learn your instance’s private IP address

To learn your instance’s private IP address, SSH into your instance and run:

ip -4 -br addr show | grep '10.'

The above command will output, for example:

enp5s0           UP             10.19.60.24/20

In the above example, the instance’s private IP address is 10.19.60.24.

Learn what ports on your instance are publicly accessible

You can use Nmap to learn what ports on your instance are publicly accessible, that is, reachable over the Internet.

First, install Nmap on your computer (not on your instance) by running:

sudo apt install -y nmap

Next, run:

nmap -Pn INSTANCE-IP-ADDRESS

Replace INSTANCE-IP-ADDRESS with your instance’s IP address, which you can get from the Cloud dashboard.

The command will output, for example:

Starting Nmap 7.80 ( https://nmap.org ) at 2023-01-11 13:22 PST
Nmap scan report for 129.159.46.35
Host is up (0.041s latency).
Not shown: 999 filtered ports
PORT   STATE SERVICE
22/tcp open  ssh

Nmap done: 1 IP address (1 host up) scanned in 6.42 seconds

In the above example, TCP port 22 (SSH) is publicly accessible.


Last modified February 11, 2023: Use more popular name (8ae4ab5)