How to Check IP Address in Ubuntu
Checking your IP address in Ubuntu is a fundamental task whether you are troubleshooting network connectivity or setting up a local server. This article provides a quick guide on how to find both your local (internal) IP address and your public (external) IP address using the terminal and the graphical user interface (GUI).
Method 1: Using the Ubuntu Terminal (Local IP)
The fastest way to find your local IP address is through the command line. You can open the terminal by pressing Ctrl + Alt + T.
- The
ipCommand: This is the modern and recommended tool for network configuration in Ubuntu. Type the following command and press Enter:
ip aLook for your active network interface (usually eth0 for
wired ethernet or wlan0/wpn0s20f3 for Wi-Fi).
Your local IP address will be listed next to the word
inet. * The hostname
Command: If you want a cleaner output that only shows the IP
addresses assigned to the machine, use:
hostname -IMethod 2: Using the Graphical User Interface (Local IP)
If you prefer not to use the command line, Ubuntu allows you to view your network details easily through the desktop settings.
- Open the Settings menu by clicking the network icon in the top right corner of the screen and selecting Settings.
- In the left sidebar, click on Network (if you are on a wired connection) or Wi-Fi.
- Click the gear icon next to your active network connection.
- A window will pop up showing your connection details, where your local IP address will be displayed on the IPv4 Address line.
Method 3: Finding Your Public IP Address
The methods above show your address within your local network. If you need to find your public IP address—the address the rest of the internet sees—you can query an external server via the terminal.
Run either of the following commands:
curl ifconfig.mecurl icanhazip.comIf curl is not installed on your system, you can install
it using sudo apt install curl, or simply open a web
browser and search for “What is my IP”.