controll# yum install -y openstack-neutron openstack-neutron-ml2 openstack-neutron-linuxbridge ebtables
创建neutron服务数据库和管理账户
controll#
mysql -u root -p
password:openstack
mariadb>
CREATE DATABASE neutron;
GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost' IDENTIFIED BY 'neutron';
GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'%' IDENTIFIED BY 'neutron';
exit
创建neutron用户、赋予admin角色:
#openstack user create --domain default --password-prompt neutron
此处需要输入密码: neutron
#openstack role add --project service --user neutron admin
创建neutron服务、endpoint:
#openstack service create --name neutron --description "OpenStack Network" network
#openstack endpoint create --region RegionOne network public http://controll:9696
#openstack endpoint create --region RegionOne network internal http://controll:9696
#openstack endpoint create --region RegionOne network admin http://controll:9696
配置neutron各组件配置文件(共5个文件,先备份配置文件):
controll# cp /etc/neutron/neutron.conf /etc/neutron/neutron.conf.bak
controll# vi /etc/neutron/neutron.conf
[DEFAULT]
core_plugin = ml2
service_plugins =
transport_url =rabbit://openstack:openstack@controll
auth_strategy = keystone
notify_nova_on_port_status_changes = true
notify_nova_on_port_data_changes = true
[database]
connection = mysql+pymysql://neutron:neutron@controll/neutron
[keystone_authtoken]
auth_uri = http://controll:5000
auth_url = http://controll:35357
memcached_servers = controll:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = neutron
[nova]
auth_url = http://controll:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = nova
password = nova
[oslo_concurrency]
lock_path = /var/lib/neutron/tmp
controller#cp /etc/neutron/plugins/ml2/linuxbridge_agent.ini /etc/neutron/plugins/ml2/linuxbridge_agent.ini.bak
controller# vi /etc/neutron/plugins/ml2/linuxbridge_agent.ini
[linux_bridge]
physical_interface_mappings =provider:eth0 (自己主机网卡的名称)
[vxlan]
enable_vxlan = false
[securitygroup]
enable_security_group = true
firewall_driver =neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
controll# cp /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugins/ml2/ml2_conf.ini.bak
controll# vi /etc/neutron/plugins/ml2/ml2_conf.ini
[ml2]
type_drivers = flat,vlan
tenant_network_types =
mechanism_drivers = linuxbridge
extension_drivers = port_security
[ml2_type_flat]
flat_networks = provider
[securitygroup]
enable_ipset = true
controll# cp /etc/neutron/dhcp_agent.ini /etc/neutron/dhcp_agent.ini.bak
controll# vi /etc/neutron/dhcp_agent.ini
[DEFAULT]
interface_driver = linuxbridge
dhcp_driver =neutron.agent.linux.dhcp.Dnsmasq
enable_isolated_metadata = true
controll#cp /etc/neutron/metadata_agent.ini /etc/neutron/metadata_agent.ini.bak
controll#vi /etc/neutron/metadata_agent.ini
[DEFAULT]
nova_metadata_ip = controll
metadata_proxy_shared_secret = meta
修改nova配置(加上neutron配置信息):
controll# vi /etc/nova/nova.conf
[neutron]
url = http://controll:9696
auth_url = http://controll: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 = meta
创建指向/etc/neutron/plugin.ini的符号链接,指向ML2配置文件:
ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini
同步数据库
controll#
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
设置开机自启动并启动服务
controll# systemctl enable neutron-server.service neutron-linuxbridge-agent.service neutron-dhcp-agent.service neutron-metadata-agent.service
controll# systemctl restart neutron-server.service neutron-linuxbridge-agent.service neutron-dhcp-agent.service neutron-metadata-agent.service openstack-nova-api.service
yum install openstack-neutron-linuxbridge ebtables ipset –y
compute#cp /etc/neutron/neutron.conf /etc/neutron/neutron.conf.bak
compute#vi /etc/neutron/neutron.conf
[DEFAULT]
transport_url =rabbit://openstack:openstack@controll
auth_strategy = keystone
[keystone_authtoken]
auth_uri = http://controll:5000
auth_url = http://controll:35357
memcached_servers = controll:11211
auth_type = password
project_domain_name = default
user_domain_name = default
username = neutron
password = neutron
[oslo_concurrency]
lock_path = /var/lib/neutron/tmp
#绑定提供物理网络的网卡:
compute# vi /etc/neutron/plugins/ml2/linuxbridge_agent.ini
[linux_bridge]
physical_interface_mappings = provider:eth0
[vxlan]
enable_vxlan = false
[securitygroup]
enable_security_group = true
firewall_driver =neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
#修改nova配置(加上neutron的配置信息):
compute# vi /etc/nova/nova.conf
[neutron]
url = http://controll:9696
auth_url = http://controll:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = neutron
#修改下面两项:
vif_plugging_is_fatal = false
vif_plugging_timeout=0
开机自启动、启动并查看服务(此部分尤其注意关闭防火墙)
compute#
systemctl enable neutron-linuxbridge-agent.service
systemctl restart neutron-linuxbridge-agent.service openstack-nova-compute.service
查看网络服务运行情况:
control#
openstack extension list --network
openstack network agent list