Internet Protocol address or IP address is a set of numeric digits that are required to identify your device and allow network communication. This is because all devices that are connected through a network are able to identify one another only by their IP addresses.
We all use the IP address daily, whether we’re aware of it or not. For instance, whenever you type a website name or a search query into your web browser, it first looks up the IP address of that particular URL and then loads the website.
The IP address is what websites and services see and recognize when you access them anywhere from your computer. Therefore, if you are trying to connect to your computer with a remote connection that isn’t on the same network, your public IP address will be required.
The IP address also tells the location of a device. So it can become important for you at times to know what IP address of whatever device it is you are using.
Now how to find this IP address is the main question and that is why you are here. In the article below, you will learn four ways through which you can find the IP address of your device while working in Linux environment.
Four ways to find your IP Address in Linux
Following are four methods by which you can find the IP address of your device with ease:
Method 1:Finding your IP address on the desktop
The first method of finding the IP address of your device is on the Linux desktop interface using some basic desktop utilities. For this, you need to proceed as follows:
First, go to your Activities screen and type Network (for a wired connection) or wireless (for a Wi-Fi connection)
Click on the gear icon next to the network connection icon (Wi-Fi icon) shown at the top right of the title bar.
A cascading menu will appear and your IP address is listed in the Network profile as shown below:
One thing you would notice above are the two types of IP addresses: IPv4 and IPv6. Let me talk about them briefly before we go into the other methods.
IPv4 address or Internet Protocol version 4 is the fourth version of the Internet Protocol (IP). It is one of the main protocols of standards-based methods on the Internet and other packet-controlled networks.
It has the format x.x.x.x, where x=0 to 255 and uses 32-bit addresses which limits the possible address space to about 4 billion; precisely 4294967296 (232) addresses. IPv4 has special address blocks specifically for private networks (approx. 18 million addresses) together with multicast addresses (approx. 270 million addresses).
Contrariwise, IPv6 address or Internet Protocol Version 6 address is used to identify an locate a network interface of a computer in an IPv6 computer network.
IPv6 has a more complex format using hex numbers. With a total number of 128 bits, it means there are a whopping 340 undecillion!—possible IPv6 addresses. IPv6 was introduced to tackle the predictable exhaustion of IPv4 addresses in the near future.
Method 2: Finding your IP address on the Shell with IP command
The second method we would look at for finding the IP address of your device is through a terminal command. In order to do this, you need to proceed as follows:
First of all, open the terminal window by pressing Ctrl+ T or you can click or double-click on the terminal icon directly if it is shown on your taskbar. You can also click on the search icon located on the taskbar and then type Terminal, when it comes in the result, press enter to open it. The newly opened terminal window is shown below:
Input the command ip addr in the terminal window and press Enter.
This command is shown below:
The next thing is to press Enter, some information will cascade down on the terminal window. Check the image shown below in the terminal screen, the highlighted rectangle shows the IP address of your device just beside the inet field.
Method 3: Finding your IP address on the Shell with ifconfig command
The third method we will look at in order to find the IP address of your device is through another terminal command window. In order to do this, you need to proceed with the following steps mentioned below:
Launch the terminal window by pressing Ctrl+ T or clicking (or double-clicking) on the terminal icon or you can search for terminal in the search window shown below and pressing Enter when it comes up in the search results.
Then type the command: /sbin/ifconfig
in the already opened terminal and press Enter.
Just as soon as you press Enter, you will see a lot of information cascade down on the terminal screen. From all the displayed information below, the highlighted rectangle shows the IP address of your device besides the inet addr field.
The ifconfig command works in the exact same way for finding the IP address of a device using the terminal window in Linux as ipconfig command works for finding the IP address of a device using command prompt terminal in Windows operating system.
Method 4: Finding your IP address on the Shell by using hostname command
The method four we will be looking at for finding the IP address of your device makes use of yet another terminal command. For this method, you need to go through the following steps mentioned below:
Launch the terminal window by pressing Ctrl+ T or clicking (or double-clicking) on the terminal icon. You can as well search for terminal in the search window shown below and press Enter when it comes up in the search results.
When the terminal window appears, type the command: hostname -I
then press Enter. This command is shown in the following window:
Just as soon as you press Enter, you will see the IP address of your device will immediately be displayed on the terminal window right below your entered command as seen below:
Finally, as described earlier, an IP address is the most direct route to a computer over a network. Once you know the IP address of your device, you can freely interact with any other device that is connected to the same network to which you are connected.
It is certain that by making use of any of the methods listed above, you can find the IP address of your device with ease and enable a totally safe and secure network communication through it.
There are other systems, such as DNS and Avahi, that can assist you in routing one computer to another, but when those are unavailable for any reason, the IP address is what you use. IP address provides an identity to your device so that you can recognize it whenever and wherever you want to.
Now you understand the why of IP addresses, and more importantly, how to find it on your Linux. I hope that this article has helped you and will still help you a lot in the future.