Ubuntu

How to Find my IP Address in Ubuntu 22.04

The IP address is the address by which your machine is identified on a Network as well as on the internet. Every machine is assigned a unique IP address when it gets connected to the router. In this blog, we are going to understand the IP address as well as the method by which we can find out the IP address of our machine on Ubuntu 22.04.

What is an IP Address?

The IP is the unique address by which the machine can be identified on the internet, and to understand it more clearly, it is just our house address, by using which the postman can deliver a letter to our home as well as the food delivery boy can deliver the food.

IP addresses are divided into two categories:

Let’s learn both of these IP address types and how to find them out in Ubuntu 22.04.

Public IP address

The Public IP address is used on the internet by which the browser can identify that this HTML request is made by the following machine or this email should be sent to the following IP address.

How to Find Public IP Address on Ubuntu 22.04?

The public IP address can be found from the “ipinfo.io/ip” link using curl command as shown below:

$ curl http://ipinfo.io/ip

The public IP address of our Ubuntu 22.04 machine is “39.41.37.159”.

Private IP address

A private IP address is used when you are going to connect with a machine in a private network to share data.

How to Find Private IP Address on Ubuntu 22.04?

Private IP addresses can be found using two different methods on Ubuntu:

  • Through the command line interface
  • Through the Graphical User interface

Method 1: Find Private IP Address in Ubuntu Through CLI

In this method, we are going to find out two different methods: using the “IP address” command and second is by using the “ifconfig” command.

How to Find out Private IP Address Using “ip address” Command

For this method, we will first open the terminal of the Ubuntu with the shortcut key of CTRL+ALT+T and then run either of the following commands:

$ ip address

$ ip a

Both the above-mentioned commands will produce the same result.

How to find private IP address using the ifconfig command on Ubuntu

Another method to find out private IP address on Ubuntu is by installing the package of net-tools using the command:

$ sudo apt install net-tools -y

When the package of the net-tools is successfully installed, then run the command:

$ ifconfig

The IP address has been displayed on the screen of Ubuntu.

Method 2: Find Private IP address in Ubuntu through GUI

Another method which is more convenient to find the private IP address on Ubuntu is through to GUI method. For this, open the Settings of the Ubuntu:

When the Settings are open, choose the “Network” in the left side of the menu and then click on the “gear” icon in the “Wired” section:

A pop up will appear:

The IP address is being displayed.

Conclusion

To find IP address in Ubuntu 22.04, use “ip a” command to find private IP address and execute “curl http://ipinfo.io/ip” command to find Public IP address. In this blog, different methods to find out the IP address of our machine on Ubuntu have been discovered.

About the author

Hammad Zahid

I'm an Engineering graduate and my passion for IT has brought me to Linux. Now here I'm learning and sharing my knowledge with the world.