To view the IP addresses currently assigned to your NIC by command
# ip addr
The above command displays the information such as the current IP address, netmask, gateway and broadcast addresses as follows
Several interfaces may be configured. The one that we will focus on for this guide is the second interface entitled eth0 (on your system the interfaces might have a different name, such as eth0, eth1, p2p1 etc)
Adding additional IP to network interface
the interface config files are located in /etc/sysconfig/network-scripts/ and they are all prefixed with ifcfg-eth0, edit the file using vi command
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
The output may look like the following:
“IPADDR” is the initial IP address that is assigned to your server, to add an additional IP address, simply add a line below that titled IPADDR1
Save and exit the editor, the changes will effect only after restarting network services.
To restart network service use below command
# systemctl restart network
Once the network has been restarted successfully, you should be able to ping that new IP address.