Raspberry Pi

How to find the IP address of the Raspberry Pi operating system

The Raspberry Pi operating system is also a type of Debian-based Linux distribution so the commands of the command-line interface are almost the same so we can find out the IP address of the Raspberry Pi similarly we find in any other Debian based distribution..

In this write-up, we will find out about the methods by which we can find out the IP address of the Raspberry Pi operating system, but before proceeding towards these methods, we will explore what the IP address is.

What is an IP address

The IP address is a unique address through which we can communicate on the internet and also interact with other devices. The 32 bit IP address is a combination of the numeric values like 192.168.12.3, each number of this address can vary between 0 to 255, and this unique IP address is set by the ISP (Internet Service Provider) mostly. This unique IP address is used mainly for two purposes, the first one is to identify the machine, and the second one is to share some data with other machines.

What are private IP and public IP addresses

There are two types of IP addresses, one is private and the other is public, from the name it is being clear that the public address of the machine is used to interact with a huge network, simply we can say to interact with different servers on the internet whereas the private IP address is unique to every machine, for example, if three devices including laptop, mobile, and tablet are connected to the same router, all these devices will have a different private IP addresses.

How to find out the private IP address on the Raspberry Pi

In the Raspberry Pi, we can find out the private IP address by running the command in the terminal:

$ ip address

We can also use the command:

$ ip a

One more way to find the IP address of your machine is by using the “ifconfig” command with the flag of “a” which is used for address:

$ ifconfig -a

How to find out the public IP address on the Raspberry Pi

The public IP address which has been explained in the above section can be found on the Raspberry Pi using the command:

$ curl ifconfig.me

The other command to find out the Public IP address is

$ curl ident.me

Conclusion

The IP (Internet Protocol) is an address that is used to communicate between different devices on the local area network and to share data among different servers on the internet. We have to know the IP address of our machine so that we can communicate with other devices using this IP address. In this write-up, we have discussed the method by which we can find the IP address on the Raspberry Pi operating system through a command-line interface.

About the author

Hammad Zahid

I'm an Engineering graduate and my passion for IT has brought me to Linux. Now here I'm learning and sharing my knowledge with the world.