Recently I tried a little something regarding MACVLAN, could be interesting for you or someone, so I post it here. Most of the time I use Portainer and write my docker compose files myself to have full control over everything. And with that one can get around the TN GUI limitations/bugs.
- Create a macvlan interface:
docker network create -d macvlan \
--subnet=192.168.1.0/24 \
--gateway=192.168.1.1 \
-o parent=enp8s0 \
macvlan_enp8s0
- docker compose file example:
services:
pihole:
image: pihole/pihole
restart: unless-stopped
networks:
macvlan_enp8s0:
ipv4_address: 192.168.1.9
networks:
macvlan_enp8s0:
external: true
And so the “pihole” container has it’s LAN IP. Port mapping in the compose file is inherently irrelevant, because the container has it’s own IP. In this case, pihole web gui will be on 192.168.1.9:80