Neutron hand-built

Source: Internet
Author: User
Tags openvswitch

Controller

Mysql-u Root-popenstack

mysql> CREATE DATABASE Neutron;

Mysql> GRANT all privileges on neutron.* to ' neutron ' @ ' localhost '

Identified by ' OpenStack ';

Mysql> GRANT all privileges in neutron.* to ' neutron ' @ '% ' \

Identified by ' OpenStack ';

Mysql> exit


To create a neutron user:

Keystone User-create--name Neutron--pass neutron--email [email protected]


Assign the neutron user Administrator role:

Keystone User-role-add--user Neutron--tenant service--role admin


To create a neutron service and port:

Keystone Service-create--name neutron--type network--description "OpenStack Networking"

Keystone endpoint-create \

--service-id $ (Keystone Service-list | awk '/network/{print $} ') \

--publicurl http://controller:9696 \

--adminurl http://controller:9696 \

--internalurl http://controller:9696


Installing neutron related Packages


Yum Install Openstack-neutron OPENSTACK-NEUTRON-ML2 python-neutronclient


Configuring the Neutron database connection


Openstack-config--set/etc/neutron/neutron.conf Database Connection Mysql://neutron:[email Protected]/neutron


Configuring the Neutron Certification

Openstack-config--set/etc/neutron/neutron.conf DEFAULT auth_strategy Keystone

Openstack-config--set/etc/neutron/neutron.conf Keystone_authtoken Auth_uri http://controller:5000

Openstack-config--set/etc/neutron/neutron.conf Keystone_authtoken auth_host Controller

Openstack-config--set/etc/neutron/neutron.conf Keystone_authtoken Auth_protocol http

Openstack-config--set/etc/neutron/neutron.conf Keystone_authtoken Auth_port 35357

Openstack-config--set/etc/neutron/neutron.conf keystone_authtoken admin_tenant_name Service

Openstack-config--set/etc/neutron/neutron.conf keystone_authtoken Admin_user Neutron

Openstack-config--set/etc/neutron/neutron.conf keystone_authtoken Admin_password Neutron


Configuring the message agent for neutron

Openstack-config--set/etc/neutron/neutron.conf DEFAULT rpc_backend neutron.openstack.common.rpc.impl_qpid

Openstack-config--set/etc/neutron/neutron.conf DEFAULT qpid_hostname Controller


Configuration compute allows calculations to notice changes in network policies


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

Openstack-config--set/etc/neutron/neutron.conf DEFAULT Nova_url http://controller:8774/v2

Openstack-config--set/etc/neutron/neutron.conf DEFAULT Nova_admin_username Nova

Openstack-config--set/etc/neutron/neutron.conf DEFAULT nova_admin_tenant_id $ (Keystone Tenant-list | awk '/service/{ Print $} ')

Openstack-config--set/etc/neutron/neutron.conf DEFAULT Nova_admin_password Nova

Openstack-config--set/etc/neutron/neutron.conf DEFAULT Nova_admin_auth_url http://controller:35357/v2.0


Configure neutron to use ML2 plugins-in


Openstack-config--set/etc/neutron/neutron.conf DEFAULT Core_plugin ML2

Openstack-config--set/etc/neutron/neutron.conf DEFAULT service_plugins Router


Configuring ML2 Plugin


Openstack-config--set/etc/neutron/plugins/ml2/ml2_conf.ini ML2 type_drivers GRE

Openstack-config--set/etc/neutron/plugins/ml2/ml2_conf.ini ML2 tenant_network_types GRE

Openstack-config--set/etc/neutron/plugins/ml2/ml2_conf.ini ML2 mechanism_drivers openvswitch

Openstack-config--set/etc/neutron/plugins/ml2/ml2_conf.ini Ml2_type_gre tunnel_id_ranges 1:1000

Openstack-config--set/etc/neutron/plugins/ml2/ml2_conf.ini Securitygroup Firewall_driver Neutron.agent.linux.iptables_firewall. Ovshybridiptablesfirewalldriver

Openstack-config--set/etc/neutron/plugins/ml2/ml2_conf.ini securitygroup Enable_security_group True


Configure compute to use the network

Openstack-config--set/etc/nova/nova.conf DEFAULT Network_api_class Nova.network.neutronv2.api.API

