How to Find Your IP Address on Linux
Last updated July 4, 2026
To find your IP address on Linux, open a terminal and run ip a (or hostname -I) to see
your local address, and curl ifconfig.me to see your public one. The commands work on every major
distribution, and our checker shows your public IPv4 and IPv6 in a browser.
Those are two different addresses: the local (private) IP assigned on your network and the public IP the internet sees (public vs private IP addresses explains the split). Everything below works on Ubuntu, Debian, Fedora, Arch and virtually every other distribution.
Find your public IP address (instant)
The simplest way to see your public IP is to open our What Is My IP Address tool in a browser. It shows your public IPv4 and IPv6 address, location and ISP instantly, with no logging. Prefer the command line? See the terminal method below.
Find your local IP address via the terminal
Open a terminal and use the modern iproute2 tooling:
ip addr show(or justip a): read theinetline under your active interface, e.g.eth0orwlan0.hostname -I: prints just your local IP address(es), space-separated.ip route get 1.1.1.1: shows which interface and source IP your traffic actually uses.
The older ifconfig command still works if net-tools is installed, but ip is the current
standard.
Find your public IP address from the terminal
One short command queries an external service and prints your public address:
curl ifconfig.mecurl -4 icanhazip.com: forces IPv4; use-6for IPv6.dig +short myip.opendns.com @resolver1.opendns.com: a DNS-based lookup.
Find your local IP via the desktop
If you are on a GNOME desktop and prefer a GUI:
- Open Settings.
- Select Network (wired) or Wi-Fi.
- Click the gear ⚙ icon next to your connection to see the IPv4 Address.
Find your IPv6 address on Linux
Run ip -6 addr to list only IPv6 addresses. Look for inet6 lines marked scope global: those are your routable addresses. Lines with scope link (starting fe80::) only work on the local network segment.
Most distributions enable IPv6 privacy extensions (RFC 4941), so you will usually see a stable address plus
one or more marked temporary. The temporary ones rotate periodically and are preferred for outgoing
connections, which is why the address a website sees may not be the first one in your list. Confirm the public IPv6 your
traffic presents with curl -6 icanhazip.com or our IP checker.
Find your router's IP address (default gateway)
Run ip route | grep default. The address after default via is your router, usually 192.168.1.1 or 192.168.0.1. Our how to find your router's IP address guide explains what to do with it.
Troubleshooting: wrong or confusing addresses
Too many interfaces. If you run Docker or virtual machines, ip a is cluttered with virtual
interfaces: docker0 (usually 172.17.0.1), veth… pairs, br-… bridges and
libvirt's virbr0. None of them is your LAN address. The reliable filter is ip route get 1.1.1.1, which prints the interface and src address your real traffic uses.
hostname -I prints several addresses. It lists every configured address on every interface,
including those virtual bridges and IPv6, in no meaningful order. Treat it as a quick dump, not an answer; when it matters,
identify the active interface first.
Two network managers. Desktop distributions typically manage connections with NetworkManager
(nmcli device show shows per-device addresses and gateways), while servers often use systemd-networkd
(networkctl status). If the GNOME Network panel looks empty or ignores your interface, it is probably managed
by the other service, so check there before assuming the connection is down.