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
| Type | Example | Who sees it |
|---|---|---|
| Private (local) IPv4 | 192.168.1.25, 10.0.0.12 | Devices on the same network, such as your router or another PC |
| Public IPv4 / IPv6 | 203.0.113.40 | Websites and services on the internet. It usually belongs to your router, not your PC |
| Loopback | 127.0.0.1 | Only your own machine (localhost) |
Method 1: Check IP Address in Ubuntu Settings (GUI)
- Open Settings from the Activities overview or the system menu in the top-right corner.
- Click Network for a wired connection or Wi-Fi for a wireless one.
- Click the gear icon next to the active connection.
- 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.
How did it make you feel?

What does slash mean?
The other way round to do this is using cmd
The command is ifconfig
Hey, NIKETAN, after entering that command, how do I tell which IP address is the system one?
“ifconfig” is deprecated and has been replaced by command “ip”.
Thank you!! The screenshots and the red squares helps me a lot!!!
perfect thanks!
Thank you
Nice article. Thanks man
Thanks a lot
On terminal, just type
$ip address
will get current ipv4 and ipv6 address.
Thank you for this useful information. it helped a lot.
nice, thanks
Thanks for help. 🙂
Thank you for this useful information. it helped a lot.