Cloud Native应用交付

  • 首页
  • 关于本站
  • 个人介绍
  • Downloads
  • Repo
    • Github
    • Container
  • F5
    • F5 In AI Agent Arch
    • F5 AI Infrastructure Blueprint
    • F5 Python SDK
    • F5-container
    • F5-LBaaS
  • 社交
    • 联系我
    • 微信/微博
    • 公众号
    • 打赏赞助
行至水穷处 坐看云起时
Cloud Native Application Services: cnadn.net
  1. 首页
  2. 化云为雨/Openstack
  3. 正文

openstack L3-GRE 网络结构分析记录 (Icehouse) 第三篇(多租户)

2014年12月29日 14334点热度 0人点赞 0条评论

Warning: Array to string conversion in /home/wwwroot/myf5/wp-content/plugins/wpjam-basic/public/wpjam-utils.php on line 496

在上述两篇文章中描述的是单租户情况下同网段或不同网段间数据是如何走的,以及描述一个数据包是如何去往其他datacenter网络或互联网的。

openstack L3-GRE 网络结构分析记录 (Icehouse) 第一篇

openstack L3-GRE 网络结构分析记录 (Icehouse) 第二篇

本篇博文记录描述多租户情形下的网络及数据流情况。

首先,新建一个租户,并在该租户上下文下创建一个路由器和一个私网:

多租户网络之demo租户

和另一个租户网络比较一下:
多租户网络之admin租户

可以看出,两个租户共享了internet网络,这是因为在创建internet网络时,该网络是一个科共享的网络,即所有租户都可以使用。 两个租户的私有网络则完全不同,且两个网络拥有独立的虚拟路由器。

此时,在网络节点上,与前几篇文章描述的差异不大,neutron的l3agent会为每个租户创建独立的虚拟路由器,通过namespace隔离:

root@network:/home/mycisco# ip netns show
qrouter-015840ab-38ed-4086-b78e-696664d59281
qdhcp-5286db3e-0025-4650-8a4d-3e3e1dd9f70c
qrouter-040c1455-6096-4806-ba91-fec64cdaed81
qdhcp-224f79e0-8068-4ef7-8c79-2326bc0cf5c4
qdhcp-70f7aa46-b66b-455e-896e-05f94a08fcb8
qdhcp-4e3f621f-d6b9-4438-be58-aa51d3c2e061

上面 ***9281的虚拟路由器则是demo租户的。

而从openvswitch的角度来看,与之前的结构一样,只是多出一个port来连接demo租户的internal网络,对ovs来说没有租户的概念,租户和ovs中哪个网络连接是有neutron来负责的。

root@network:/home/mycisco# ovs-vsctl show
909c85d0-ff4e-446b-bf8a-9166f0fccd24
    Bridge br-int
        fail_mode: secure
        Port "taped034aae-11"
            tag: 1
            Interface "taped034aae-11"
                type: internal
        Port "tap78dd7f1e-53"
            tag: 2
            Interface "tap78dd7f1e-53"
                type: internal
        Port "qr-219fc331-d3"
            tag: 4
            Interface "qr-219fc331-d3"
                type: internal
        Port "qr-09208a89-0b"
            tag: 1
            Interface "qr-09208a89-0b"
                type: internal
        Port "tap1b1b29de-97"
            tag: 4
            Interface "tap1b1b29de-97"
                type: internal
        Port "qr-d8fd27a6-d1"
            tag: 2
            Interface "qr-d8fd27a6-d1"
                type: internal
        Port "tap708ee330-0c"
            tag: 3
            Interface "tap708ee330-0c"
                type: internal
        Port br-int
            Interface br-int
                type: internal
        Port patch-tun
            Interface patch-tun
                type: patch
                options: {peer=patch-int}
        Port "qr-4debe62b-e4"
            tag: 3
            Interface "qr-4debe62b-e4"
                type: internal
    Bridge br-ex
        Port "qg-6f726a6c-41"
            Interface "qg-6f726a6c-41"
                type: internal
        Port "eth2"
            Interface "eth2"
        Port br-ex
            Interface br-ex
                type: internal
        Port "qg-814e9e39-99"
            Interface "qg-814e9e39-99"
                type: internal
    Bridge br-tun
        Port patch-int
            Interface patch-int
                type: patch
                options: {peer=patch-tun}
        Port "gre-0a0a648c"
            Interface "gre-0a0a648c"
                type: gre
                options: {in_key=flow, local_ip="10.10.100.139", out_key=flow, remote_ip="10.10.100.140"}
        Port br-tun
            Interface br-tun
                type: internal
    ovs_version: "2.0.2"

