Skip to main content

macvlan

Create a macvlan network set to the adequate adapter (in our case br0)

docker network create -d macvlan --subnet=192.168.178.0/24 --gateway=192.168.178.1 -o parent=br0 macvlan_net

Then add this into docker-compose.yml (adding first idented networks to service config and then configuring networks in a separate block).

    networks:
        macvlan_net:
          ipv4_address: 192.168.178.$
networks:
    macvlan_net:
      external: true
      driver: macvlan
      driver_opts:
        parent: eno1 # Ensure this is the correct interface - us br0 if using bridge
      ipam:
        config:
          - subnet: 192.168.178.0/24
            gateway: 192.168.178.1