We use cookies to improve our services and provide a better experience. By continuing to use this site, you agree with our Cookies Policy.

Tutorials
More than 400 step-by-step articles to guide you through online project development.
HomeTutorialsOperating SystemsLinuxAdministration

How to Add IP Address on CentOS Operating Systems?

Brazil VPS
USA VPS
OpenVZ VPS
Linux Cloud Server
KVM VPS
Windows Cloud Server
Linux KVM Hosting
cPanel KVM
Ubuntu VPS
Germany Cloud Servers
Follow These Steps to Add IP Adress on CentOS

To add a new IP into your environment you firstly need to locate network configuration directory. To access it use:

1
cd /etc/sysconfig/network-scripts/

To add new IP first you need to copy ifcfg-eth0 file by creating new file ifcfg-eth0:0. Use following command:

1
cp ifcfg-eth0 ifcfg-eth0:0

Now it’s time to edit the file you’ve copied. Enter:

1
vi ifcfg-eth0:0

This command will open the file with Linux text editor (if you prefer another text editor you can choose nano). Look at the lines which should be in the file and the changes which should be applied:

DEVICE=”eth0″ change into DEVICE=”eth0:0″
IPADDR= 195.144.5.24 contains the IP which you want to add
NETMASK=255.255.255.0 for example if you have IP from /24 subnet then netmask will be 255.255.255.0

GATEWAY=195.144.5.1 also include the gateway

To save the changes enter:

1
:wq

Make sure that all configurations are correct and after adding required IP restart the network by using the following command:

1
/etc/init.d/network restart

That’s it. You’ve added a new IP address to your server with CentOS.

Germany Cloud Servers
Brazil VPS
KVM VPS
Ubuntu VPS
OpenVZ VPS
USA VPS
Windows Cloud Server
cPanel KVM
Linux KVM Hosting
Linux Cloud Server
Rate this Tutorial:
No Comments

Other (3)

Popular Keywords