Weave网络使用之前需要执行  eval $(weave env) ,其作用是将后续的docker 命令发送给weave proxy处理,如果需要恢复之前的网络,可以执行 eval $(weave env --restore)
 
 
root@host1:~# eval $(weave env)
root@host1:~# docker run --name bbox1 -itd busybox
c3414fa41f61583a82aeef4dbbe8f4431f01b063a60696f15ccab35ab68b13f7
root@host1:~# docker exec bbox1 ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
24: eth0@if25: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 qdisc noqueue
    link/ether 02:42:0a:02:2e:02 brd ff:ff:ff:ff:ff:ff
    inet 10.2.46.2/24 brd 10.2.46.255 scope global eth0
       valid_lft forever preferred_lft forever
26: ethwe@if27: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1376 qdisc noqueue
    link/ether aa:f8:77:29:4e:49 brd ff:ff:ff:ff:ff:ff
    inet 10.32.0.1/12 brd 10.47.255.255 scope global ethwe
       valid_lft forever preferred_lft forever
root@host1:~# ip link
27: vethwepl3962@if26: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1376 qdisc noqueue master weave state UP mode DEFAULT group default
    link/ether 3e:45:bc:fd:67:82 brd ff:ff:ff:ff:ff:ff link-netnsid 0
root@host1:~# brctl show
bridge name    bridge id        STP enabled    interfaces
docker0        8000.0242fbab05c3    no        vetha0c66cd
weave        8000.9aac0ef31a18    no        vethwe-bridge
                                            vethwepl3962
 
#    bbox1中的 ethwe@if27  与 host 上的 vethwe13962@if26 是一对 veth pair , vethwep13962 又挂在了桥 weave下面
 
root@host1:~# ip -d link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 promiscuity 0 addrgenmode eui64
2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether 00:50:56:87:4c:70 brd ff:ff:ff:ff:ff:ff promiscuity 0 addrgenmode eui64
3: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether 00:50:56:87:22:32 brd ff:ff:ff:ff:ff:ff promiscuity 0 addrgenmode eui64
4: ens192.10@ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
    link/ether 00:50:56:87:22:32 brd ff:ff:ff:ff:ff:ff promiscuity 0
    vlan protocol 802.1Q id 10 <REORDER_HDR> addrgenmode eui64
5: ens192.20@ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
    link/ether 00:50:56:87:22:32 brd ff:ff:ff:ff:ff:ff promiscuity 0
    vlan protocol 802.1Q id 20 <REORDER_HDR> addrgenmode eui64
6: flannel.1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UNKNOWN mode DEFAULT group default
    link/ether 66:2b:a5:56:0d:c6 brd ff:ff:ff:ff:ff:ff promiscuity 0
    vxlan id 1 local 10.12.31.211 dev ens160 srcport 0 0 dstport 8472 nolearning ageing 300 addrgenmode eui64
7: docker0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default
    link/ether 02:42:fb:ab:05:c3 brd ff:ff:ff:ff:ff:ff promiscuity 0
    bridge forward_delay 1500 hello_time 200 max_age 2000 ageing_time 30000 stp_state 0 priority 32768 vlan_filtering 0 vlan_protocol 802.1Q addrgenmode eui64
16: datapath: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1376 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1
    link/ether 0e:46:0b:d9:e7:46 brd ff:ff:ff:ff:ff:ff promiscuity 1
    openvswitch addrgenmode eui64
18: weave: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1376 qdisc noqueue state UP mode DEFAULT group default qlen 1000
    link/ether 9a:ac:0e:f3:1a:18 brd ff:ff:ff:ff:ff:ff promiscuity 0
    bridge forward_delay 1500 hello_time 200 max_age 2000 ageing_time 30000 stp_state 0 priority 32768 vlan_filtering 0 vlan_protocol 802.1Q addrgenmode eui64
19: dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether 76:8c:4e:05:d9:24 brd ff:ff:ff:ff:ff:ff promiscuity 0
    dummy addrgenmode eui64
21: vethwe-datapath@vethwe-bridge: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1376 qdisc noqueue master datapath state UP mode DEFAULT group default
    link/ether be:d6:9a:e2:7c:cb brd ff:ff:ff:ff:ff:ff promiscuity 1
    veth
    openvswitch_slave addrgenmode eui64
