在控制节点上执行

controllerHost='controller'
MYSQL_PASSWD='m4r!adbOP'
RABBIT_PASSWD='0penstackRMQ'
NOVA_PASSWD='nova1234!'
NEUTRON_PASSWD='neutron1234!'
controllerTunnelIP='172.31.240.49'
controllerProviderInterface='ens224'

1.创建数据库

mysql -uroot -p${MYSQL_PASSWD} << EOF
     DROP DATABASE IF EXISTS neutron;
     CREATE DATABASE neutron;
     GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost' IDENTIFIED BY '${NEUTRON_PASSWD}';
     GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'%' IDENTIFIED BY '${NEUTRON_PASSWD}';
EOF

2.创建认证用户并授权

source ~/admin-openrc
openstack user create --domain default --password ${NEUTRON_PASSWD} neutron
openstack role add --project service --user neutron admin

3.创建服务实体和端点

openstack service create --name neutron   --description "OpenStack Networking" network
openstack endpoint create --region RegionOne network public http://${controllerHost}:9696
openstack endpoint create --region RegionOne network admin http://${controllerHost}:9696
openstack endpoint create --region RegionOne network internal http://${controllerHost}:9696

4.安装neutron服务

yum -y install openstack-neutron openstack-neutron-ml2 ebtables ipset

5.配置neutron服务访问数据库

openstack-config --set  /etc/neutron/neutron.conf database connection  mysql+pymysql://neutron:${NEUTRON_PASSWD}@${controllerHost}/neutron

6.配置neutron服务访问memcached

openstack-config --set  /etc/neutron/neutron.conf cache backend  oslo_cache.memcache_pool
openstack-config --set  /etc/neutron/neutron.conf cache enabled  true
openstack-config --set  /etc/neutron/neutron.conf cache memcache_servers  ${controllerHost}:11211

7.配置neutron服务访问rabbitmq

openstack-config --set  /etc/neutron/neutron.conf DEFAULT transport_url rabbit://openstack:${RABBIT_PASSWD}@${controllerHost}:5672

8.配置neutron服务访问认证服务

openstack-config --set  /etc/neutron/neutron.conf DEFAULT auth_strategy  keystone
openstack-config --set  /etc/neutron/neutron.conf keystone_authtoken  auth_uri  http://${controllerHost}:5000
openstack-config --set  /etc/neutron/neutron.conf keystone_authtoken  auth_url  http://${controllerHost}:5000
openstack-config --set  /etc/neutron/neutron.conf keystone_authtoken  auth_type password
openstack-config --set  /etc/neutron/neutron.conf keystone_authtoken  project_domain_name  default
openstack-config --set  /etc/neutron/neutron.conf keystone_authtoken  user_domain_name  default
openstack-config --set  /etc/neutron/neutron.conf keystone_authtoken  project_name  service
openstack-config --set  /etc/neutron/neutron.conf keystone_authtoken  username  neutron
openstack-config --set  /etc/neutron/neutron.conf keystone_authtoken  password  ${NEUTRON_PASSWD}

9.配置neutron服务启用ML2插件,路由器服务和浮动IP功能

openstack-config --set  /etc/neutron/neutron.conf DEFAULT core_plugin  ml2
openstack-config --set  /etc/neutron/neutron.conf DEFAULT service_plugins  router
openstack-config --set  /etc/neutron/neutron.conf DEFAULT allow_overlapping_ips  true

10.配置neutron服务将网络拓扑变化的消息通知给计算节点

openstack-config --set  /etc/neutron/neutron.conf DEFAULT notify_nova_on_port_status_changes  true
openstack-config --set  /etc/neutron/neutron.conf DEFAULT notify_nova_on_port_data_changes  true

11.配置neutron服务使用nova身份访问认证服务

openstack-config --set  /etc/neutron/neutron.conf nova auth_url  http://${controllerHost}:5000
openstack-config --set  /etc/neutron/neutron.conf nova project_domain_name  default
openstack-config --set  /etc/neutron/neutron.conf nova user_domain_name  default
openstack-config --set  /etc/neutron/neutron.conf nova region_name  RegionOne
openstack-config --set  /etc/neutron/neutron.conf nova project_name  service
openstack-config --set  /etc/neutron/neutron.conf nova auth_type  password
openstack-config --set  /etc/neutron/neutron.conf nova username  nova
openstack-config --set  /etc/neutron/neutron.conf nova password  ${NOVA_PASSWD}

12.配置neutron中oslo库的锁定路径

openstack-config --set  /etc/neutron/neutron.conf oslo_concurrency lock_path  /var/lib/neutron/tmp

