mullane.info

An IPv6 address for the VPN, and a firewall that had none to give

2026-12-06 · network

The plan for this morning was small: run the checks that were due after yesterday’s firewall and IPv6 work, then give the WireGuard server an IPv6 address people can actually find, so mullane.info gets an AAAA record and the tunnel itself can reach the IPv6 Internet. It took most of the morning, mostly because nearly every step turned out to rest on an assumption that wasn’t true.

The checks went fine, for the most part. Backups had arrived, the monthly offsite copy of desktom was a day early, the DNS redirects in the IoT zones were doing their job (the speakers asking Google for DNS were getting AdGuard instead, and none of them noticed), and the IPv6 prefix tables still matched the interfaces a day later. The firewall log was more interesting. The kitchen Nest Hub turned out to be responsible for most of the blocked traffic in its zone: a few hundred tries an hour at Google’s DNS over IPv6, and about 130 an hour, each, at two of the three Hue bridges over Matter. The Matter one makes sense once you think about it. Those two bridges are in Google Home as Matter devices, which needs a local path, and there hasn’t been one since the lights and the speakers went into different VLANs in November. Until yesterday the hub couldn’t even try, because the zones had no IPv6 between them.

I’m planning to replace the Google Home devices anyway (with something Raspberry Pi based, probably, as part of getting Google out of the house as far as I can), so I didn’t want to spend any time making Matter work across zones. Both kinds of traffic are now dropped without logging. The hub will keep trying until it’s unplugged, which is fair enough, as that’s what it was built to do.

Then the actual job. The note I’d left myself said the AAAA record needed an address first, and offered two ways to get one: ask the ISP for an address on WAN, which would reconfigure WAN and might renumber every zone, or use the firewall’s own global address on one of the internal interfaces. I picked the second, because it doesn’t touch WAN. As it happens the first was never really on the table: the agent looked at the live WAN settings and found that OPNsense has been asking for a WAN address all along, and the ISP just hands out the prefix and nothing else.

The second option nearly went wrong in a way I wouldn’t have caught for a while. ddclient on OPNsense was running the perl backend, and the plugin’s template gives any account that reads its address from an interface both an IPv4 and an IPv6 line. Upstream ddclient doesn’t filter private IPv4 addresses. So an “IPv6 only” account pointed at the management interface would also have helpfully set mullane.info‘s A record to the firewall’s private management address, and the VPN would have stopped working from everywhere except home, which is precisely where nobody needs it. The agent found this by reading the plugin’s template and ddclient’s source before changing anything, and stopped to ask instead of going ahead with the plan I’d approved. I’m glad it did.

What we did instead was switch ddclient to OPNsense’s own (native) backend, which handles one address family per account and ignores private IPv4 addresses entirely, and add a second Cloudflare account that only does the AAAA record. It finds its address with a web check (ipify) bound to the management interface, so the answer is always that interface’s global address. The existing A record carried on unchanged through the switch, which I checked rather than assumed.

There were a couple of smaller surprises along the way. Neither backend will create a DNS record that doesn’t exist yet, so I had to add a placeholder AAAA in Cloudflare by hand first. After I’d done that, the agent told me the record wasn’t there. It was; I exported the zone file to prove it. The catch was our own work from yesterday: my zone redirects every outgoing DNS query on port 53 to AdGuard, so a dig aimed at Cloudflare’s public resolver from my desktop was really asking AdGuard, which had cached the earlier “no such record” answer. Asking over DNS-over-TLS, which isn’t redirected, showed the record straight away. I’d built that redirect specifically so devices couldn’t get around AdGuard, and it worked on me too.

The API also won’t hand back a stored Cloudflare token (good), so I made a new token, scoped to editing DNS for this one zone, and pasted it into the new account myself. Then nothing happened. Enabling the account and pressing Apply in the GUI didn’t start it; there wasn’t even an error in the log. A reconfigure from the API did, and within a few seconds Cloudflare had the right address.

The tunnel half had its own wrinkle. The idea was NPTv6: translate the tunnel’s private (ULA) prefix to a spare /64 from the ISP’s delegation, so peers get IPv6 Internet without me hard-coding a public prefix that might change. OPNsense can make an NPT rule follow a prefix by tracking an interface, but the agent read the source and found it simply uses that interface’s first address. WAN only has a link-local address, so tracking WAN directly gives you nonsense. The fix was a loopback interface whose only job is to hold the spare /64, tracking WAN like the other zones do, and an NPT rule that tracks the loopback. Adding it restarted the IPv6 client on WAN, which I was a bit wary of, but the prefix stayed put.

To test it, the agent ran its WireGuard test script on my laptop, which builds a temporary tunnel from inside the LAN. Everything passed, including a request to Cloudflare that came back showing the laptop’s address inside the spare /64, which is the translation doing what it should. (It also failed a ping to a ULA the agent had made up, which it owned up to and fixed.)

So mullane.info now has an AAAA record that follows the prefix, the firewall accepts WireGuard over IPv6, and the tunnel reaches the IPv6 Internet. Peers will still prefer IPv4 for anything that has it, so in practice the gain is the odd IPv6-only site. The real test, a handshake from outside the house over IPv6, waits until I’m next travelling. That said, I learned more about ddclient this morning than I ever meant to.