计算节点情况:

root@compute:/home/mycisco# ovs-vsctl show
b5553502-95e4-4ad2-90a6-a3da02d3819d
    Bridge br-tun
        Port br-tun
            Interface br-tun
                type: internal
        Port "gre-0a0a648b"
            Interface "gre-0a0a648b"
                type: gre
                options: {in_key=flow, local_ip="10.10.100.140", out_key=flow, remote_ip="10.10.100.139"}
        Port patch-int
            Interface patch-int
                type: patch
                options: {peer=patch-tun}
    Bridge br-int
        fail_mode: secure
        Port br-int
            Interface br-int
                type: internal
        Port "qvo2e48b70e-e1"
            tag: 3
            Interface "qvo2e48b70e-e1"
        Port "qvo8cbe7bb6-18"
            tag: 2
            Interface "qvo8cbe7bb6-18"
        Port "qvoa6f975bb-60"
            tag: 1
            Interface "qvoa6f975bb-60"
        Port patch-tun
            Interface patch-tun
                type: patch
                options: {peer=patch-int}
    ovs_version: "2.0.2"
root@network:/home/mycisco# neutron net-list
+--------------------------------------+---------------+-----------------------------------------------------+
| id                                   | name          | subnets                                             |
+--------------------------------------+---------------+-----------------------------------------------------+
| 224f79e0-8068-4ef7-8c79-2326bc0cf5c4 | mgmt-net      | 410a9d7c-6ae8-4059-954e-973529a933c5 10.10.30.0/24  |
| 4e3f621f-d6b9-4438-be58-aa51d3c2e061 | private2      | f380d778-d576-4179-96df-cb3a2618dbd3 10.10.20.0/24  |
| 5286db3e-0025-4650-8a4d-3e3e1dd9f70c | demo_internal | f43edf85-594e-4eb1-bd02-adc90c47ada1 10.90.10.0/24  |
| 70f7aa46-b66b-455e-896e-05f94a08fcb8 | private1      | dcdd699a-c4b0-4360-9219-c62cb6ed0b3e 10.10.10.0/24  |
| bbf38334-045a-4124-859d-419e7c7abbda | internet      | 7b2cd216-1251-4eaa-9f05-b8cadc82bc1e 192.168.0.0/24 |
+--------------------------------------+---------------+-----------------------------------------------------+
root@network:/home/mycisco# source creds_demo
root@network:/home/mycisco# neutron net-list
+--------------------------------------+---------------+-----------------------------------------------------+
| id                                   | name          | subnets                                             |
+--------------------------------------+---------------+-----------------------------------------------------+
| 5286db3e-0025-4650-8a4d-3e3e1dd9f70c | demo_internal | f43edf85-594e-4eb1-bd02-adc90c47ada1 10.90.10.0/24  |
| bbf38334-045a-4124-859d-419e7c7abbda | internet      | 7b2cd216-1251-4eaa-9f05-b8cadc82bc1e 192.168.0.0/24 |
+--------------------------------------+---------------+-----------------------------------------------------+
root@network:/home/mycisco#

两个租户之间网络是完全不通和隔离的,且连个租户内的虚机实例所使用的安全组规则也是相互独立的,iptables利用为不同的qbr***设置各自独立的规则:

root@compute:/home/mycisco# brctl show
bridge name     bridge id               STP enabled     interfaces
qbr2e48b70e-e1          8000.ee0883a9a73e       no              qvb2e48b70e-e1
                                                        tap2e48b70e-e1
qbr8cbe7bb6-18          8000.5e56d69f355c       no              qvb8cbe7bb6-18
                                                        tap8cbe7bb6-18
qbra6f975bb-60          8000.fe4f362748db       no              qvba6f975bb-60
virbr0          8000.000000000000       yes
root@compute:/home/mycisco# 
root@compute:/home/mycisco# 
root@compute:/home/mycisco# iptables -L -n
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
neutron-openvswi-INPUT  all  --  0.0.0.0/0            0.0.0.0/0           
ACCEPT     udp  --  0.0.0.0/0            0.0.0.0/0            udp dpt:53
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:53
ACCEPT     udp  --  0.0.0.0/0            0.0.0.0/0            udp dpt:67
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:67

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
neutron-filter-top  all  --  0.0.0.0/0            0.0.0.0/0           
neutron-openvswi-FORWARD  all  --  0.0.0.0/0            0.0.0.0/0           
ACCEPT     all  --  0.0.0.0/0            192.168.122.0/24     ctstate RELATED,ESTABLISHED
ACCEPT     all  --  192.168.122.0/24     0.0.0.0/0           
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           
REJECT     all  --  0.0.0.0/0            0.0.0.0/0            reject-with icmp-port-unreachable
REJECT     all  --  0.0.0.0/0            0.0.0.0/0            reject-with icmp-port-unreachable

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         
neutron-filter-top  all  --  0.0.0.0/0            0.0.0.0/0           
neutron-openvswi-OUTPUT  all  --  0.0.0.0/0            0.0.0.0/0           
ACCEPT     udp  --  0.0.0.0/0            0.0.0.0/0            udp dpt:68

Chain neutron-filter-top (2 references)
target     prot opt source               destination         
neutron-openvswi-local  all  --  0.0.0.0/0            0.0.0.0/0           

Chain neutron-openvswi-FORWARD (1 references)
target     prot opt source               destination         
neutron-openvswi-sg-chain  all  --  0.0.0.0/0            0.0.0.0/0            PHYSDEV match --physdev-out tapa6f975bb-60 --physdev-is-bridged
neutron-openvswi-sg-chain  all  --  0.0.0.0/0            0.0.0.0/0            PHYSDEV match --physdev-in tapa6f975bb-60 --physdev-is-bridged
neutron-openvswi-sg-chain  all  --  0.0.0.0/0            0.0.0.0/0            PHYSDEV match --physdev-out tap2e48b70e-e1 --physdev-is-bridged
neutron-openvswi-sg-chain  all  --  0.0.0.0/0            0.0.0.0/0            PHYSDEV match --physdev-in tap2e48b70e-e1 --physdev-is-bridged
neutron-openvswi-sg-chain  all  --  0.0.0.0/0            0.0.0.0/0            PHYSDEV match --physdev-out tap8cbe7bb6-18 --physdev-is-bridged
neutron-openvswi-sg-chain  all  --  0.0.0.0/0            0.0.0.0/0            PHYSDEV match --physdev-in tap8cbe7bb6-18 --physdev-is-bridged

Chain neutron-openvswi-INPUT (1 references)
target     prot opt source               destination         
neutron-openvswi-oa6f975bb-6  all  --  0.0.0.0/0            0.0.0.0/0            PHYSDEV match --physdev-in tapa6f975bb-60 --physdev-is-bridged
neutron-openvswi-o2e48b70e-e  all  --  0.0.0.0/0            0.0.0.0/0            PHYSDEV match --physdev-in tap2e48b70e-e1 --physdev-is-bridged
neutron-openvswi-o8cbe7bb6-1  all  --  0.0.0.0/0            0.0.0.0/0            PHYSDEV match --physdev-in tap8cbe7bb6-18 --physdev-is-bridged

