The fastest way to see your IP address in Linux
Open a terminal and type ip addr show, then press Enter. You will see a list of all network connections on your machine. Look for the line that starts with inet — that is your IPv4 address. It usually looks like 192.168.1.100 or 10.0.0.50. If you see inet6, that is your IPv6 address, which looks like a longer string of letters and numbers separated by colons.
The ip addr command works on every modern Linux system — Ubuntu, Fedora, Debian, Linux Mint, and others. It shows you every network interface your computer has, including ones that are not currently connected. If you have multiple network cards or a virtual machine running, you will see them all listed separately.
If you only want to see the addresses without all the extra information, type hostname -I instead. This prints just the IP addresses on one line, which is useful if you need to copy the address quickly or use it in another command.
Key Takeaways
- The ip addr show command displays all your network addresses in one terminal window, with IPv4 addresses marked as inet.
- Your IPv4 address is the one you need to share with other devices on your home network — it usually starts with 192.168 or 10.0.
- The hostname -I command shows only the addresses without extra details, which is faster if you just need the number.
- Different network connections (WiFi, Ethernet, virtual machines) each have their own address, and all of them appear in the same output.
Understanding what you see in the output
When you run ip addr show, the output is organized by network interface. Each interface gets its own section, starting with a number and a name like eth0 (Ethernet) or wlan0 (WiFi). Below that name you will see several lines of information.
The line you need starts with inet followed by a space and then your IP address. After the address you will see a slash and a number, like /24 — that is the subnet mask, which tells your computer how many other devices are on the same network. You do not need to understand subnet masks to find your address; just copy everything from inet to the slash.
If a network interface is not currently connected, it may not have an inet line at all. That is normal. You only care about the interfaces that show an address. The lo interface (called loopback) always shows 127.0.0.1 — that is your computer talking to itself, not your real network address.
Finding your address on WiFi versus Ethernet
If your Linux machine is connected by WiFi, your address will be under the wlan0 section (or sometimes wlan1 if you have multiple WiFi cards). If it is plugged into an Ethernet cable, look under eth0 or enp0s3. The name varies depending on your hardware and Linux version, but the structure is always the same.
You can tell which connection is active by looking for the word UP near the interface name. If you see DOWN, that connection is not currently working. Most home machines have only one active connection at a time, so you will usually see just one inet address that matters.
If you want to see only one specific interface instead of all of them, type ip addr show wlan0 (or replace wlan0 with whatever your interface is called). This filters the output to just that one connection, which is useful on machines with many network devices.
Other commands that show your IP address
The ifconfig command is older but still works on most Linux systems. Type ifconfig and you will see output similar to ip addr show, with your IPv4 address listed as inet addr: followed by the number. This command is less common on newer systems, but if ip addr does not work for some reason, ifconfig usually will.
The nmcli command works if your system uses NetworkManager, which most desktop Linux machines do. Type nmcli device show to see all connections, or nmcli connection show to see only the ones that are currently active. The output is longer and includes more details about your network, but your IP address is still there — look for the line starting with IP4.ADDRESS.
For a quick check on a server or headless machine (one without a desktop), hostname -I remains the simplest option. It prints only the addresses and nothing else, which is useful in scripts or when you are working over a slow connection.
Why you might have multiple IP addresses
Some machines show more than one inet address under the same interface. This happens when your network administrator has assigned multiple addresses to one connection, or when you are running virtual machines. Each address is valid and can be used to reach your machine, but usually only one is the "main" address that your router knows about.
If you are running Docker, VirtualBox, or other virtualization software, you will see additional interfaces like docker0 or vboxnet0. These are virtual network cards created by the software, not real connections. Your actual network address is still under eth0 or wlan0.
If you are unsure which address to use, the one under your active connection (the one marked UP) is almost always the right one. If someone on your home network needs to reach your Linux machine, give them that address.
Finding your address if the terminal is not available
If you are using a Linux desktop with a graphical interface, you can find your IP address without opening a terminal. In Ubuntu, click the network icon in the top-right corner, then click the settings icon (usually a gear or three dots). Select "Wired" or "WiFi" depending on your connection, then click the connection name. Your IP address will be listed under "IPv4 Address" or similar.
In other desktop environments like GNOME, KDE, or Cinnamon, the process is similar: open Settings, go to Network, and click your active connection. The address will be displayed somewhere on that screen. The exact location varies, but it is always labeled clearly.
If you cannot find it in the graphical settings, opening a terminal and typing ip addr show is still the fastest method. Most Linux users keep a terminal window open anyway, so this becomes your default approach over time.
Frequently Asked Questions
What is the difference between the address I see in Linux and the address my router shows?
Your Linux machine has an internal IP address (like 192.168.1.100) that it uses to talk to other devices on your home network. Your router also has a public IP address that the internet sees. The address you find in Linux is the internal one. If you need your public address, you would check your router's settings or visit a website like whatismyipaddress.com from any device on your network.
Why do I see 127.0.0.1 in the output?
That is the loopback address, which is your computer talking to itself. It is not your real network address. Ignore it and look for the address under your actual network interface (eth0, wlan0, etc.). The loopback address is always 127.0.0.1 on every Linux machine and is used for testing network software.
Can I change my IP address in Linux?
Yes, but whether you should depends on your setup. If your router assigns addresses automatically (DHCP), your address may change after a reboot. If you need a permanent address, you can configure a static IP in your network settings or ask your router to always give your machine the same address. This is a more advanced task and usually only necessary for servers or machines that other devices need to reach reliably.
What if the ip command does not work?
Try ifconfig instead. If that does not work either, your system may be very old or minimal. In that case, check your router's settings — most routers show all connected devices and their addresses in a status page you can access from any web browser on your network.