Openstack-config--set/etc/nova/nova.conf DEFAULT Neutron_url http://controller:9696

Openstack-config--set/etc/nova/nova.conf DEFAULT neutron_auth_strategy Keystone

Openstack-config--set/etc/nova/nova.conf DEFAULT neutron_admin_tenant_name Service

Openstack-config--set/etc/nova/nova.conf DEFAULT neutron_admin_username Neutron

Openstack-config--set/etc/nova/nova.conf DEFAULT Neutron_admin_password Neutron

Openstack-config--set/etc/nova/nova.conf DEFAULT Neutron_admin_auth_url http://controller:35357/v2.0

Openstack-config--set/etc/nova/nova.conf DEFAULT linuxnet_interface_driver nova.network.linux_net. Linuxovsinterfacedriver

Openstack-config--set/etc/nova/nova.conf DEFAULT firewall_driver nova.virt.firewall.NoopFirewallDriver

Openstack-config--set/etc/nova/nova.conf DEFAULT Security_group_api Neutron


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


Service Openstack-nova-api Restart

Service Openstack-nova-scheduler Restart

Service Openstack-nova-conductor Restart


Service Neutron-server Restart

Chkconfig Neutron-server on


If you return a database error, the solution:


Openstack-config--set/etc/neutron/neutron.conf DEFAULT Core_plugin neutron.plugins.ml2.plugin.Ml2Plugin

Openstack-config--set/etc/neutron/neutron.conf DEFAULT service_plugins neutron.services.l3_router.l3_router_ Plugin. L3routerplugin


Su-s/bin/sh-c "Neutron-db-manage--config-file/etc/neutron/neutron.conf--config-file/etc/neutron/plugin.ini Upgrade Head "Neutron



Change the file back to

Openstack-config--set/etc/neutron/neutron.conf DEFAULT Core_plugin ML2

Openstack-config--set/etc/neutron/neutron.conf DEFAULT service_plugins Router


Restarting the Neutron Server service

Service Neutron-server Restart



Network


Vim/etc/sysctl.conf

Net.ipv4.ip_forward=1

Net.ipv4.conf.all.rp_filter=0

Net.ipv4.conf.default.rp_filter=0


Sysctl-p


RPM Packages required for installation

Yum Install Openstack-neutron OPENSTACK-NEUTRON-ML2 openstack-neutron-openvswitch


To configure neutron authentication:

Openstack-config--set/etc/neutron/neutron.conf DEFAULT auth_strategy Keystone

Openstack-config--set/etc/neutron/neutron.conf Keystone_authtoken Auth_uri http://controller:5000

Openstack-config--set/etc/neutron/neutron.conf Keystone_authtoken auth_host Controller

Openstack-config--set/etc/neutron/neutron.conf Keystone_authtoken Auth_protocol http

Openstack-config--set/etc/neutron/neutron.conf Keystone_authtoken Auth_port 35357

Openstack-config--set/etc/neutron/neutron.conf keystone_authtoken admin_tenant_name Service

Openstack-config--set/etc/neutron/neutron.conf keystone_authtoken Admin_user Neutron

Openstack-config--set/etc/neutron/neutron.conf keystone_authtoken Admin_password Neutron


Configuring the Neutron message Agent

Openstack-config--set/etc/neutron/neutron.conf DEFAULT rpc_backend neutron.openstack.common.rpc.impl_qpid

Openstack-config--set/etc/neutron/neutron.conf DEFAULT qpid_hostname Controller



Configure neutron to use ML2 plugins-in

Openstack-config--set/etc/neutron/neutron.conf DEFAULT Core_plugin ML2

Openstack-config--set/etc/neutron/neutron.conf DEFAULT service_plugins Router


Configure L3-agent

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 use_namespaces True


Configure Dhcp-agent

Openstack-config--set/etc/neutron/dhcp_agent.ini DEFAULT Interface_driver Neutron.agent.linux.interface.OVSInterfaceDriver

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 use_namespaces True


Configure Metadata-agent

Openstack-config--set/etc/neutron/metadata_agent.ini DEFAULT Auth_url http://controller:5000/v2.0

Openstack-config--set/etc/neutron/metadata_agent.ini DEFAULT auth_region regionone

Openstack-config--set/etc/neutron/metadata_agent.ini DEFAULT admin_tenant_name Service

