How to find your IP address on Linux
Your PC's IP address is a number that identifies your computer on a network — like a mailing address for data. On Linux, you can see it in seconds using the command line. The fastest method is to open a terminal and type a single command that shows your address when ready.
You do not need special permissions or software. Linux includes the tools built in. The command you use depends slightly on which Linux version you have, but the most common one works on nearly every system.
Key Takeaways
- Your IP address appears when ready when you type ip addr show or ifconfig into a terminal — no installation needed.
- The address you see starting with 192.168 or 10. is your local IP, used only on your home or office network.
- If you need the address your internet provider assigned you, that is your public IP, which is different and requires a different command.
- The terminal is faster and more reliable than clicking through menus, and the same command works the same way every time.
Opening a terminal on your Linux desktop
A terminal is a text window where you type commands. On most Linux desktops, you can open one by right-clicking on the desktop background and selecting "Open Terminal" or "Open in Terminal". If that option does not appear, look in your applications menu — it is usually called "Terminal", "Konsole", "GNOME Terminal", or "XTerm" depending on which desktop you use.
Once the terminal window opens, you will see a prompt — usually a line ending with a dollar sign ($) or hash mark (#). This is where you type. Click in the window to make sure it is active, then type the command below.
Viewing your local IP address with ip addr show
Type this command and press Enter:
ip addr show
The terminal will display a list of all network connections on your PC. Each one starts with a number (1, 2, 3) and a name like eth0, wlan0, or enp0s3. Look for the section labeled inet — that line holds your local IP address. It will look like 192.168.1.50 or 10.0.0.25. That is your address on your local network.
Ignore the line labeled inet6 — that is a different type of address used less often. Also ignore the entry labeled lo (loopback), which is your PC talking to itself and always shows 127.0.0.1.
Using ifconfig if ip addr show does not work
Older Linux systems sometimes do not have the ip command. If you type ip addr show and the terminal says "command not found", try this instead:
ifconfig
This command shows similar information in a slightly different format. Look for the line labeled inet addr: or just inet — the number next to it is your local IP address. Again, skip any line labeled inet6 and skip the lo section entirely.
Both commands show the same information. Use whichever one your system accepts. Most modern Linux systems prefer ip addr show, but ifconfig still works on nearly all of them.
Finding your public IP address
The address you just found (192.168 or 10.) is your local IP — it works only inside your home or office network. Your internet provider also assigned you a different address called your public IP, which the rest of the internet sees.
To see your public IP from the terminal, type:
curl ifconfig.me
The terminal will display a single number — that is your public IP. This command reaches out to a website that reports back what address it sees you coming from. If curl is not installed, try wget instead:
wget -qO- ifconfig.me
Your public IP changes periodically (usually when your modem restarts), while your local IP stays the same as long as you stay on the same network.
Understanding what you are looking at
When you run ip addr show, you see multiple network connections because most PCs have more than one. Your computer might have an Ethernet port (wired connection), a WiFi card, and a virtual network for other purposes. Each one gets its own section in the output.
The one you want is the one that is actually connected. Look for the word UP in the line with the connection name — that means it is active. If a connection shows DOWN, it is not in use right now. Your active connection will have an inet line with an IP address next to it.
If you have both Ethernet and WiFi connected at the same time, you will see two inet addresses. Your PC uses one as the primary route (usually Ethernet if both are plugged in). Both are valid local addresses for your computer.
Frequently Asked Questions
Why do I see 127.0.0.1 when I run the command?
That is the loopback address — your PC's way of talking to itself. Ignore it. Keep looking through the output for an address starting with 192.168, 10., or 172.16. That is your real local IP.
My IP address starts with 169.254. Is that normal?
That means your PC is not connected to a working network. Your computer assigned itself a temporary address because it could not reach a router or DHCP server. Check that your Ethernet cable is plugged in or that you are connected to WiFi, then run the command again.
Can I make my IP address stay the same?
Your local IP can change if you disconnect and reconnect to the network. To keep it fixed, you can set a static IP in your network settings, but that is a separate task. For most home users, the address changing occasionally does not matter.
Do I need to be an administrator to see my IP address?
No. Any user account can run ip addr show or ifconfig without special permissions. These commands only read information — they do not change anything on your system.
What if the terminal says permission denied?
That should not happen with these commands. If it does, make sure you typed the command exactly as shown, with no extra spaces or capital letters. If the problem continues, try opening the terminal again or restarting your PC.