Understanding Hetzner IPv4 Suballocations: A Beginner’s Guide
Introduction
Looking to expand your Hetzner server’s reach without the hassle of managing multiple dedicated servers? Hetzner IPv4 suballocations let you slice a single block of IP addresses into smaller, reusable units. This guide walks you through the basics, benefits, and step‑by‑step setup so you can start leveraging suballocations today.
What Are IPv4 Suballocations?
In simple terms, a suballocation is a portion of a larger IPv4 address block that you assign to individual services, containers, or virtual machines. Instead of requesting a new IP for every new instance, you reserve a block (e.g., /28) and then allocate individual /32 addresses from that pool.
Why Use Hetzner Suballocations?
- Cost‑effective: One block covers many services, reducing extra fees.
- Simplified routing: All sub‑IPs stay within the same network, easing firewall rules.
- Scalability: Add or remove IPs without contacting support each time.
How Hetzner Handles Suballocations
Hetzner provides two main options:
- IP Block Allocation – You order a block (e.g., /24) and Hetzner routes it to your server.
- Floating IPs – Individual IPs that can be moved between servers via the robot interface.
For suballocation purposes, the IP block method is preferred because it gives you full control over the subnet mask and routing.
Step‑By‑Step: Setting Up an IPv4 Suballocation on Hetzner
1. Order an IP Block
Log into the Hetzner Robot, navigate to IP Addresses → Order Additional IPs, and select the block size you need (commonly /28 or /29). Confirm the purchase; Hetzner will assign the block to your primary server.
2. Configure the Server’s Network Interface
Add the new block to your network configuration. Example for a Debian‑based server:
# /etc/network/interfaces auto eth0 iface eth0 inet static address 203.0.113.10 netmask 255.255.255.0 gateway 203.0.113.1 # Add the suballocation block post-up ip addr add 203.0.113.64/28 dev eth0
Replace the addresses with your actual block. Use ip addr add for a quick test, then make it permanent in your network scripts.
3. Verify Routing
Run ip route to ensure the new subnet points to your interface. You should see a line similar to:
203.0.113.64/28 dev eth0 proto kernel scope link src 203.0.113.64
4. Allocate Individual IPs
Now you can assign any address from the block to containers, VMs, or services. For Docker, add the --ip flag:
docker run -d --name web --network bridge --ip 203.0.113.66 nginx
5. Update Firewall Rules
Include the new range in your iptables or ufw configuration to allow traffic:
ufw allow from any to 203.0.113.64/28 port 80,443
Best Practices for Managing Suballocations
- Document each assignment – Keep a spreadsheet linking IPs to services.
- Monitor usage – Tools like
netstat -tunlphelp spot orphaned IPs. - Reserve a few spare IPs for future growth or emergency rollbacks.
- Secure the block – Apply rate‑limiting and intrusion detection on any public-facing IP.
FAQ
Do I need a /24 block for suballocations?
No. A /28 (16 IPs) or /29 (8 IPs) is often sufficient for small to medium projects and is cheaper.
Can I move a suballocated IP to another Hetzner server?
Yes, by re‑routing the entire block via the Robot UI or using ip route on the destination server.
Are there any hidden fees?
Hetzner charges a one‑time fee per additional IP block, but there are no recurring per‑IP charges.
What happens if I exceed my block size?
You’ll need to order a larger block or request another block; Hetzholder does not auto‑expand.
Is IPv6 suballocation similar?
The concept is the same, but IPv6 blocks are virtually unlimited, making suballocation even easier.
Conclusion
Hetzner IPv4 suballocations give you the flexibility to grow your infrastructure without juggling multiple servers or paying for excess IPs. By ordering a modest block, configuring your network, and following the best‑practice checklist, you’ll have a scalable, secure IP management system in minutes.
Ready to Optimize Your Hetzner Setup?
Start by ordering a /28 block today, and see how suballocation simplifies your deployments. Need hands‑on help? Contact our team for a custom configuration session.
For related reads, consider linking to Hetzner Server Basics and Docker Networking Guide.
Reference: Hetzner documentation on additional IP blocks.
Comments are closed, but trackbacks and pingbacks are open.