Chain neutron-openvswi-OUTPUT (1 references)
target     prot opt source               destination         

Chain neutron-openvswi-i2e48b70e-e (1 references)
target     prot opt source               destination         
DROP       all  --  0.0.0.0/0            0.0.0.0/0            state INVALID
RETURN     all  --  0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED
RETURN     icmp --  0.0.0.0/0            0.0.0.0/0           
RETURN     udp  --  10.90.10.3           0.0.0.0/0            udp spt:67 dpt:68
neutron-openvswi-sg-fallback  all  --  0.0.0.0/0            0.0.0.0/0           

Chain neutron-openvswi-i8cbe7bb6-1 (1 references)
target     prot opt source               destination         
DROP       all  --  0.0.0.0/0            0.0.0.0/0            state INVALID
RETURN     all  --  0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED
RETURN     tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:22
RETURN     icmp --  0.0.0.0/0            0.0.0.0/0           
RETURN     all  --  10.10.20.1           0.0.0.0/0           
RETURN     all  --  10.10.30.1           0.0.0.0/0           
RETURN     all  --  10.10.20.7           0.0.0.0/0           
RETURN     all  --  10.10.10.1           0.0.0.0/0           
RETURN     udp  --  10.10.10.2           0.0.0.0/0            udp spt:67 dpt:68
neutron-openvswi-sg-fallback  all  --  0.0.0.0/0            0.0.0.0/0           

Chain neutron-openvswi-ia6f975bb-6 (1 references)
target     prot opt source               destination         
DROP       all  --  0.0.0.0/0            0.0.0.0/0            state INVALID
RETURN     all  --  0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED
RETURN     tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:22
RETURN     icmp --  0.0.0.0/0            0.0.0.0/0           
RETURN     all  --  10.10.20.1           0.0.0.0/0           
RETURN     all  --  10.10.30.1           0.0.0.0/0           
RETURN     all  --  10.10.10.7           0.0.0.0/0           
RETURN     all  --  10.10.10.1           0.0.0.0/0           
RETURN     udp  --  10.10.20.2           0.0.0.0/0            udp spt:67 dpt:68
neutron-openvswi-sg-fallback  all  --  0.0.0.0/0            0.0.0.0/0           

Chain neutron-openvswi-local (1 references)
target     prot opt source               destination         

Chain neutron-openvswi-o2e48b70e-e (2 references)
target     prot opt source               destination         
RETURN     udp  --  0.0.0.0/0            0.0.0.0/0            udp spt:68 dpt:67
neutron-openvswi-s2e48b70e-e  all  --  0.0.0.0/0            0.0.0.0/0           
DROP       udp  --  0.0.0.0/0            0.0.0.0/0            udp spt:67 dpt:68
DROP       all  --  0.0.0.0/0            0.0.0.0/0            state INVALID
RETURN     all  --  0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED
RETURN     all  --  0.0.0.0/0            0.0.0.0/0           
neutron-openvswi-sg-fallback  all  --  0.0.0.0/0            0.0.0.0/0           

Chain neutron-openvswi-o8cbe7bb6-1 (2 references)
target     prot opt source               destination         
RETURN     udp  --  0.0.0.0/0            0.0.0.0/0            udp spt:68 dpt:67
neutron-openvswi-s8cbe7bb6-1  all  --  0.0.0.0/0            0.0.0.0/0           
DROP       udp  --  0.0.0.0/0            0.0.0.0/0            udp spt:67 dpt:68
DROP       all  --  0.0.0.0/0            0.0.0.0/0            state INVALID
RETURN     all  --  0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED
RETURN     icmp --  0.0.0.0/0            0.0.0.0/0           
RETURN     all  --  0.0.0.0/0            0.0.0.0/0           
neutron-openvswi-sg-fallback  all  --  0.0.0.0/0            0.0.0.0/0           

