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.

ip a

Look 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 -I

Method 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.

  1. Open the Settings menu by clicking the network icon in the top right corner of the screen and selecting Settings.
  2. In the left sidebar, click on Network (if you are on a wired connection) or Wi-Fi.
  3. Click the gear icon next to your active network connection.
  4. 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.me
curl icanhazip.com

If 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”.