How setup additional IP address

Additional IP addresses (Host)

Setting up additional single IPv4 addresses

It is currently possible to obtain up to 3 additional single IPv4 addresses. Should further addresses be required, you may apply for a subnet.

The IP addresses can be temporarily used in two different ways:

  1. ifconfig eth0:1 10.4.2.1 netmask 255.255.255.255
  2. or
  3. ip addr add 10.4.2.1/32 dev eth0

CentOS

A permanent configuration is only possible by default via alias interfaces (eth0:1, eth0:2 etc.). A file needs to be created for each IP address:

/etc/sysconfig/network-scripts/ifcfg-eth0:1
/etc/sysconfig/network-scripts/ifcfg-eth0:2

These files must include the following information:

DEVICE=eth0:1
BOOTPROTO=none
ONBOOT=yes
IPADDR=<IP Address>
NETMASK=255.255.255.255

Finally, a “service network restart” needs to be initiated or the server needs to be restarted (“reboot”).

Please note: A different configuration is needed for the use of IP addresses in virtual machines!

Fedora

For a permanent configuration the IP addresses can be added to the configuration file:

 # cat /etc/sysconfig/network-scripts/ifcfg-eth0
 DEVICE="eth0"
 ...
 IPADDR=192.0.2.1
 NETMASK=255.255.255.240
 IPADDR0=192.0.2.10 # Additional IP
 PREFIX0=28
 IPADDR1=192.0.2.11
 PREFIX1=28
 IPADDR2=...

Leave a Reply

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