Re-homing a self-hosted platform onto a single IP address
A two-month migration after an ISP change removed a block of IPv4 addresses, with segmentation, a redundant load balancer pair and automation built in.
Challenge
I have built and run websites for over twenty-five years, mostly PHP with a MySQL back end. My ISP changed its service and removed my block of public IPv4 addresses. I had about two months to move everything I host behind a single address. Missing the deadline meant losing service, and then rebuilding it after the cutover.
Approach
- Understand what exists first. I inventoried the home setup in NetBox. I then worked through the old NAT rules to learn where every service lived and what it did. That gave me a plan based on how the network really worked, not how I remembered it.
- Design for one address. I planned a pair of HAProxy load balancers that use Consul for dynamic updates. They publish all services through a single public address. I mapped each old NAT rule onto the new design, including my PBX. Cloudflare fronts the public services.
- Keep the firewall honest. The Proxmox firewall rules had to change, because the load balancers now needed access to the back ends. I rebuilt them to match the new traffic flows.
- Fix the network while moving. As each service moved, I segregated the network properly and resolved the problems that surfaced along the way.
- Make it repeatable. I built hosts and DNS with Terraform and configured them with Ansible. Credentials live in HashiCorp Vault and are fetched at run time. Kestra workflows handle monitoring and routine jobs. The mail server signs outgoing mail with DKIM and publishes SPF and DMARC policies.
Outcome
The key services moved within the deadline. Less essential services needed some debugging afterwards. I also had to add routes that the first design missed, such as those for ACME HTTP challenges, so certificate renewal kept working. The platform now has a documented inventory, a redundant front end with dynamic configuration, a segregated network, and most operational work held as code in a repository. The same pattern lets a small organisation publish many services through one address without a large budget.