This article will show you how to find the private and public IP address of a Linux computer.
Steps
Method 1 of 2: Find a Private IP Address
Step 1. Know when to use this method
If you need to find the IP address of a computer on a wireless network (for example, to redirect your computer's router), you need a private IP address.

Step 2. Start the terminal
Click or double click on the terminal icon or just press Ctrl + Alt + T.

Step 3. Enter the command to display the private IP address
Enter ifconfig in a terminal window. Other commands you can use:
- ip addr
- ip a

Step 4. Press ↵ Enter
The command will be executed, and the screen will display the IP addresses of all network elements, including your computer.

Step 5. Find the line with the computer's IP address
Typically this is a string with "wlo1" (or "wlan0"), with an "inet" tag to its right.

Step 6. Find your private IP address (IPv4 address)
It is located to the right of the "inet" tag. This is the IP address of a computer on the current network.
The IPv6 address can be found next to the "inet6" tag. IPv6 is not as widespread as IPv4

Step 7. Try entering the "hostname" command
On some versions of Linux, such as Ubuntu, you can find the IP address of your computer by typing hostname -I (this is an uppercase "i", not a lowercase "L") and pressing ↵ Enter.
Method 2 of 2: Find a Public IP Address
Step 1. Know when to use this method
A public IP address is the address that websites and online services “see” when you open them on your computer. If you want to connect to your computer from another computer that is on a different network, you will need a public IP address.

Step 2. Start the terminal
Click or double click on the terminal icon or just press Ctrl + Alt + T.

Step 3. Enter the command to display the public IP address
Enter curl ifconfig.me in terminal. This command will get the public IP address from the website.

Step 4. Press ↵ Enter
The command will be executed.

Step 5. Find your public IP address
The IP address that appears under the entered command is the public IP address of your network.