13.配置DHCP代理服务加载驱动程序并取消元数据隔离

openstack-config --set  /etc/neutron/dhcp_agent.ini DEFAULT dhcp_driver  neutron.agent.linux.dhcp.Dnsmasq
openstack-config --set  /etc/neutron/dhcp_agent.ini DEFAULT enable_isolated_metadata  true

14.配置元数据代理服务的共享密钥和位置

openstack-config --set  /etc/neutron/metadata_agent.ini DEFAULT nova_metadata_host ${controllerHost}
openstack-config --set  /etc/neutron/metadata_agent.ini DEFAULT metadata_proxy_shared_secret  123456

15.创建neutron-server服务启动时需要的软连接

ln -sv /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini

16.使能网桥调用内核过滤器netfilter功能

sed -i "/net.bridge.bridge-nf-call-ip6tables/c\net.bridge.bridge-nf-call-ip6tables = 1"  /usr/lib/sysctl.d/00-system.conf
sed -i "/net.bridge.bridge-nf-call-iptables/c\net.bridge.bridge-nf-call-iptables = 1"   /usr/lib/sysctl.d/00-system.conf
sysctl -p

17.配置nova服务使能对neutron服务的支持

openstack-config --set /etc/nova/nova.conf DEFAULT use_neutron  true

openstack-config --set /etc/nova/nova.conf neutron url  http://${controllerHost}:9696
openstack-config --set /etc/nova/nova.conf neutron auth_url  http://${controllerHost}:5000
openstack-config --set /etc/nova/nova.conf neutron project_domain_name  default
openstack-config --set /etc/nova/nova.conf neutron user_domain_name  default
openstack-config --set /etc/nova/nova.conf neutron region_name  RegionOne
openstack-config --set /etc/nova/nova.conf neutron project_name  service
openstack-config --set /etc/nova/nova.conf neutron auth_type  password
openstack-config --set /etc/nova/nova.conf neutron username  neutron
openstack-config --set /etc/nova/nova.conf neutron password  ${NEUTRON_PASSWD}

18.配置nova服务使能对元数据代理的支持

openstack-config --set /etc/nova/nova.conf neutron service_metadata_proxy  true
openstack-config --set /etc/nova/nova.conf neutron metadata_proxy_shared_secret  123456

19.重启nova服务

systemctl restart openstack-nova-api.service && systemctl status openstack-nova-api.service

在控制节点上使用linuxbridge作为虚拟交换机

20.安装linuxbridge组件

yum -y install openstack-neutron-linuxbridge

21.配置L3代理服务的接口驱动为Linux网桥驱动

openstack-config --set /etc/neutron/l3_agent.ini  DEFAULT  interface_driver  linuxbridge

22.配置DHCP代理服务的接口驱动为Linux网桥驱动

openstack-config --set /etc/neutron/dhcp_agent.ini DEFAULT interface_driver  linuxbridge

23.启用flat和vxlan网络

openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 type_drivers  flat,vxlan

24.启用Linux网桥和L2集群机制

openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 mechanism_drivers  linuxbridge,l2population

25.在端口上使能安全扩展驱动

openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 extension_drivers  port_security

26.开启安全组功能,并加载防火墙驱动程序

openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini securitygroup enable_security_group  true
openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini securitygroup firewall_driver  neutron.agent.linux.iptables_firewall.IptablesFirewallDriver

27.将提供商网络设置为flat并关联通向提供商网络的物理接口

openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2_type_flat  flat_networks  provider
openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini linux_bridge physical_interface_mappings  provider:${controllerProviderInterface}

28.将租户网络设置成VXLAN并设置VXLAN的VNI范围

openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 tenant_network_types  vxlan
openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2_type_vxlan vni_ranges  1:1000

29.创建vxlan隧道并设置隧道的物理接口IP

openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini vxlan l2_population  true
openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini vxlan enable_vxlan  true
openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini vxlan local_ip  ${controllerTunnelIP}

30.同步数据库

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

31.启动neutron服务

systemctl enable neutron-server.service neutron-dhcp-agent.service neutron-metadata-agent.service neutron-l3-agent.service neutron-linuxbridge-agent.service
systemctl start neutron-server.service neutron-dhcp-agent.service neutron-metadata-agent.service neutron-l3-agent.service neutron-linuxbridge-agent.service
systemctl status neutron-server.service neutron-dhcp-agent.service neutron-metadata-agent.service neutron-l3-agent.service neutron-linuxbridge-agent.service

