Every computer, whether server or client, connected to the Internet has an assigned IP address and communicates with other services using the TCP/IP protocol. In this tutorial, we will learn how to find out public and private IP addresses on Rocky Linux. You can find out your IP address either through the terminal or through a GUI option. So let’s get started. The same commands work on other RHEL-based Linux distributions like AlmaLinux and CentOS too.

Find the Public IP address on Rocky Linux

Here is a list of commands and services that can be used to get your external IP address. Just paste one of the on the command line to get the IP.

  • curl ifconfig.me
  • curl icanhazip.com
  • curl ipinfo.io/ip
  • curl api.ipify.org
  • curl checkip.dyndns.org
  • dig short myip.opendns.com @resolver1.opendns.com
  • host myip.opendns.com resolver1.opendns.com
  • curl ident.me
  • curl bot.whatismyipaddress.com
  • curl ipecho.net/plain

Check Private IP Address via Terminal

To find out your system IP address through the terminal, open up the terminal and type the following command:

# ifconfig
# ip addr show
# ip a

You can use any one of the following commands to view your system IP address.

<img alt="Get Internal IP address" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/04/echo/word-image-68.png62552fb1b6542.jpg" data-ez ezimgfmt="rs rscb10 src ng ngcb10 srcset" height="286" src="data:image/svg xml,” width=”736″>

As you can see network adapter ens33 with IP address 192.168.40.130/24 is assigned to my system.

Check Private IP Address via GUI

For this option, you must have GUI installed on your System. Now login to your system and type Settings in the search bar and click:

<img alt="Open settings" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/04/echo/word-image-69.png62552fb1d2f81.jpg" data-ez ezimgfmt="rs rscb10 src ng ngcb10 srcset" height="221" loading="lazy" src="data:image/svg xml,” width=”600″>

The sidebar appears on your left side, navigate to the Network tab. After that click on the icon which was highlighted, to view system IP address as shown in the figure:

<img alt="Network settings" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/04/echo/word-image-70.png62552fb2427dd.jpg" data-ez ezimgfmt="rs rscb10 src ng ngcb10 srcset" height="519" loading="lazy" src="data:image/svg xml,” width=”798″>

Now you can see your system IP address which is 192.168.40.130.

<img alt="IP address" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/04/echo/word-image-71.png62552fb27f6a4.jpg" data-ez ezimgfmt="rs rscb10 src ng ngcb10 srcset" height="302" loading="lazy" src="data:image/svg xml,” width=”577″>

Conclusion

In this tutorial, we learned how to find out your Public IP address using curl, host, and dig. We also saw how to find a system’s internal Private IP address using CLI and GUI in Rocky Linux 8.Advertisement