docker software

Using a macvlan Network in Docker Compose

Edit 2020-10-28: Update docker-compose to v1.27.0+ and you might be able to use IPAM config in a v3 compose file (Link)

Docker Compose v3+ does not support IPAM configuration (gateway, ip_range, aux_addresses) of macvlan networks.

This network definition used to work in v2, but as v3 targets Docker Swarm use cases, it was removed (NOT deprecated!?):

name: home-lan
driver: macvlan
parent: eth0
- subnet:


  • Use ip_range that matches your home network if you’d like your containers to appear with everything else on that network
  • DHCP is NOT supported for containers on macvlan networks – make sure to assign a static ipv4_address to the container if you don’t want it to conflict with something else on your network – this will create big problems

More Info:

Docker Compose Spec – IPAM:

Note: Additional IPAM configurations, such as gateway, are only honored for version 2 at the moment.

Docker Macvlan Tutorial:

Note: macvlan is NOT supported on Windows hosts

Related Links:

Leave a Reply

Your email address will not be published. Required fields are marked *