Skip to content

How to Check IP Address on Ubuntu 26.04 & 24.04

Find your private and public IP address on Ubuntu 26.04 and 24.04 using Settings, ip addr, hostname -I, nmcli and curl. Works on desktop and server.

Category
Networking
Covers
Ubuntu
Versions & support
About Ubuntu →
On this page

Every computer on a network has at least one IP address. On Ubuntu you usually need two of them: the private (local) IP address that other machines on your LAN use to reach you, and the public IP address that websites see when you browse. This guide shows how to find both on Ubuntu 26.04 LTS and Ubuntu 24.04 LTS, using the Settings app or a few terminal commands. The same commands work on Ubuntu Server and on other current Ubuntu releases.

Private vs Public IP Address

TypeExampleWho sees it
Private (local) IPv4192.168.1.25, 10.0.0.12Devices on the same network, such as your router or another PC
Public IPv4 / IPv6203.0.113.40Websites and services on the internet. It usually belongs to your router, not your PC
Loopback127.0.0.1Only your own machine (localhost)

Method 1: Check IP Address in Ubuntu Settings (GUI)

  1. Open Settings from the Activities overview or the system menu in the top-right corner.
  2. Click Network for a wired connection or Wi-Fi for a wireless one.
  3. Click the gear icon next to the active connection.
  4. The Details tab shows the IPv4 Address, IPv6 Address, hardware (MAC) address, default route and DNS servers.

This is the quickest way on a desktop. If you are on a server or connected over SSH, use the terminal methods below.

Method 2: Check IP Address with the ip Command

Open a terminal with Ctrl + Alt + T and run:

ip addr show

Each network interface is listed with its addresses. Look for the line that starts with inet under your active interface (often enp0s3, eth0 or wlp2s0):

2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP
    link/ether 08:00:27:5a:3c:11 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.25/24 brd 192.168.1.255 scope global dynamic enp0s3
    inet6 fe80::a00:27ff:fe5a:3c11/64 scope link

Here 192.168.1.25 is the IPv4 address and /24 is the subnet mask (255.255.255.0). For a shorter, one-line-per-interface view, use the brief mode:

ip -br addr

Method 3: Print Only the IP Address with hostname

To print just the addresses, with no extra details, run:

hostname -I

The output is a space-separated list of every address assigned to the machine, for example 192.168.1.25 172.17.0.1. The second address in this example belongs to a Docker bridge. This command is handy in scripts.

Method 4: Check IP with NetworkManager (nmcli)

Ubuntu Desktop manages networking with NetworkManager. Its command-line tool shows the address, gateway and DNS servers for each device:

nmcli device show | grep -E 'GENERAL.DEVICE|IP4.ADDRESS|IP4.GATEWAY|IP4.DNS'

On Ubuntu Server, networking is usually handled by netplan and systemd-networkd, so ip addr or networkctl status are the better choices there.

Find Your Public IP Address

Your public IP address is assigned by your internet provider to your router, so local commands cannot show it. Ask an external service instead:

curl -4 ifconfig.me

Use curl -6 ifconfig.me to see your public IPv6 address, if you have one. See more ways to find your public IP from the terminal.

Find Your Default Gateway

The gateway is usually your router’s address. It is the line starting with default via:

ip route show default

Conclusion

On Ubuntu Desktop, the Settings app shows your IP address in two clicks. On any Ubuntu system, ip addr gives the full picture, hostname -I prints just the addresses, and curl ifconfig.me returns your public IP. If you want the address to stay the same after a reboot, follow our guide to configure a static IP address on Ubuntu 24.04.

Rahul

I, Rahul Kumar am the founder and chief editor of TecAdmin.net. I am a Red Hat Certified Engineer (RHCE) and working as an IT professional since 2009..

14 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *


Back to top