If you’re a student or new user and need to understand how your computer is connected to the network, getting the system’s IP address information can be crucial. When it comes to IP addresses, there are two basic types. Private and Public addresses. Private IP addresses are reserved for internal use only and are not route-able across the Internet. This means, if your computer is assigned a private IP address, no one will be able to connect to it from across the Internet directly. A public IP address is unique and is assigned to each device that is connected to the internet. They are publicly route-able. There are also two types of private and public IP addresses: IPv4 and IPv6. I am not going to go too deep into networking here. but the IP address ranges below are reserved for internal usage only.

10.0.0.0/8 172.16.0.0/12 192.168.0.0/16

Now that you know the basics, continue below to learn how to find out or determine your IP addresses on Ubuntu

Use the IP addr | hostname -I Commands

There are multiple ways one can determine their IP addresses on the Ubuntu system. A common command to find out your system IP is to use the ip addr command. This command only displays your private IP addresses. To use it, run the commands below You should see a similar screen as shown below: The highlighted line is the system’s private IP address You can also use the hostname -I command to find out the system IP address. to use it, run the commands below The commands above display a single line with your IP address Now that you know how to find out your private IP addresses, use the options below to determine your public IP address.

Use the dig | curl Commands

If you want to know your public IP address, then you can simply go to Google.com and type in “what’s my IP” Google will tell you your public IP address. If you can’t use a browser to determine your public IP, then use the commands below. Some DNS providers such as OpenDNS and Google allow you to query their servers to obtain your public IP address information. Not all DNS providers will allow that, but the ones below will provide your public IP. You can use any of the dig commands below to determine your public IP address. The commands above should display your public IP. If you have curl or wget installed, you can use these as well. That should do it! Congratulations! You have learned how to determine your private and public IP addresses on Ubuntu systems.