Linux Commands

How to find your IP address in Linux?

An IP address is a network address of your device when it connects to the internet or local area network. On the internet, IP addresses are allocated to each user which is used to distinctly identify them. . Internet uses this address to get your emails, messages, files, and images from another device of a different identification number (IP).

The IPV4 address is a 32-bit unique number that has two types: public and private. Public IP is used to access the internet while private IP is reserved for local usage.

Knowing your IP address is important especially when you want to create a local area network for gaming or data transferring. It is also important when it comes to troubleshooting your network issues and configuring the firewall. This guide will elaborate on the different methods to check your IP address whether public or private in Linux.

How to find the private IP address in Linux:

There are two ways to check your private IP address. The first is through GUI and the second way is through a terminal. Let’s check the first method.

First, open “Settings” from applications:

IP/1_1%20copy.png

Afterward, click on “Network”.

On the right side of the screen, click the icon as demonstrated in the following image:

IP/2%20copy.png

A window containing the private IP address and other related information will open.

IP/3%20copy.png

The second method to find the private IP address is using the terminal.

Simply open the terminal and type:

$ ip addr

IP/5%20copy.png

The highlighted part of the above image indicates the private IP.

Another command to check private IP is:

$ hostname -I

IP/6%20copy.png

Or execute:

$ ifconfig

IP/7%20copy.png

How to find the public IP address in Linux:

Public IP is relatively easier to find. Simply open the web browser and then Google “What’s my IP”. Your public IP address will be displayed:

IP/12%20copy.png

It can also be accessed using the terminal. There are numerous services that provide your public IP address.

Use the below-mentioned commands to find your public IP:

$ curl checkip.amazonaws.com

IP/8%20copy.png

$ curl ifconfig.me

IP/9%20copy.png

$ curl ident.me

IP/10%20copy.png

Conclusion:

In this post, we have learned the importance of IP addresses, the difference between public and private IP, and how to find both in Linux using different methods. The IP address is a 32-bit address, also known as IPV4, and is a unique identity that helps you connect with other devices on the internet. Local IP addresses are used to connect different devices in order to create a shared local area network. Since the number of internet users is multiplying, the IPV4 address may soon be replaced with a newer IP scheme known as IPV6, which is faster and more efficient.

About the author

Sam U

I am a professional graphics designer with over 6 years of experience. Currently doing research in virtual reality, augmented reality and mixed reality.
I hardly watch movies but love to read tech related books and articles.