

This is different from creating sub-interface on a physical interface using vlan. Macvlan allows a single physical interface to have multiple mac and ip addresses using macvlan sub-interfaces. The following picture shows 2 Containers connected to a Linux bridge with ethx interface providing external connectivity. For external connectivity, we would need to use NAT.

Linux Bridge acts like a regular hardware switch with learning and also supports protocols like STP for loop prevention. In linux bridge implementation, VMs or Containers will connect to bridge and bridge will connect to outside world. In Overlay network approach, there is an additional level of encapsulation like VXLAN, NVGRE between the Container/VM network and the underlay network. Bridge, macvlan and ipvlan network drivers are examples of this approach. In Underlay network approach, VMs or Containers are directly exposed to host network. Broadly, there are two ways for Containers or VMs to communicate to each other. It is needed to have sophisticated mechanism to interconnect Containers.

When running Containers in a host, the number of Containers in a single host can easily exceed 100. On an average, the number of VMs in a single host does not exceed 15-20. When we run multiple VMs in a host, it is needed to provide connectivity between VMs within the host and across hosts. When running a baremetal server, host networking can be straightforward with few ethernet interfaces and a default gateway providing external connectivity. In the next set of blogs, I will cover how macvlan and ipvlan interfaces are used in Docker and CoreOS.
Docker ip linux how to#
In this blog, I will cover basics of macvlan and ipvlan, compare macvlan and ipvlan to Linux bridge and sub-interfaces and also show how to create these interfaces in Linux system. Macvlan and ipvlan are Linux network drivers that exposes underlay or host interfaces directly to VMs or Containers running in the host.
