Add Addtional IP addresses

Additional IP addresses (Host)

Setting up additional single IPv4 addresses

The IP addresses can be made temporarily available in two different ways:

ifconfig eth0:1 192.0.2.10 netmask 255.255.255.255

or

ip addr add 192.0.2.10/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").

Setting up additional IPv4 subnets

Subnets are routed on the main IP of a server. In general the first (Network IP) and the last (Broadcast IP) cannot be used. This leaves six usable addresses for a /29 subnet.

A /29 subnet consisting of 8 IP addresses will look like this:

aaa.aaa.aaa.aaa (Network IP)
bbb.bbb.bbb.bbb
ccc.ccc.ccc.ccc
ddd.ddd.ddd.ddd
eee.eee.eee.eee
fff.fff.fff.fff
ggg.ggg.ggg.ggg
hhh.hhh.hhh.hhh (Broadcast IP)

The IPs "b" to "g" can be configured and used as single IPs. Alternatively, a file can be created:

/etc/sysconfig/network-scripts/ifcfg-eth0-range0

IPADDR_START=<Your Network Address + 1>
IPADDR_END=<Your Network Address + 6>
BROADCAST=<Your Network Address + 7>
CLONENUM_START=0
NETMASK=255.255.255.248

Restart the service network using "service network restart".

 

  • 1 Users Found This Useful
Was this answer helpful?

Related Articles

Ho to connect to Windows Server in RDP

To connect to our Windows Servers you need to set a Custom RDP Port on you R ClientDP, this to...