在控制节点上使用OVS作为虚拟交换机

20.安装openvswitch组件

yum -y install openstack-neutron-openvswitch

21.配置L3代理服务的接口驱动为OVS网桥驱动并关联外部网桥

openstack-config --set /etc/neutron/l3_agent.ini DEFAULT interface_driver neutron.agent.linux.interface.OVSInterfaceDriver
openstack-config --set /etc/neutron/l3_agent.ini DEFAULT external_network_bridge br-ex

22.配置DHCP代理服务的接口驱动为OVS网桥驱动

openstack-config --set /etc/neutron/dhcp_agent.ini DEFAULT interface_driver neutron.agent.linux.interface.OVSInterfaceDriver

23.启用flat和vxlan网络

openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 type_drivers  flat,vxlan

24.启用OVS网桥和L2集群机制

openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 mechanism_drivers openvswitch,l2population
openstack-config --set /etc/neutron/plugins/ml2/openvswitch_agent.ini agent l2_population True

25.在端口上使能安全扩展驱动

openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 extension_drivers  port_security

26.开启安全组功能,并加载防火墙驱动程序

openstack-config --set /etc/neutron/plugins/ml2/openvswitch_agent.ini securitygroup firewall_driver neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
openstack-config --set /etc/neutron/plugins/ml2/openvswitch_agent.ini securitygroup enable_security_group True

27.将提供商网络设置为flat并关联通向提供商网络的外部网桥

openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2_type_flat  flat_networks provider
openstack-config --set /etc/neutron/plugins/ml2/openvswitch_agent.ini ovs bridge_mappings provider:br-ex

28.将租户网络设置成VXLAN并设置VXLAN的VNI范围

openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 tenant_network_types  vxlan
openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2_type_vxlan vni_ranges  1:1000

29.创建vxlan隧道并设置隧道的物理接口IP

openstack-config --set /etc/neutron/plugins/ml2/openvswitch_agent.ini agent tunnel_types vxlan
openstack-config --set /etc/neutron/plugins/ml2/openvswitch_agent.ini ovs integration_bridge  br-int
openstack-config --set /etc/neutron/plugins/ml2/openvswitch_agent.ini ovs tunnel_bridge br-tun
openstack-config --set /etc/neutron/plugins/ml2/openvswitch_agent.ini ovs enable_tunneling True
openstack-config --set /etc/neutron/plugins/ml2/openvswitch_agent.ini ovs local_ip ${controllerTunnelIP}

30.同步数据库

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

31.创建br-ex网桥并添加通向提供商网络的物理接口

ovs-vsctl add-br br-ex
ovs-vsctl add-port br-ex ${controllerProviderInterface}

32.启动neutron服务

systemctl enable neutron-server.service neutron-dhcp-agent.service neutron-metadata-agent.service neutron-l3-agent.service neutron-openvswitch-agent.service
systemctl start neutron-server.service neutron-dhcp-agent.service neutron-metadata-agent.service neutron-l3-agent.service neutron-openvswitch-agent.service
systemctl status neutron-server.service neutron-dhcp-agent.service neutron-metadata-agent.service neutron-l3-agent.service neutron-openvswitch-agent.service

在计算节点上执行

controllerHost='controller'
RABBIT_PASSWD='0penstackRMQ'
NEUTRON_PASSWD='neutron1234!'
computeTunnelIP='172.31.240.45'

1.安装neutron组件

yum -y install openstack-neutron-ml2 ebtables ipset

2.配置neutron服务访问memcached服务

openstack-config --set  /etc/neutron/neutron.conf cache backend  oslo_cache.memcache_pool
openstack-config --set  /etc/neutron/neutron.conf cache enabled  true
openstack-config --set  /etc/neutron/neutron.conf cache memcache_servers  ${controllerHost}:11211

3.配置neutron服务访问rabbitmq服务

openstack-config --set  /etc/neutron/neutron.conf DEFAULT transport_url rabbit://openstack:${RABBIT_PASSWD}@${controllerHost}:5672

4.配置neutron服务访问认证服务

openstack-config --set  /etc/neutron/neutron.conf DEFAULT auth_strategy  keystone
openstack-config --set  /etc/neutron/neutron.conf keystone_authtoken  auth_uri  http://${controllerHost}:5000
openstack-config --set  /etc/neutron/neutron.conf keystone_authtoken  auth_url  http://${controllerHost}:5000
openstack-config --set  /etc/neutron/neutron.conf keystone_authtoken  auth_type password
openstack-config --set  /etc/neutron/neutron.conf keystone_authtoken  project_domain_name  default
openstack-config --set  /etc/neutron/neutron.conf keystone_authtoken  user_domain_name  default
openstack-config --set  /etc/neutron/neutron.conf keystone_authtoken  project_name  service
openstack-config --set  /etc/neutron/neutron.conf keystone_authtoken  username  neutron
openstack-config --set  /etc/neutron/neutron.conf keystone_authtoken  password  ${NEUTRON_PASSWD}

