On Debian 11 instances, we removed the /etc/network/interfaces file and now configure interfaces using Cloud-init on boot. Discovery will send a snippet of data to the network, including the location of your hard drive, assigned IPs, number of CPUs and Ram to name a few things. This information is configured during the boot phase. If you reboot a Debian 11 instance and use the NoVNC or xTerm consoles, you will see the process in the console at startup.
Because of this change, customers with an NVME VPS Server or High Avaliabliltuy VPS Server do not need to worry about static routes, gateways or netmasks. To add additional IPs to Debian 11 instances you just specify the IPs routed to the instance. Let’s take a closer look at this.
Debian 11 Interfaces & Cloud-init
On Debian 11. The interfaces file located at /etc/network/interfaces is supposed to be empty. The configuration file for the networking is located at /etc/network/interfaces.d/50-cloud-init. Let’s open up that file.
auto lo iface lo inet loopback dns-nameservers 184.108.40.206 220.127.116.11 2001:4860:4860::8888 dns-search f2h.cloud auto eth0 iface eth0 inet static address 18.104.22.168/28 gateway 22.214.171.124 # control-alias eth0 iface eth0 inet6 static address 2001:41d0:800:3d92::1b31/122 gateway 2001:41d0:0800:3dff:ff:ff:ff:ff
As you can we, we have our eth0 interfaces configured with IPv4 126.96.36.199 and an IPv6 of 2001:41d0:800:3d92::1b31. We have our gateways specified already. Let’s assume we want to add the 188.8.131.52/30 IP block. That’s 4 additional IPs. All we need to do is specify those IPs in this file.
Configure Additional IPs in Debian 11
So to add additional IPs to this Debian instance, I will add those IPs to the eth0 interface. I don’t need to specify any special routing or gateways. We strategically route additional IPs to your server’s MAC address making this super easy.
auto lo iface lo inet loopback dns-nameservers 184.108.40.206 220.127.116.11 2001:4860:4860::8888 dns-search f2h.cloud auto eth0 iface eth0 inet static address 18.104.22.168/28 gateway 22.214.171.124 # Add additional /30 IP block iface eth0 inet static address 126.96.36.199/30 iface eth0 inet static address 188.8.131.52/30 iface eth0 inet static address 184.108.40.206/30 iface eth0 inet static address 220.127.116.11/30 # control-alias eth0 iface eth0 inet6 static address 2001:41d0:800:3d92::1b31/122 gateway 2001:41d0:0800:3dff:ff:ff:ff:ff
Once any additional IPs have been specified in the file, save and close. Reboot the server and those IPs will now resolve. Changes made in this file will persist over reboots.
How was this article? – How to configure additional IPs in a Debian 11 VPS
More from Linux VPS Servers
Default Ubuntu Sources.List
Default Ubuntu Sources.List The Ubuntu sources.list is where your F2H VPS instances get the latest updates and security fixes directly from …
How to update Ubuntu 20 LTS to Ubuntu 22 LTS
Many people will be using LTS (Long Term Support) versions of Ubuntu. These LTS versions are great for developers because …
Enable Mod_RemoteIP – See Visitors Real IP address when using Cloudflare & Apache
If you are using Cloudflare on your Apache server you will always see Cloudflare IPs in your logs and not …