Every device on your Ubuntu machine needs a unique label on the network, and that label is your IP address. Understanding how to find and manage this identifier helps you troubleshoot connections and secure your communications.
Whether you are using Ubuntu Desktop or Ubuntu Server, the operating system provides clear, built-in tools to reveal your IP information quickly.
| Category | Term or Interface | Example Value | Typical Use Case |
|---|---|---|---|
| Address Type | IPv4 | 192.168.1.45 | Common private LAN addressing |
| Address Type | IPv6 | 2001:db8::1 | Modern global unicast connectivity |
| Scope | Private (LAN) | 10.0.0.2 / 192.168.0.2 | Not routable on the public Internet |
| Scope | Public (External) | 203.0.113.42 | Visible to remote servers and services |
| Interface | eth0 / ens33 | ens33 | Physical or virtual Ethernet adapter |
| Interface | lo | 127.0.0.1 | Local loopback for internal testing |
Finding Your IP Address in Ubuntu Desktop
The graphical environment gives you quick ways to see your network details without opening a terminal.
Using Settings and About
Open Settings, navigate to About, and look at the Device section to see the local network assignment provided by the system.
Using the Network Menu
Click the top-right system tray icon, select your connection name, and you can view both IPv4 and IPv6 addresses directly in the popup.
Finding Your IP Address in Ubuntu Server
On headless servers, command-line tools are the primary method to identify your addressing configuration.
Using the ip Command
The modern ip addr or ip a command shows all interfaces, their states, and associated IP addresses in a clean, script-friendly format.
Using ifconfig for Legacy Output
If the net-tools package is installed, ifconfig provides a familiar layout that some administrators prefer for quick checks.
Interpreting Private and Public IPs on Ubuntu
Ubuntu distinguishes between internal network addressing and globally routed addressing, which affects how you use the information.
Private IP Context
Private addresses such as 192.168.x.x or 10.x.x.x are used inside your home or office network and are translated by routers through NAT when reaching the Internet.
Public IP Context
Your public IP is the address seen by web servers and online services, and it is typically assigned by your Internet Service Provider to the router or cloud instance.
Using the Terminal to Query Ubuntu IP Details
Combining a few commands gives you precise control over which interface and which address family you want to inspect.
Command Options and Filters
Pipe ip addr through grep and awk to extract only the lines containing inet, and use hostname -I to list all non-loopback addresses in one line.
Scripting and Automation
In startup scripts or deployment tools, you can assign the result of ip -4 addr show eth0 | grep -oP '(? to a variable for dynamic configuration.
Securing and Managing Your Ubuntu Network Identity
Strategic handling of IP information supports monitoring, access control, and service reliability across your infrastructure.
- Use static IP assignments for servers to ensure consistent access and firewall rules
- Document both IPv4 and IPv6 addresses when you manage mixed protocol environments
- Verify NAT and routing rules after network changes to avoid connectivity surprises
- Restrict unnecessary exposure of administrative interfaces by scope and interface
- Schedule periodic checks with
ip addrto catch configuration drift early
FAQ
Reader questions
How do I find only my IPv4 address from the command line in Ubuntu?
Run hostname -I to list all non-loopback IPv4 addresses, or use ip -4 addr show eth0 | grep -oP '(? to target a specific interface.
What does 127.0.0.1 represent on my Ubuntu system?
It is the loopback address, which lets applications communicate with the same machine without involving any physical network interface.
Why does my public IP differ from the address shown inside my home network?
This difference is caused by NAT, where your router uses one private IP internally and a separate public IP to talk to external servers.
Can I change my external IP address from the Ubuntu terminal?
On a typical home connection, you can restart your router or contact your ISP; on cloud Ubuntu instances, you may reassign an elastic IP through the provider's dashboard or API.