how to

How do I find my IP address in the Ubuntu terminal command line

 

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 numeric label assigned to each device connected to a computer network that uses the Internet Protocol to communicate. An IP address has two primary functions: identifying a host or network interface and addressing a location.

IP addresses are recorded 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 an address’s routing prefix is ​​indicated in CIDR notation by adding a number of significant bits to the address, such as 192.168.1.15/24, which is equivalent to the historically used subnet mask of 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 a 128-bit IP address, was standardized in 1998.

Find your IP address – GUI method

Find your internal (network) IP address

  1. Open the activity overview and start typing Network.
  2. Click Network to open the panel.
  3. Select your connection: Wi-Fi or wired in the left panel.
  4. The IP address for the wired connection will be displayed on the right.
  5. Click the settings button to see your wireless network IP address in the details panel.

Find your IP address – Terminal commands

The easiest way to find out the internal IP address is to use the ip command in a terminal. Just open a terminal and run the following command:

$ ip a

or

$ ip address

The ip command is used to display or manage routing, devices, routing policies, and tunnels in the system. The “address” command option is used to display the IP address or IPv6 address on the device.

You can also use other commands to find the 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 on the Internet to locate computer systems and devices. The external IP address is for accessing the public Internet through the router, while the internal IP address is for 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

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button