I have the need for a Docker container that is visible in the host network with its own ip, mac and hostname advertised via avahi. (I want to use wire-pod without changing hostnames and stuff on my host computer)
I created a Docker network for this like:
networks:
wirepod_net:
driver: macvlan
driver_opts:
parent: "enp4s0"
ipam:
config:
- subnet: "192.168.10.0/24"
gateway: "192.168.10.1"
and gave the container a corresponding ip and mac address
mac_address: "9C:EE:7D:1A:0F:E8"
networks:
wirepod_net:
ipv4_address: "192.168.10.11"
This works totally fine and exactly as I wanted it.
BUT I installed tailscale on my host recently and as long as tailscale runs the container does NOT have internet access.
I googled a while for this but every problem that comes close to mine only wants to enable host <-> container communication. And I tried that because I thought maybe it's the same problem after all. But sadly that didn't help my "container cannot access internet" problem. (Or I did it wrong; I can not rule that out...)
That problem is a little bit over my head so I appreciate every help I get.
I carefully read and followed these posts:
- https://forum.tailscale.com/t/problem-with-tailscale-subnet-and-container-in-a-macvlan-network/1565 As far as I understand it, this focusses on accessing the macvlan container via tailscale.
- https://stackoverflow.com/questions/42083546/docker-macvlan-network-unable-to-access-internet Doesn't apply because the internet works normally only with tailscale the problem occurs.