Much has happened since 2015 when I wrote EdgeRouter IPv6 done right. One example is that I replaced the EdgeRouter with an UniFi® Security Gateway. If I remember correctly from when I set up the USG it worked out of the box (or possible GUI configuration) with IPv6.

But… Back in May the ISPs Access Switch for my apartment building gave up and was replaced by a new one. Since then the IPv6 stopped working. I was told that the old switch carried a special configuration only made for me as a quick fix to deliver IPv6 before official support in the rest of the ISPs infrastructure. 5 years later proper support for IPv6 was now in place but did not play well with my setup. In the beginning of this jurney I didn’t even see any IPv6 reaching my WAN port. Then summer paused everything. Slowly this autum I and the ISP started to work on the issue again and by the end of November tcpdump once again showed IPv6 packets reaching the WAN port. Unfortunately the router didn’t care. So I had to dig deeper in the USG.

I think some of the headache I got from this issue was casued by a bug in the USG. I’m not sure but it felt like all commands didn’t have the same effect depending on which order they where commited.

In the end after some tweaks and trial and error I ended up with a config.gateway.json which works for IPv6 with Bahnhof and Sundbybergs stadsnät as carrier:

{
  "interfaces": {
    "ethernet": {
      "eth0": {
        "dhcpv6-pd": {
          "no-dns": "''",
          "pd": {
            "0": {
              "interface": {
                "eth1": {
                  "host-address": "::1",
                  "no-dns": "''",
                  "prefix-id": "0"
                }
              },
              "prefix-length": "/64"
            }
          },
          "rapid-commit": "disable"
        }
      }
    }
  }
}

I think that the main issue was that the old infrastructure routed my prefix through the fe80 address and the new setup tried to route the prefix through the address provided in the DHCPv6 packet (which the USG ignored). Hope that this information can be useful for someone else.