CentOS7 minimal openstack pike neutron linuxbridge Self-service networks 租户网络搭建教程

注:Controller 节点 ip192.168.0.200compute1节点是 192.168.0.203

  • 安装和配置(基于 Self-service networks Controller 节点)
  1. 下载:
    yum install openstack-neutron openstack-neutron-ml2 openstack-neutron-linuxbridge ebtables
  2. 配置
    vi /etc/neutron/neutron.conf
[database]
...
connection = mysql+pymysql://neutron:123456@controller/neutron

[DEFAULT]
...
core_plugin = ml2
service_plugins = router
allow_overlapping_ips = true
transport_url = rabbit://openstack:123456@controller
auth_strategy = keystone
notify_nova_on_port_status_changes = true
notify_nova_on_port_data_changes = true

[keystone_authtoken]
...
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = 123456

[nova]
...
auth_url = http://controller:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = nova
password = 123456

[oslo_concurrency]
...
lock_path = /var/lib/neutron/tmp
  1. 配置
    vi /etc/neutron/plugins/ml2/ml2_conf.ini
[ml2]
...
type_drivers = flat,vlan,vxlan
tenant_network_types = vxlan
mechanism_drivers = linuxbridge,l2population
extension_drivers = port_security

[ml2_type_flat]
...
flat_networks = provider

[ml2_type_vxlan]
...
vni_ranges = 1:1000

[securitygroup]
...
enable_ipset = true
  1. 配置
    vi /etc/neutron/plugins/ml2/linuxbridge_agent.ini
[linux_bridge]
physical_interface_mappings = provider:enp3s0

[vxlan]
enable_vxlan = true
local_ip = 192.168.0.200
l2_population = true

[securitygroup]
...
enable_security_group = true
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
  1. 配置
    vi /etc/neutron/l3_agent.ini
[DEFAULT]
...
interface_driver = linuxbridge
  1. 配置
    vi /etc/neutron/dhcp_agent.ini
[DEFAULT]
...
interface_driver = linuxbridge
dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
enable_isolated_metadata = true
  1. 启动
    systemctl enable neutron-l3-agent.service
    systemctl start neutron-l3-agent.service
  • 配置(基于 Self-service networks compute1节点)
  1. 配置
    vi /etc/neutron/plugins/ml2/linuxbridge_agent.ini
[linux_bridge]
physical_interface_mappings = provider:enp3s0

[vxlan]
enable_vxlan = true
local_ip = 192.168.0.203
l2_population = true

[securitygroup]
...
enable_security_group = true
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
  • 验证(Controller 节点)
    注:先创建 provider网络
  1. 登录:. admin-openrc
  2. 查看列表:openstack network agent list
    CentOS7 minimal openstack pike neutron linuxbridge Self-service networks 租户网络搭建教程_第1张图片
    image.png
  • 创建网络
  1. 登录:. demo-openrc
  2. 创建:
    openstack network create selfservice
    CentOS7 minimal openstack pike neutron linuxbridge Self-service networks 租户网络搭建教程_第2张图片
    image.png
  3. 创建子网:
    openstack subnet create --network selfservice --dns-nameserver 192.168.0.1 --gateway 172.16.1.1 --subnet-range 172.16.1.0/24 selfservice
    CentOS7 minimal openstack pike neutron linuxbridge Self-service networks 租户网络搭建教程_第3张图片
    image.png
  • 创建路由
  1. 登录:. demo-openrc

  2. 创建router
    openstack router create router

    CentOS7 minimal openstack pike neutron linuxbridge Self-service networks 租户网络搭建教程_第4张图片
    image.png

  3. 添加到网络上
    neutron router-interface-add router selfservice

    image.png

  4. 在路由器上设置网关
    neutron router-gateway-set router provider

    image.png

  • 验证
  1. 登录:. admin-openrc
  2. ip:ip netns
    image.png
  3. 查看路由:neutron router-port-list router
    image.png

你可能感兴趣的:(CentOS7 minimal openstack pike neutron linuxbridge Self-service networks 租户网络搭建教程)