Layer 2 communication with host on Windows

I have been tasked with investigating the possibility of running a Docker container on Windows, that runs one or more simulated devices, using an Ubuntu 24.04 image, and has to network traffic to the host. Unfortunately, one of these protocols (GOOSE) requires the usages of Layer 2 network traffic. I have found that this is not possible on Docker Desktop for Windows. Is there some virtual switch or perhaps even cloud solution that could act as a network switch, to make this communication work? Or is this a dead end?

I have explored the idea of running Docker inside of a Linux VM, with fairly good results, however unless I use host mode networking, which kills the plan to have multiple containers, as they need to be individually IP addressable. Is there perhaps something that I’m missing here? The stakeholders wish to use docker as rebuilding containers on changes is very fast.

On Windows 11 running Docker Desktop 4.37.1 with the WSL2 engine.

It won’t work with Docker Desktop as it runs a VM in which Docker has its own private network. Even the host network in Docker Desktop works on Layer 4.

If you run a Linux VM on Windows, you can try MacVLAN probably which is used by people too much, but I don’t see other ways in this case

Macvlan network driver | Docker Docs Then the container in the VM could be on the same LAN as your host if oyu can make that network available in the VM to be used as a parent by the container network.

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