openstack O版 Neutron网络服务

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了openstack O版 Neutron网络服务相关的知识,希望对你有一定的参考价值。

1.创建neutron数据库
[[email protected] ~]# mysql -uroot -pdevops
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 94
Server version: 10.1.20-MariaDB MariaDB Server
Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.
MariaDB [(none)]> CREATE DATABASE neutron;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON neutron. to ‘neutron‘@‘localhost‘ IDENTIFIED BY ‘devops‘;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON neutron.
to ‘neutron‘@‘%‘ IDENTIFIED BY ‘devops‘;
2.创建neutron用户和项目
[[email protected] ~]# source /root/admin-openrc
[[email protected] ~]# openstack user create --domain default neutron --password devops
[[email protected] ~]# openstack role add --project service --user neutron admin
[[email protected] ~]# openstack service create --name neutron --description "OpenStack Networking" network
技术图片
[[email protected] ~]# openstack endpoint create --region RegionOne network public http://controller:9696
技术图片
[[email protected] ~]# openstack endpoint create --region RegionOne network internal http://controller:9696
技术图片
[[email protected] ~]# openstack endpoint create --region RegionOne network admin http://controller:9696
技术图片
3.安装neuton服务和修改配置文件
[[email protected] ~]# yum -y install openstack-neutron openstack-neutron-ml2 openstack-neutron-linuxbridge ebtables
[[email protected] ~]# cp /etc/neutron/neutron.conf /etc/neutron/neutron.conf.bak
[[email protected] ~]# >/etc/neutron/neutron.conf
[[email protected] ~]# cat /etc/neutron/neutron.conf
[DEFAULT]
core_plugin = ml2
service_plugins = router
allow_overlapping_ips = True
auth_strategy = keystone
transport_url = rabbit://openstack:[email protected]
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 = nova
password = devops
[database]
connection = mysql+pymysql://neutron:[email protected]/neutron
[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 = devops
[oslo_concurrency]
lock_path = /var/lib/neutron/tmp
[[email protected] ~]# cat /etc/neutron/plugins/ml2/ml2_conf.ini | grep -v "^#" | grep -v "^$"
[DEFAULT]
[ml2]
type_drivers = flat,vlan,vxlan
mechanism_drivers = linuxbridge,l2population
extension_drivers = port_security
tenant_network_types = vxlan
path_mtu = 1500
[ml2_type_flat]
flat_networks = provider
[ml2_type_geneve]
[ml2_type_gre]
[ml2_type_vlan]
[ml2_type_vxlan]
vni_ranges = 1:1000
[securitygroup]
enable_ipset = True
[[email protected] ~]# cat /etc/neutron/plugins/ml2/linuxbridge_agent.ini | grep -v "^#" | grep -v "^$"
[DEFAULT]
debug = false
[agent]
prevent_arp_spoofing = True
[linux_bridge]
physical_interface_mappings = provider:ens33
[securitygroup]
enable_security_group = True
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
[vxlan]
enable_vxlan = True
local_ip = 192.168.0.111
l2_population = True

[[email protected] ~]# cat /etc/neutron/l3_agent.ini | grep -v "^#" | grep -v "^$"
[DEFAULT]
interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver
external_network_bridge =
debug = false
[agent]
[ovs]

[[email protected] ~]# cat /etc/neutron/dhcp_agent.ini | grep -v "^#" | grep -v "^$"
[DEFAULT]
interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver
dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
enable_isolated_metadata = True
verbose = True
debug = false
[agent]
[ovs]
重新配置/etc/nova/nova.conf,配置这步的目的是让compute节点能使用上neutron网络
[neutron]
url = http://controller:9696
auth_url = http://controller:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = devops
service_metadata_proxy = True
metadata_proxy_shared_secret = devops
将dhcp-option-force=26,1450写入/etc/neutron/dnsmasq-neutron.conf
# echo "dhcp-option-force=26,1450" >/etc/neutron/dnsmasq-neutron.conf
[[email protected] ~]# cat /etc/neutron/metadata_agent.ini | grep -v "^#" | grep -v "^$"
[DEFAULT]
nova_metadata_ip = controller
metadata_proxy_shared_secret = devops
metadata_workers = 4
verbose = True
debug = false
nova_metadata_protocol = http
[agent]
[cache]
4.创建连接并创建keystone用户
[[email protected] ~]# ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini
5.更新数据库
[[email protected] ~]# su -s /bin/sh -c "neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head" neutron
[[email protected] ~]# systemctl restart openstack-nova-api.service
[[email protected] ~]# systemctl status openstack-nova-api.service
6.启动服务
[[email protected] ~]# systemctl enable neutron-server.service neutron-linuxbridge-agent.service neutron-dhcp-agent.service neutron-metadata-agent.service
[[email protected] ~]# systemctl start neutron-server.service neutron-linuxbridge-agent.service neutron-dhcp-agent.service neutron-metadata-agent.service
启动neutron-l3-agent.service并设置开机启动
# systemctl enable neutron-l3-agent.service
**
# systemctl restart neutron-l3-agent.service
# systemctl status neutron-l3-agent.service
[[email protected] ~]# neutron ext-list
[[email protected] ~]# neutron agent-list
技术图片
7.查看注册信息
[[email protected] ~]# openstack endpoint list

技术图片

所有的配置文件在百度云盘中:
链接:https://pan.baidu.com/s/1CnmKkFMTemv199ctgb5Oig
提取码:27om
复制这段内容后打开百度网盘手机App,操作更方便哦

以上是关于openstack O版 Neutron网络服务的主要内容,如果未能解决你的问题,请参考以下文章

浅谈OpenStack T版服务组件--Neutron计算服务(#^.^#) 持续更新中

OpenStack Train版-7.neutron网络服务概述

openstack Q版部署-----网络服务(neutron)安装部署

OpenStack 运维 - 部署Neutron组件[T版]

OpenStack 运维 - 部署Neutron组件[T版]

OpenStack 运维 - 部署Neutron组件[T版]