5.配置neutron中oslo库的锁定路径

openstack-config --set  /etc/neutron/neutron.conf oslo_concurrency lock_path  /var/lib/neutron/tmp

6.使能网桥调用内核过滤器netfilter功能

sed -i "/net.bridge.bridge-nf-call-ip6tables/c\net.bridge.bridge-nf-call-ip6tables = 1"  /usr/lib/sysctl.d/00-system.conf
sed -i "/net.bridge.bridge-nf-call-iptables/c\net.bridge.bridge-nf-call-iptables = 1"   /usr/lib/sysctl.d/00-system.conf
sysctl -p

7.配置nova服务使能对neutron服务的支持

openstack-config --set /etc/nova/nova.conf DEFAULT use_neutron  true
openstack-config --set /etc/nova/nova.conf neutron url  http://${controllerHost}:9696
openstack-config --set /etc/nova/nova.conf neutron auth_url  http://${controllerHost}:5000
openstack-config --set /etc/nova/nova.conf neutron project_domain_name  default
openstack-config --set /etc/nova/nova.conf neutron user_domain_name  default
openstack-config --set /etc/nova/nova.conf neutron region_name  RegionOne
openstack-config --set /etc/nova/nova.conf neutron project_name  service
openstack-config --set /etc/nova/nova.conf neutron auth_type  password
openstack-config --set /etc/nova/nova.conf neutron username  neutron
openstack-config --set /etc/nova/nova.conf neutron password  ${NEUTRON_PASSWD}

8.重启nova服务

systemctl restart openstack-nova-api.service && systemctl status openstack-nova-api.service

在计算节点上使用linuxbridge作为虚拟交换机

9.安装linuxbridge组件

yum -y install openstack-neutron-linuxbridge

10.开启安全组功能,并加载防火墙驱动程序

openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini securitygroup enable_security_group  true
openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini securitygroup firewall_driver  neutron.agent.linux.iptables_firewall.IptablesFirewallDriver

11.启动L2集群机制

openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini vxlan l2_population  true

12.创建vxlan隧道并设置隧道的物理接口IP

openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini vxlan enable_vxlan  true
openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini vxlan local_ip  ${computeTunnelIP}

13.启动neutron服务

systemctl enable neutron-linuxbridge-agent.service
systemctl restart neutron-linuxbridge-agent.service
systemctl status neutron-linuxbridge-agent.service

在计算节点上使用OVS作为虚拟交换机

9.安装openvswitch组件

yum -y install openstack-neutron-openvswitch

10.开启安全组功能,并加载防火墙驱动程序

openstack-config --set  /etc/neutron/plugins/ml2/openvswitch_agent.ini securitygroup firewall_driver neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
openstack-config --set  /etc/neutron/plugins/ml2/openvswitch_agent.ini securitygroup enable_security_group True

11.启用L2集群机制

openstack-config --set  /etc/neutron/plugins/ml2/openvswitch_agent.ini agent l2_population True

12.创建vxlan隧道并设置隧道的物理接口IP

openstack-config --set  /etc/neutron/plugins/ml2/openvswitch_agent.ini agent tunnel_types vxlan
openstack-config --set  /etc/neutron/plugins/ml2/openvswitch_agent.ini ovs integration_bridge br-int
openstack-config --set  /etc/neutron/plugins/ml2/openvswitch_agent.ini ovs tunnel_bridge br-tun
openstack-config --set  /etc/neutron/plugins/ml2/openvswitch_agent.ini ovs enable_tunneling True
openstack-config --set  /etc/neutron/plugins/ml2/openvswitch_agent.ini ovs local_ip ${computeTunnelIP}

13.启动neutron服务

systemctl enable neutron-openvswitch-agent.service
systemctl restart neutron-openvswitch-agent.service
systemctl status neutron-openvswitch-agent.service

