博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
050、创建overlay网络(2019-03-15 周五)
阅读量:6835 次
发布时间:2019-06-26

本文共 1899 字,大约阅读时间需要 6 分钟。

参考
 
在host01中创建overlay网络 ov_net1
 
在下面的例子中可以看到,我们在host01上创建的overlay类型网络,会自动出现在host02上,该网络的name、id、IPAM都一样
 
这是因为host01将ov_net1的信息存到了consul中,host02从consul读取到了新创建的网络,自动同步到host02上
 
IPAM(IP Address Management)
 
root@host01:~# docker network create -d overlay ov_net1
609020e03ff4ac5fb1aad73e23bfb22bc288463663e5aba775ed06263077c242
root@host01:~# docker network ls
NETWORK ID          NAME                DRIVER              SCOPE
5f1cb3e7ea16        bridge              bridge              local
a08d5e1df638        host                host                local
83f08e15caa8        none                null                local
609020e03ff4        ov_net1             overlay             global
root@host01:~# docker network inspect ov_net1
[
    {
        "Name": "ov_net1",
        "Id": "609020e03ff4ac5fb1aad73e23bfb22bc288463663e5aba775ed06263077c242",
        "Created": "2019-03-15T08:52:44.452192114+08:00",
        "Scope": "global",
        "Driver": "overlay",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": {},
            "Config": [
                {
                    "Subnet": "10.0.0.0/24",
                    "Gateway": "10.0.0.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {},
        "Options": {},
        "Labels": {}
    }
]
 
-----------------------------------------------------------------------------------------
 
root@host02:~# docker network ls
NETWORK ID          NAME                DRIVER              SCOPE
6e2bde8f59ac        bridge              bridge              local
54f47d6227e5        host                host                local
042431e6b445        none                null                local
609020e03ff4        ov_net1             overlay             global
root@host02:~# docker network inspect ov_net1
[
    {
        "Name": "ov_net1",
        "Id": "609020e03ff4ac5fb1aad73e23bfb22bc288463663e5aba775ed06263077c242",
        "Created": "2019-03-15T08:52:44.452192114+08:00",
        "Scope": "global",
        "Driver": "overlay",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": {},
            "Config": [
                {
                    "Subnet": "10.0.0.0/24",
                    "Gateway": "10.0.0.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {},
        "Options": {},
        "Labels": {}
    }
]
 
 

转载于:https://www.cnblogs.com/www1707/p/10534893.html

你可能感兴趣的文章
CF1036C Classy Numbers dfs+二分
查看>>
linux管理和进程(4)
查看>>
公钥与私钥,HTTPS详解 转载
查看>>
构建之法阅读笔记(3)
查看>>
mysql having,group by查询去除重复记录
查看>>
StringBuffer和StringBuilder的区别
查看>>
修改GDAL库支持RPC像方改正模型
查看>>
UVALive5461 UVA615 POJ1308 Is It A Tree?(解法二)
查看>>
dataGridView 去除默认选择
查看>>
物理删除和逻辑删除
查看>>
MFC中使用ADO的记录集
查看>>
nodejs中 require 方法的加载规则
查看>>
webpack学习笔记一:安装webpack、webpack-dev-server、内存加载js和html文件、loader处理非js文件...
查看>>
jQuery
查看>>
RH253读书笔记(2)-Lab 2 System Resource Access Controls
查看>>
miterLimit和lineJoin属性
查看>>
用手抓饭增食欲
查看>>
就算会用python画颗心,可你依然还是只单身狗
查看>>
#5 string and custom functions && regular expressions
查看>>
.net mvc 分页
查看>>