[Solved] Docker macvlan network

I'm trying to use OpenWRT as a Docker host to run pihole attached the LAN network of OpenWRT. I have done this before with an Ubuntu host where OpenWRT was a virtualbox vm and pihole is a docker container, both were running on the Ubuntu host connected to bridged Ethernet network. I had to do the macvlan workaround so that the Ubuntu Host and the OpenWRT VM could ping the pihole LAN IP.

With the new awesome release 21.02 (thanks to everyone!), I thought of moving the pihole container into OpenWRT as it supports Docker. However when I'm trying the basic macvlan setup like below, I'm getting an error when starting the container.

docker-compose.yml
...
networks:
  internal:
  lan:
    name: lan
    driver: macvlan
    driver_opts:
      parent: eth2 #LAN interface which is currently not a bridged LAN in OpenWRT
    ipam:
      config:
        - subnet: 192.168.1.0/24
          gateway: 192.168.1.1
error output:
root@OpenWrt:~/docker-data# docker-compose -f docker-compose.yml up pihole
Building with native build. Learn about native build in Compose here: https://docs.docker.com/go/compose-native-build/
Starting pihole ... error

ERROR: for pihole  Cannot start service pihole: failed to create the macvlan port: operation not supported

ERROR: for pihole  Cannot start service pihole: failed to create the macvlan port: operation not supported
ERROR: Encountered errors while bringing up the project.

I'm looking for a way for making that work, running pihole inside of OpenWRT. Is it maybe possible with lxc or ujail instead?

1 Like

I was able to fix the problem by installing kmod-macvlan.

1 Like

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