Controller — Neutron

Create Neutron User

  1. [root@controller ~]# source /root/admin-openrc
  2. [root@controller ~]# openstack user create --domain default neutron --password password
  3. [root@controller ~]# openstack role add --project service --user neutron admin

Create Neutron Service

  1. [root@controller ~]# openstack service create --name neutron --description "OpenStack Networking" network

Create Endpoint

  1. [root@controller ~]# openstack endpoint create --region RegionOne network public http://controller:9696
  2. [root@controller ~]# openstack endpoint create --region RegionOne network internal http://controller:9696
  3. [root@controller ~]# openstack endpoint create --region RegionOne network admin http://controller:9696

Install Neutron

  1. [root@controller ~]# yum install openstack-neutron openstack-neutron-ml2 openstack-neutron-linuxbridge ebtables -y

Configure Neutron

  1. [root@controller ~]# cp /etc/neutron/neutron.conf /etc/neutron/neutron.conf.bak
  2. [root@controller ~]# openstack-config --set /etc/neutron/neutron.conf DEFAULT core_plugin ml2
  3. [root@controller ~]# openstack-config --set /etc/neutron/neutron.conf DEFAULT service_plugins router
  4. [root@controller ~]# openstack-config --set /etc/neutron/neutron.conf DEFAULT allow_overlapping_ips True
  5. [root@controller ~]# openstack-config --set /etc/neutron/neutron.conf DEFAULT auth_strategy keystone
  6. [root@controller ~]# openstack-config --set /etc/neutron/neutron.conf DEFAULT transport_url rabbit://openstack:[email protected]
  7. [root@controller ~]# openstack-config --set /etc/neutron/neutron.conf DEFAULT notify_nova_on_port_status_changes True
  8. [root@controller ~]# openstack-config --set /etc/neutron/neutron.conf DEFAULT notify_nova_on_port_data_changes True
  9. [root@controller ~]# openstack-config --set /etc/neutron/neutron.conf keystone_authtoken auth_uri http://controller:5000
  10. [root@controller ~]# openstack-config --set /etc/neutron/neutron.conf keystone_authtoken auth_url http://controller:35357
  11. [root@controller ~]# openstack-config --set /etc/neutron/neutron.conf keystone_authtoken memcached_servers controller:11211
  12. [root@controller ~]# openstack-config --set /etc/neutron/neutron.conf keystone_authtoken auth_type password
  13. [root@controller ~]# openstack-config --set /etc/neutron/neutron.conf keystone_authtoken project_domain_name default
  14. [root@controller ~]# openstack-config --set /etc/neutron/neutron.conf keystone_authtoken user_domain_name default
  15. [root@controller ~]# openstack-config --set /etc/neutron/neutron.conf keystone_authtoken project_name service
  16. [root@controller ~]# openstack-config --set /etc/neutron/neutron.conf keystone_authtoken username neutron
  17. [root@controller ~]# openstack-config --set /etc/neutron/neutron.conf keystone_authtoken password password
  18. [root@controller ~]# openstack-config --set /etc/neutron/neutron.conf database connection mysql+pymysql://neutron:[email protected]/neutron
  19. [root@controller ~]# openstack-config --set /etc/neutron/neutron.conf nova auth_url http://controller:35357
  20. [root@controller ~]# openstack-config --set /etc/neutron/neutron.conf nova auth_type password
  21. [root@controller ~]# openstack-config --set /etc/neutron/neutron.conf nova project_domain_name default
  22. [root@controller ~]# openstack-config --set /etc/neutron/neutron.conf nova user_domain_name default
  23. [root@controller ~]# openstack-config --set /etc/neutron/neutron.conf nova region_name RegionOne
  24. [root@controller ~]# openstack-config --set /etc/neutron/neutron.conf nova project_name service
  25. [root@controller ~]# openstack-config --set /etc/neutron/neutron.conf nova username nova
  26. [root@controller ~]# openstack-config --set /etc/neutron/neutron.conf nova password password
  27. [root@controller ~]# openstack-config --set /etc/neutron/neutron.conf oslo_concurrency lock_path /var/lib/neutron/tmp

Configure ML2

  1. [root@controller ~]# cp /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugins/ml2/ml2_conf.ini.bak
  2. [root@controller ~]# openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 type_drivers flat,vlan,vxlan
  3. [root@controller ~]# openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 mechanism_drivers linuxbridge,l2population
  4. [root@controller ~]# openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 extension_drivers port_security
  5. [root@controller ~]# openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 tenant_network_types vxlan
  6. [root@controller ~]# openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 path_mtu 1500
  7. [root@controller ~]# openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2_type_flat flat_networks provider
  8. [root@controller ~]# openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2_type_vxlan vni_ranges 1:1000
  9. [root@controller ~]# openstack-config --set /etc/neutron/plugins/ml2/ml2_conf.ini securitygroup enable_ipset True

