Add newly assigned IP addresses

To add newly assigned IP addresses from SSH, follow this procedure:

(Please follow the steps given below only on a Centos / Fedora.)

  • Login to your server with SSH as root.
  • Go to the /etc/sysconfig/network-scripts directory.
cd  /etc/sysconfig/network-scripts/
  • Verify which interface you will use to add IP addresses. Typically, this will be eth0 for public IP addresses.

/sbin/ifconfig

  • Make a copy of ifcfg-eth0 for each IP you wish to add and name them as ifcfg-eth0:0, ifcfg-eth0:1 etc.
cp ifcfg-eth0 ifcfg-eth0:0 
cp ifcfg-eth0 ifcfg-eth0:1 
cp ifcfg-eth0 ifcfg-eth0:2 
cp ifcfg-eth0 ifcfg-eth0:3 
cp ifcfg-eth0 ifcfg-eth0:4
  • Open each of them and change the fields DEVICE, .IPADDR and NETMASK accordingly.
  • Restart the network:
/etc/init.d/network restart

Leave a Reply

You must be logged in to post a comment.