Skip to content

Instantly share code, notes, and snippets.

Last active November 20, 2023 06:50
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Setup Home Assistant matter-server as a container with macvlan

Setup Home Assistant matter-server as a container with macvlan


This guide glosses over a lot of network details and how ipv4 and ipv6 works. It works in my case but mistakes or other differences could lose you access to your server or cause other problems on your network. I advise to only use it if you have knowledge of linux and network. Use at your own risk

Only try this if have problems setting up your HA matter-server with the error CHIP Error 0x000000C1: Endpoint pool full with the official method (network_mode: host)


Define a local ipv6 subnet(Matter needs(!) ipv6 connectivity with mDNS support): e.g. fd4b:8c60:5ef3:d321::/64

Define IPv4 address for the matter-server(HA needs this address) and a second one for the bridge interface in your local network. e.g. if your subnet is

  • Bridge interface:
  • Matter server:

Choose a name for the bridge interface e.g. macvlan01. You also need the name of your servers network interface. e.g. enp5s0

Make sure to replace all addresses and names in the following commands with your corresponding values.

Create the bridge:
ip link add macvlan01 link enp5s0 type macvlan mode bridge

Set the ip address of the bridge:
ip addr add dev macvlan01

Enable the bridge:
ip link set macvlan01 up

Add route for the ipv4 adress of the container:
ip route add dev macvlan01

Add route for the ipv6 subnet:
ip route add fd4b:8c60:5ef3:d321::/64 dev macvlan01

If you have done the steps you can create the docker-compose.yml(see the example below) and start the server. In HA you add the matter integration with url ws://

Related issues

version: "3.6"
container_name: matter-server
restart: unless-stopped
# Needed for Bluetooth via dbus
#- apparmor:unconfined
- ./data:/data/
#- /run/dbus:/run/dbus:ro
#the choosen ipv4 address (you have to set a static ip here, because docker does not use dhcp to allocate ip addresses, it chooses one from the subnet given below)
driver: macvlan
enable_ipv6: true
parent: enp5s0
- subnet: "" # your ipv4 network
gateway: "" # address of your ipv4 gateway/router
- subnet: "fd4b:8c60:5ef3:d321::/64" #ipv6 subnet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment