Additional ip address can be added to centos server.There are two ways we can add ip depending on whether network interface is controlled by network manager or not.Lets check if network manager is controlling the interface or not.Issue the following command to check the interface name.

ip addr show

Now issue the following command to check network manager is controlling the interface or not.

 grep "NM_CONTROLLED" /etc/sysconfig/network-scripts/ifcfg-enp0s3

As you can see the output

NM_CONTROLLED=”yes”

which means network interface is controlled by network manager.Now follow the step to add the additional ip address.

Type following command

nmtui

Select Edit a connection

then select Edit

Then click Add and add the desire ip address

As you can see in image we have added ip address 192.168.43.138

Now click OK and Quit

Now reboot your server check the new ip with following command

ip addr show

Above procedure is true if Network manager is controlling the interface.

But in case network interface is not controlled by network manager follow the below steps.

cp /etc/sysconfig/network-scripts/ifcfg-enp0s3  /etc/sysconfig/network-scripts/ifcfg-enp0s3:1

Edit the ifcfg-enp0s3:1 file

 vi /etc/sysconfig/network-scripts/ifcfg-enp0s3:1

change the IPADDR field with desire ip

ex:-

IPADDR=192.168.43.138

Save the file and reboot the system now you have successfully added the additional ip address.

Was this article helpful?
YesNo

Comments

  1. Natividad

    Thanks for your marvelous posting! I actually enjoyed reading it, you happen to be a great author. I will remember to bookmark your blog and will often come back from now on. I want to encourage continue your great writing, have a nice day!|

  2. Jovan

    I love what you guys are up too. Such clever work and reporting! Keep up the fantastic works guys I’ve incorporated you guys to my personal blogroll.|

Leave a Reply

Your email address will not be published. Required fields are marked *