openstack-网络

Neutron介绍
openstack高可用集群6-OVS和VXLAN的结合
第 11 章 配置网桥映射 Red Hat OpenStack Platform 9 | Red Hat Customer Portal
第 7 章 把一个实例连接到物理网络 Red Hat Enterprise Linux OpenStack Platform 7 | Red Hat Customer Portal

命令

openstack network list   查看创建的网络列表

neutron net-create public01 --provider:network_type flat --provider:physical_network physnet1 --router:external=True --shared   #创建provider网络。没创子网
neutron net-show flat   #查看创建的网络名称flat详细

ovs-ofctl dump-flows br-int  #查看经过ovs接口的数据包
ovs-ofctl dump-flows br-ex

provider与self-service网络

讲清楚说明白openstack中vm流量走向之1——集中式网络节点

虚拟网络连接外部网络

第 7 章 把一个实例连接到物理网络 Red Hat Enterprise Linux OpenStack Platform 7 | Red Hat Customer Portal

openstack网络=vxlan+provider+路由

root@m-openstack-20:~# ip route add 172.25.3.0/24 via 192.168.2.77 dev br-ex   #在master节点或者计算节点添加到虚拟机路由

openstack四种网络类型

ovs-vsctl show

root@m-openstack-20:~# ovs-vsctl show
# br-tun是虚拟机通信设备网络,使用vxlan
# br-int连接br-tun与虚拟机veth对设备,网络节点的br-int还连接了路由器设备
# br-ex是内部网络,提供者网络
f6b704fb-30d8-4be4-afa8-18b852a779f9
    Manager "ptcp:6640:127.0.0.1"
        is_connected: true
    Bridge br-tun
        Controller "tcp:127.0.0.1:6633"
            is_connected: true
        fail_mode: secure
        datapath_type: system
        Port vxlan-c0a80316
            Interface vxlan-c0a80316
                type: vxlan
                options: {df_default="true", egress_pkt_mark="0", in_key=flow, local_ip="192.168.3.20", out_key=flow, remote_ip="192.168.3.22"}
        Port patch-int
            Interface patch-int
                type: patch
                options: {peer=patch-tun}
        Port vxlan-c0a80315
            Interface vxlan-c0a80315
                type: vxlan
                options: {df_default="true", egress_pkt_mark="0", in_key=flow, local_ip="192.168.3.20", out_key=flow, remote_ip="192.168.3.21"}
        Port br-tun
            Interface br-tun
                type: internal
    Bridge br-ex
        Controller "tcp:127.0.0.1:6633"
            is_connected: true
        fail_mode: secure
        datapath_type: system
        Port phy-br-ex
            Interface phy-br-ex
                type: patch
                options: {peer=int-br-ex}
        Port ens32
            Interface ens32
        Port br-ex
            Interface br-ex
                type: internal
    Bridge br-int
        Controller "tcp:127.0.0.1:6633"
            is_connected: true
        fail_mode: secure
        datapath_type: system
        Port tap708af430-c4
            tag: 3
            Interface tap708af430-c4
                type: internal
        Port br-int
            Interface br-int
                type: internal
        Port patch-tun
            Interface patch-tun
                type: patch
                options: {peer=patch-int}
        Port qr-e6e8aabb-d5
            tag: 2
            Interface qr-e6e8aabb-d5  #连接的是路由器,tag是2
                type: internal
        Port qg-7561b4dd-af
            tag: 1
            Interface qg-7561b4dd-af  #连接的是路由器,tag是1
                type: internal
        Port tap9b2253ea-06
            tag: 2
            Interface tap9b2253ea-06
                type: internal
        Port qr-baf680b7-4d
            tag: 3
            Interface qr-baf680b7-4d  #连接的是路由器,打上tag3
                type: internal
        Port tape74e5b71-6d
            tag: 1
            Interface tape74e5b71-6d
                type: internal
        Port int-br-ex
            Interface int-br-ex
                type: patch
                options: {peer=phy-br-ex}
    ovs_version: "2.13.1"


# 路由器设备查看
root@m-openstack-20:~# ip net list
qrouter-78f6416a-f7d2-409a-97bb-786c249f9a5c (id: 3)
qdhcp-13d54342-2068-4d56-a61f-0c95e3a46ea8 (id: 2)
qdhcp-315f4635-eedd-4919-a70f-a942c6055c11 (id: 1)
qdhcp-7ad8a0b0-8a94-4bbc-bcdb-464674fc387e (id: 0)
root@m-openstack-20:~# ip net exec qrouter-78f6416a-f7d2-409a-97bb-786c249f9a5c route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.2.2     0.0.0.0         UG    0      0        0 qg-7561b4dd-af
172.25.2.0      0.0.0.0         255.255.255.0   U     0      0        0 qr-baf680b7-4d
172.25.3.0      0.0.0.0         255.255.255.0   U     0      0        0 qr-e6e8aabb-d5
192.168.2.0     0.0.0.0         255.255.255.0   U     0      0        0 qg-7561b4dd-af


# 清理ovs接口
/usr/bin/neutron-ovs-cleanup    --ovs_all_ports

linuxbridge+vlan

Neutron Vlan Network 原理- 每天5分钟玩转 OpenStack(92) - CloudMan - 博客园
交换机的Access口与Trunk口
Openstack基础环境交换机常用配置(CISCO 3750G为例)

微信:jinmuqq222
原文地址:https://www.cnblogs.com/jinmuqq222/p/14688003.html