Command to Find IP Address in Ubuntu Terminal

How to find IP address in Ubuntu terminal? Here are the commands to find internal and external IP address in Ubuntu terminal.

Internet Protocol Address (IP Address)

An Internet Protocol address (IP address) is a numerical label assigned to each device connected to a computer network that uses the Internet Protocol for communication. An IP address serves two main functions: host or network interface identification and location addressing.

IP addresses are written and displayed in human-readable notations, such as 172.16.254.1 in IPv4, and 2001:db8:0:1234:0:567:8:1 in IPv6. The size of the routing prefix of the address is designated in CIDR notation by suffixing the address with the number of significant bits, e.g., 192.168.1.15/24, which is equivalent to the historically used subnet mask 255.255.255.0.

Note: Internet Protocol version 4 (IPv4) defines an IP address as a 32-bit number. A new version of IP (IPv6), using 128 bits for the IP address, was standardized in 1998.

Find Your IP Address – GUI Method

Find your internal (network) IP address

  1. Open the Activities overview and start typing Network.
  2. Click on Network to open the panel.
  3. Choose which connection, Wi-Fi or Wired, from the left pane.
  4. The IP address for a wired connection will be displayed on the right.
  5. Click the settings button to see the IP address for the wireless network in the Details panel.

Find Your IP Address – Terminal Commands

The easiest method to find the internal IP address is by using the ip command in terminal. Simply open terminal and run the following command:

$ ip a

or

$ ip address

The ip command is used to show or manipulate routing, devices, policy routing and tunnels on the system. The command option “address” is used to show the IP or IPv6 address on a device.

You can also use other commands to find IP address:

$ ifconfig

Or

$ hostname -i

Or

$ ip addr show

Find Your External IP Address – GUI Method

An external or public IP address is used across the Internet locating computer systems and devices. The external IP address is for accessing the public Internet via the router, whereas the internal IP address is specific to the home network.

Run the following command to find the external IP address:

$ curl -w "n" -s https://api.ipify.org

Or

$ curl ifconfig.me

Original Article

Spread the love

Leave a Comment