Chain neutron-openvswi-oa6f975bb-6 (2 references)
target     prot opt source               destination         
RETURN     udp  --  0.0.0.0/0            0.0.0.0/0            udp spt:68 dpt:67
neutron-openvswi-sa6f975bb-6  all  --  0.0.0.0/0            0.0.0.0/0           
DROP       udp  --  0.0.0.0/0            0.0.0.0/0            udp spt:67 dpt:68
DROP       all  --  0.0.0.0/0            0.0.0.0/0            state INVALID
RETURN     all  --  0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED
RETURN     icmp --  0.0.0.0/0            0.0.0.0/0           
RETURN     all  --  0.0.0.0/0            0.0.0.0/0           
neutron-openvswi-sg-fallback  all  --  0.0.0.0/0            0.0.0.0/0           

Chain neutron-openvswi-s2e48b70e-e (1 references)
target     prot opt source               destination         
RETURN     all  --  10.90.10.2           0.0.0.0/0            MAC FA:16:3E:99:88:5A
DROP       all  --  0.0.0.0/0            0.0.0.0/0           

Chain neutron-openvswi-s8cbe7bb6-1 (1 references)
target     prot opt source               destination         
RETURN     all  --  10.10.10.7           0.0.0.0/0            MAC FA:16:3E:32:28:AF
DROP       all  --  0.0.0.0/0            0.0.0.0/0           

Chain neutron-openvswi-sa6f975bb-6 (1 references)
target     prot opt source               destination         
RETURN     all  --  10.10.20.7           0.0.0.0/0            MAC FA:16:3E:CB:91:43
DROP       all  --  0.0.0.0/0            0.0.0.0/0           

Chain neutron-openvswi-sg-chain (6 references)
target     prot opt source               destination         
neutron-openvswi-ia6f975bb-6  all  --  0.0.0.0/0            0.0.0.0/0            PHYSDEV match --physdev-out tapa6f975bb-60 --physdev-is-bridged
neutron-openvswi-oa6f975bb-6  all  --  0.0.0.0/0            0.0.0.0/0            PHYSDEV match --physdev-in tapa6f975bb-60 --physdev-is-bridged
neutron-openvswi-i2e48b70e-e  all  --  0.0.0.0/0            0.0.0.0/0            PHYSDEV match --physdev-out tap2e48b70e-e1 --physdev-is-bridged
neutron-openvswi-o2e48b70e-e  all  --  0.0.0.0/0            0.0.0.0/0            PHYSDEV match --physdev-in tap2e48b70e-e1 --physdev-is-bridged
neutron-openvswi-i8cbe7bb6-1  all  --  0.0.0.0/0            0.0.0.0/0            PHYSDEV match --physdev-out tap8cbe7bb6-18 --physdev-is-bridged
neutron-openvswi-o8cbe7bb6-1  all  --  0.0.0.0/0            0.0.0.0/0            PHYSDEV match --physdev-in tap8cbe7bb6-18 --physdev-is-bridged
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           

Chain neutron-openvswi-sg-fallback (6 references)
target     prot opt source               destination         
DROP       all  --  0.0.0.0/0            0.0.0.0/0           
root@compute:/home/mycisco#

 

所以网络的逻辑结构实际如下:

openstack l3 网络 多租户

此时如果希望两个租户之间打通网络,可以通过外部网络路由将两个租户连接起来,或在两个虚拟路由器上设置路由指向彼此。

root@network:/home/mycisco# ip netns exec qrouter-040c1455-6096-4806-ba91-fec64cdaed81 netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         192.168.0.1     0.0.0.0         UG        0 0          0 qg-6f726a6c-41
10.10.10.0      0.0.0.0         255.255.255.0   U         0 0          0 qr-d8fd27a6-d1
10.10.20.0      0.0.0.0         255.255.255.0   U         0 0          0 qr-09208a89-0b
10.10.30.0      0.0.0.0         255.255.255.0   U         0 0          0 qr-4debe62b-e4
10.90.10.0      192.168.0.4     255.255.255.0   UG        0 0          0 qg-6f726a6c-41
192.168.0.0     0.0.0.0         255.255.255.0   U         0 0          0 qg-6f726a6c-41

 

