首页 > 代码库 > Openstack-Neutron网络服务

Openstack-Neutron网络服务

技术分享


Openstack-Neutron网络服务


教程大纲

      

1. Neutron的服务组件介绍
2. Neutron的安装部署




1.neutron 网络服务部分i

mysql -u root -p -e "create database neutron;"

mysql -u root -p -e "grant all privileges on neutron.* to ‘neutron‘@‘localhost‘ identified by ‘neutron‘;"

mysql -u root -p -e "grant all privileges on neutron.* to ‘neutron‘@‘%‘ identified by ‘neutron‘;"


2.安装neutron网络组件

yum install openstack-neutron openstack-neutron-ml2 \

  openstack-neutron-linuxbridge ebtables


3.配置neutron 配置文件

【DEFAULT】

auth_strategy = keystone

core_plugin = ml2   核心插件ml2

service_plugins = router 


修改消息通知

notify_nova_on_port_status_changes = true   

notify_nova_on_port_data_changes = true

verbose = True

rpc_backend = rabbit

connection = mysql://neutron:neutron@192.168.100.40:3306/neutron


【neutron】

auth_uri = http://192.168.100.40:5000

auth_url = http://192.168.100.40:35357

auth_type = password

project_domain_name = default

user_domain_name = default

project_name = service

username = neutron

password = neutron


【nova】

auth_url=http://192.168.100.40:35357

auth_type=password

project_domain_name=default

user_domain_name=default

region_name=RegionOne

project_name =service

username =nova

password =nova


lock_path = /var/lib/neutron/tmp


rabbit_host = 192.168.100.40

rabbit_port = 5672

rabbit_userid = openstack

rabbit_password = openstack



4.修改ml2 二层交换的网络类型的修改

vi    /etc/neutron/plugins/ml2/ml2_conf.ini 

type_drivers = local,flat,vlan,gre,vxlan,geneve  支持的驱动

tenant_network_types = vlan,gre,vxlan,geneve   网络类型

mechanism_drivers = openvswitch,linuxbridge           网络底层的驱动

extension_drivers = port_security          端口安全

flat_networks = physnet1     设置单一扁平网络

enable_ipset = true


5.修改网桥的修改linuxbridge_agent.ini 

prevent_arp_spoofing = true
physical_interface_mappings =physnet1:eth0  网卡映射
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver 
enable_security_group = true
enable_vxlan = false   关闭vxlan


6.dhcp的配置文件修改 

vi   /etc/neutron/dhcp_agent.ini 

interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver 网桥

dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq    默认dnsmasq  dhcp

enable_isolated_metadata = http://www.mamicode.com/True


7.metadata的修改

vi /neutron/metadata_agent.ini 

【keystone认证的】

auth_uri = http://192.168.100.40:5000

auth_url = http://192.168.100.40:35357

auth_type = password

project_domain_name = default

user_domain_name = default

region_name = RegionOne

project_name = service

username = neutron

password = neutron


nova_metadata_ip = 192.168.100.40   

metadata_proxy_shared_secret =neutron 开启秘钥凭证


8.修改Nova的中添加neutron的网络注册信息

vi  /etc/nova/nova.conf


【neutron】

url = http://192.168.100.40:9696

auth_url = http://192.168.100.40:35357

auth_type = password

project_domain_name = default

user_domain_name = default

region_name = RegionOne

project_name = service

username = neutron

password = neutron


service_metadata_proxy=True  开启

metadata_proxy_shared_secret =neutron  共享秘钥



9.创建超链ml2 

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


10.创建neutron用户

. admin-openrc


openstack user create --domain default --password-prompt neutron

neutron添加到admin

openstack role add --project service --user neutron admin



创建一个实例

openstack service create --name neutron \

  --description "OpenStack Networking" network

添加三个节点:

openstack endpoint create --region RegionOne \

network public http://192.168.100.40:9696

           

openstack endpoint create --region RegionOne \

network internal http://192.168.100.40:9696


openstack endpoint create --region RegionOne \

network admin http://192.168.100.40:9696




11.同步数据库信息


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



13. 重启服务Nova-api 和neutron


systemctl restart openstack-nova-api.service


  neutron服务

  systemctl enable neutron-server.service \

  neutron-linuxbridge-agent.service neutron-dhcp-agent.service \

  neutron-metadata-agent.service

  systemctl restart neutron-server.service \

  neutron-linuxbridge-agent.service neutron-dhcp-agent.service \

  neutron-metadata-agent.service



14.计算节点的neutron网络组件


 安装 linuxbridge 网桥

yum install openstack-neutron-linuxbridge ebtables ipset




15.计算节点只做neutron和linuxbridge  和ml2_conf.ini的配置文件的修改。



 scp /etc/neutron/neutron.conf 192.168.100.50:/etc/neutron/

scp /etc/neutron/plugins/ml2/linuxbridge_agent.ini 192.168.100.40:/etc/neutron/plugins/ml2/

scp /etc/neutron/plugins/ml2/ml2_conf.ini 192.168.100.40:/etc/neutron/plugins/ml2/




16.修改计算节点上Nova配置 


【neutron】


url = http://192.168.100.40:9696

auth_url = http://192.168.100.40:35357

auth_type = password

project_domain_name = default

user_domain_name = default

region_name = RegionOne

project_name = service

username = neutron

password = neutron




17.做一个软连接ml2


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




16.重启Nova-api和重启neutron


systemctl restart openstack-nova-compute.service

systemctl enable neutron-linuxbridge-agent.service

systemctl restart neutron-linuxbridge-agent.service



16.测试查看


neutron agent-list

技术分享


技术分享

请观看视屏


视屏会在腾讯课堂和优酷、56视屏网站中上传。请大家搜索中祥课堂即可观看


技术分享

技术分享


Openstack-Neutron网络服务