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:



Note: also execute the same command 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 used.

Run the container bbox1 in host1 and connect to Mac_net1.

because Mac_net1 in Host1 is inherently independent of mac_net1 in Host2, in order to avoid IP collisions caused by automatic allocation, we'd better pass   --ip   specifies a bbox1 address of 172.16.86.10.

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

Verify the connectivity of Bbox1 and Bbox1.

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

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.

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.