Want to start using Matter / Thread but am having issues with IPv6 and Home Assistant

I have an IPv6 and IPv4 network which I’ve been using without any issues.

I run Home Assistant on Home Assistant Yellow.

I’m interested in trying out some Matter and Thread devices - however, I’ve read that IPv6 needs to be turned on and working in Home Assistant for Matter and Thread to work.

When IPv6 is activated in Home Assistant:
System > Network > Configure network interfaces > IPv6 > Automatic

My Home Assistant has the following IPs: (Static DHCPv4)
2a02:XXXX:XXXX:1::1000:75/128 (Static DHCPv6)
2a02:XXXX:XXXX:1:XXXX:XXXX:XXXX:XXXX/64 (Router Advertisements)
fd5a:XXXX:XXXX:1:XXXX:XXXX:XXXX:XXXX/64 (ULA Router Advertisements)
fe80::XXXX:XXXX:XXXX:XXXX/64 (Link Local Address)

When I restart Home Assistant with IPv6 activated, I get the following errors in my logs:

Logger: hass_nabucasa.remote
Source: runner.py:188
First occurred: 15:24:50 (3 occurrences)
Last logged: 15:26:10

Can't update remote details from Home Assistant cloud (timeout)

Having investigated docs on Nabu Casa here: Troubleshooting.

This super helpfully explains that this error “indicates a network issue” and “a bad IPv6 network configuration”.

The docs go on to suggest checking your IPv6 connection using test-ipv6.com which I did:

The suggested solution is to just disable IPv6, which isn’t very helpful.

In addition, HACS throws the following error:

This error originated from a custom integration.

Logger: custom_components.hacs
Source: custom_components/hacs/base.py:464
Integration: HACS (documentation, issues)
First occurred: 15:25:03 (1 occurrences)
Last logged: 15:25:03

Timeout of 20 reached while waiting for https://api.github.com/rate_limit
Traceback (most recent call last):
  File "/config/custom_components/hacs/base.py", line 464, in async_can_update
    response = await self.async_github_api_method(self.githubapi.rate_limit)
  File "/config/custom_components/hacs/base.py", line 522, in async_github_api_method
    raise HacsException(_exception)
custom_components.hacs.exceptions.HacsException: Timeout of 20 reached while waiting for https://api.github.com/rate_limit

And these integrations won’t start, some of these are custom integrations (sensor.feedparser, localtuya) but why would ZHA not start - how would this be affected by IPv6?

Logger: homeassistant.bootstrap
Source: bootstrap.py:513
First occurred: 15:25:28 (2 occurrences)
Last logged: 15:26:28

Waiting on integrations to complete setup: sensor.feedparser, zha, localtuya, surepetcare, openuv

Is anyone else having these kind of issues with IPv6 on Home Assistant? Or am I just lucky? I couldn’t find much information out there :confused: so not sure how to proceed.

I’m taking a wild guess here… I think your addresses are fine, but the URL timeout from HACS may mean that HA asked DNS for an IP address of GitHub and got a v4 and v6 record, and is trying to use IPv6 to reach Github, and googling around its not clear to me that Github supports IPv6 yet

[EDIT]. After further playing around, go into HA via SSH or console and type:
nslookup api.github.com and see if anything is returned. In my case, only an IPv4 record is returned, which should allow HACS to work properly.

Hey! Thanks for coming back to me, I got this when I ran nslookup with IPv6 enabled on Home Assistant

➜  ~ nslookup api.github.com

Name:   api.github.com
Name:   api.github.com
Address: 64:ff9b::8c52:7906

Which made me wonder why I was seeing an IPv6 address for Github… and then I realised that I had turned on DNS64 on my router.

I had assumed (incorrectly) that this would be needed for my IPv6 connection - but I also have an IPv4 connection so if anything isn’t available via IPv6 it should just fall back to IPv4.

I’ve now turned off DNS64 and everything is working as expected - no great mystery, just that I’m an idiot!