6 ways to find your private IP address in CentOS 8

Private IP addresses are used to communicate within the local network. Private IP addresses cannot be routed, and therefore, traffic from the external network cannot be sent to them. There may be a time when you need to know the private IP address of your system, for example, to configure a network application, to enable remote administration, or to troubleshoot, etc. In our previous posts, we shared with you some ways to find a private IP address on Ubuntu and Debian OS.

In this post, we will describe some methods for finding a private IP address in CentOS 8. These methods include methods from both the command line and the GUI.

The following are the IP address ranges defined by the IANA:

10.0.0.0/8=10.0.0.0 – 10.255.255.255
192.168.0.0/16=192.168.0.0 – 192.168.255.255
172.16.0.0/12=172.16.0.0 – 172.31.255.255

6 Ways to Find Private IP Address in CentOS 8

Method # 1: “ip” command

The most common way to find an IP address on CentOS is using the “ip” command. Just enter ip followed by the “addr” or “a” option:

$ ip a

or

$ ip addr

This command will display all network interfaces along with their corresponding private IP addresses.

Method # 2: “ifconfig” command

The ifconfig command is also used to find a private IP address. To use this command, just enter the ifconfig command in the terminal:

$ ifconfig

If running the above command gives you a command not found error, you need to first install net-tools as follows:

$ sudo yum -y install net-tools

Once installed, you can use it to find your private IP address.

This command will display all network interfaces along with their corresponding private IP addresses.

Method # 3: Command “hostname”

The “hostname” command is commonly used to find the hostname of a system. However, using the hostname command with the -l option will give you IP address information.

$ hostname -I

Method # 4: “nmcli” command

“Nmcli” is a command line utility for managing NetworkManager. It can also be used to find the private IP address of your system.

$ nmcli

Method 5: Using the ip route command

The “ip route” command is used to configure and display static routes in Linux OS. This command also shows the private IP address of the system. Run the following command in Terminal to find your private IP address:

$ ip route

In this post, we have described several ways in which you can find a private IP address on CentOS 8. If you know of some of the other ways we missed to find a private IP address on CentOS, please share with us in the comments!

Please disable your ad blocker or whitelist this site!

Sidebar