This wikiHow teaches you how to view your private and public IP addresses on a Linux computer.
Step
Method 1 of 2: Finding Private IP Address
Step 1. Understand the right time to use this method
If you want to find your computer's IP address over your own WiFi network (eg when you want to forward your router to your computer), you'll need to know the private IP address.
Step 2. Open Terminal
Click or double-click the Terminal program icon, or press the keyboard shortcut Ctrl+Alt+T to display the Terminal window.
Step 3. Enter the “Show IP” command
Type ifconfig into the Terminal window. Some other commands you can try are:
- ip addr
- ip a
Step 4. Press Enter key
After that, the command will be executed and the IP address information of any devices connected in the network (including your computer) will be displayed.
Step 5. Find your computer title
You can usually find your computer's private IP address information under the " wlo1 " (or " wlan0 ") heading, to the right of the " inet " tag.
Step 6. View the computer's private IP address
The IPv4 address is to the right of the " inet " marker. This is the private IP address of the computer on the currently connected network.
You can usually see the IPv6 address next to the " inet6 " marker. IPv6 addresses are typically used less frequently than IPv4 addresses
Step 7. Try the command " hostname"
On some versions of Linux (eg Ubuntu), you can display your computer's IP address by typing hostname -I (uppercase "i" instead of lowercase "L") and pressing Enter.
Method 2 of 2: Finding a Public IP Address
Step 1. Understand when this method needs to be followed
A public IP address is the address that websites and services see when you access them from your computer. If you want to contact a computer via a remote connection on a different network, you need a public IP address.
Step 2. Open Terminal
Click or double-click the Terminal program icon, or press the keyboard shortcut Ctrl+Alt+T to display the Terminal window.
Step 3. Enter the public IP address display command
Type curl ifconfig.me into the Terminal window. This command serves to retrieve the public IP address of the website.
Step 4. Press Enter key
The command will be executed immediately.
Step 5. Wait for your public IP address to be displayed
The IP address displayed under the command you entered is the public IP address for your network.