I'm trying to set up a macvlan network for my Docker containers, but I'm running into a problem where the containers can reach the internet and intranet, but they're not reachable from other devices on the same network. Here are the steps I've followed to create the macvlan: 1. Created the network with the necessary subnet, gateway, and parent interface using `docker network create`. 2. Added the macvlan interface with `ip link add`. 3. Assigned an IP address to that interface and set it up. 4. Adjusted the host interface to allow promiscuous mode. Despite having the containers configured, I can't seem to route packets from my local network into the macvlan network. It used to work a few months back, and I'm not sure what went wrong. Any suggestions?
4 Answers
It sounds like the issue might be related to your router's MAC address filtering. The macvlan interface you set up operates in bridge mode, which means it can impact how devices communicate on the LAN. Check your router settings to see if it's dropping packets from unknown MAC addresses. You might also want to add a manual route on your router to direct traffic destined for your containers' IPs to the Docker host directly. If that doesn't help, try running `ip neigh` on another LAN device to see if it recognizes the containers' MAC addresses.
I wonder why you’re using macvlan instead of the default bridge network. Macvlan can indeed complicate things instead of simplifying them. If you want your containers to be reachable like the host, sometimes using bridge networking could do the job just fine unless you have specific needs that only macvlan satisfies.
This seems to be a known issue with macvlan setups. Have you considered switching to `--network=host` for your containers? It simplifies access because containers use the host's network namespace directly, which could alleviate your routing issues. Just keep in mind to secure your host's network properly.
I believe you need macvlan for Home Assistant to communicate properly with devices like the Matter hub. They rely on mDNS for discovery, which can be a pain in containers. If you could get mDNS operations working with a reflector, you might simplify the setup. Just a heads up, the Home Assistant community might not be too helpful if you're running it within Docker, they prefer the standalone setup.

Related Questions
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures