-1

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:

1 Answers1

0

So I figured out the problem was not the internet connection in general.
The problem was the DNS resolving.

I fixed this by explicitly setting a DNS server on my Docker container with the

dns:
  - 1.1.1.1
  - 1.0.0.1

section on service level.

This resolved the problems I had.