In addition to Overlay,docker, another Driver:macvlan has been developed to support cross-host container networks.
The Macvlan itself is the Linxu kernel module, which allows multiple MAC addresses to be configured on the same physical network card, that is, multiple interface, each of which can be configured with its own IP. Macvlan is essentially a network card virtualization technology, it's not surprising that Docker implements a container network with Macvlan.
The biggest advantage of Macvlan is the excellent performance, compared to other implementations, Macvlan does not need to create a Linux bridge, but instead connects directly to the physical network via an Ethernet interface. Now let's create a Macvlan network.
Prepare the lab environment
We will create Macvlan using a separate NIC Enp0s9 on Host1 and Host2. To ensure that the network packets for multiple MAC addresses are available from ENP0S9, we need to turn on the promiscuous mode of the NIC.
IP link set enp0s9 promisc on
Make sure the ENP0S9 status up and Promisc mode is in effect.
650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170813-1502590944556070415.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170813-1502590959621015272.jpg "style=" border:0px;float:none; "/>
Because Host1 and Host2 are VirtualBox virtual machines, you also need to set promiscuous mode on the NIC configuration Options page.
650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170813-1502590944578040770.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170813-1502590959846014897.jpg "style=" border:0px;float:none; "/>
Current Lab Environment:
650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170813-1502590944551018799.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170813-1502590960440044504.jpg "alt=" 259.png "style=" BORDER:0PX;FONT-SIZE:14.4PX; Vertical-align:middle; "/>
Ready, next section we create a Macvlan network.
650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170813-1502590767482040568.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170813-1502590960645097668.jpg "alt=" two-dimensional code + fingerprint. png "style=" border:0px; "/>
Prepare for the Macvlan environment-5 minutes a day to play Docker container Technology (54)