Openstack-config--set/etc/neutron/metadata_agent.ini DEFAULT Admin_user Neutron

Openstack-config--set/etc/neutron/metadata_agent.ini DEFAULT Admin_password Neutron

Openstack-config--set/etc/neutron/metadata_agent.ini DEFAULT nova_metadata_ip Controller

Openstack-config--set/etc/neutron/metadata_agent.ini DEFAULT Metadata_proxy_shared_secret METADATA_SECRET


Controller

Openstack-config--set/etc/nova/nova.conf DEFAULT Service_neutron_metadata_proxy True

Openstack-config--set/etc/nova/nova.conf DEFAULT Neutron_metadata_proxy_shared_secret METADATA_SECRET

Service Openstack-nova-api Restart


NETOWRK:


Configuration ML2 Plugin in

Openstack-config--set/etc/neutron/plugins/ml2/ml2_conf.ini ML2 type_drivers GRE

Openstack-config--set/etc/neutron/plugins/ml2/ml2_conf.ini ML2 tenant_network_types GRE

Openstack-config--set/etc/neutron/plugins/ml2/ml2_conf.ini ML2 mechanism_drivers openvswitch

Openstack-config--set/etc/neutron/plugins/ml2/ml2_conf.ini Ml2_type_gre tunnel_id_ranges 1:1000

Openstack-config--set/etc/neutron/plugins/ml2/ml2_conf.ini OvS local_ip 10.0.1.21

Openstack-config--set/etc/neutron/plugins/ml2/ml2_conf.ini OvS Tunnel_type GRE

Openstack-config--set/etc/neutron/plugins/ml2/ml2_conf.ini OvS enable_tunneling True

Openstack-config--set/etc/neutron/plugins/ml2/ml2_conf.ini Securitygroup Firewall_driver Neutron.agent.linux.iptables_firewall. Ovshybridiptablesfirewalldriver

Openstack-config--set/etc/neutron/plugins/ml2/ml2_conf.ini securitygroup Enable_security_group True


Service Openvswitch Restart

Chkconfig Openvswitch on


Ovs-vsctl ADD-BR Br-int

Ovs-vsctl ADD-BR Br-ex

Ovs-vsctl Add-port Br-ex eth2

Ethtool-k eth2 Gro off


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


Cp/etc/init.d/neutron-openvswitch-agent/etc/init.d/neutronopenvswitch-agent.orig

Sed-i ' S,plugins/openvswitch/ovs_neutron_plugin.ini,plugin.ini,g '/etc/init.d/neutron-openvswitch-agent


Service Neutron-openvswitch-agent Restart

Service Neutron-l3-agent Restart

Service Neutron-dhcp-agent Restart

Service Neutron-metadata-agent Restart

Chkconfig neutron-openvswitch-agent on

Chkconfig neutron-l3-agent on

Chkconfig neutron-dhcp-agent on

Chkconfig neutron-metadata-agent on



Compute

Vim/etc/sysctl.conf

Net.ipv4.conf.all.rp_filter=0

Net.ipv4.conf.default.rp_filter=0


Sysctl-p


Yum Install OPENSTACK-NEUTRON-ML2 Openstack-neutron-openvswitch


Configuring the Neutron Authentication Service

Openstack-config--set/etc/neutron/neutron.conf DEFAULT auth_strategy Keystone

Openstack-config--set/etc/neutron/neutron.conf Keystone_authtoken Auth_uri http://controller:5000

Openstack-config--set/etc/neutron/neutron.conf Keystone_authtoken auth_host Controller

Openstack-config--set/etc/neutron/neutron.conf Keystone_authtoken Auth_protocol http

Openstack-config--set/etc/neutron/neutron.conf Keystone_authtoken Auth_port 35357

Openstack-config--set/etc/neutron/neutron.conf keystone_authtoken admin_tenant_name Service

Openstack-config--set/etc/neutron/neutron.conf keystone_authtoken Admin_user Neutron

Openstack-config--set/etc/neutron/neutron.conf keystone_authtoken Admin_password Neutron


Configuring the message agent for neutron

Openstack-config--set/etc/neutron/neutron.conf DEFAULT rpc_backend neutron.openstack.common.rpc.impl_qpid

