ESC

Start typing to search across invoices, services, domains, tickets, and more...

Search... Ctrl+K
Site Clusters & Multi-IP

How to Bind a Full /24 IP Block on a Linux Multi-IP (Site Cluster) Server

7 steps 10 min read 1 views 0
On this page

Site-cluster (multi-IP) servers often come with one or more /24 blocks, giving you 253+ usable addresses per block. Adding them one by one is slow and error-prone. This guide shows how to bind a full /24 IP block on a Linux site-cluster server: bind quickly with a loop, persist via Netplan or NetworkManager, auto-bind at boot with systemd, and verify in bulk. It covers Ubuntu, Debian and CentOS/Rocky/AlmaLinux.

Confirm the block, usable range, prefix and gateway in the client area or delivery email first: log in → My Products & Services → select the server → Manage; open a ticket if unsure. Usable ranges vary (network, gateway and broadcast addresses are often reserved). We use 203.0.113.2–254/24 as an example.

Step 1: Identify the Interface and Primary IP

Check the primary NIC and default route; we call it eth0 below:

ip -br addr show
ip route show default

Step 2: Bulk Bind the /24 with a Loop (Temporary)

A single for loop binds the whole block, which is handy for testing. It is lost on reboot:

for i in $(seq 2 254); do
  ip addr add 203.0.113.$i/24 dev eth0
done

Add addresses only. Do not add another default gateway for the extra block, or you will get multiple default routes.

Step 3: Persist on Ubuntu with a Netplan addresses List

Typing 253 lines by hand invites mistakes. Generate the YAML lines and paste them under addresses in your /etc/netplan/ file:

for i in $(seq 2 254); do echo "        - 203.0.113.$i/24"; done

The result looks like this:

network:
  version: 2
  ethernets:
    eth0:
      addresses:
        - 198.51.100.5/24
        - 203.0.113.2/24
        - 203.0.113.3/24
        # ... 203.0.113.254/24
      routes:
        - to: default
          via: 198.51.100.1
netplan try
netplan apply
YAML indentation must use consistent spaces. Back up the original file and make sure the VNC console works before applying, so a typo does not lock you out.

Step 4: Persist in Bulk on CentOS, Rocky or AlmaLinux with nmcli

NetworkManager stores the addresses in the connection profile and restores them at boot:

for i in $(seq 2 254); do
  nmcli connection modify eth0 +ipv4.addresses 203.0.113.$i/24
done
nmcli connection up eth0

The loop may take a minute or two; do not interrupt it.

Step 5: Debian or Generic Option: Auto-Bind at Boot with systemd

On Debian (ifupdown), or if you prefer not to touch network config files, run a script from systemd at boot. Create /usr/local/bin/bind-ips.sh:

#!/bin/bash
# /usr/local/bin/bind-ips.sh
DEV=eth0
NET=203.0.113
for i in $(seq 2 254); do
  ip addr add ${NET}.${i}/24 dev ${DEV} 2>/dev/null
done
exit 0

Then create /etc/systemd/system/bind-ips.service:

[Unit]
Description=Bind extra IPv4 block
After=network-online.target
Wants=network-online.target

[Service]
Type=oneshot
ExecStart=/usr/local/bin/bind-ips.sh
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

Make it executable and enable it:

chmod +x /usr/local/bin/bind-ips.sh
systemctl daemon-reload
systemctl enable --now bind-ips.service

On systems managed by nmcli, prefer Step 4 so NetworkManager does not drop script-added addresses when it re-activates the connection.

Step 6: Verify the /24 Block in Bulk

Count the bound addresses and spot-check outbound traffic:

ip -4 addr show dev eth0 | grep -c "inet 203.0.113."
for i in 2 100 254; do curl -s --interface 203.0.113.$i https://ifconfig.me; echo; done

The first command should print 253 (or your actual count). If curl returns the matching IP, that address works outbound. Reboot once to confirm persistence.

Step 7: Remove the Whole Block

for i in $(seq 2 254); do
  ip addr del 203.0.113.$i/24 dev eth0
done

Also clean up the persistent config: remove the lines from Netplan, use nmcli -ipv4.addresses, or disable bind-ips.service.

FAQ

Should I use /24 or /32 as the prefix?

It depends on whether the block shares the layer-2 network with the primary IP or is routed to it. Follow the delivery information, or open a ticket to confirm.

Some IPs do not respond to ping.

Make sure the IP is in the usable range and check the firewall; test it individually with curl --interface. If it still fails, send the list of IPs in a ticket.

Does binding hundreds of IPs hurt performance?

A few hundred addresses have negligible kernel impact, although netplan apply may take a little longer.

Still stuck? Open a ticket with IMIDC 24/7 technical support.

Was this answer helpful?

Related Tutorials