The quickest way to see your IP address on Linux
The fastest command to see your IP address on Linux is hostname -I. Open a terminal and type that command, then press Enter. You will see your local IP address — the one your router assigned to your device — printed on the next line.
This works on almost every Linux distribution: Ubuntu, Fedora, Debian, Linux Mint, and others. The command shows only the address itself, nothing else, so you can read it at a glance.
If you want more detail about your network setup, or if hostname -I does not work on your system, the next sections show other commands that give you the full picture of what your network looks like.
Key Takeaways
- Type hostname -I in a terminal to see your local IP address in one line.
- The ip addr command shows all your network interfaces and their addresses, including IPv4 and IPv6.
- Use ifconfig if your system has it installed, though it is older and not available on all modern Linux distributions.
- Your local IP address starts with 192.168, 10, or 172.16 — these are private addresses that only work inside your home network.
- To find your public IP address (the one the internet sees), use curl ifconfig.me or visit a website like ifconfig.me in your browser.
Using ip addr to see all your network interfaces
The ip addr command shows every network connection on your Linux machine, including Ethernet, Wi-Fi, and virtual interfaces. Open a terminal and type ip addr, then press Enter. You will see a list of all interfaces with their IP addresses, MAC addresses, and status.
Look for the interface you are actually using — usually eth0 or enp0s3 for wired Ethernet, or wlan0 or wlp3s0 for Wi-Fi. Next to inet you will see your IPv4 address. If you see inet6, that is your IPv6 address, which is a newer format that looks like a long string of letters and numbers separated by colons.
The ip addr command also shows whether each interface is up (connected) or down (disconnected). This is useful if you are troubleshooting a network problem and need to see which connections are active.
Finding your IP address with ifconfig
The ifconfig command is older than ip addr but still works on many Linux systems. Type ifconfig in a terminal and press Enter. You will see a similar list of network interfaces, with the IP address listed next to inet addr or just inet.
On newer Linux distributions, ifconfig may not be installed by default. If you type the command and get "command not found", your system does not have it. In that case, use ip addr instead — it does the same job and is becoming the standard on all Linux systems.
If you want to install ifconfig on Ubuntu or Debian, you can run sudo apt install net-tools, but this is not necessary if ip addr works for you.
The difference between your local IP and your public IP
The address you see from hostname -I or ip addr is your local IP address — the one your router gave to your Linux machine. It always starts with 192.168, 10, or 172.16. This address only works inside your home network. Devices outside your home cannot reach you using this address.
Your public IP address is what the internet sees when you connect to a website or send data outside your home. Your router translates between the two — it takes traffic from your local address and sends it out to the internet using your public address. To find your public IP, open a terminal and type curl ifconfig.me, then press Enter. The command will show your public address on the next line.
You can also find your public IP by visiting ifconfig.me in a web browser. Both methods show the same address — the one your internet service provider assigned to your router.
Checking your IP address through the graphical interface
If you prefer not to use the terminal, most Linux desktop environments let you see your IP address through the settings menu. In Ubuntu with GNOME, click the system menu in the top right corner, then click the Wi-Fi or network icon. Click the gear icon next to your connected network, then look for the IPv4 Address field.
In KDE Plasma, right-click the network icon in the system tray and select "Connection Information". In XFCE, open the Settings menu, go to Network, and click your active connection to see the details.
The graphical method is slower than typing a command, but it shows the same information and does not require you to remember the command syntax.
What to do if you cannot see your IP address
If hostname -I returns nothing, or if ip addr shows no inet address next to your interface, your network connection may not be active. Check that your Ethernet cable is plugged in, or that you are connected to your Wi-Fi network. Then try the command again.
If you are connected but still see no address, your router may not have assigned one yet. Wait a few seconds and try again. If the problem continues, restart your network interface by typing sudo systemctl restart networking in a terminal, then check again.
On some systems, you may need to use sudo to run network commands. If a command returns "permission denied", try typing sudo before it — for example, sudo ip addr.
Using grep to find just your IP address quickly
If ip addr shows too much information and you want to see only the IPv4 addresses, you can combine it with the grep command. Type ip addr | grep inet and press Enter. This filters the output to show only lines that contain "inet", which makes the list shorter and easier to read.
You can make it even more specific by typing ip addr | grep "inet " | grep -v inet6. This shows only IPv4 addresses and hides IPv6 addresses, which is useful if you have both and want to focus on one.
These commands do the same thing as hostname -I, just with more detail about which interface each address belongs to. Use whichever method feels easiest for your workflow.
Frequently Asked Questions
Why does my IP address start with 192.168 instead of a different number?
Your router automatically assigns addresses from a private range that is reserved for home and office networks. The 192.168 range is the most common, but some routers use 10 or 172.16 instead. All three ranges are private, meaning they only work inside your local network and are not routable on the public internet.
Will my local IP address change if I restart my computer?
Usually not. Your router remembers which device is which and assigns the same local IP address each time you connect. However, if you wait a long time before connecting again, or if your router runs out of addresses, you might get a different one. This is normal and does not affect your ability to use the network.
How do I find the IP address of another device on my network?
Type arp -a in a terminal to see a list of all devices your computer has recently communicated with, along with their IP addresses and MAC addresses. You can also use ip neigh for a similar list. If you want to find a specific device, you may need to ping it first or check your router's admin page.
What is the difference between IPv4 and IPv6?
IPv4 addresses look like 192.168.1.100 — four numbers separated by dots. IPv6 addresses look like 2001:0db8::1 — longer strings of letters and numbers separated by colons. IPv6 is newer and provides many more possible addresses, but most home networks still use IPv4. Your device may have both.
Can I change my local IP address manually?
Yes, but it is usually not necessary. You can set a static IP address in your network settings or through your router's admin page. This is useful if you want a device to always have the same address, but it requires more setup. For most home users, letting the router assign addresses automatically is simpler and works fine.