Create Macvlan Network-5 minutes a day to play Docker container technology (55)

Source: Internet
Author: User

In the previous section we prepared the Macvlan experimental environment, and today we create Macvlan network Mac_net1 in Host1 and host2:

650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170815-1502768401876055089.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170815-1502768498693056007.jpg "style=" border:0px;float:none; "/>

Note: The same command will be executed in Host2 .

-d macvlan ① specifies driver as Macvlan.

②macvlan Network is the local network, in order to ensure that cross-host communication, users need to manage their own IP subnet.

③ Unlike other networks, Docker does not create a gateway for Macvlan, where the gateway should be real, or the container cannot be routed.

-o parent ④ Specifies the network interface to use.

Run the container bbox1 in host1 and connect to Mac_net1.

Since Mac_net1 in Host1 is inherently independent from Mac_net1 in Host2, in order to avoid IP collisions caused by automatic assignment, we'd better --ip Specify Bbox1 address as 172.16.86.10 。

In Host2, run the container bbox2, specifying the IP 172.16.86.11.

650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170815-1502768402042042258.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170815-1502768499077041361.jpg "style=" border:0px;float:none; "/>

Verify the connectivity of Bbox1 and Bbox1.

650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170815-1502768402030088381.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170815-1502768499193070510.jpg "style=" border:0px;float:none; "/>

Bbox2 can ping the IP 172.16.86.10 to Bbox1, but cannot resolve the "BBOX1" hostname.

650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170815-1502768402136017090.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170815-1502768499359088665.jpg "style=" border:0px;float:none; "/>

Docker does not provide DNS services for Macvlan, which is different from the overlay network.

In the next section we will analyze the network structure of Macvlan in detail.

650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170815-1502768353037013636.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170815-1502768499490091285.jpg "alt=" two-dimensional code + fingerprint. png "style=" border:0px; "/>

Create Macvlan Network-5 minutes a day to play Docker container technology (55)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.