How to configure additional ips?

You subscribed to one or more additional IPs.
These additional IPs do not self-configure on the server. This process has to be done manually.
Therefore, if you have a server running Linux CentOS, it is done as follows:

  1. You need to know the name of the network card in your server. And to know that, just do the command "ip addr show". It will show you which network cards and IPs are already configured.
    (For the sake of explanation, let's say it's called "enp1s0f0")
  2. You now go to the /etc/sysconfig/network-scripts/ folder and find the file with the same name.
    (in our case the file is called "ifcfg-enp1s0f0")
  3. Copy that file to a new file with the same name followed by ":" and a number starting at "0".
    If we have for example 4 additional IPs we will do the following commands:
    1. cp ifcfg-enp1s0f0 ifcfg-enp1s0f0:0
    2. cp ifcfg-enp1s0f0 ifcfg-enp1s0f0:1
    3. cp ifcfg-enp1s0f0 ifcfg-enp1s0f0:2
    4. cp ifcfg-enp1s0f0 ifcfg-enp1s0f0:3
  4. Now let's edit each of the created files and delete all but the following lines:
    • "DEVICE", and changes from "ifcfg-enp1s0f0" to "ifcfg-enp1s0f0:0" (the name you put here is exactly the name you put in the filename)
    • "ONBOOT"
    • "IPADDR" and change the IP to the first new IP.
    • "NETMASK" and adjust the mask to the mask you were given in the email you received (more info at the end)
  5. After you have made the changes to all files, you run the "service network restart" command for those changes to take effect.
  6. You can confirm that the IPs are functional by executing the command "ip addr show".

Common questions:

Question: I was given a range, how do I know which mask I have to put on?
Answer: You can see the equivalences in the following table:

CIDR Mask # IPs
/32 1
/31 2
/30 4
/29 8
/28 16
/27 32
/26 64
/25 128
/24 256

Question: How do I configure IPv6?
Answer: Exactly the same as IPv4, but using the following variables:

  • IPV6INIT=yes
  • IPV6ADDR=xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:/64

Question: I have another operating system. How do I configure additional IPs?
Answer: You can search the net for the specific process for your system.

Was this answer helpful?