Add Additional IPv4 address(es)
If this has not already been entered automatically, it can be entered manually in the network config.
The network config is opened with an editor, eg with "nano".
sudo nano /etc/network/interfaces
⚠️ The config must be edited with root rights.
There is already an entry in the config that could look like this:
auto lo iface lo inet loopback allow-hotplug eth0 iface eth0 inet static address 126.96.36.199 netmask 255.255.255.0 gateway 188.8.131.52
There the interface "eth0" is specified as well as the IPv4, its netmask and gateway.
In order to add a further IPv4, another interface must be entered, eg "eth1". The additional IPv4 is e.g. 184.108.40.206. The network mask is 255.255.255.0 because it is a class C network. The gateway is always the IPv4 address with a 1 at the end.
⚠️ Important: It must be the additional IPv4 that is displayed in the web interface under IP addresses.
The additional interface then looks like this:
allow-hotplug eth1 iface eth1 inet static address 220.127.116.11 netmask 255.255.255.0 gateway 18.104.22.168
Together with the "eth0" interface, the config now looks like this:
auto lo iface lo inet loopback allow-hotplug eth0 iface eth0 inet static address 22.214.171.124 netmask 255.255.255.0 gateway 126.96.36.199 allow-hotplug eth1 iface eth1 inet static address 188.8.131.52 netmask 255.255.255.0 gateway 184.108.40.206
The confing must then be saved, with "nano" eg with CTRL+X, y then Enter
The network module must now be restarted so that the new IPv4 address becomes active, this is done with the following command:
sudo service networking restart
As soon as this is completed, the server can be reached via both IPv4 addresses. This can be checked, for example, with a ping check via Windows CMD or Linux Terminal, depending on your own computer operating system:
The same steps have to be done with even more additional IPv4 addresses, the interface then always increases by a number e.g. "eth2", "eht3" etc.
✅ The additional IPv4 address has now been successfully set up.