Last updated:
Quick answer: on Debian 13 (Trixie) and Debian 12 (Bookworm), run ip -br addr to see the private IP address of every network interface, or hostname -I to print just the addresses. To see your public IP address, run curl -4 ifconfig.me.
| What you want | Command | Notes |
|---|---|---|
| Private IPv4 address of each interface | ip -4 -br addr |
Uses iproute2, installed by default |
| The address used to reach the internet | ip route get 1.1.1.1 |
Read the value after src |
| All addresses on one line | hostname -I |
Skips loopback and IPv6 link-local addresses |
| Address from NetworkManager | nmcli device show |
Only if NetworkManager is installed (desktop installs) |
| Public IPv4 address | curl -4 ifconfig.me |
Needs curl and sends a request to an outside service |
An IP address is the number other devices use to reach your machine. Your router hands your computer a private address that only works inside your network, while your ISP gives the router a public address that the rest of the internet sees. The commands below work the same on Debian 13 and Debian 12. The screenshots were taken on Debian 12, where the interface is called enp0s3; yours may be eth0, ens18, enp1s0 or similar, and ip -br link lists the real names.
Find the private IP address (Debian 13 and 12)
The private address is assigned by your router or DHCP server and is only reachable from the local network. It is the one you need for SSH, file sharing, or a connection to the machine from another device on the same network. Seven ways to read it are below; the first one is enough for most people.
Method 1: Using the ip Command
The “IP” command in Linux serves multiple purposes; it can do anything from viewing, adding, deleting, and managing the network interfaces. To list down all the interfaces and the IP addresses against them, run the below command:
ip a

How to read it: lo is the loopback interface (127.0.0.1) and can be ignored. On your real interface, the inet line is the IPv4 address with its prefix length (for example 192.168.1.50/24), and inet6 is IPv6. state UP means the link is active.
You can also view the IP address in a more simplified way via the following command:
ip -br addr show

To print only the global IPv4 addresses, use the command below. This is the shortest way to answer “what is my IP address” on Debian:
ip -4 -br addr show scope global
To view the IP address against a specified interface (enp0s3 in this case), run the below-mentioned command:
ip addr show enp0s3

Method 2: Using the ifconfig Command
The “ifconfig” command is a legacy command line utility to get network information. It is deprecated and not part of a default install, but the package is still available: net-tools 2.10 in both Debian 12 and Debian 13. However, you can still install it via the “net-tools”. Installing packages needs administrative rights, so make sure your account can use sudo on Debian 12 first. To install the “net-tools”, run the below command:
sudo apt install net-tools -y

Now, execute the below command to get the IP address of all interfaces configured on your system:
sudo ifconfig

Method 3: Via the nmcli Command
The “nmcli” is a command-line utility for managing the “Network Manager” and viewing the information related to it. Using the “nmcli” command, you can get the IP address on your system, as seen below:
nmcli

Note: nmcli and nmtui exist only when NetworkManager is installed, which is normal on desktop installs. Server and minimal installs often use ifupdown or systemd-networkd instead, and ip works everywhere. Do not install NetworkManager on a remote server just to read an address, because it can take over the network configuration. To show the address of one interface: nmcli device show enp0s3 | grep IP4.ADDRESS.
Method 4: Via the nmtui Command
The “nmtui” is a text-based (terminal) interface for NetworkManager. Apart from the network management, you can view the network’s properties including the IP address. To get your system’s IP address, use the “nmtui” command as follows:
nmtui
It now opens up a new window, select the “Edit a connection” option from here:

Next, choose the specified “Connection” or “Interface” against which you want to get the IP address:

Now, under the “IPv4” configuration, view the IP address of the system:

Note: Scroll down from the above screen to get the “IPv6”.
Method 5: Using the hostname Command
The “hostname” command lets you manage the system’s hostname and has many flags to view distinct system information. One of its flags is the “-I” flag that outputs the system’s IP, as seen below:
hostname -I

hostname -I prints all non-loopback addresses on one line, separated by spaces. If it prints nothing, no address is assigned yet; see the troubleshooting table below.
Method 6: Via the ip route Command
The “ip route” is a command line utility for Debian and other Linux distributions to manage the static routes in the routing table for the specific network interfaces. It can also output the network information that also includes the IP address. To view it, execute the below command:
ip route show table local

