An IP address is a unique label that is assigned to each system connected to a network or the internet for identification and communication purpose. It is a very critical piece of information that you should know in order to set up network-related applications, troubleshoot network problems, giving other users access to your system for sharing resources.
When it comes to a network device, typically there are two main types of IP addresses involved i.e. the external IP address and internal IP address. External IP is the address that you obtain when connected to the internet and is assigned to your router by an ISP. While the internal IP address is the address that is assigned to you by your router or internet device that helps you to connect to the internet.
In this article, we will explain how to find an internal IP address in a Debian-based OS. There are mainly two methods to find it via GUI and command line. We will describe both methods including various commands. The commands described in this article will work on Ubuntu and Linux Mint too.
We will use Debian 10 for describing the procedure mentioned in this article.
Find internal IP via GUI
In Debian-based OS, we can use the graphical method for finding an internal IP address that is assigned to our system. For that, click on the network icon on the top right corner of your desktop. When the menu appears, click on the Wired Connected option. See the below screenshot for a clear understanding.
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 internal IP via Command line
Finding internal IP via command line is much easier than through the graphical method as you will not have to navigate through the several windows. just open the Terminal and type the one-line command to find your internal IP address. We will see different commands using that you can find your internal IP.
First, we have to launch the Terminal application. To do so, go to the Activities tab located on the top left corner of your desktop. Then in the search bar, type terminal. 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.
Now we have learned how to find an internal IP address in Debian-based OS. You can use either GUI or various command-line methods described above. Other than just Debian, these methods can be applied to other Linux distributions as well.