This guide is intended for Linux beginners. It shows 6 different ways to find the IP address of your local network card using the command line as well as the GNOME Desktop on Debian 11.
An IP address is a unique identifier assigned to any system connected to a network or the Internet for identification and communication. It is a very important piece of information to know in order to set up network-related applications, troubleshoot network problems, and allow other users to access your system to share resources.
There are usually two types of IP addresses for a network device: the external IP address and the internal IP address. The external IP address is the address you get when you are connected to the Internet and is assigned to your router by an Internet service provider. The internal IP address is the address assigned to you by your router or Internet device that allows you to connect to the Internet.
In this article, we will explain how to find an internal IP address in a Debian-based operating system. There are mainly two methods to find it: through the GUI and the command line. We will describe both methods and different commands. The commands described in this article also work on Ubuntu and Linux Mint.
We will use Debian 11 to describe the methods described in this article.
Find internal IP via GUI
In a Debian-based operating system, we can use the graphical method to find an internal IP address assigned to our system. To do this, click on the network icon in the upper right corner of your desktop. When the menu appears, click on the Wired option. The following screenshot illustrates this.
Next, click on the Wired Settings option.
It will launch the network settings window. To view the Wired or wireless connection settings, click on the cog icon in front of the connected interface.
It will display the detailed settings of your network interface including internal IP address, MAC address, default route, and DNS information.
Find IP-Address on the Command line
Finding the internal IP via the command line is much easier than via the graphical method, since you don’t have to navigate through different windows. We will take a look at different commands that you can use to find your internal IP.
First, we need to launch the terminal application. To do this, go to the Activities tab in the upper left corner of your desktop. Then type terminal in the search bar. When the terminal icon appears, click on it to launch it.
Once the Terminal opens, try using the below commands one by one to find the internal IP address.
Method # 1: Using IP address command
In this method, you can use the IP command in different ways to find the internal IP address of your system. In the Terminal, type either ip a, ip addr, or ip address:
$ ip a
The output will look similar to below:
From the above output, you can see the IP address in the highlighted rectangle along with the other information.
Method # 2 Using ifconfig command
ifconfig is the most used command in various Linux distributions but it has now deprecated and therefore missing from the latest Debian OS. However, we can still use it. And for that, we have to install it using apt-get command. Open the Terminal and run the below command in it to do so:
$ apt install net-tools
Once installed, type the below command to find the IP address.
This command displays the IP address of all active network interfaces including other information.
To view the IP address of the specific interface, use the following command syntax. Make sure to replace interface_name with your interface name e.g ens33, eth0, etc
$ /sbin/ifconfig interface_name
In the output below, you can see the IP address in the red highlighted rectangle.
Method # 3 Using IP route command
IP route or ip r command is actually used for displaying the routing table in Linux. However, we can use also use it to find the internal IP address. To do so, open the Terminal and type the below command in it:
$ ip r
In the output below, you can see the IP address of the system.
Method # 4 Using the hostname command
The hostname command is actually used to display the host name of a system. However, we can also use it to display the IP address of our system. To do, open the Terminal and type hostname followed by –I character as shown below:
$ hostname –I
5. Using nmcli command
Nmcli is a command-line tool that is used to control NetworkManager. You can use it to display the IP address of a network device along with its status. To use this command, open the Terminal and enter the following command:
$ nmcli –p device show
From the output below, you can see the network interface IP along with other details.
The IP address has been marked in the screenshot.
Now we have learned how to find an internal IP address in a Debian-based operating system. You can either use the GUI or the various command line methods described above. These methods can also be applied to other Linux distributions.