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 auto eth0 iface eth0 inet static address 220.127.116.11 netmask 255.255.255.0 gateway 18.104.22.168
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. 22.214.171.124. 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:
auto eth1 iface eth1 inet static address 126.96.36.199 netmask 255.255.255.0 gateway 188.8.131.52
Together with the "eth0" interface, the config now looks like this:
auto lo iface lo inet loopback auto eth0 iface eth0 inet static address 184.108.40.206 netmask 255.255.255.0 gateway 220.127.116.11 auto eth1 iface eth1 inet static address 18.104.22.168 netmask 255.255.255.0 gateway 22.214.171.124
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.