Run edge servers apart from the nodes
The network redesign of 2026-10-27 changes this page. hopbox leaves the vRack and the OVHcloud API, and the servers talk over their public addresses (Q90). This page still describes the current code. Milestones N26 to N32 change the code and this page. Before you set up a fleet on the vRack, read Q90.
An edge server takes the public traffic of an install: the URL of each machine, SSH, the API, and the console. It also takes the egress of the machines to the internet (the egress of the machines). A small install runs every role on one server. A bigger install runs the edge role and the DNS role on two servers of their own, edge1 and edge2. The install then has two name servers. When one edge server stops, the other one takes the traffic. This guide adds two edge servers to an install whose servers talk over their peer addresses. Then it reaches a machine through each edge server.
An edge server without the node role reaches each machine over the mesh, the WireGuard device hbm0 between the servers (the mesh). The edge role covers the way to the machines in full.
The release files of hopbox are not public yet. The hopbox team gives them on request.
How a client reaches a machine
Section titled “How a client reaches a machine”- The client asks DNS for
box1.example.com. Each edge server answers with the DNS role. The zone names the floating IPv4 address of each edge server, and its floating IPv6 address.ns1isedge1, andns2isedge2. - The client connects to one of the addresses. It uses HTTPS for a machine URL or the API, and SSH for the SSH port of the machine.
- The edge server finds the node of the machine in its routes. It connects to the address of the machine over
hbm0, from its mesh address. - The node lets the connection reach the machine, because the mesh address belongs to an edge server.
A floating address is a public IPv4 address that the provider of the servers can route to one server and then to another. Examples are an Additional IP of OVHcloud, and a floating IP of another provider. The operator routes it to the edge server at the provider. A replacement of the edge server takes the same address, so the zone never changes. The floating IPv6 address of an edge server is an IPv6 address that the operator routes to the edge server at the provider. The edge server holds it on its uplink as a /128. hopboxd does not put it there (the edge role). The IPv6 egress of the machines leaves from another address: the IPv6 address of the uplink.
What you need
Section titled “What you need”- An install with a control server that listens on its peer address, and nodes in the mesh (the mesh).
- Two servers for
edge1andedge2. - One floating IPv4 address for each edge server. This guide uses
203.0.113.101foredge1and203.0.113.102foredge2. The operator routes each address to its edge server at the provider. The edge server holds it on its uplink as a/32, and the peer address stays the source of its default route. So the connections of the edge server to the other servers leave from its peer address. The Terraform provider sets this up with the attributefloating_addresses(hopbox Terraform provider). Without the provider, set it up by hand. - One floating IPv6 address for each edge server, held on its uplink as a
/128. This guide uses2001:db8::11foredge1and2001:db8::12foredge2. The Terraform provider sets this up with the attributepublic_ipv6. - An IPv6 default route and a global IPv6 address on the uplink of each edge server, for the IPv6 egress of the machines. This guide uses
2001:db8:1::21foredge1and2001:db8:2::22foredge2. - The internal URL of the control server on its peer address, such as
https://203.0.113.11:7443(the internal listener). - The peer address of each server: its public IPv4 address on its uplink, at which the other servers reach it (Enrollment and the install PKI). This guide uses
203.0.113.21foredge1,203.0.113.22foredge2, and203.0.113.31for the nodenode1. dig,curl, andsshon your laptop.
Add the edge servers
Section titled “Add the edge servers”Write the bootstrap config of each edge server
Section titled “Write the bootstrap config of each edge server”On edge1, write /etc/hopbox/hopboxd.toml before the install. The install keeps the keys of the file (hopboxd):
roles = ["edge", "dns"]
[dns]listen = ["203.0.113.101:53", "[2001:db8::11]:53"]
[edge]public_ipv6 = "2001:db8::11"public_ipv4 = "203.0.113.101"On edge2, write the same file with 203.0.113.102 and 2001:db8::12.
The tested OS runs systemd-resolved on port 53 of a loopback address. So dns.listen names the public addresses of the server, not every address (the DNS role). The DNS role takes queries on the floating IPv6 address once the uplink holds it. edge.public_ipv6 names that address, without a prefix length (the bootstrap config of hopboxd). edge.public_ipv4 names the floating address from which the egress of the machines leaves. The Terraform provider writes these keys for you (hopbox Terraform provider).
Install and enroll each edge server
Section titled “Install and enroll each edge server”On the control server, make a token for each edge server. The token names the peer address of the edge server, so the enrollment must come from that address, and the server keeps it:
sudo hopboxd admin enrollment-token create --roles edge,dns --peer-address 203.0.113.21On edge1, install with the URL of the control server, and enroll with the token:
sudo hopboxd install --roles edge,dns --control-url https://203.0.113.11:7443sudo hopboxd enroll --token <token>Do the same on edge2 with its own token, for the peer address 203.0.113.22.
Reach the servers through the edge servers
Section titled “Reach the servers through the edge servers”On its public interface, the host firewall of each server takes the mesh port and the ports of the egress tunnels only from the peer addresses of the install (the host firewall). Port 22 of a server without the edge role takes only the peer addresses of the edge servers, the set jump_hosts.
Each edge server got its peer address from its token. A server that enrolled without a peer address, such as a server from before peer addresses, has no part in these sets. On the control server, set its peer address. For example, for node1:
sudo hopboxd admin server set-peer-address <id of node1> 203.0.113.31Within 5 s, each server holds the peer addresses of the edge servers in the set jump_hosts of its table:
sudo nft list set inet hopbox_host jump_hostsFrom your laptop, port 22 of node1 times out. Log in to node1 through edge1 as the jump host, at the peer address of node1. edge1 dials node1 from its peer address, the source of its default route:
nc -vz -w 3 203.0.113.31 22ssh -J debian@203.0.113.101 debian@203.0.113.31node1 keeps these jump hosts, also when the edge servers leave the install. The way back after a lockout is the rescue mode or the console of the provider (the host firewall).
Check the mesh and the IPv6 address
Section titled “Check the mesh and the IPv6 address”On the control server, list the servers. Each edge server is ready:
sudo hopboxd admin server listhopboxd admin server get <id> shows the mesh address of each edge server in mesh_address (hopboxd).
On edge1, check the floating IPv6 address and the IPv6 default route of the uplink:
ip -6 addr show to 2001:db8::11ip -6 route show defaultThe uplink holds 2001:db8::11, and the IPv6 default route names the uplink. The log of hopboxd shows the line the IPv6 egress of the machines leaves from the uplink address of this edge server, with the uplink and 2001:db8:1::21 (the host firewall).
Point the zone at both edge servers
Section titled “Point the zone at both edge servers”Set the public addresses
Section titled “Set the public addresses”The zone names the public addresses of the install. ns1 takes the first address of each family, and ns2 the second (the DNS role). So list edge1 first:
sudo hopboxd admin config set --public-address 203.0.113.101,203.0.113.102,2001:db8::11,2001:db8::12Check each name server
Section titled “Check each name server”Ask each edge server at each of its addresses. Each answer has the flag aa, and names both edge servers:
dig @203.0.113.101 box1.example.com A +norecdig @2001:db8::12 box1.example.com AAAA +norecdig @203.0.113.102 example.com NS +norecThe NS answer names ns1.example.com and ns2.example.com. Its additional section gives ns1 the addresses of edge1, and ns2 the addresses of edge2.
Each heartbeat of an edge server reports the serial of the zone that it serves. Both edge servers report the same serial:
$ sudo hopboxd admin server get <id of edge1> | grep dns_zone_serialdns_zone_serial 1792249094Delegate the domain
Section titled “Delegate the domain”Give the parent zone the two name servers and their glue records: ns1 at the addresses of edge1, and ns2 at the addresses of edge2 (Serve the domain of an install with the DNS role). If the domain points at another server now, change the glue records last. A resolver keeps an answer for 60 seconds.
Reach a machine through each edge server
Section titled “Reach a machine through each edge server”The certificate of the install reaches both edge servers over the control channel (Get the wildcard certificate of an install). Open the URL of box1 through each edge server. --resolve sends the request to one address:
curl --resolve box1.example.com:443:203.0.113.101 https://box1.example.com/curl --resolve 'box1.example.com:443:[2001:db8::12]' https://box1.example.com/Open SSH through each edge server, at the SSH port of box1, such as 10022 (Reach a machine over SSH):
ssh -p 10022 user@203.0.113.101ssh -p 10022 user@2001:db8::12The code of the machine sees the mesh address of the edge server as the client, such as 10.239.0.3. The header X-Forwarded-For of a request holds the address of the real client (the edge role).
Check the egress of the machines
Section titled “Check the egress of the machines”Each node sends the egress of its machines through an egress tunnel to one edge server. The hash of the machine address picks the edge server (the egress of the machines). On edge1, check its tunnel, and the routes of the replies back into it:
sudo wg show hbe0 allowed-ipsip rule show table 26819sudo nft list chain inet hopbox_host egress_natThe tunnel has each node as a peer, with its subnet and the IPv6 /64 of that subnet. The rule fwmark 0x68620100 lookup 26819 sends the replies back into the tunnel. The chain egress_nat gives the IPv6 egress of the machines the address of the uplink, 2001:db8:1::21 (NAT66).
In a machine, ask a server on the internet for the address that it sees:
hopbox exec box1 curl -sS https://ifconfig.mehopbox exec box1 curl -6 -sS https://ifconfig.meThe commands print the floating IPv4 address and the IPv6 address of the uplink of one edge server, such as 203.0.113.101 and 2001:db8:1::21. The IPv6 egress never leaves from the floating IPv6 address. Both families of one machine leave through the same edge server. An edge server without edge.public_ipv4 gives the IPv4 egress the address of its uplink, and logs a warning at its start. An edge server without a global IPv6 address on its uplink refuses the IPv6 egress, and logs a warning.
When an edge server stops
Section titled “When an edge server stops”The other edge server goes on: it answers DNS, the machine URLs, SSH, and the API. A resolver that gets no answer from one name server asks the other one. The control role marks the stopped edge server unresponsive after 20 s. At their next heartbeat, the nodes then send all the egress of their machines to the other edge server. The address of the stopped edge server gives no answer to a client. It answers again when the edge server is back, or when its replacement takes the address.
A DNS server keeps the last zones of the control plane on its disk (the DNS role). So an edge server that restarts while no control server runs answers with those zones. Its log shows serving the dns zones on the disk until the control plane sends its zones.
Replace an edge server
Section titled “Replace an edge server”The new server takes the same addresses as the old one:
- Write the bootstrap configuration of the new server with the same
edge.public_ipv6andedge.public_ipv4. Put the floating IPv4 address on its uplink as a/32, and the floating IPv6 address as a/128. The Terraform provider does this step withfloating_addressesandpublic_ipv6. - Install and enroll the new server as above, with a token for its own peer address. The servers of the install then take SSH from the new server as a jump host.
- Route the floating IPv4 address and the floating IPv6 address to the new server at the provider. The Terraform provider never moves an address.
The public addresses of the install stay the same, so the zone and the glue records need no change. The IPv6 egress of the machines leaves from the uplink address of the new server, so its IPv6 source changes (the egress of the machines).
Take the edge role from a server
Section titled “Take the edge role from a server”A server can give its roles edge and DNS to the edge servers and keep its other roles (the admin API). An example is a first server that keeps the roles control and node. This section takes them from the server server1, while the edge servers keep them.
-
Make sure that another edge server is ready with the roles edge and DNS, and holds a floating address. The removal checks it.
-
Set the public addresses of the install without the addresses of
server1. Then the zone names only the edge servers that stay. Run on a control server:sudo hopboxd admin config set --public-address 203.0.113.101 -
Wait until each name server serves the new zone, as in Check each name server. The parent zone keeps its glue records only for the name servers that stay.
-
Start the removal. Run on a control server:
sudo hopboxd admin server remove-role <id of server1> edge dns -
If
server1is a control server whose internal listener listens on loopback, move the listener to the peer address ofserver1. The control role refuses a token with a peer address on a call from loopback, and in step 6server1calls its own listener. Run onserver1, with every role that it has now (the internal listener):sudo hopboxd install --roles control,node,dns,edge --internal-listen <peer address of server1>:7443 -
End the removal on
server1. Make a token for the server and the roles that stay, and run the install with every role that stays:sudo hopboxd admin enrollment-token create --server <id of server1> --roles node --peer-address <peer address of server1>sudo HOPBOX_ENROLLMENT_TOKEN=<token> hopboxd install --roles control,node -
After the restart of
hopboxd, remove the floating addresses ofserver1from its uplink. The uplink is the interface of the IPv4 default route, whichip route show defaultnames afterdev. This example useseth0, the floating IPv4 address203.0.113.100, and the floating IPv6 address2001:db8::10. Run onserver1:sudo ip address del 203.0.113.100/32 dev eth0sudo ip address del 2001:db8::10/128 dev eth0Then remove the addresses from the network configuration of the host too, so that a reboot does not put them back.
hopboxd restarts without the roles edge and DNS, and the services of server1 stop for some seconds. Its host firewall closes ports 80, 443, 53, and the SSH ports of the machines. From then on, port 22 takes only the jump hosts. So reach server1 through an edge server that stays (Reach the servers through the edge servers). For a server that Terraform manages, drop the roles edge and dns from its configuration, and apply instead. Drop its floating addresses there too. The provider runs steps 4 to 7 (hopbox Terraform provider).