The fastest way to check your IP address in Linux
The quickest command to see your IP address is ip addr. Open a terminal, type ip addr, and 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 will look something like 192.168.1.100 or 10.0.0.50.
If you only want to see the IP address without all the extra information, use ip addr show followed by the name of your network device. Most machines use eth0 for wired connections or wlan0 for wireless. For example: ip addr show eth0. This narrows the output to just that one connection.
The older command ifconfig still works on many Linux systems, though it is being phased out. Type ifconfig and look for the line labeled inet addr or just inet. The format is the same — your IP address appears right there.
Key Takeaways
- The ip addr command shows all your network connections and their IP addresses in one view.
- Look for lines starting with inet to find IPv4 addresses; lines starting with inet6 show IPv6 addresses.
- Use ip addr show eth0 (or your device name) to see just one network connection instead of all of them.
- The ifconfig command works on older systems but is no longer the standard way to check IP addresses.
- Your local IP address (like 192.168.x.x) is different from your public IP, which is what websites see when you connect to them.
Understanding what you are looking at in the output
When you run ip addr, each network device gets its own numbered section. The first one is usually 1: lo, which is the loopback device — this is your machine talking to itself and always has the address 127.0.0.1. You can ignore this one.
The next sections are your actual network connections. Each starts with a number and a name like 2: eth0 or 3: wlan0. Under that name, you will see several lines of information. The line that starts with inet is what you need. The address right after inet is your IP address, followed by a slash and a number (like /24). That number is the subnet mask — you usually do not need to worry about it.
If a device shows DOWN in its status, that connection is not active. If it shows UP, the connection is working. A device can be plugged in but still show DOWN if the network is not responding or if the device is disabled.
Finding just your public IP address
Your local IP address (the one you see with ip addr) is only visible inside your home or office network. Websites and services on the internet see a different address — your public IP. This is assigned by your internet service provider and goes through your router.
To see your public IP from the Linux terminal, use the command curl ifconfig.me or curl icanhazip.com. Either one will print your public IP address on the screen. These commands reach out to a public server that tells you what address you are connecting from.
You can also use wget -qO- ifconfig.me if curl is not installed on your system. Both commands do the same thing — they just use different tools to fetch the information.
Checking IP addresses for specific network devices
If your machine has multiple network connections, you may want to check just one. Use ip addr show followed by the device name. Common device names are eth0 (wired), wlan0 (wireless), or docker0 (if you use Docker). For example, to check only your wireless connection, type ip addr show wlan0.
To see a list of all your network devices without their full details, use ip link show. This gives you the device names and their status (UP or DOWN) without showing the IP addresses. It is useful when you are not sure what your devices are called.
If you need to see which device is currently connected to the internet, look for the one marked UP with an inet address. Devices that are DOWN or have no inet line are not currently active.
Using graphical tools instead of the terminal
If you prefer not to use the terminal, most Linux desktop environments have a network settings tool. In GNOME (used by Ubuntu and Fedora), click the network icon in the top right corner, then click the settings icon (gear symbol). This opens the network settings panel where you can see your IP address listed under your active connection.
In KDE Plasma (used by Kubuntu and other systems), right-click the network icon in the system tray and select Connection Information. A window will open showing your IP address and other network details.
These graphical tools show the same information as the terminal commands, just in a point-and-click format. They are useful if you only need to check your IP once and do not want to remember command syntax.
Troubleshooting when you do not see an IP address
If you run ip addr and a device shows no inet line, that device is not connected to a network. For a wired connection, check that the cable is plugged in. For wireless, make sure you are connected to a network — you should see the network name in your system tray.
If a device is plugged in or connected but still shows no IP address, it may not have received one from your router yet. Wait a few seconds and run ip addr again. If it still does not appear, try unplugging the cable or disconnecting and reconnecting to the wireless network.
On some systems, you may need to restart the network service. Use the command sudo systemctl restart networking (on Debian-based systems like Ubuntu) or sudo systemctl restart network (on Red Hat-based systems like Fedora). This forces your machine to ask the router for a new IP address.
Frequently Asked Questions
What is the difference between 127.0.0.1 and my actual IP address?
127.0.0.1 is the loopback address — it is your machine talking to itself. Your actual IP address (like 192.168.1.100) is what other devices on your network use to reach you. You will see 127.0.0.1 listed under the lo device and can ignore it.
Why do I have multiple IP addresses listed?
You may have multiple network devices (wired and wireless, for example), or you may have both IPv4 and IPv6 addresses. Each device can have its own IP address. Only the ones marked UP are currently active. The others are either disabled or not connected.
How do I know if my IP address is static or dynamic?
A static IP stays the same every time you restart. A dynamic IP changes periodically or when you reconnect. To check, write down your current IP, restart your machine, and run ip addr again. If the address is the same, it is static. If it changed, it is dynamic. Most home networks use dynamic addresses.
Can I change my IP address from the terminal?
Yes, but it requires editing network configuration files or using commands like ip addr add. This is beyond basic checking and usually requires administrator (sudo) access. Most users should not need to do this — your router assigns addresses automatically.
What does the number after the slash mean in an IP address?
That number is the subnet mask in CIDR notation. For example, /24 means your network can have 254 usable addresses. You do not need to change or understand this number for basic network use — it is just how your network is divided up.