Configure LinuxBridge Agent

  1. [root@controller ~]# cp /etc/neutron/plugins/ml2/linuxbridge_agent.ini /etc/neutron/plugins/ml2/linuxbridge_agent.ini.bak
  2. [root@controller ~]# openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini DEFAULT debug false
  3. [root@controller ~]# openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini linux_bridge physical_interface_mappings provider:<strong>enp0s3</strong>
  4. [root@controller ~]# openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini vxlan enable_vxlan True
  5. [root@controller ~]# openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini vxlan local_ip 10.2.2.61
  6. [root@controller ~]# openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini vxlan l2_population True
  7. [root@controller ~]# openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini agent prevent_arp_spoofing True
  8. [root@controller ~]# openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini securitygroup enable_security_group True
  9. [root@controller ~]# openstack-config --set /etc/neutron/plugins/ml2/linuxbridge_agent.ini securitygroup firewall_driver neutron.agent.linux.iptables_firewall.IptablesFirewallDriver

Configure L3 Agent

  1. [root@controller ~]# cp /etc/neutron/l3_agent.ini /etc/neutron/l3_agent.ini.bak
  2. [root@controller ~]# openstack-config --set /etc/neutron/l3_agent.ini DEFAULT interface_driver neutron.agent.linux.interface.BridgeInterfaceDriver
  3. [root@controller ~]# openstack-config --set /etc/neutron/l3_agent.ini DEFAULT external_network_bridge
  4. [root@controller ~]# openstack-config --set /etc/neutron/l3_agent.ini DEFAULT debug false

Configure DHCP Agent

  1. [root@controller ~]# cp /etc/neutron/dhcp_agent.ini /etc/neutron/dhcp_agent.ini.bak
  2. [root@controller ~]# openstack-config --set /etc/neutron/dhcp_agent.ini DEFAULT interface_driver neutron.agent.linux.interface.BridgeInterfaceDriver
  3. [root@controller ~]# openstack-config --set /etc/neutron/dhcp_agent.ini DEFAULT dhcp_driver neutron.agent.linux.dhcp.Dnsmasq
  4. [root@controller ~]# openstack-config --set /etc/neutron/dhcp_agent.ini DEFAULT enable_isolated_metadata True
  5. [root@controller ~]# openstack-config --set /etc/neutron/dhcp_agent.ini DEFAULT verbose True
  6. [root@controller ~]# openstack-config --set /etc/neutron/dhcp_agent.ini DEFAULT debug false

Configure Neutron For Nova Service

  1. [root@controller ~]# openstack-config --set /etc/nova/nova.conf neutron url http://controller:9696
  2. [root@controller ~]# openstack-config --set /etc/nova/nova.conf neutron auth_url http://controller:35357
  3. [root@controller ~]# openstack-config --set /etc/nova/nova.conf neutron auth_plugin password
  4. [root@controller ~]# openstack-config --set /etc/nova/nova.conf neutron project_domain_id default
  5. [root@controller ~]# openstack-config --set /etc/nova/nova.conf neutron user_domain_id default
  6. [root@controller ~]# openstack-config --set /etc/nova/nova.conf neutron region_name RegionOne
  7. [root@controller ~]# openstack-config --set /etc/nova/nova.conf neutron project_name service
  8. [root@controller ~]# openstack-config --set /etc/nova/nova.conf neutron username neutron
  9. [root@controller ~]# openstack-config --set /etc/nova/nova.conf neutron password password
  10. [root@controller ~]# openstack-config --set /etc/nova/nova.conf neutron service_metadata_proxy True
  11. [root@controller ~]# openstack-config --set /etc/nova/nova.conf neutron metadata_proxy_shared_secret password

Configure DHCP Option

  1. [root@controller ~]# echo "dhcp-option-force=26,1450" >/etc/neutron/dnsmasq-neutron.conf

Configure Metadata Agent

  1. [root@controller ~]# openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT nova_metadata_ip controller
  2. [root@controller ~]# openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT metadata_proxy_shared_secret password
  3. [root@controller ~]# openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT metadata_workers 4
  4. [root@controller ~]# openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT verbose True
  5. [root@controller ~]# openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT debug false
  6. [root@controller ~]# openstack-config --set /etc/neutron/metadata_agent.ini DEFAULT nova_metadata_protocol http

Configure Neutron For ML2

  1. [root@controller ~]# ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini

Synchronize Database

  1. [root@controller ~]# 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

Restart Nova Service

  1. [root@controller ~]# systemctl restart openstack-nova-api.service
  2. [root@controller ~]# systemctl status openstack-nova-api.service

Start Neutron L3 Service

  1. [root@controller ~]# systemctl enable neutron-server.service neutron-linuxbridge-agent.service neutron-dhcp-agent.service neutron-metadata-agent.service neutron-l3-agent.service
  2. [root@controller ~]# systemctl restart neutron-server.service neutron-linuxbridge-agent.service neutron-dhcp-agent.service neutron-metadata-agent.service neutron-l3-agent.service
  3. [root@controller ~]# systemctl status neutron-server.service neutron-linuxbridge-agent.service neutron-dhcp-agent.service neutron-metadata-agent.service neutron-l3-agent.service

List Neutron Agent

  1. [root@controller ~]# openstack network agent list

Leave a Reply

Your email address will not be published. Required fields are marked *