Linux – Find IP Address in Linux-Based Operating Systems

Linux Find IP Address – Are you new to Linux? Do you want to learn how to get IP Address in Linux? If so, then you are at the perfect website portal to learn How to Find IP Addresses in Linux. This is going to be a complete guide on the topic.

Well, finding the IP address of your system is not a difficult task even if you use any OS either be it Linux-based operating systems, MS Windows operating systems, or Mac OS. You can find the IP address of your system just by running some simple commands. If you have used windows based operating system then you must know it is how easy to find the IP address in that particular OS.

Linux Find IP Address
Find IP Address in Linux

Finding IP in Linux– That’s true the command we use to find the IP address in other operating systems doesn’t work in Linux. In Linux, you can find the IP Address of your system by running ip addr Command. Yes, now you have got to know the command to get IP Address in Linux.

But we suggest you go through this complete article so that you can gather some more useful information.

Now we will discuss-

  • What is the IP Address
  • Get IP Address in Linux
  • Type of IP Address

We do not like to provide half information. We try to cover all the aspects of the subject we are writing about. So, We will start with-

What Is The IP Address

There could be many definitions of the IP Address. You can get many different definitions over the internet. But we are going to let you understand in the simplest way possible.

IP Address Definition – IP stands for Internet Protocol and the IP Address is a kind of unique identification address for your computer system. As we all know about data communication or data transmission. So, the IP address is used for data communication over the internet.

On a network, IP addresses are kinds of identifiers that are used to send data between devices.

The IP address is the set of four numbers separated by the periods. The number in an IP address could be between 0 to 255.

Example of an IP Address-

192.247.56.2

As we told you that the IP Address could be between 0 to 255. So the full IP could be from 0.0.0.0 to 255.255.255.255.

Note – If you are thinking that your IP address could be any random numbers from 0.0.0.0 to 255.255.255.255 then you are wrong. IP addresses are mathematically produced and allocated to a system by IANA (Internet Corporation for Assigned Name and Numbers).

How to Find IP Address in Linux

Finally, this is the section in which you will be more interested. Here, you will learn how to find the IP address in Linux-based operating systems or how to get IP in Linux.

The ip addr show or sudo ip addr show command is used to find the IP address in Linux.

We have already covered ip addr show command in one of our most informative blog posts – Linux Commands With Examples

The ip addr show Command to find the IP address in Linux

Finding IP in Linux is as easy as finding it in Windows or Mac OS. But you need to know how to use the command which is used to get it. So, we will explain how exactly we get the IP address in Linux.

Syntax

$ ip addr show

output

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 08:00:27:81:21:b5 brd ff:ff:ff:ff:ff:ff
    inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic noprefixroute enp0s3
       valid_lft 75916sec preferred_lft 75916sec
    inet6 fe80::559b:9c67:bc33:7938/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever

Graphical Example-

Find IP address in Linux

Some people find it very confusing, Are you one of them? So in such a case, if you are so confused then let’s learn about the simple command to get IP Address only in Linux.

Linux Command to find IP address only nothing else

When you run ip addr show command, you don’t only get the IP address but also you get lots of information related to it. But what if you want to get the IP address only when you run a command for showing the IP address?

Well, if so then there is a command for you. That is hostname -I command.

Syntax-

$ hostname -I

Output

10.0.2.15

Now you have got to know how to find the IP address in Linux. It’s time to learn about types of IP addresses.

Types of IP Addresses

There are mainly four types of IP addresses for different purposes. What are those four types of IP Addresses?

Let’s see-

Types of IP Address

  • Private IP
  • Public IP
  • Static IP
  • Dynamic IP

Public and Private IP Address

Everyone who is using the internet has two IP addresses- Private and Public IP Addresses.

If we talk about Private IP addresses then I have to say “The Private IP Address is used inside the network while The Public IP is used outside the network.

Static And Dynamic IP Address

Let me tell you, Static and Dynamic IP Addresses are the two forms of Public IP Addresses. Let’s talk about both Static and Dynamic IP Addresses.

Static IP Address- Static IP address is a kind of IP that never gets changed. Static IP is used for hosting servers.

For Example, if you want to check the IP address of sites like Facebook, Wikipedia or Twitter then you will find that it will be the same forever.

Dynamic IP Address– Dynamic IP Addresses are a kind of IP that automatically gets changed when you access the internet. The Dynamic IP Addresses are assigned by DHCP (Dynamic Host Configuration Protocol) to a device.

Conclusion

In this whole blog post, we tried to explain IP addresses how ever our topic was “How to Find IP Address In Linux” or “How to Get IP Address in Linux” and we covered the main topic in the best possible way. We taught how to use ip addr show command to find the IP address in Linux Based Operating Systems. We also covered topics like “Types of IP addresses” and described them in minimal words.

Leave a Comment