To find your IP address on Linux, open a terminal and run ip address show. Look for an inet line under the active Wi-Fi or Ethernet interface for IPv4, or an inet6 line for IPv6. For a shorter list, run hostname -I. These commands show addresses assigned to the Linux computer, while an online IP lookup shows the public address visible to websites.
First Decide Which Linux IP Address You Need
A Linux computer can show several correct addresses at the same time. Choosing the right one depends on the task:
- Private IPv4 address: Used by other devices on the same home, office, or lab network. Common examples begin with 10, 172.16 through 172.31, or 192.168.
- Public IP address: Seen by websites and other internet services. A router, VPN, proxy, or mobile carrier may provide it.
- Global IPv6 address: A publicly routable IPv6 address assigned to an interface.
- Link-local IPv6 address: Usually begins with
fe80and works only on the local network link. - Loopback address:
127.0.0.1for IPv4 or::1for IPv6. It points back to the same computer. - Container or virtual address: Assigned to Docker, a virtual machine, a bridge, or another software interface.
Private IPv4 ranges are defined in RFC 1918. If you need an address for SSH or file sharing inside your network, the active private address is usually correct. If a support form asks what websites see, use the public address instead.
Method 1: Use the ip address Command
The most complete modern command is:
ip address show
You can shorten it to:
ip addr
The command lists network interfaces and their assigned protocol addresses. The upstream ip-address manual documents ip address show and filters for devices, scopes, and active interfaces.
- Open Terminal from the application menu.
- Run
ip address show. - Find the active interface, often named
enp...,eth...,wlp..., orwlan.... - Read the value after
inetfor IPv4. - Read values after
inet6when IPv6 details are needed. - Ignore
lounless you specifically need the loopback address.
To show only globally scoped IPv4 entries, try:
ip -4 address show scope global
For global IPv6 entries, use:
ip -6 address show scope global
You can also target one known interface:
ip address show dev enp3s0
Replace enp3s0 with the real interface name from your system.
Method 2: Use hostname -I for a Short Answer
Run this command with a capital letter I:
hostname -I
It prints the configured network addresses in a compact line and normally leaves out loopback. The Linux hostname manual explains that the -I option displays network addresses for the host.
This method is fast, but the output does not clearly label which interface owns each value. It may include Ethernet, Wi-Fi, VPN, bridge, container, and IPv6 addresses together. Use ip address show when you need interface names, prefix lengths, or address scopes.
Do not confuse capital -I with lowercase -i. They are different options and can produce different results.
Method 3: Find the Address with NetworkManager
Many desktop Linux distributions manage connections with NetworkManager. Start by listing device status:
nmcli device status
Then show full details:
nmcli device show
Look for fields such as GENERAL.DEVICE, GENERAL.STATE, IP4.ADDRESS, IP4.GATEWAY, and IP6.ADDRESS. To inspect one interface only, add its name:
nmcli device show wlp2s0
The official NetworkManager nmcli reference describes nmcli device show as a way to display detailed information for all devices or one selected interface.
- Run
nmcli device statusand find a device marked connected. - Copy that device name.
- Run
nmcli device show DEVICE. - Read
IP4.ADDRESSorIP6.ADDRESS. - Do not copy the gateway or DNS field by mistake.
If the shell says nmcli: command not found, NetworkManager may not be installed or your distribution may use another network service. The ip method normally remains the better general choice.
Method 4: Use Linux Desktop Network Settings
You can find the address without a terminal on common desktop systems. Menu wording changes between GNOME, KDE Plasma, Cinnamon, and distribution versions, but the general process is similar:
- Open Settings or System Settings.
- Select Network for Ethernet or Wi-Fi for wireless.
- Choose the active connection.
- Open its details, properties, or settings button.
- Look for IPv4 Address and IPv6 Address.
GNOME's official network settings guide directs users to Settings, then Network or Wi-Fi, followed by the settings button for the active connection. Do not change the address method or other fields when you only want to read the current values.
A desktop panel may also show the gateway, subnet mask or prefix, hardware address, and DNS servers. The gateway belongs to the router, and the hardware address is a MAC address. Neither one is the computer's IP address.
Method 5: Find the Address Used for an Internet Route
A computer with Wi-Fi, Ethernet, VPNs, and virtual networks may have many addresses. To see which source address Linux would select for a route, run:
ip route get 1.1.1.1
The output can include a device name after dev and a chosen local address after src. For example:
1.1.1.1 via 192.168.1.1 dev wlp2s0 src 192.168.1.44
In this example, 192.168.1.44 is the local source address Linux selected, while 192.168.1.1 is the gateway. This route query helps when the general address list is too crowded. The selected result can change when a VPN connects or when network priority changes.
Method 6: Check Your Public IP Address
Local Linux commands report addresses assigned to interfaces. They may not reveal the public address visible beyond a router using Network Address Translation. Open the ipdnslookup IP Lookup in a browser to see the public address used for that web request.
- Connect through the network you want to test.
- Open the IP Lookup page in your browser.
- Read the main public IPv4 or IPv6 result.
- Note whether a VPN or proxy is active.
- Repeat after changing networks when you need to compare routes.
Several devices in one home can show different private addresses but the same public IPv4 address because the router shares one internet connection. A VPN can make the visible public address belong to the VPN service instead of the ordinary internet provider.
Linux IP Address Output Example
Reading an ip address result
2: wlp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP>
inet 192.168.1.44/24 brd 192.168.1.255 scope global dynamic wlp2s0
inet6 2001:db8:1234:5678::25/64 scope global dynamic
inet6 fe80::1234:abcd:5678:90ef/64 scope link
- wlp2s0: The wireless interface name.
- 192.168.1.44: The private IPv4 address assigned to the computer.
- /24: The IPv4 network prefix length.
- 192.168.1.255: The broadcast address, not the device address.
- 2001:db8:...: An example global IPv6-format entry.
- fe80::...: A link-local IPv6 address limited to the local link.
The IPv6 global line above uses the documentation prefix, so it is an example rather than a live address. Real output will contain values assigned by your network.
Why Linux Shows Multiple IP Addresses
Multiple results are normal. Review the interface and scope instead of choosing the first number blindly.
- Wi-Fi and Ethernet: Both can be connected and have separate addresses.
- IPv4 and IPv6: One interface can use both protocols at the same time.
- Temporary IPv6: Privacy addressing can add temporary global IPv6 values.
- VPN tunnel: A VPN creates another interface and can change the preferred route.
- Docker or Podman: Container bridges often create additional private ranges.
- Virtual machines: Hypervisors can add bridges, NAT networks, and virtual adapters.
- Loopback: The
lointerface always supports communication within the same system.
For a local service, choose the address on the interface reachable by the client. For internet troubleshooting, compare the selected route with the public address shown online.
Common Problems and Safe Fixes
- ip command not found: Install the distribution's iproute2 package using its normal package manager.
- Only loopback appears: Wi-Fi or Ethernet may be disconnected, disabled, or still waiting for DHCP.
- No IPv4 address: The network may be IPv6-only, DHCP may have failed, or the connection may be incomplete.
- Too many addresses: Filter by IP version, scope, or interface with the
ip address showoptions. - Public address looks unfamiliar: Check for a VPN, proxy, corporate gateway, carrier NAT, or cloud environment.
- Address changes later: DHCP leases, privacy addresses, VPN reconnects, and network switching can change values.
- ifconfig is missing: Use
ip address. Older tutorials may rely on the optional net-tools package.
Avoid running ip address flush while trying to inspect an address. The manual warns that flush operations remove selected addresses. The read-only show commands in this guide are enough for finding information.
Protect IP Information When Sharing Results
Private addresses are not normally reachable from the public internet, but screenshots can also expose interface names, Wi-Fi details, VPN routes, public IPv6 addresses, and network structure. Share only the lines needed for support.
Do not post complete production server networking output in a public discussion unless you have reviewed it. Remove unrelated addresses and identifiers first. An IP address alone usually does not reveal an exact home address, but it can still provide approximate network and provider context.
Frequently Asked Questions
What is the fastest command to find a Linux IP?
Run hostname -I for a short list. Use ip address show when you need interface names and scopes.
How do I show only my IPv4 address?
Run ip -4 address show scope global, then choose the address under the active interface.
How do I show IPv6 addresses?
Run ip -6 address show. Add scope global when you want to hide link-local entries.
Is 127.0.0.1 my network address?
It is the IPv4 loopback address for the same computer. Other devices cannot use it to reach your Linux machine.
Why is my public IP different from the terminal result?
The terminal often shows a private interface address, while websites see the public address after routing, NAT, or a VPN.
Which address should I use for SSH?
Use the reachable address on the target interface. Inside one LAN this is often a private address. Remote access may require a VPN, public routing, or a secure gateway.
Does Linux keep the same IP forever?
Not necessarily. DHCP, IPv6 privacy features, VPNs, and connection changes can assign new addresses.
Do I need sudo to view my IP address?
Usually no. The read-only commands in this guide normally work as a regular user.
Choose the Correct Linux Address
Use ip address show for the clearest complete view, hostname -I for speed, and nmcli device show on NetworkManager systems. Desktop settings provide a simple visual option, while ip route get helps identify the source address chosen for a route.
Use the IP Lookup for the public address visible online. Then open the CIDR Notation Calculator to understand a prefix or the IPv4 Class Calculator for historical classification. These ipdnslookup pages help explain the value you found without changing your Linux network settings.