安装neutron的更多相关文章

  1. OpenStack:安装Neutron与provider network

    1. 安装(1)Install Networking services on a dedicated network node# apt-get install neutron-server neut ...

  2. CentOS7安装OpenStack(Rocky版)-06.安装Neutron网络服务(控制节点)

    上一章介绍了独立的nova计算节点的安装方法,本章分享openstack的网络服务neutron的安装配制方法 ------------------- 完美的分割线 ----------------- ...

  3. OpenStack Train版-10.安装neutron网络服务(网络节点:可选)

    可选:安装neutron网络服务节点(neutron01网络节点192.168.0.30)网络配置按照官网文档的租户自助网络 配置系统参数 echo 'net.ipv4.ip_forward = 1' ...

  4. OpenStack Train版-9.安装neutron网络服务(计算节点)

    在计算节点安装neutron网络服务(computel01计算节点192.168.0.20)安装组件 yum install openstack-neutron-linuxbridge ebtable ...

  5. OpenStack Train版-8.安装neutron网络服务(控制节点)

    安装neutron网络服务(controller控制节点192.168.0.10) 创建neutron数据库 mysql -uroot CREATE DATABASE neutron; GRANT A ...

  6. 单网卡安装neutron

    devstack中机器只有一个物理网卡,如何设置neutron中的external网络? 方式是: 创建一个linux bridge和veth,把eth0和veth1加入到brige,用veth的另一 ...

  7. openstack 安装neutron网络服务安装 报错:Unknown operation 'enabled'

     注:这个脚本文件有一个地方是错误的,最后一行需要修改一下 # vim /usr/local/bin/iass-install-neutron-controller-gre.sh # 改systemc ...

  8. OpenStack—neutron组件介绍与安装

    neutron介绍 Neutron 概述:传统的网络管理方式很大程度上依赖于管理员手工配置和维护各种网络硬件设备:而云环境下的网络已经变得非常复杂,特别是在多租户场景里,用户随时都可能需要创建.修改和 ...

  9. 六、OpenStack—neutron组件介绍与安装

    一.neutron介绍 Neutron 概述:传统的网络管理方式很大程度上依赖于管理员手工配置和维护各种网络硬件设备:而云环境下的网络已经变得非常复杂,特别是在多租户场景里,用户随时都可能需要创建.修 ...

随机推荐

  1. JS用正则替换特殊字符

    'abcabce'.replace(/abc/g,'') "e" 'abcabce$E$'.replace(/$E$/g,'') "abcabce$E$" 'a ...

  2. 题解 [51nod1385] 凑数字

    题面 解析 首先设\(n\)有\(l\)位, 那么对于前\(l-1\)位,\(0\)~\(9\)都是要选上的, 而对于最高位上的数\(x\),\(1\)~\(x-1\)也是要选上的. 到这里就有了\( ...

  3. sqlalchemy 基本操作

    表操作 models.py 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 ...

  4. [Python自学] day-21 (2) (Cookie、FBV|CBV装饰器)

    一.什么是Cookie 1.什么是Cookie? Cookie是保存在客户端浏览器中的文件,其中记录了服务器让浏览器记录的一些键值对(类似字典). 当Cookie中存在数据时,浏览器在访问网站时会读取 ...

  5. 3 Servlet、Filter使用

    1 使用Servlet获取数据 使用Servlet获取前端的数据,在后端从控制台中打印出前端的数据,前端页面如下图 前端页面程序:需要注意的是form的提交,以及input的不同类型对应的显示不同 & ...

  6. 用CSS实现梯形图标

    遇到需要实现如下图标 由图形分析,梯形,平行四边形等都可以由矩形变形而来. 而想要实现梯形,需要进行3D变换,需要使用css3的 perspective属性. 属性 perspective指定了观察者 ...

  7. Hdu 2047 Zjnu Stadium(带权并查集)

    Zjnu Stadium Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total ...

  8. 阿里云Ubuntu安装LNMP环境之PHP7

    在QQ群很多朋友问阿里云服务器怎么安装LNMP环境,怎么把项目放到服务器上面去,在这里,我就从头开始教大家怎么在阿里云服务器安装LNMP环境. 在这之前,我们先要知道什么是LNMP. L: 表示的是L ...

  9. 阿里云Ubuntu安装LNMP环境之Mysql

    在QQ群很多朋友问阿里云服务器怎么安装LNMP环境,怎么把项目放到服务器上面去,在这里,我就从头开始教大家怎么在阿里云服务器安装LNMP环境. 在这之前,我们先要知道什么是LNMP. L: 表示的是L ...

  10. Mybatis源码学习之类型转换(四)

    简述 JDBC数据类型与Java语言中的数据类型并不是完全对应的,所以在PreparedStatement为SQL语句绑定参数时,需要从Java类型转换成JDBC类型,而从结果集中获取数据时,则需要从 ...