neutron网络服务
注册neutroon账号
openstack user create --domain default --password=neutron neutron
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.56.11:9696
openstack endpoint create --region RegionOne
network internal http://192.168.56.11:9696
openstack endpoint create --region RegionOne
network admin http://192.168.56.11:9696
安装
yum install openstack-neutron openstack-neutron-ml2
openstack-neutron-linuxbridge ebtables
修改配置文件
vi /etc/neutron/neutron.conf
[default]
core_plugin = ml2
service_plugins = router
allow_overlapping_ips = True
transport_url = rabbit://openstack:openstack@192.168.56.11
notify_nova_on_port_status_changes = True
notify_nova_on_port_data_changes = True
auth_strategy = keystone
[nova] auth_url = http://192.168.56.11: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
[database] connection = mysql+pymysql://neutron:neutron@192.168.56.11/neutron
[keystone_authtoken] auth_uri = http://192.168.56.11:5000 auth_url = http://192.168.56.11:35357 memcached_servers = 192.168.56.11:11211 auth_type = password project_domain_name = default user_domain_name = default project_name = service username = neutron password = neutron
vim /etc/neutron/plugins/ml2/ml2_conf.ini
[ml2] type_drivers = flat,vlan,vxlan tenant_network_types = vxlan mechanism_drivers = linuxbridge,l2population extension_drivers = port_security
[ml2_type_flat] flat_networks = provider
[ml2_type_vxlan] vni_ranges = 1:1000
[securitygroup] enable_ipset = True
vim /etc/neutron/plugins/ml2/linuxbridge_agent.ini
[linux_bridge] physical_interface_mappings = provider:eth0
[vxlan] enable_vxlan = True local_ip = 192.168.56.11 l2_population = True
[securitygroup] enable_security_group = True firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
vi /etc/neutron/l3_agent.ini interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver
配置dhcp vi /etc/neutron/dhcp_agent.ini [DEFAULT] interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq enable_isolated_metadata = True
vi /etc/neutron/metadata_agent.ini [DEFAULT] nova_metadata_ip = 192.168.56.11 metadata_proxy_shared_secret = neutron
vi /etc/nova/nova.conf [neutron]
url = http://192.168.56.11:9696 auth_url = http://192.168.56.11: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
创建软链接
ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini
同步数据库
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
重启nova api
systemctl restart openstack-nova-api.service
开机启动
systemctl enable neutron-server.service
neutron-linuxbridge-agent.service neutron-dhcp-agent.service
neutron-metadata-agent.service
启动服务
systemctl start neutron-server.service
neutron-linuxbridge-agent.service neutron-dhcp-agent.service
neutron-metadata-agent.service
第三层服务
systemctl enable neutron-l3-agent.service systemctl start neutron-l3-agent.service
查看状态 neutron ext-list openstack network agent list
===================================================== 在计算节点192.168.56.12安装neutron yum install openstack-neutron-linuxbridge ebtables ipset 在192.168.56.11同步 scp /etc/neutron/neutron.conf 192.168.56.12:/etc/neutron/ 在192.168.56.12 vi etc/neutron/neutron.conf local_ip = 192.168.56.11
vim /etc/neutron/plugins/ml2/linuxbridge_agent.ini [linux_bridge] physical_interface_mappings = provider:eth0
[vxlan] enable_vxlan = True local_ip = 192.168.56.12 l2_population = True
[securitygroup] ... enable_security_group = True firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
vim /etc/neutron/metadata_agent.ini [DEFAULT] nova_metadata_ip = 192.168.56.11 metadata_proxy_shared_secret = neutron
在192.168.56.12 vi /etc/nova/nova.conf url = http://192.168.56.11:9696 auth_url = http://192.168.56.11:35357 auth_type = password project_domain_name = default user_domain_name = default region_name = RegionOne project_name = service username = neutron password = neutron
ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini
重启nova systemctl restart openstack-nova-compute.service
启动 systemctl enable neutron-linuxbridge-agent.service systemctl start neutron-linuxbridge-agent.service
验证 openstack network agent list