The table above is the local routing table and lists every local address, including loopback and broadcast entries, so it is noisy. A cleaner routing-based check asks the kernel which address it would use to reach the internet; the address after src is your primary private IP:
ip route get 1.1.1.1
Example output (your addresses will differ): 1.1.1.1 via 192.168.1.1 dev enp0s3 src 192.168.1.50. Here 192.168.1.1 is the gateway (usually your router) and 192.168.1.50 is this machine.
Method 7: Using the Network Settings | GUI
The “Network Settings” is where you can manage your system’s network by interacting with the GUI. It also displays the network information and to view the IP address from it, open the “Advanced Network” settings from the “Activities”:

Now, select the “Ethernet” or “Interface” against which you want to view the IP and double-click/tap it:

Next, use the “IPv4 Settings” tab or IPv6” tab according to your network’s configuration and view the IP in the “Addresses”, as seen below:

That’s all for the methods to get the “Private IP Address on Debian 12”.
Find the public IP address
Your internet service provider or ISP provides the “Public IP” for your router. Your system uses this IP to connect with outside networks, and to trace the path packets take across those networks you can also install and use traceroute on Debian 12. You can view the public IP online or using the “curl” command on Debian 12. The “curl” is a command-line tool currently in use for data transferring between the systems (to or from the servers).
Below are examples of using the “curl” command to get your Public IP Address in Debian 12.
curl ifconfig.me
curl ifconfig.me

curl api.ipify.org and icanhazip.com
curl api.ipify.org

To get the Public IPv4 address in Debian 12, use the below command:
curl -4 icanhazip.com

To get the IPv6 address in Debian 12, execute the following command:
curl -6 icanhazip.com
That’s all for the methods to get the “Public IP Address on Debian 12”.
Private IP vs public IP
A private IP identifies your Debian machine inside the local network. This is the address you usually need for SSH, local sharing, and a remote desktop connection on Debian 12 on the same network. If it changes after a reboot, it came from DHCP; you can set a static IP address on Debian 13 or 12 to keep it fixed.
A public IP identifies your network on the internet. At home it belongs to your router, on a VPS it is usually assigned directly to the server. Behind a VPN, a proxy, or carrier-grade NAT (common on mobile and some ISP connections), the public address you see can be shared with other customers or belong to the VPN provider. To trace the route packets take to that address, install and use traceroute on Debian.
If you already use DNS tools, dig +short myip.opendns.com @resolver1.opendns.com also returns your public IPv4 address; it needs the bind9-dnsutils package, covered in the dig guide for Debian 13 and 12.
Privacy note: every curl method above sends a request to a third-party service that sees your public IP. That is harmless for a quick check, but avoid scripting it in a tight loop.
Troubleshooting
| Symptom | Likely cause | What to check |
|---|---|---|
hostname -I prints nothing |
No address assigned or link is down | ip -br link should show UP; check the virtual or physical cable and your DHCP server |
Only 127.0.0.1 or a 169.254.x.x address |
No DHCP answer; 169.254.x.x is a link-local fallback address | Confirm the router is reachable and the interface is connected to the right network |
ifconfig: command not found |
net-tools is not installed or /sbin is not in your PATH |
sudo apt install net-tools, then run sudo ifconfig, or just use ip |
curl: command not found |
curl is not installed on a minimal system | sudo apt install curl |
nmcli: command not found |
NetworkManager is not installed | Use ip -br addr instead |
| Address is 10.0.2.15 in VirtualBox | VirtualBox NAT mode gives the VM a private address | Use bridged networking if other devices must reach the VM |
curl -6 fails or hangs |
No IPv6 connectivity | Use curl -4; many networks have no IPv6 |
Interface is not called enp0s3 |
Names vary by hardware and hypervisor | Run ip -br link and use the name it shows |
FAQ
What is the fastest command to find my IP address on Debian?
hostname -I prints the private addresses on one line and ip -br addr shows them per interface. Both work on Debian 13 and 12 without installing anything.
Is ifconfig still available on Debian 13?
Yes, as the optional net-tools package (version 2.10-1.3 in the Debian 13 archive at the time of writing). It is not installed by default, and ip from iproute2 is the maintained replacement.
Why is my public IP different from the address on my Debian machine?
Your machine has a private address from the router, and the router shares one public address for the whole network using NAT. The two are expected to differ unless the machine has a public address directly, as many VPS servers do.