PDF download Download Article PDF download Download Article

This wikiHow teaches you how to view your computer's private and public IP addresses on a Linux computer.

Method 1
Method 1 of 2:

Finding Your Public IP Address

PDF download Download Article
  1. The public IP address is what websites and services see when you access them from your computer. If you want to try to connect to your computer via a remote connection that isn't on the same network, you'll need the public IP address.
  2. Click or double-click the Terminal app icon, or press Ctrl + Alt + T to bring up the Terminal window.
    Advertisement
  3. Type curl ifconfig.me into the Terminal window. This command retrieves your public IP address from a website. [1]
  4. Doing so runs the command.
  5. The IP address that appears below the command you entered is the public IP address for your network.
  6. Advertisement
Method 2
Method 2 of 2:

Finding Your Private IP Address

PDF download Download Article
  1. If you're trying to find the IP address of your computer within your Wi-Fi network (e.g., if you want to forward your router for your computer), you'll need to know the IP address.
  2. Click or double-click the Terminal app icon, or press Ctrl + Alt + T to bring up the Terminal window.
  3. Type ifconfig into the Terminal window. Other commands you can try include the following:
    • ip addr
    • ip a
  4. Doing so runs your command and displays the IP address information of any network items, including your computer.
  5. You'll usually find your computer's information under the "wlo1" (or "wlan0") heading, just right of the "inet" tag.
  6. The IPv4 address is to the right of the "inet" tag. This is the IP address of your computer on your current network.
    • You can usually see the IPv6 address next to the "inet6" tag. The IPv6 address is less commonly used than the IPv4 address.
  7. On some Linux versions, such as Ubuntu, you can bring up your computer's IP address by typing in hostname -I (that's a capital "i", not a lower-case "L") and pressing Enter .
  8. Advertisement


Community Q&A

Search
Add New Question
  • Question
    What is an IP address?
    Pingu
    Top Answerer
    It is a label that consists of four numbers separated by dots. Every computer with an internet connection is assigned an IP address. It is used so that computers can connect to each other. If you write the name of a web page into your browser's address bar, it actually looks up what IP that name refers to and then connects with that IP.
  • Question
    How can I find someone else's IP address using my own device?
    Pingu
    Top Answerer
    If the device the IP of which you're trying to find has a domain name, you can use the "nslookup" function. So for example, "nslookup google.com" would give you the IP address of one of Google's servers. If it doesn't, and the device connected to your device at some time, one of the many logs (located at /var/log) can contain its IP address. Other than that, there is no way to find someone else's IP address from your device, but you can use theirs.
  • Question
    What would I enter at the command prompt (terminal) on a Linux system to display a list of files and sub directories that exist within the present working directory?
    Somone
    Community Answer
    You can type "ls" (without quotes) to list the files and directories in the present working directory and "ls -a" to list everything, including all hidden files.
Ask a Question
      Advertisement

      Tips

      • Your private IP address is the number assigned to your computer within your wireless network, while your public IP address is the address assigned to your network.
      Submit a Tip
      All tip submissions are carefully reviewed before being published
      Thanks for submitting a tip for review!
      Advertisement

      Warnings

      Advertisement

      About This Article

      Article Summary X

      To check your public IP address in Linux, start by clicking the Terminal app icon or simultaneously pressing “Control,” “Alt,’ and “T” to bring up the Terminal window. Once the Terminal window is open, enter the public IP command "curl ifconfig.me" to retrieve your address from a website. Press “Enter” to run the command, and wait for your public IP address to appear. Alternatively, to find your private IP address, bring up the terminal window and enter the Show IP command "ifconfig." Press Enter to run your command and display the IP address information of any network items, including your computer. In order to find your computer’s heading, look under the “wlo1” heading and review the private IP address. To learn how to use the “hostname” command to bring up your computer’s IP address, keep reading!

      Did this summary help you?
      Thanks to all authors for creating a page that has been read 24,126,002 times.

      Reader Success Stories

      • Roland Weber

        Sep 6, 2016

        "It's great to have several different terminal commands to choose from. I used to call ifconfig, but that ..." more
      Share your story

      Is this article up to date?

      Advertisement