How to Check IP Address on Linux

Author: Laura McKinney
Date Of Creation: 1 August 2021
Update Date: 1 July 2024
Anonim
How to Find Your IP Address in Linux Terminal
Video: How to Find Your IP Address in Linux Terminal

Content

This article shows you how to view a private and public IP address of a Linux-based computer.

Steps

Method 1 of 2: Find your public IP address

  1. Know when to use this method. Your public IP address is the information that websites and services see when you access them from your computer. If you want to connect to your computer via a remote connection that doesn't have the same network, you need a public IP address.

  2. Open Terminal. Double-click the Terminal application icon or press a combination of keys Ctrl+Alt+T to open a Terminal window.

  3. Enter a public IP command. You will enter commands curl ifconfig.me enter the Terminal window. This is a command to get your public IP address from a website.
  4. Press ↵ Enter. This deploys the command.

  5. Wait for your public IP address to show up. The IP address shown below the command you entered is the public IP address for your network. advertisement

Method 2 of 2: Find your private IP address

  1. Know when to use this method. If you want to find your computer's IP address in a Wi-Fi network (for example, when you want to forward your router to your computer), you'll need to know the private IP address.
  2. Open Terminal. Click or double-click the Terminal application icon or press a key combination Ctrl+Alt+T to open a Terminal window.
  3. Enter the command "Show IP". Enter an order ifconfig enter the Terminal window. Here are a few more commands you can try:
    • ip addr
    • ip a
  4. Press the key ↵ Enter. This will deploy the command and display the IP address information of every device connected to the network, including your computer.
  5. Find the title of the computer. Your computer's information is usually displayed below the "wlo1" heading (or "wlan0"), just to the right of the "inet" tag.
  6. View private IP address information. The IPv4 address is displayed to the right of the "inet" tab. This is the IP address of the computer on your current network.
    • You can see the IPv6 address next to the "inet6" tag. IPv6 addresses are less commonly used than IPv4 addresses.
  7. Try the command "hostname". On some versions of Linux, such as Ubuntu, you can see your computer's IP address by entering a command hostname -I (this is a capital "i", not a lowercase "L") and press the key ↵ Enter. advertisement

Advice

  • A private IP address is a number dedicated to your computer in a wireless network, and a public IP address is an address for your network.

Warning

  • Avoid sharing a computer's public IP address.