Dynamic IPv6 Routing for Matter Devices Across Subnets

Started by userunkn4wn, Today at 01:22:52 AM

Previous topic - Next topic
Hi OPNsense Community,

I'm currently trying to figure out how to reach my Matter devices, which are on a different subnet from my Home Assistant instance.

I managed to get it working by enabling the mDNS reflector, using my Matter Border Router (IKEA DIRIGERA) as a gateway into the IoT network, and adding a static route for the Matter network's ULA prefix via this gateway.

While this setup works, it's somewhat fragile because the route is configured statically. The Matter network's ULA prefix doesn't seem to change, so that's not an issue. However, my IKEA DIRIGERA's IPv6 link-local address changes after every reboot, meaning the gateway address changes as well.

I tried enabling Router Advertisement acceptance on the interface using:

sudo ifconfig bridge2 inet6 accept_rtadv

Unfortunately, this didn't seem to work.

Does anyone have an idea how I could move away from the static route and have OPNsense automatically learn the route instead?

Having to update the route after every reboot isn't a huge issue, especially since I only noticed this behavior after weeks of running this setup successfully, but it's certainly not ideal.

Thanks in advance for any suggestions!

Place your Home Assistant VM in your IOT VLAN?
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

It's a bit unclear to me what you are trying to achieve. Matter is an application protocol. Matter devices are registered to a Matter controller. That's called a "fabric". The Matter controller usually happens to live on a border router. Your Dirigera hub is a border router that connects devices on Ethernet and Thread networks. So, if you want to communicate on the Matter level, connect to the controller via its name or IP, like you do with any other device on your local networks.

If however, you want to communicate to your Matter devices bypassing the controller, you will need to explicitly configure routes. But, as you already found out, you have no control over the ULAs. This, in fact, is by design. Thread is a radio network. If communication between devices on that network breaks down for whatever reason, the network will reorganise into so called partitions, i.e. partial networks where communication still works. The partitions will reconfigure and choose a new ULA. Same thing happens when partitions eventually rejoin.

To work around this simply add the Dirigera controller as a Matter hub to your Home Assistant, if there is support for this. That way, HA and Dirigera will talk Matter protocol. Don't communicate with your Matter devices via low-level IP, i.e. don't use multi-admin mode. It only drains batteries faster.

If that's not an option, follow Patrick's advice and put your HA into the same network as the Dirigera hub (possibly via another interface).

Quote from: mooh on <strong>Today</strong> at 02:16:27 PMIt's a bit unclear to me what you are trying to achieve. Matter is an application protocol. Matter devices are registered to a Matter controller. That's called a "fabric". The Matter controller usually happens to live on a border router. Your Dirigera hub is a Matter controller and border router that connects devices on Ethernet and Thread networks. So, if you want to communicate on the Matter level, connect to the controller via its name or IP, like you do with any other device on your local networks.

If however, you want to communicate to your Matter devices bypassing the controller, you will need to explicitly configure routes. But, as you already found out, you have no control over the ULAs. This, in fact, is by design. Thread is a radio network. If communication between devices on that network breaks down for whatever reason, the network will reorganise into so called partitions, i.e. partial networks where communication still works. The partitions will reconfigure and choose a new ULA. Same thing happens when partitions eventually rejoin.

To work around this simply add the Dirigera controller as a Matter hub to your Home Assistant, if there is support for this. That way, HA and Dirigera will talk Matter protocol. Don't communicate with your Matter devices via low-level IP, i.e. don't use multi-admin mode. It only drains batteries faster.

If that's not an option, follow Patrick's advice and put your HA into the same network as the Dirigera hub (possibly via another interface).


Quote from: Patrick M. Hausen on <strong>Today</strong> at 07:05:38 AMPlace your Home Assistant VM in your IOT VLAN?

Yes, that would be the simplest solution, but Home Assistant is running in a container on a Raspberry Pi 5, and I'd prefer to keep it on a separate network.

However, I could add a virtual interface to the Pi and handle it using VLANs.

Quote from: mooh on <strong>Today</strong> at 02:16:27 PMIt's a bit unclear to me what you are trying to achieve. Matter is an application protocol. Matter devices are registered to a Matter controller. That's called a "fabric". The Matter controller usually happens to live on a border router. Your Dirigera hub is a border router that connects devices on Ethernet and Thread networks. So, if you want to communicate on the Matter level, connect to the controller via its name or IP, like you do with any other device on your local networks.

If however, you want to communicate to your Matter devices bypassing the controller, you will need to explicitly configure routes. But, as you already found out, you have no control over the ULAs. This, in fact, is by design. Thread is a radio network. If communication between devices on that network breaks down for whatever reason, the network will reorganise into so called partitions, i.e. partial networks where communication still works. The partitions will reconfigure and choose a new ULA. Same thing happens when partitions eventually rejoin.

To work around this simply add the Dirigera controller as a Matter hub to your Home Assistant, if there is support for this. That way, HA and Dirigera will talk Matter protocol. Don't communicate with your Matter devices via low-level IP, i.e. don't use multi-admin mode. It only drains batteries faster.

If that's not an option, follow Patrick's advice and put your HA into the same network as the Dirigera hub (possibly via another interface).


Home Assistant is already part of the same Matter fabric as the DIRIGERA, and it can actually reach the DIRIGERA hub without any issues.

What stopped working after I moved Home Assistant to a different subnet was communication with the smart bulbs. To make that work, I had to configure static routes on OPNsense.

I also just noticed that the Matter ULA prefix can change, as you pointed out. So I guess Patrick's suggestion of placing Home Assistant in the IoT network would probably be the best solution.

I assume the actual issue is that Home Assistant can reach the DIRIGERA hub but cannot reach the Thread devices through the border router without the appropriate routes.

If your HA and Dirigera are part of the same fabric, you are using a multi-admin setup. In that case both hubs need to be on the same (V)LAN segment.

As I tried to explain, either keep them on the same (V)LAN in multi-admin mode or remove the devices from HA, add the Dirigera as a Matter hub to HA. This will expose devices connected to the Dirigera via Matter to the HA. Then, you may move the HA to another network because HA will not try to talk to the devices via their ULAs directly.