I’m a little confused as to how the following scenario works. It’s a very simple setup, so I hope the explanation is simple.
I have a host with a single physical NIC. I create a single macvlan sub-interface in bridge mode off this physical NIC. Then I start up two LXD/LXC containers. Each with their own unique MAC and IP. In the profile, I specify the same single macvlan sub-interface as each container’s parent interface.
Both containers have access to the network without issue. I’m also able to SSH into each container using each container’s unique IP address (from a different machine, not the machine hosting the containers). This is the bit that confuses me:
How is all of this working underneath the hood? How are two containers using a single macvlan interface? Isn’t there going to be some sort of collision with MAC/IP? Shouldn’t this not work? Shouldn’t I need one macvlan subinterface per container?
macvlan isn’t documented much, hoping someone out there can help out.
Second side question:
Am I right to assume that a macvlan interface uses virtual functions on a NIC?