How to Bind Additional IPs for Debian VPS


This article provides a guide for how to bind additional IPs for Debian VPS servers.

How to Bind Additional IPs for Debian VPS

In Debian 12, configuring an additional IP address can be done using systemd-networkd or the /etc/network/interfaces file, depending on your network configuration setup.

Method 1: Using systemd-networkd (Recommended for Debian 12)

Step 1: Identify Network Interface

Check your network interface with command:

ip a

Step 2: Create or Edit the Network Configuration File

Debian 12 uses systemd-networkd by default. Network configuration files are stored in /etc/systemd/network/.

Create a file like 20-wired.network for your main interface (replace ens33 with your interface name):

sudo nano /etc/systemd/network/20-wired.network

Example Configuration:

[Match]
Name=ens33
[Network]
Address=192.168.1.100/24  # Primary IP
Address=192.168.1.101/24  # Additional IP
Gateway=192.168.1.1
DNS=8.8.8.8
DNS=8.8.4.4

Step 3: Enable and Restart systemd-networkd

sudo systemctl enable systemd-networkd
sudo systemctl restart systemd-networkd

Step 4: Verify Configuration

ip a

Method 2: Using /etc/network/interfaces (Legacy Method)

If you prefer using the legacy method with /etc/network/interfaces, follow these steps:

Step 1: Edit /etc/network/interfaces

Open the network configuration file:

sudo nano /etc/network/interfaces

Example Configuration:

# Primary Interface
auto ens33
iface ens33 inet static
    address 192.168.1.100
    netmask 255.255.255.0
    gateway 192.168.1.1
    dns-nameservers 8.8.8.8 8.8.4.4
# Additional IP
iface ens33:1 inet static
    address 192.168.1.101
    netmask 255.255.255.0

Step 2: Restart Networking Service

Debian network interfaces

Method 3: Temporary Method Using Command Line

If you want to add an IP address temporarily without making it persistent:

sudo ip addr add 192.168.1.101/24 dev ens33

To remove the IP:

sudo ip addr del 192.168.1.101/24 dev ens33

Verification

Check if the additional IP is configured correctly:

ip a

Troubleshooting Tips

  1. Check Status: If it doesn't work, check the network status:

sudo systemctl status systemd-networkd

Conclusion

You now know how to bind additional IPs for Debian VPS servers.

  • debian, ip address, network interface
  • 0 brukere syntes dette svaret var til hjelp
Var dette svaret til hjelp?

Related Articles

What Server Virtualization Are Your Hypervisors?

All VPS hypervisors use KVM virtualization technology. Order here: KVM VPS servers

Video: How to Check Whether the VPS Status is Online or Offline in Virtualizor

This video tutorial provides Step-by-Step instructions for how to check whether the VPS status is...

Video: How to Check VPS RAM, IP, Disk Capacity and the Virtualization Details in Virtualizor

This video tutorial provides Step-by-Step instructions for how to check VPS RAM, IP, disk...

Video: How to Change the Password of Your Virtualizor Account

This video tutorial provides Step-by-Step instructions for how to change the password of your...

Video: How to Access Your VPS via VNC in Virtualizor

This video tutorial provides Step-by-Step instructions for how to access your VPS via VNC in...