If you’ve purchased additional IP addresses for your HostHatch VPS running Debian 11, it’s important to map them correctly to ensure smooth operation of your website or application. In this guide, we’ll show you how to map additional IP addresses to your VPS in just three simple steps.
Step 1: Disable Any Pre-Existing Network Configurations
The first step is to disable any pre-existing network configurations that may conflict with your new IP addresses. To do this, create a file named /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg and paste the following into it:
Paste the following into the file
network: {config: disabled}
Step 2: Edit the Network Configuration File
Next, you’ll need to edit the network configuration file. Open /etc/network/interfaces.d/50-cloud-init and make the following changes:
- Add the new IP addresses under the ‘auto eth0’ line, replacing ‘eth0’ with your network interface name.
- Set the IP address, netmask, and gateway for each new IP address.
- Add the DNS nameservers for your server.
# This file is generated from information provided by the datasource. Changes
# to it will not persist across an instance reboot. To disable cloud-init's
# network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 103.173.179.7
netmask 255.255.255.0
gateway 103.173.179.1
dns-nameservers 1.1.1.1 1.0.0.1
auto eth0:0
iface eth0:0 inet static
address 103.173.179.80
netmask 255.255.255.0
auto eth0:1
iface eth0:1 inet static
address 103.173.179.81
netmask 255.255.255.0
auto eth0:2
iface eth0:2 inet static
address 212.52.0.10
netmask 255.255.255.0
gateway 212.52.0.1
dns-nameservers 1.1.1.1 1.0.0.1
auto eth0:3
iface eth0:3 inet static
address 212.52.0.222
netmask 255.255.255.0
gateway 212.52.0.1
dns-nameservers 1.1.1.1 1.0.0.1
Step 3: Restart the Networking Service
Finally, restart the networking service to apply the changes:
systemctl restart networking
That’s it! Your additional IP addresses are now mapped to your VPS running Debian 11. With this guide, you can easily expand the capabilities of your HostHatch VPS and ensure that your website or application runs smoothly.