Methods to Find Your Private IP Address in CentOS 8 ?

This article will guide you on the different methods to find the private IP address in CentOS 8.

Different ways to display IP addresses in Centos:

1. Using ifconfig command. The ifconfig command is the most commonly used command for displaying and modifying IP addresses on the system.

2. Using ip command.

3. Using the hostname command.

4. using nmcli command.

5. Using ip route show command.

To configure a static IP address on CentOS 7 / RHEL 7:

1. Create a file named /etc/sysconfig/network-scripts/ifcfg-eth0 as follows:

2. DEVICE=eth0.

3. BOOTPROTO=none.

4. ONBOOT=yes.

5. PREFIX=24.

6. IPADDR=192.168.x.xxx.

7. Restart network service: systemctl restart network.

Commands will get you the private IP address of your interfaces:

i. ifconfig -a.

ii. ip addr (ip a)

iii. hostname -I | awk '{print $1}'

iv. (Fedora) Wifi-Settings→ click the setting icon next to the Wifi name that you are connected to → Ipv4 and Ipv6 both can be seen.

v. nmcli -p device show.