How to know the IP address of my computer

The IP of your computer allows you to identify it within a network. Therefore, it will be necessary to know it to make certain network configurations and to allow other equipment and services to connect with your computer. Here's how to find out what the IP is on all your devices.

Public IP vs Private IP

The IP address is a unique identifier number that is assigned to your computer to uniquely identify it when it connects to a network. Something like your ID card. Knowing it is very important and will allow things like accessing content from others in far geographical area from your device.

There are two types of IP address: public IP and private IP. Before starting, it is important to differentiate which one you want to know.

Private IP is the one used by each computer within your local network and allows you to identify the different computers that are connected to it. As a general rule, when you connect your computer to a router, you are assigned a private IP for that network to which you just connected. For example if your router has IP 192.168.0.1 your computer will be assigned IP address in a range from 192.168.0.2 to 192.168.0.254.

The public IP, on the other hand, is the one that is shown to the rest of devices that are outside that network. In this case all the equipment connected to the same router share the same public IP, since it is the router that performs the functions of input/output. Therefore, the IP that is displayed to the web pages and other services on the Internet is not the private IP of your computer, but the public IP address of your router, which is the one that acts as a gateway to the Internet.

How to know the IP of a Windows computer

You can get the private IP address of your Windows computer in several ways.

The most graphic and simple is to right-click the System Networks Tray icon next to the Windows clock, and choose the Open Network and Sharing Center option.

Then click on the Change adapter settings link on the side.

Select the network card you are using and right click on it. Now choose the Status option.

Then a table appears showing the status of the chosen connection. Click the Details button and look for the IPv4 Address line. The series of digits to the right is the private IP address of that computer. In the screen below the IP of the router is 192.168.0.1.

Find the IP address on your Mac

If you use an Apple computer, the task of finding the private IP address of your computer is greatly simplified. As in Windows, there are several ways to know that IP address, one of the easiest is to access System Preferences and, there, click on the Network option.

The Network box is shown below. In the side panel, select the connection you are currently using and, in the Status section of the central box, indicates the status of the connection and the IP address you are using.

It is also specified in the IP Address entry.

How to find out the public and private IP from the terminal

From time to time it is useful to know what is our public IP. Not the private one, with which our computers are seen in the local area network to which we usually connect at home or at work, which is normally assigned by the router via DHCP. The public IP determines, among other things, the country in which we are - hence certain services block us from accessing, like Pandora in the United States, from our IP.

Finding out that IP is usually simple if you use websites like whatismyip.com.

That is not necessary from Linux, since there is a way to ascertain that public IP by making use of the curl command. If you do not have the package installed you will have to install it following the steps (for ubuntu / debian): $ sudo apt-get install curl

The installation process is similar in other distributions, and once with curl installed it will suffice to write in the terminal the following: $ curl ifconfig.me curl

To obtain in a few seconds the public IP with which we are "coming out" to the Internet.

Private IP in Terminal Emulator

Private IP is the one with which we connect to our router. Usually it is always 192.168.0.X although it can vary slightly being 0.X or 2.X, etc.

Find out your private and public IP in Ubuntu

With this IP we can connect and share files within the same network. For example, if you want to share a folder with another computer connected to your network, you need to know the private IP of that computer in order to connect to it. Instead, with this private IP, they will never be able to connect you from outside your network.

Follow these steps:

Open Terminal Window and enter ifconfig. It will display the IP address, subnet mask, default gateway, DNS servers, MAC Address, etc.