What is macvlan and when would you use it?
AdvancedConceptNetworking
Answer
macvlan gives each container its own MAC address and an IP on your physical LAN, so it looks like a separate host. Use it for legacy apps needing LAN presence or specific IPs. Caveats: the host cannot reach its own macvlan containers without a macvlan sub-interface, switches may limit MACs per port, and Wi-Fi/cloud (AWS ENI) usually blocks it.
docker network create -d macvlan --subnet=192.168.1.0/24 --gateway=192.168.1.1 -o parent=eth0 lan
More on Networking
What network drivers does Docker have?BeginnerHow does the default bridge network work?AdvancedDefault bridge vs user-defined bridge: what is the difference?IntermediateHow does container DNS work?IntermediateHow does `-p 8080:80` work under the hood?AdvancedWhat is the difference between `-p 80:80` and `-p 127.0.0.1:80:80`?Beginner