How to Check Your IP Address in Ubuntu: Complete Guide for Beginners and Advanced Users

1. Introduction

When using Ubuntu, there are situations where you need to check your IP address, such as troubleshooting network connections or managing servers. An IP address is essential information used to identify devices on the internet or a local network. This article clearly explains various ways to check your IP address in Ubuntu, suitable for both beginners and advanced users.

2. What Is an IP Address?

An IP address is a unique number used to identify computers and devices on the internet or within a local network. Every device connected to the internet is assigned an IP address, which is required to communicate with external networks. There are two types of IP addresses:

  • Public IP Address: An address used to identify a device on the internet. It is provided by your ISP (Internet Service Provider) and used for external access.
  • Private IP Address: An address used within a local network, such as in homes or offices. It cannot be directly accessed from the internet and is used for internal communication between devices.

Additionally, IP addresses can be classified as dynamic or static. A dynamic IP address changes every time the device connects to the network, while a static IP address is manually configured and does not change.

3. Checking the IP Address Using the Command Line

The most efficient way to check your IP address in Ubuntu is through the terminal. This method is especially useful in server environments or when working remotely.

1. Using the ip Command

You can display network information, including IP addresses, by running the following command:

ip addr show

The output includes multiple network interfaces, each showing IPv4 and IPv6 addresses. The line containing inet represents the IPv4 address, while inet6 represents the IPv6 address.

If you want to display only IP information concisely, use the -br option:

ip -br addr

2. Using the ifconfig Command

Older versions of Linux used the ifconfig command to check IP addresses. On newer Ubuntu versions, you must install net-tools to use it.

sudo apt install net-tools
ifconfig

Running this command displays detailed information for each interface.

4. Checking via the GUI (Graphical User Interface)

For beginners or those unfamiliar with the command line, Ubuntu also provides a GUI-based method to check IP addresses. This visual and intuitive approach is suitable for many desktop users.

Step 1: Open Network Settings

On the Ubuntu desktop, click the network icon in the upper-right corner of the screen, then select “Network Settings.”

Step 2: View Detailed Information

In the Network Settings window, select the active network connection (Wi-Fi or wired), and click “Connection Information.” Here, you can view both IPv4 and IPv6 addresses.

5. How to Check Your Public IP Address

A public IP address is used to identify your device on the internet. It is assigned by your ISP and allows other servers and services to recognize your device.

Command to Check

You can easily display your public IP address by running the following command:

curl ifconfig.me

This command shows the public IP address visible from the internet.

6. Differences Between Public and Private IP Addresses

Understanding the difference between public and private IP addresses helps improve your knowledge of networking.

  • Public IP Address: Visible to other users and services on the internet. It enables external access such as web servers, online games, and remote connections.
  • Private IP Address: Used within home or corporate networks and cannot be accessed directly from the internet. Devices such as PCs and printers use this address for internal communication.

7. Summary

This article introduced various methods to check your IP address in Ubuntu using the command line and GUI tools. GUI-based methods are recommended for beginners, while command-line tools are ideal for server administrators and remote workers. Use the method that suits your environment to quickly check your IP address and efficiently resolve network issues.

8. FAQ: Frequently Asked Questions

Q1: Why do multiple IP addresses appear?
A: If your device has multiple network interfaces (such as Wi-Fi and wired connections), each may have its own IP address.

Q2: How can I change my IP address?
A: To configure a static IP address, manually edit your netplan settings and run sudo netplan apply.

Q3: How can I keep my public IP address private?
A: Using a VPN hides your public IP address and helps protect your privacy online.