Macvlan attached containers missing default route

OS Version/build: Ubuntu 22.04.5 LTS (5.15.0-130-generic)
App version: Docker version 27.4.1, build b9d17ea

Happy New Year all

I’m following this guide

But alas, I don’t get a default route?

# docker exec my-macvlan-alpine ip route
192.168.1.0/24 dev eth0 scope link  src 192.168.1.33 

Everything seems to have worked with the network creation, I can see the gateway in there, alas it doesn’t seem to have been passed to the container? (This all works fine for the normal bridge driver)

# docker network inspect my-macvlan-net
[
    {
        "Name": "my-macvlan-net",
        "Id": "0273b8b456e695146fca69e76c938f9df8022d7fc7b4a9c7761c9ae6a54f3527",
        "Created": "2025-01-01T11:57:28.173284086Z",
        "Scope": "local",
        "Driver": "macvlan",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": {},
            "Config": [
                {
                    "Subnet": "192.168.1.0/24",
                    "IPRange": "192.168.1.32/27",
                    "Gateway": "192.168.1.1",
                    "AuxiliaryAddresses": {
                        "local": "192.168.1.32"
                    }
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {
            "7b1603eaacb48b06b176427f69eac686909471ac17421b2be04441263c0defbb": {
                "Name": "my-macvlan-alpine",
                "EndpointID": "25b8a68aa969430c5eed98d34be00fecece09a9843dd1cd7a091dc2d889f2fef",
                "MacAddress": "02:42:c0:a8:01:21",
                "IPv4Address": "192.168.1.33/24",
                "IPv6Address": ""
            }
        },
        "Options": {
            "enp5s0": ""
        },
        "Labels": {}
    }
]

What have I done wrong???

Cheers

I can’t reproduce it with official Docker. I used “alpine:latest” for the test. How did you install Docker?

Hi I just followed the instruction from here

On the off chance I started to downgrade versions.

I tried the latest 26 but no joy, but then it started to work with 25.0.5
Alas I now have a default route, but it has no network access.

# docker exec netshoot ip route
default via 192.168.1.1 dev eth0 
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.33 

I’ve set promisc on but nothing, no pings in any direction, but this maybe going off-topic from this thread. I’ve clearly other issues :frowning_face:

If you only hve the issue with macvlan, I don’t think it is an off-topic. But I agree, you must have other issues causing this. I asked how you installed Docker, but now I wonder how you installed the host? Is it a phyiscal machine or virtual? If virtual, what did you use to virtualize it? Is it in the cloud? Is it a WSL2 distribution on Windows? Was it an existing system before Docker, or created for Docker?

Thanks for the reply. I’m migrating my home server from one physical box to another. So its a fresh install, the only other thing I’ve done on it are set up ZFS and SMB. Its only the Home Assistant container that requires macvlan, this was all working fine on the old machine, I was also using Portainer.

For the LOL’s I’ve just tried this on my laptop with a wired adaptor running Ubuntu 24.04(6.8.0-39) and have exactly the same issue. I tried downgrading that too but it only has 5.27 & 5.26 and neither work for me.

I’ve watched the excellent videos from NetworkChuck & Christian Lempa who seem to have it all just working.
I do hope I’ve not done something daft.

DNS is working btw

# docker exec -it netshoot host google.com
google.com has address 216.58.201.110
google.com has IPv6 address 2a00:1450:4009:827::200e
google.com mail is handled by 10 smtp.google.com.

I had a quick tcpdump and there seems to be unanswered ARP requests for the gateway?

I’m going to try and get both machines powered up and see what he differences are.

Thanks for your help so far

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.