# mysql -u root -p
> CREATE DATABASE neutron;
> GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost' IDENTIFIED BY 'openstack';
> GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'%' IDENTIFIED BY 'openstack';
> exit
# source admin-openrc.sh
# keystone user-create --name neutron --pass openstack
# keystone user-role-add --user neutron --tenant service --role admin
# keystone service-create --name neutron --type network --description "OpenStack Networking"
# keystone endpoint-create --service-id $(keystone service-list | awk '/ network / {print $2}') --publicurl http://controller:9696 --internalurl http://controller:9696 --adminurl http://controller:9696 --region regionOne
# apt-get install neutron-server neutron-plugin-ml2 python-neutronclient
# nano /etc/neutron/neutron.conf
[DEFAULT]
rpc_backend = rabbitneutron.openstack.common.rpc.impl_kombu
rabbit_host = controller
rabbit_password = openstack
[database]
connection = mysql://neutron:openstack@controller/neutron
rpc_backend = rabbit
rabbit_host = controller
rabbit_password = openstack
auth_strategy = keystone
verbose = True
core_plugin = neutron.plugins.ml2.plugin.Ml2Plugin
service_plugins = neutron.services.l3_router.l3_router_plugin.L3RouterPlugin
allow_overlapping_ips = True
notify_nova_on_port_status_changes = True
notify_nova_on_port_data_changes = True
nova_url = http://controller:8774/v2
nova_admin_auth_url = http://controller:35357/v2.0
nova_region_name = regionOne
nova_admin_username = nova
nova_admin_tenant_id = SERVICE_TENANT_ID #换成对应的ID
nova_admin_password = openstack
[keystone_authtoken]
auth_host = controller
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = neutron
admin_password = openstack
# nano /etc/neutron/plugins/ml2/ml2_conf.ini
[ml2]
...
type_drivers = gre
tenant_network_types = gre
mechanism_drivers = openvswitch
[ml2_type_gre]
...
tunnel_id_ranges = 1:1000
[securitygroup]
...
enable_security_group = True
firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
# nano /etc/nova/nova.conf
[DEFAULT]
...
network_api_class = nova.network.neutronv2.api.API
security_group_api = neutron
linuxnet_interface_driver = nova.network.linux_net.LinuxOVSInterfaceDriver
[neutron]
url = http://controller:9696
auth_strategy = keystone
admin_auth_url = http://controller:35357/v2.0
admin_tenant_name = service
admin_username = neutron
admin_password = openstack
# neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade icehouse
# service nova-api restart
# service nova-scheduler restart
# service nova-conductor restart
# service neutron-server restart
# rm -f /var/lib/neutron/neutron.sqlite
$ source admin-openrc.sh
$ neutron ext-list