An IP address is like your physical mailing address. Once you connect a Linux distribution like Ubuntu to the internet or a router, your system is assigned two IP addresses. There's the private one, which is used to identify your device on an internal network, and the public IP address, which is what websites see when you connect.
Knowing your IP address on Linux is important in case you have network problems or if you're on the phone with an IT administrator and they need to connect remotely. The good news is that Ubuntu makes it easy to view your IP address. You can use the Terminal or the graphical user interface (GUI) Settings app.
Find a private IP address using the GUI
Checking for a private IP address using the GUI on Ubuntu is easy.
- Open Settings.
- Click network in the sidebar. (If you are connected to Wi-Fi, select Wi-Fi.)
- Click on the Settings Equipment next to the network you are connected to
You will see your IP address listed under “IPv4 address”.
Use the terminal to find a private IP address
If you want to find a private IP address on Ubuntu using the command line interface (CLI), only one command is required.
- Open terminal.
- Load network information:
ip a
This command will load all available network interfaces. Check the interface you are connected to. The IP address will be listed below.
Use the terminal to find a public IP address
To search for a public IP address using Terminal, you need to have curl installed and run a single command. Follow these steps:
- Open terminal.
- Install Lure:
sudo apt install curl
- Use Curl to check the private IP address:
curl ifconfig.me
Find a public IP address using the GUI
You can check a public IP address on Ubuntu using a web browser of your choice.
- Open your Web browser. (Firefox should be preinstalled.)
- Visit whatsmyip.org.
You should see your IP address listed at the top of the website.
Next steps and more
Knowing your IP address allows you to dive into more advanced settings. For example, you may want to use a static internal IP address, but this is just one setting that can be changed. Ubuntu is an open-source and highly customizable operating system, giving you plenty of scope to make further changes.