Adding Multiple IP Addresses in CentOS 7

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.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to add IP Address to servers

1.Login to the server via RDP. 2.In the Run window type NCPA.CPL. 3.In the network properties...

How to configure IP's on Ubuntu 18?

To configure a static IP address on your Ubuntu 18.04 server you need to modify a relevant...

How to install Wordpress in webmin

  The following steps are followed for installing Wordpress in Webmin   Open File Manager in...

How to install Webmin in CentOs

  Installing webmin using YUM repository Create a .repo file using a command # nano...

How to install Virtualmin in webmin

  Steps for Installing Virtualmin on Webmin (Ubuntu):   Setting the hostname and FQDN For...

Powered by WHMCompleteSolution