Docker, podman & lxc in same VM need to communicate

Hi
I want to have a Ubuntu Server (24 LTS) that runs Docker containers, LXC containers and Podman pods at the same time. Container services have to be able to communicate with each other and the rest of the network e.g. Internet.
The host has 2 NICs, one purely for management and the other for container services only (the host has no IP on this NIC).
Pods have to run in rootless mode.

I don’t understand how I have to implement this. I tried the following:

eth0                (parent for app_br)
 └─ app_br          (parent for all macvlans)
     ├─ macvlan_doc (attach Docker containers here; created with docker network create...)
     ├─ macvlan_pod (attach Pods here; created with podman network create)
     └─ macvlan_lxc (attach LXC here)

This works for Docker, but I cannot get this to work for Podman. Even if I create the macvlan_pod and verify it’s there and attached to app_br podman run... throws the following error as soon as I try to attach something to macvlan_pod:

Error: netavark: Netlink error: No such device (os error 19)

I also tried to create a macvlan with netplan but all the netplan syntax I have found and tried fails.

AI could not help and let me run in circles.

This is what I would like to achieve:
container_networking

How can I implement this? I would like for each container to have its very own ip but also mac address so that each appears as a real client on the network. That is the reason I tried to implement this with macvlan.

Any help is welcome. Thank you

Very curious to be running Docker and Podman at the same time. Podman should be able to handle everything, but to each their own.

As for your actual question, my initial thought is that this is because it’s a rootless podman container. According to the docs, under the --driver section:

Driver to manage the network. Currently bridge, macvlan and ipvlan are supported. Defaults to bridge. As rootless the macvlan and ipvlan driver have no access to the host network interfaces because rootless networking requires a separate network namespace.

(emphasis mine).

Maybe this has something to do with it?

Thanks for you answer. This is not for production, this is just a lab for me to learn and experiment with the different technologies and I want to get experience with all 3 of them.

Not sure, I will certainly look into it. So far I have only used Docker in Unraid and there it’s basically install a “Plugin” and you’re done. So I’m a dummy at the beginning of it’s journey…

1 Like

Fair enough, and I’m not like a network expert so I can only help you so much :sweat_smile:

I will also through out that podman can handle networking through a couple different libraries/tools like pasta and slirp4netns. I’m not sure what the differences are, but those are other terms you can search for.