HomeKit Discovery + Docker + MACVlan

Sometime over the past 3 or so months, my homekit integration stopped responding. I attempted to delete/readd the integration, and iOS would time out when trying to connect to HomeKit.

I used apk add tcpdump and ran tcpdump -i all -n host 224.0.0.251 and port 5353 to listen for all mdns packets, and then restarted Home Assistant via the server controls page. This led me to discover that all mDNS packets were not flowing out of my MACVlan, but instead out of a bridge interface I configured for Traefik reverse proxying.

Long story short - docker doesn’t have an intentional method for prioritizing networks attached to a container. A solution for me was to rename my MACVlan interface to aaa_macvlan from macvlan. This gave it the highest priority on the docker container, and thus the mDNS packets began flowing out of the correct interface.

Figured I’d write this up to help others who may have issues.

3 Likes

Old post I know, but I have the same setup and I’m experiencing the same problems.

I would like to rename my macvlan interface, but how do I do that?

I am using Portainer, but I can also do it through CLI.

Thanks.