1.在控制节点安装网络节点Neutron,安装数据库Neutron,并设置访问权限的设置
mysql -u root -p123456
MariaDB [(none)]> CREATE DATABASE neutron;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost' IDENTIFIED BY '123456';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'%' IDENTIFIED BY '123456';
(weizhixing)
MariaDB [(none)]> GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'openstackpro01' IDENTIFIED BY '123456';
2.创建Neutron的服务凭证
[root@openstackpro01 ~]# openstack user create --domain default --password-prompt neutron
[root@openstackpro01 ~]# openstack role add --project service --user neutron admin
[root@openstackpro01 ~]# openstack service create --name neutron --description "OpenStack Networking" network
结果:截图
3.创建Neutron服务的API端点
创建服务凭证
[root@openstackpro01 ~]# openstack user create --domain default --password-prompt neutron
[root@openstackpro01 ~]# openstack role add --project service --user neutron admin
[root@openstackpro01 ~]# openstack service create --name neutron --description "OpenStack Networking" network
[root@openstackpro01 ~]# openstack endpoint create --region RegionOne network public http://192.168.253.130:9696
[root@openstackpro01 ~]# openstack endpoint create --region RegionOne network internal http://192.168.253.130:9696
[root@openstackpro01 ~]# openstack endpoint create --region RegionOne network admin http://192.168.253.130:9696
结果:
4.配置网络选项
根据要部署的虚拟网络类型配置网络选项(Provider networks、Self-service networks)由于Self-service networks也支持Provider networks,所以安装Self-service networks
yum install -y openstack-neutron openstack-neutron-ml2 openstack-neutron-linuxbridge ebtables
5.编辑/etc/neutron/neutron.conf文件进行Neutron的相关配置
[database]
connection=mysql+pymysql://neutron:123456@192.168.253.130/neutron
[DEFAULT]
core_plugin=ml2
service_plugins=router
allow_overlapping_ips=true
transport_url=rabbit://openstack:123456@192.168.253.130
auth_strategy=keystone
notify_nova_on_port_status_changes=true
notify_nova_on_port_data_changes=true
[keystone_authtoken]
auth_uri=http://192.168.253.130:5000
auth_url=http://192.168.253.130:5000
memcached_servers=192.168.253.130:11211
auth_type=password
project_domain_name=default
user_domain_name=default
project_name=service
username=neutron
password=123456
[nova]
# ...
auth_url=http://192.168.253.130:5000
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
6.Configure the Modular Layer 2 (ML2) plug-in 编辑/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
7.Configure the Linux bridge agent 编辑文件
/etc/neutron/plugins/ml2/linuxbridge_agent.ini
[linux_bridge]
physical_interface_mappings=provider:PROVIDER_INTERFACE_NAME(待配)
[vxlan]
enable_vxlan=true
local_ip=192.168.253.130
l2_population=true
[securitygroup]
enable_security_group=true
firewall_driver=neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
8.Configure the layer-3 agent Edit the /etc/neutron/l3_agent.ini file
[DEFAULT]
interface_driver = linuxbridge
9.Configure the DHCP agent Edit the /etc/neutron/dhcp_agent.ini file
[DEFAULT]
interface_driver = linuxbridge
dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
enable_isolated_metadata = true
10.Configure the metadata agent Edit the /etc/neutron/metadata_agent.ini file
[DEFAULT]
nova_metadata_host=192.168.253.130
metadata_proxy_shared_secret = METADATA_SECRET
11.nova.conf文件配置neutron节点
[neutron]
url = http://192.168.253.130:9696
auth_url = http://192.168.253.130:35357
auth_type = password
project_domain_name=default
user_domain_name=default
region_name=RegionOne
project_name=service
username=neutron
password=123456
service_metadata_proxy=true
metadata_proxy_shared_secret=METADATA_SECRET
12.对网络服务进行软链接
[root@openstackpro01 ~]# ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini
[root@openstackpro01 ~]# neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head
13.配置相关API服务
[root@openstackpro01 ~]# systemctl restart openstack-nova-api.service
[root@openstackpro01 ~]# systemctl enable neutron-server.service
[root@openstackpro01 ~]# systemctl start neutron-server.service
[root@openstackpro01 ~]# systemctl enable neutron-linuxbridge-agent.service
[root@openstackpro01 ~]# systemctl start neutron-linuxbridge-agent.service
[root@openstackpro01 ~]# systemctl enable neutron-dhcp-agent.service
[root@openstackpro01 ~]# systemctl start neutron-dhcp-agent.service
[root@openstackpro01 ~]# systemctl enable neutron-metadata-agent.service
[root@openstackpro01 ~]# systemctl start neutron-metadata-agent.service
[root@openstackpro01 ~]# systemctl enable neutron-l3-agent.service
[root@openstackpro01 ~]# systemctl start neutron-l3-agent.service