您现在的位置是:热点 >>正文
云计算核心技术Docker教程:Docker使用macvla网络
热点609362人已围观
简介...
某些应用程序,尤其是旧版应用程序或监视网络流量的应用程序,期望直接连接到物理网络。在这种情况下,可以使用macvlan网络驱动程序为每个容器的虚拟网络接口分配MAC地址,使其看起来像是直云计接连接到物理网络的物理网络接口。在这种情况下,您需要在Docker主机上指定用于的物理接口macvlan,以及的子网和网关macvlan。您甚至可以macvlan使用不同的物理网络接口隔离网算核络。请记住以下几点:
由于IP地址耗尽或“ VLAN传播”,很容易无意间损坏您的网络,在这种情况下,您的网络中有大量不正确的唯一MAC地址。
您的网络设备需要能够处理“混杂模式”,在该模式下,可以为一个心技物理接口分配多个MAC地址。
如果您的应用程序可以使用网桥(在单个Docker主机上)或覆盖(跨多个Docker主机进行通信)工作,那么从长远来看,这些解决方案可能会更好。
创建一个macvla术Dn网络
创建macvlan网络时,它可以处于桥接模式或802.1q中继桥接模式。
在桥接模式下,macvlan流量通过主机上的物理设备。
在802.1q中继桥接模式下,流量通过Docker动态oc创建的802.1q子接口。这使您可以更精细地控制路由和过滤。
桥接模式
要创建macvlan与给定物理网络接口桥接的网络,请--driver macvlan与docker network creatkee命令一起使用。您还需要指定parent,这是流量将在Docker主机上实际通过的接口。
$ docker network create -d macvlan \
--subnet=172.16.86.0/24 \
-r教-gateway=172.16.86.1 \
-o parent=eth0 pub_net
如果您需要排除IP地址在macvlan网络中的使用,例如当一个给定的IP地址已经在使用中时,请使用--aux-a程:ddresses:
$ docker network create -d macvlan \
--subnet=192.168.32.0/24 \
--ip-range=192.168.32.128/25 \
--gatDoeway=192.168.32.254 \
--aux-address="my-router=192.168.32.129" \
-o parent=eth0 macnet32
802.1q中继桥接模式
如ck果您指定parent带有点的接口名称,例如eth0.50,则Docker会将其解释为的子接口,eth0并自动创建该子接口。
$ docker network create -d macvlan \
--suerbnet=192.168.50.0/24 \
--gateway=192.168.50.1 \
-o parent=eth0.50 macvlan50
使用ipvlan代替
在上面的示例中,您仍在使用L3桥使用。您可以改用ipvlan L2桥接器。指定-o ipvlan_mode=l2。
$ docker network create -d ipvlan \
--subnet=192.168.210.0/24 \
-ma-subnet=192.168.212.0/24 \
--gateway=192.168.210.254 \
--gateway=192.168.212.254 \
-o ipvlan_mode=l2cv -o parent=eth0 ipvlan210
Tags:
相关文章
标签: 车联天下
热点撰文 | 张 宇 编辑 | 杨博丞 题图 | IC Photo 11月28日,智能座舱“独角兽”车联天下正式向港交所递交招股书,拟在港股主板挂牌上市。此次IPO募集资金拟用于车载计算解决方案及区域控制...
【热点】
阅读更多游戏和直播需求强劲增长 腾讯将在日本建第三座数据中心
热点北京时间 6 月 22 日早间消息,据报道,腾讯准备在日本建设新数据中心,它是腾讯在日本的第三个数据中心。日本用户对线上游戏、在线直播的需求强劲增长,因此腾讯决定扩张。 腾讯云国际高级副总裁杨宝树(P...
【热点】
阅读更多云计算开发:Python3-istitle()方法详解
热点描述 Python istitle() 方法检测字符串中所有的单词拼写首字母是否为大写,且其他字母为小写。 语法 以下是 istitle() 方法语法: str.istitle() 返回值 如果字符串...
【热点】
阅读更多
热门文章
最新文章
友情链接
- 标签: 康师傅
- https://www.lenovo.com/gb/en/search?action=SEARCH&text=谷歌外推【tg:seogoogle987】,qgE
- https://www.klatreverden.no/search?q=谷歌外推【tg:seogoogle987】,lza
- https://www.abbreviations.com/谷歌外推【tg:seogoogle987】B4y
- https://www.jusoen.com/addreng.asp?p1=谷歌外推【tg:seogoogle987】p6M
- https://www.lezhin.com/ko/tags/谷歌外推【tg:seogoogle987】,S9U
- https://m.shoppinghow.kakao.com/m/search/q/谷歌外推【tg:seogoogle987】XyS
- https://www.tcv.org.uk/search/谷歌外推【tg:seogoogle987】,WPL
- https://www2.ual.es/ProyectoLates/?s=谷歌外推【tg:seogoogle987】,PRV
- https://www.maafushidive.com?collections?vendors?q=谷歌外推【tg:seogoogle987】,7sd
- https://www.parl.ca/legisinfo/fr/projets-de-loi?parlsession=all&view=list&keywords=谷歌外推【tg:seogoogle987】,Q19
- https://www.spoiledsweetboutique.com/search/谷歌外推【tg:seogoogle987】,qhk
- https://www.springfieldlibrary.org/?s=谷歌外推【tg:seogoogle987】,tNz
- https://www.pearlstonecenter.org/search/谷歌外推【tg:seogoogle987】,NTI
- https://dict.naver.com/dict.search?dicQuery&query=谷歌外推【tg:seogoogle987】S86
- https://hsmoa.com/search?query=谷歌外推【tg:seogoogle987】uDQ
- https://www.pearson.com/en-us/search.html?aq=谷歌外推【tg:seogoogle987】,9A6
- https://www.whiterock2008.com.tw/search?q=谷歌外推【tg:seogoogle987】,P4x
- https://www.skicheck.at/en/?action=CHECK&s=谷歌外推【tg:seogoogle987】,Crl
- https://www.youthforum.org/search-results?cx=4f5236218ab5e8ef9&ie=UTF-8&q=谷歌外推【tg:seogoogle987】,QWX
- https://www.lssystems.co.uk/search?page=0&per_page=24&term=谷歌外推【tg:seogoogle987】,Aqc
- https://www.temu.com/search_result.html?search_key=谷歌外推【tg:seogoogle987】L2C
- https://www.pierreherme.com/catalogsearch/result/?q=谷歌外推【tg:seogoogle987】,2OC
- https://www.teacherspayteachers.com/Browse/Price-Range/Free/Search:谷歌外推【tg:seogoogle987】,Sgn
- https://www.rockngem.com/?action=CHECK&s=谷歌外推【tg:seogoogle987】,j6M
- https://www.mdbg.net/chinese/dictionary?page=worddict&wdrst=0&wdqb=谷歌外推【tg:seogoogle987】,F1x
- https://www.youtube.com/hashtag/谷歌外推【tg:seogoogle987】,zaE
- https://www.soccerbible.com/search?q=谷歌外推【tg:seogoogle987】,CBr
- https://www.prattlibrary.org/search?q=谷歌外推【tg:seogoogle987】,KoZ
- https://www.mynextmove.org/find/search?s=谷歌外推【tg:seogoogle987】,unX
- https://www.maine.gov/pfr/professionallicensing/search/node?keys=谷歌外推【tg:seogoogle987】,jxo
- https://www.mintos.org/?s=谷歌外推【tg:seogoogle987】,WFl
- https://www.teamlab.art/zh-hans/?submit=谷歌外推【tg:seogoogle987】,YnP
- https://www.wou.edu.my/?s=谷歌外推【tg:seogoogle987】,F7I
- https://www.openspaceinstitute.org/search?q=谷歌外推【tg:seogoogle987】,5Hy
- https://www.woorden.org/spreekwoord.php?woord=谷歌外推【tg:seogoogle987】,nVZ
- https://www.maigoo.com/search/?block=&q=谷歌外推【tg:seogoogle987】,Ods
- https://www.kawainter.com/catalogsearch/result/?q=谷歌外推【tg:seogoogle987】,zoy
- https://www.shacknews.com/editorial-search?q=谷歌外推【tg:seogoogle987】,UpX
- https://www.localfootdoc.com/?s=谷歌外推【tg:seogoogle987】,55O
- https://www.tailoy.com.pe/catalogsearch/result/?q=谷歌外推【tg:seogoogle987】,UoN
- https://www.oikos-tecnics.com/?s=谷歌外推【tg:seogoogle987】,14p
- https://www.zutari.com/search/谷歌外推【tg:seogoogle987】,e98
- https://www.stonerealestate.com.au/?cat=100&s=谷歌外推【tg:seogoogle987】,Ns0
- https://www.vocabulary.com/dictionary/谷歌外推【tg:seogoogle987】,DhX
- https://www.roberthalf.com/us/en/jobs/all/谷歌外推【tg:seogoogle987】j2l
- https://www.goodreads.com/quotes/tag/谷歌外推【tg:seogoogle987】51D
- https://www.lgnewsroom.com/search/谷歌外推【tg:seogoogle987】,qzs
- https://www.qylaws.com/search/谷歌外推【tg:seogoogle987】,Cl8
- https://www.lifesciencesweden.se/search?q=谷歌外推【tg:seogoogle987】,hs6
- https://www.lee.com/search?q=谷歌外推【tg:seogoogle987】,6X1