22: vethwe-bridge@vethwe-datapath: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1376 qdisc noqueue master weave state UP mode DEFAULT group default
    link/ether e2:ad:6d:b8:8d:c4 brd ff:ff:ff:ff:ff:ff promiscuity 1
    veth
    bridge_slave state forwarding priority 32 cost 2 hairpin off guard off root_block off fastleave off learning on flood on addrgenmode eui64
23: vxlan-6784: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master datapath state UNKNOWN mode DEFAULT group default qlen 1000
    link/ether da:4e:f2:ed:84:34 brd ff:ff:ff:ff:ff:ff promiscuity 1
    vxlan id 0 srcport 0 0 dstport 6784 nolearning ageing 300 udp6zerocsumrx
    openvswitch_slave addrgenmode eui64
25: vetha0c66cd@if24: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master docker0 state UP mode DEFAULT group default
    link/ether 0a:ea:26:d8:40:3c brd ff:ff:ff:ff:ff:ff link-netnsid 0 promiscuity 1
    veth
    bridge_slave state forwarding priority 32 cost 2 hairpin off guard off root_block off fastleave off learning on flood on addrgenmode eui64
27: vethwepl3962@if26: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1376 qdisc noqueue master weave state UP mode DEFAULT group default
    link/ether 3e:45:bc:fd:67:82 brd ff:ff:ff:ff:ff:ff link-netnsid 0 promiscuity 1
    veth
    bridge_slave state forwarding priority 32 cost 2 hairpin on guard off root_block off fastleave off learning on flood on addrgenmode eui64
 
#       1、vethwe-bridge@vethwe-datapath 和 vethwe-datapath@vethwe-bridge 是一对 veth pair
#    2、vethwe-datapath 的父设备(master)是datapath
#    3、datapath是一个openvswitch
#    4、vxlan-6784 是vxlan interface ,其master也是datapath,weave主机间通信走的是vxlan
 
 
 
root@host1:~# docker run --name bbox2 -itd busybox
8ba1a2fd0b8142460adce5c0c84f340f1293c70725703f7553b8eb8f3b559a9b
root@host1:~# docker ps -a
CONTAINER ID        IMAGE                        COMMAND                  CREATED             STATUS              PORTS               NAMES
8ba1a2fd0b81        busybox                      "/w/w sh"                7 seconds ago       Up 5 seconds                            bbox2
c3414fa41f61        busybox                      "/w/w sh"                7 minutes ago       Up 7 minutes                            bbox1
7e8598656934        weaveworks/weave:2.5.1       "/home/weave/weaver …"   25 hours ago        Up 25 hours                             weave
65fab63189a6        weaveworks/weaveexec:2.5.1   "data-only"              25 hours ago        Created                                 weavevolumes-2.5.1
a4d5d7b88819        weaveworks/weavedb:latest    "data-only"              25 hours ago        Created                                 weavedb
root@host1:~# docker exec bbox1 hostname
bbox1.weave.local
root@host1:~# docker exec bbox2 hostname
bbox2.weave.local
root@host1:~# docker exec bbox1 ping bbox2
PING bbox2 (10.32.0.2): 56 data bytes
64 bytes from 10.32.0.2: seq=0 ttl=64 time=0.097 ms
64 bytes from 10.32.0.2: seq=1 ttl=64 time=0.041 ms
64 bytes from 10.32.0.2: seq=2 ttl=64 time=0.076 ms
root@host1:~# docker exec bbox1 ip r
default via 10.2.46.1 dev eth0
10.2.46.0/24 dev eth0 scope link  src 10.2.46.2
10.32.0.0/12 dev ethwe scope link  src 10.32.0.1
224.0.0.0/4 dev ethwe scope link
root@host1:~# docker exec bbox2 ip r
default via 10.2.46.1 dev eth0
10.2.46.0/24 dev eth0 scope link  src 10.2.46.3
10.32.0.0/12 dev ethwe scope link  src 10.32.0.2
224.0.0.0/4 dev ethwe scope link
 
 
weave网络拓扑如下
 