Openstack-config--set/etc/neutron/neutron.conf DEFAULT qpid_hostname Controller


Configure neutron to use ML2 plugin

Openstack-config--set/etc/neutron/neutron.conf DEFAULT Core_plugin ML2

Openstack-config--set/etc/neutron/neutron.conf DEFAULT service_plugins Router


Configuring ML2 Plugin

Openstack-config--set/etc/neutron/plugins/ml2/ml2_conf.ini ML2 type_drivers GRE

Openstack-config--set/etc/neutron/plugins/ml2/ml2_conf.ini ML2 tenant_network_types GRE

Openstack-config--set/etc/neutron/plugins/ml2/ml2_conf.ini ML2 mechanism_drivers openvswitch

Openstack-config--set/etc/neutron/plugins/ml2/ml2_conf.iniml2_type_gre tunnel_id_ranges 1:1000

Openstack-config--set/etc/neutron/plugins/ml2/ml2_conf.ini OvS local_ip 10.0.1.31

Openstack-config--set/etc/neutron/plugins/ml2/ml2_conf.ini OvS Tunnel_type GRE

Openstack-config--set/etc/neutron/plugins/ml2/ml2_conf.ini OvS enable_tunneling True

Openstack-config--set/etc/neutron/plugins/ml2/ml2_conf.inisecuritygroup Firewall_driver Neutron.agent.linux.iptables_firewall. Ovshybridiptablesfirewalldriver

Openstack-config--set/etc/neutron/plugins/ml2/ml2_conf.inisecuritygroup Enable_security_group True


Service Openvswitch Start

Chkconfig Openvswitch on


Ovs-vsctl ADD-BR Br-int


Configure compute to use neutron


Openstack-config--set/etc/nova/nova.conf DEFAULT Network_api_class Nova.network.neutronv2.api.API

Openstack-config--set/etc/nova/nova.conf DEFAULT Neutron_url http://controller:9696

Openstack-config--set/etc/nova/nova.conf DEFAULT neutron_auth_strategy Keystone

Openstack-config--set/etc/nova/nova.conf DEFAULT neutron_admin_tenant_name Service

Openstack-config--set/etc/nova/nova.conf DEFAULT neutron_admin_username Neutron

Openstack-config--set/etc/nova/nova.conf DEFAULT Neutron_admin_password Neutron

Openstack-config--set/etc/nova/nova.conf DEFAULT Neutron_admin_auth_url http://controller:35357/v2.0

Openstack-config--set/etc/nova/nova.conf DEFAULT linuxnet_interface_driver nova.network.linux_net. Linuxovsinterfacedriver

Openstack-config--set/etc/nova/nova.conf DEFAULT firewall_driver nova.virt.firewall.NoopFirewallDriver

Openstack-config--set/etc/nova/nova.conf DEFAULT Security_group_api Neutron


Ln-s/etc/nuetron/plugins/ml2/ml2_conf.ini/etc/neutron/plugin.ini


Cp/etc/init.d/neutron-openvswitch-agent/etc/init.d/neutronopenvswitch-agent.orig

Sed-i ' S,plugins/openvswitch/ovs_neutron_plugin.ini,plugin.ini,g '/etc/init.d/neutron-openvswitch-agent


Service Openstack-nova-compute Restart


Service Neutron-openvswitch-agent Restart

Chkconfig neutron-openvswitch-agent on


Create an initialization network

SOURCE admin-openrc.sh

Neutron net-create ext-net--shared--router:external=true


To create an external network:

Neutron subnet-create ext-net--name ext-subnet--allocation-pool start=192.168.1.150,end=192.168.1.200 \

--disable-dhcp--gateway 192.168.1.1 192.168.1.0/24


Create a tenant network

SOURCE demo-openrc.sh

Neutron net-create demo-net

Neutron subnet-create demo-net--name demo-subnet--gateway 192.168.0.1 192.168.0.0/24

Neutron router-create Demo-router


Connect the tenant network to the router

Neutron Router-interface-add demo-router demo-subnet


Set up a router's gateway

Neutron Router-gateway-set demo-router ext-net


Make sure that the network is connected correctly

Ping 192.168.1.150


This article is from the "Gaogaozi" blog, make sure to keep this source http://hangtiangazi.blog.51cto.com/8584103/1675950

Neutron hand-built

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.