Ubuntu

How do I find my IP address in Ubuntu

An IP address is one-of-a-kind or a unique numerical identifier such as 192.168.3.124 for a device on the internet or a local network. IP stands for “Internet Protocol,” a collection of rules and serves two main purposes: network or host interface identification or location address. The IP address can be both private or public. A public IP address can be directly accessible over the internet and is usually associated with the gateway to your local network or the router. Your device has a private IP address concealed when connecting to the internet using the router’s public IP address. We will discuss approaches to check your private and public IP address both by GUI and CLI. Before going on to the implementation part, let’s look at some details of types of IP addresses. Let’s begin!

Private IP address

Your private IP address is used to assign computers to your private area without allowing them to be exposed to the internet directly. For example, you may wish to utilize private IP addresses to address every computer inside your home if you have several devices. In this case, the public IP address is provided for your router, and each device connected to your router receives a private IP address via the DHCP protocol from your router.

Public IP address

A public IP address is an Internet-accessible IP address, i.e., directly accessible over the internet and assigned to the network router connected to the ISP. The public IP address is the internationally unique IP address issued to a LAN. Your router now receives the requests and responses and forwards them to you using your private IP address. Google search makes it easy to find your public IP address.

GUI vs. CLI

GUI is a graphical user interface that any user may use as visual advice is provided.

CLI is a command-line interface that uses a terminal to connect to the server and perform UNIX operations.

For example, you could use Windows Explorer and go to some directory (the GUI). Or, you can start a CMD and use the cd command to interact with the OS using CLI.

Find Private IP address via GUI in Ubuntu OS:

For the Ubuntu desktop, one can check the wireless, private IP address using the below steps:

  • Open Settings and navigate to Wi-Fi in the left menu.
  • Click on the settings icon after the connected wifi network.
  • The new tab shows the details, including your IP address, including IPv4 and IPv6 addresses.

Find Private IP Address via CLI in Ubuntu OS

Run the following command to get a private IP address. For private IP addresses, there will be wlan0, wlan1, or wlan2 sections where private IP address details are mentioned.

ifconfig

You can install this command using net-tools which can be installed by:

sudo apt install net-tools

The private IP address is also found using the following command from the terminal:

ip address

Find Public IP address

Write the below command to get your public IP address:

curl http://ipinfo.io/ip

Another alternative to look for your public IP address is to search it on Google engine. Since anyone can view the public IP address, it is openly available on Google search.

Conclusion

In this article, we saw several techniques to find our IP address (both private and public) in Ubuntu OS. One needs to know IP addresses for various activities such as clustering, debugging networks, pinging to a host, connecting servers, etc. IP addresses are unique addresses for each device in the network. You will always need IP addresses whenever you encounter a task related to exchanging data between multiple devices. Besides, in the IP address instances of our web applications, you will need to determine the running instances to respond to the requests made between server and client. All these examples determine the essence of IP addresses in the networking world.

About the author

Simran Kaur

Simran works as a technical writer. The graduate in MS Computer Science from the well known CS hub, aka Silicon Valley, is also an editor of the website. She enjoys writing about any tech topic, including programming, algorithms, cloud, data science, and AI. Travelling, sketching, and gardening are the hobbies that interest her.