064、Weave网络结构分析(2019-04-04 周四)的更多相关文章

  1. 第 8 章 容器网络 - 064 - Weave 网络结构分析

    Weave 网络结构分析 在 host1 中运行容器 bbox1: eval $(weave env) docker run --name bbox1 -itd busybox 首先执行 eval $ ...

  2. Weave 网络结构分析 - 每天5分钟玩转 Docker 容器技术(64)

    上一节我们安装并创建了 Weave 网络,本节将部署容器并分析网络结构.在 host1 中运行容器 bbox1: eval $(weave env) docker run --name bbox1 - ...

  3. macvlan 网络结构分析 - 每天5分钟玩转 Docker 容器技术(56)

    上一节我们创建了 macvlan 并部署了容器,本节详细分析 macvlan 底层网络结构. macvlan 网络结构分析 macvlan 不依赖 Linux bridge,brctl show 可以 ...

  4. 如何使用 Weave 网络?- 每天5分钟玩转 Docker 容器技术(63)

    weave 是 Weaveworks 开发的容器网络解决方案.weave 创建的虚拟网络可以将部署在多个主机上的容器连接起来.对容器来说,weave 就像一个巨大的以太网交换机,所有容器都被接入这个交 ...

  5. 第 8 章 容器网络 - 063 - 如何使用 Weave 网络?

    如何使用 Weave 网络? weave 是 Weaveworks 开发的容器网络解决方案. weave 创建的虚拟网络可以将部署在多个主机上的容器连接起来. 对容器来说,weave 就像一个巨大的以 ...

  6. Docker Weave网络部署

    Weave在Docker主机之间实现Overlay网络,使用业界标准VXLAN封装,基于UDP传输,也可以加密传输.Weave Net创建一个连接多个Docker主机的虚拟网络,类似于一个以太网交换机 ...

  7. 第 8 章 容器网络 - 056 - macvlan 网络结构分析

    macvlan 网络结构分析 macvlan 不依赖 Linux bridge,brctl show 可以确认没有创建新的 bridge. 查看一下容器 bbox1 的网络设备: 除了 lo,容器只有 ...

  8. docker (centOS 7) 使用笔记5 - weave网络

    weave官网 https://www.weave.works 1. 下载安装 sudo curl -L git.io/weave -o /usr/local/bin/weave sudo chmod ...

  9. 62-Weave 网络结构分析

    上一节我们安装并创建了 Weave 网络,本节将部署容器并分析网络结构. 在 host1 中运行容器 bbox1: eval $(weave env) docker run --name bbox1 ...

随机推荐

  1. MT【274】一道漂亮的不等式题

    已知$x_1^2+x_2^2+\cdots+x_6^2=6,x_1+x_2+\cdots+x_6=0,$证明:$x_1x_2\cdots x_6\le\dfrac{1}{2}$ 解答:显然只需考虑2个 ...

  2. Hdoj 1102.Constructing Roads 题解

    Problem Description There are N villages, which are numbered from 1 to N, and you should build some ...

  3. 每天一个linux命令(1):wc命令

    Linux系统中的wc(Word Count)命令的功能为统计指定文件中的字节数.字数.行数,并将统计结果显示输出. 1.命令格式: wc [选项]文件... 2.命令功能: 统计指定文件中的字节数. ...

  4. docker-compose.yml(3)

    ELK:version: '2' services: elasticsearch: build: context: elasticsearch/ volumes: - ./elasticsearch/ ...

  5. LNOI2014LCA(树链剖分+离线操作+前缀和)

    题意:给一棵有根树,有多组询问,询问为l r z,求下标为l到r之间的点和z的lca的深度和. 如果我们一个一个求.emmmmm... 考虑答案怎么产生,仔细想一想,如果我们把l到r的所有点到根都加上 ...

  6. 阶乘函数(factorial)——结果在整型范围内的阶乘计算

    定义: 在数学中,正整数的阶乘(英语:factorial)是所有小于及等于该数的正整数的积,计为n!,例如5的阶乘计为5!,其值为120: \[ 5!=5\times 4\times 3\times ...

  7. javascript之判断专题

    javascript有数组,对象,函数,字符串,布尔,还有Symbol,set,map,weakset,weakmap. 判断这些东西也是有很多坑,像原生的typeof,instanceOf有一些bu ...

  8. The 2018 ACM-ICPC Asia Qingdao Regional Contest

    The 2018 ACM-ICPC Asia Qingdao Regional Contest 青岛总体来说只会3题 C #include<bits/stdc++.h> using nam ...

  9. Linux中编译或安装程序时提示No such file or directory

    deb系发行版本 Debian Ubuntu Linux Mint等 dpkg -S dpkg-query -S rpm系发行版本 RHEL CentOS等 yum provides rpm -qf ...

  10. (转)git checkout 撤销修改

    背景:学习git相关命令 git撤销修改和版本回退 git status查看当前仓库的状态 liuzhipeng@exdroid43:~/pad/pad-test$ git status 位于分支 m ...