What is an IP address?
The IP is the unique address that can be used to identify the machine on the internet, and for better understanding, it is just our home address for the postman to bring a letter to our home, as well as the food delivery man can deliver the food.
IP addresses are divided into two categories:
Let’s learn these two 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 recognize that this HTML request comes from the following machine or that email should be sent to the following IP address.
How to find a public IP address on Ubuntu 22.04?
The public IP address can be determined via the link “ipinfo.io/ip”. ruffle Command as shown below:
The public IP address of our Ubuntu 22.04 machine is “220.127.116.11”.
Private IP address
A private IP address is used when you connect to a computer on a private network to exchange data.
How to find a private IP address on Ubuntu 22.04?
Private IP addresses can be found using two different methods on Ubuntu:
- Through the command line interface
- Via the graphical user interface
Method 1: Find Private IP Address in Ubuntu via CLI
In this method, we will see two different methods: using the “IP address” command and the second is using the “ifconfig” command.
How to find out the private IP address using the ip address command
For this method, we will start by opening Ubuntu’s terminal with the keyboard shortcut of CTRL+ALT+T and then run one of the following commands:
Both of the above commands produce the same result.
How to find a private IP address using ifconfig command on Ubuntu
Another method to find out the private IP address on Ubuntu is to install the net-tools package with the following command:
When the net-tools package is successfully installed, run the command:
The IP address was displayed on the Ubuntu screen.
Method 2: Find Private IP Address in Ubuntu via GUI
Another method which is more convenient to find private IP address on Ubuntu is GUI method. To do this, open the Ubuntu settings:
Once Settings are open, select “Network” on the left side of the menu, then click the “gear” icon in the “Wired” section:
A popup will appear:
The IP address is displayed.
To find the IP address in Ubuntu 22.04, use the “ip a” command to find the private IP address and run “curl https://ipinfo.io/ip” command to find the public IP address. Various methods have been discovered in this blog to find out the IP address of our machine on Ubuntu.