Categories: DebianLinuxShell

Linux Basics: 3 Ways to find your local IP Address in Debian

In our daily computer work, we need to know the IP address of our machine from time to time. This tutorial lists three ways to find the IP address of your local network card in Debian 11  and 12 with the help of the terminal.

Using ifconfig command

A widely used command to find a network configuration is the ifconfig command. If it is not installed on your machine (as on my system), you can install it by following the procedure.

Open the terminal with root privileges and execute the following command to install net-tools packages.

apt-get install net-tools

Wait for the command to finish.

When you have successfully installed the ifconfig command on your machine, execute it on the terminal.

ifconfig

You will see which IP address is bound to which network interface. This is your private IP address. If you want to check the network configuration for a particular interface, the command should look like the following.

ifconfig <interface>

Replace <interface> with the interface that you like to look up. In my example, the network interface is ens33.

You will get a list of all private IP addresses on this interface.

Using ip addr command

The second command you can use to find an IP address is the ip command. Execute "ip addr" on the terminal.

ip addr

You will see which IP is bound to which interface in the command output.

Using hostname command

The last command you can use to find an IP address is executing the hostname command as follows.

hostname -I

You will have the following result on your terminal.

These are all the methods you can use to find the network configuration of your machine. Finding your public IP address is not that easy, especially when your system is behind a NAT router. Have a look at this guide if you would like to know the public IP and even the geolocation of the IP. Enjoy!!

Vitux Staff

Recent Posts

How to Install Magento 2 on AlmaLinux

Magento is a free and open-source e-commerce platform written in PHP. It is simple, easy…

1 year ago

How to Install ISPConfig Hosting Control Panel with Apache Web Server on Ubuntu 24.04

ISPConfig is an open-source control panel that allows users to manage multiple servers from a…

1 year ago

How to Test your Email Server (SMTP) Using the Telnet Command

As a Linux administrator, you may find it necessary to troubleshoot or test your Simple…

1 year ago

Managing Network Interfaces and Settings on Ubuntu 24.04 with nmcli

Ubuntu 24.04, like many modern Linux distributions, relies on the NetworkManager for managing network connections.…

2 years ago

Using Restic Backup on Ubuntu 24.04

Restic is a modern, open-source backup program designed for efficiency, security, and simplicity. It enables…

2 years ago

Installing phpMyAdmin on Rocky Linux 9 and Securing it with Let’s Encrypt SSL

phpMyAdmin is a popular free tool written in PHP intended to administer MySQL and MariaDB…

2 years ago