Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to create a macvlan Network

2025-04-12 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

How to create a macvlan network, I believe that many inexperienced people do not know what to do, so this paper summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.

Create macvlan network mac_net1 in host1 and host2 today

Note: the same command should be executed in host2.

①-d macvlan specifies that driver is macvlan.

② macvlan network is a local network. In order to ensure communication across hosts, users need to manage the IP subnet themselves.

Unlike other networks, ③ does not create gateways for macvlan. The gateways here should be real, otherwise the container cannot route them.

④-o parent specifies the network interface to use.

Run container bbox1 in host1 and connect to mac_net1.

Since the mac_net1 in host1 is essentially independent from the mac_net1 in host2, in order to avoid IP conflicts caused by automatic allocation, it is best to specify the bbox1 address as 172.16.86.10 through-ip.

Run container bbox2 in host2, specifying IP 172.16.86.11.

Verify connectivity between bbox1 and bbox1.

Bbox2 can ping to bbox1's IP 172.16.86.10, but cannot resolve the "bbox1" hostname.

It can be seen that docker does not provide DNS services for macvlan, which is different from overlay networks.

After reading the above, have you mastered the method of how to create a macvlan network? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report