How to Find the IP Address in Linux

An IP address is a unique address that identifies a device on the internet or a local private network. Every computer in the network requires its own unique IP address to get identified. There are two different IP addresses: private and public. A computer can be assigned private IPs or public IP or both.

A public IP is an address that is exposed to the internet. Devices that are assigned public IP can be accessed from the internet. Whereas private IP is accessible to a local internal network.

In this tutorial, we learn the different ways to find the IP Address of a Linux system.

What is an IP Address Explained | T...
What is an IP Address Explained | Tech Education

Find Your IP address Using CLI

Private IP is assigned to devices such as laptops, printers, phones for internal communication. If this machine needs to communicate outside the world then needs to use a router.

Address ranges used by private networks are the following:

  • 10.0. 0.0 to 10.255. 255.255.
  • 172.16. 0.0 to 172.31. 255.255.
  • 192.168. 0.0 to 192.168. 255.255.

There are few commands available in Linux to find the IP address. The popular command is ip.

To display all the network interfaces and their assigned IP address, type:

$ ip addr
show IP address using ip command

There are few more commands which can display the private IP address of your system.

$ ifconfig
$ hostname - I
$ nmcli
$ ip route get | awk '{print $7}'

Find Your IP Address Using GUI

If you are running Linux in a graphical environment, you can easily navigate to the Network settings to find the IP address. Here I am using the Ubuntu GNOME interface.

In the Gnome desktop, top-right click on the 'Network' icon.

network icon on gnome desktop


From the drop-down menu click on 'Wired Connected'.

Wired Connected

 Next, click on the 'Wired Settings' option that appears below

Wired Settings

This displays the 'Network Settings' window. Click on the gear icon, in the new windows the first tab 'Details' shows the IP address of the system.

Wired - Details tab

Find Your Public IP Address

A public IP address is an IP address that can be accessible from the internet. Normally public IP is assigned to the network router by ISP (for example your home router), servers that host websites, VPN, FTP, etc.

Address range used by public networks is to (excluding private IP addresses, few unusable and reserved IPs).

As public IP is globally routable, we can use the help external website, HTTP/HTTPS services, dig or curl command to display public IP.

The simplest way to find the public IP address is to open the following website on any browser.

You may also use the following commands to find the public IP address:

$ curl
$ curl
$ curl
$ curl
$ curl -s
$ dig ANY +short ANY


In this tutorial, we learn the different ways to find the IP Address of a Linux system. Those include finding both private and public IP address using commands and other services.

Leave a Comment