root@network:/home/mycisco# ip netns exec qrouter-015840ab-38ed-4086-b78e-696664d59281 netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         192.168.0.1     0.0.0.0         UG        0 0          0 qg-814e9e39-99
10.10.10.0      192.168.0.2     255.255.255.0   UG        0 0          0 qg-814e9e39-99
10.90.10.0      0.0.0.0         255.255.255.0   U         0 0          0 qr-219fc331-d3
192.168.0.0     0.0.0.0         255.255.255.0   U         0 0          0 qg-814e9e39-99

T`$@UH5[SPM(8)3V5ANQTJ6

Array
本作品采用 知识共享署名-非商业性使用 4.0 国际许可协议 进行许可
标签: l3-agent network neutron openstack 多租户
最后更新:2014年12月29日

纳米

linjing.io

打赏 点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理。

页面AI聊天助手

纳米

linjing.io

☁️迈向Cloud Native ADC ☁️

认证获得:
TOGAF: ID 152743
Kubernetes: CKA #664
Microsoft: MCSE MCDBA
Cisco: CCNP
Juniper: JNCIS
F5:
F5 Certified Solution Expert, Security
F5 Certified Technology Specialist, LTM/GTM/APM/ASM
F5 Certified BIG-IP Administrator
  • 点击查看本博技术要素列表
  • 归档
    分类
    • AI
    • Automation
    • Avi Networks
    • Cisco ACI
    • CISCO资源
    • F5 with ELK
    • F5-Tech tips
    • F5技术
    • Juniper
    • Linux
    • NGINX
    • SDN
    • ServiceMesh
    • WEB编程
    • WINDOWS相关
    • 业界文章
    • 交换机技术
    • 化云为雨/Openstack
    • 协议原理
    • 容器/k8s
    • 我的工作
    • 我的生活
    • 网站技术
    • 路由器技术
    • 项目案例
    标签聚合
    k8s openstack F5 network DNS envoy api istio neutron irule nginx flannel bigip docker gtm
    最近评论
    Abeny 发布于 8 个月前(02月20日) Very good!
    lz 发布于 2 年前(02月26日) 66666666666666
    汤姆 发布于 2 年前(09月10日) 嗨,楼主,里面的json怎么下载啊,怎么收费啊?
    汤姆 发布于 2 年前(09月09日) 大佬,kib的页面可以分享下吗?谢谢
    zhangsha 发布于 2 年前(05月12日) 资料发给我下,谢谢纳米同志!!!!lyx895@qq.com
    浏览次数
    • Downloads - 196,236 views
    • 联系我 - 137,261 views
    • 迄今为止最全最深入的BIGIP-DNS/GTM原理及培训资料 - 126,937 views
    • Github - 115,472 views
    • Sniffer Pro 4 70 530抓包软件 中文版+视频教程 - 91,507 views
    • F5常见log日志解释 - 90,848 views
    • 迄今为止最全最深入的BIGIP-DNS/GTM原理及培训资料 - 88,833 views
    • 从传统ADC迈向CLOUD NATIVE ADC - 下载 - 87,832 views
    • 关于本站 - 76,604 views
    • F5利用Elastic stack(ELK)进行应用数据挖掘系列(2)-DNS - 65,058 views
    链接表
    • F5SE创新
    • Jimmy Song‘s Blog
    • SDNlab
    • Service Mesh社区
    • 三斗室
    • 个人profile
    • 云原生社区

    COPYRIGHT © 2023 Cloud Native 应用交付. ALL RIGHTS RESERVED.

    Theme Kratos Made By Seaton Jiang

    京ICP备14048088号-1

    京公网安备 11010502041506号