Find out the IP address in Linux

Author: Roger Morrison
Date Of Creation: 6 September 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

Regardless of which version of Linux or Unix you are running, there are methods to find out the internal IP address, both using a simple graphical interface and by diving deeper into the network details.

To step

Method 1 of 4: Use the Ubuntu interface

  1. Right-click on the network icon in the notification center. In most distributions, the icon is made up of two vertical arrows pointing up and down, near the date and time stamp.
    • If your network icon is not displayed, you can add it back by right-clicking on the notification center, selecting "Add to Panel" and then "Network Manager".
    • If your network icon is still not shown, navigate to System> Administration> Network Tools and select your network device from the pull-down menu (usually "Ethernet Interface eth0"). The 10-digit number shown is your IP address.
  2. Click on Connection Information. This should open a window with information about your network connections, including your IP address.

Method 2 of 4: Enter a Terminal command (most Linux distros)

  1. Open Terminal. You can find it in your list of applications, or by searching for "terminal".
  2. Enter the following command: ip addr show. This should provide data on every connected ethernet device.
  3. The IP address of each device is displayed after "inet".
    • If you're not sure what device you're looking for, this is probably "eth0", the first ethernet adapter listed. To view only the data of eth0, enter "ip addr show eth0".

Method 3 of 4: Run a Terminal command (Unix, "Unix-like" and some Linux distros)

  1. Open a terminal. You can find it in your list of applications, or by searching for "terminal".
  2. Enter the following command / sbin / ifconfig. This shows a large block of network data.
    • If you get an error about insufficient administrator rights, enter sudo / sbin / ifconfig in.
    • If you are using Solaris or any other Unix version, then you may need to / sbin / ifconfig -a to display the data for multiple devices.
    • If you get the message that your ifconfig has been rejected, see the instructions above for Enter a Terminal command (most Linux distros).
  3. Find the IP address for each device, as indicated after "inet adr".
    • If there is too much information to find your IP address, type / sbin / ifconfig | less to limit the amount of data, or type / sbin / ifconfig | grep "inet addr:" to show only the IP address.
    • If you are not sure which device you are looking for, it is probably "eth0", the first Ethernet adapter recognized. To view only the data for eth0, type / sbin / ifconfig eth0.

Method 4 of 4: Another Terminal command for Ubuntu / Unix / Linux

  1. Open a terminal.
  2. Enter the following command: hostname -I (the uppercase i)
    • If one interface is active, you will get one IP address as a result, without additional information.
      • % hostname -I
      • 192.168.1.20

Tips

  • If you are looking for your external IP address, go to a website such as http://www.whatismyip.org, or google "what is my ip?" For several similar websites.