openstack(六)neutron

控制节点

yum install -y openstack-neutron openstack-neutron-ml2 openstack-neutron-linuxbridge ebtables

/etc/neutron/neutron.conf

cat > /etc/neutron/neutron.conf << EOF
[DEFAULT]
auth_strategy = keystone
transport_url = rabbit://openstack:[email protected]
core_plugin = ml2
service_plugins =
notify_nova_on_port_status_changes = True
notify_nova_on_port_data_changes = True

[database]
connection = mysql+pymysql://neutron:[email protected]/neutron

[keystone_authtoken]
auth_uri = http://192.168.3.220:5000
auth_url = http://192.168.3.220:35357
memcached_servers = 192.168.3.220:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = neutron

[nova]
auth_url = http://192.168.3.220: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
EOF

neutron.conf

/etc/neutron/plugins/ml2/ml2_conf.ini

cat > /etc/neutron/plugins/ml2/ml2_conf.ini << EOF
[ml2]
type_drivers = flat,vlan,gre,vxlan,geneve
tenant_network_types = flat,vlan,gre,vxlan,geneve
mechanism_drivers = linuxbridge,openvswitch,l2population
extension_drivers = port_security,qos

[ml2_type_flat]
flat_networks = provider

[securitygroup]
enable_ipset = True
EOF

ml2_conf.ini

/etc/neutron/plugins/ml2/linuxbridge_agent.ini

cat > /etc/neutron/plugins/ml2/linuxbridge_agent.ini << EOF
[linux_bridge]
physical_interface_mappings = provider:ens32

[vxlan]
enable_vxlan = False

[securitygroup]
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
enable_security_group = True
EOF

linuxbridge_agent.ini

/etc/neutron/dhcp_agent.ini

cat > /etc/neutron/dhcp_agent.ini << EOF
[DEFAULT]
nova_metadata_host = 192.168.3.220

metadata_proxy_shared_secret = le
EOF

dhcp_agent.ini

/etc/nova/nova.conf (增加)

[neutron]
url = http://192.168.3.220:9696
auth_url = http://192.168.3.220: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 = le

增加部分

建立plugin.ini

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

初始化neutron数据库
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

查看表

mysql -uneutron -pneutron -e "use neutron;show tables;"

重启服务并设置开机启动

systemctl restart openstack-nova-api neutron-server neutron-linuxbridge-agent neutron-dhcp-agent neutron-metadata-agent

systemctl enable neutron-server neutron-linuxbridge-agent neutron-dhcp-agent neutron-metadata-agent 1>&2

创建服务/端点

openstack service create --name neutron --description "OpenStack Networking" network
openstack endpoint create --region RegionOne network public http://192.168.3.220:9696
openstack endpoint create --region RegionOne network internal http://192.168.3.220:9696
openstack endpoint create --region RegionOne network admin http://192.168.3.220:9696

服务/端点

查看网络

openstack network agent list

========================================================

计算节点

yum install -y openstack-neutron openstack-neutron-linuxbridge ebtables

/etc/neutron/neutron.conf(删掉控制节数据库)

cat > /etc/neutron/neutron.conf << EOF
[DEFAULT]
auth_strategy = keystone
transport_url = rabbit://openstack:[email protected]

[keystone_authtoken]
auth_uri = http://192.168.3.220:5000
auth_url = http://192.168.3.220:35357
memcached_servers = 192.168.3.220:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = neutron
password = neutron

[oslo_concurrency]
lock_path = /var/lib/neutron/tmp

EOF

neutron.conf

/etc/neutron/plugins/ml2/linuxbridge_agent.ini(和控制节点一样)

cat > /etc/neutron/plugins/ml2/linuxbridge_agent.ini << EOF
[linux_bridge]
physical_interface_mappings = provider:ens32

[vxlan]
enable_vxlan = False

[securitygroup]
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
enable_security_group = True
EOF

linuxbridge_agent.ini

/etc/nova/nova.conf(添加neutron)

[neutron]
url = http://192.168.3.220:9696
auth_url = http://192.168.3.220:35357
auth_type = password
project_domain_name = default
user_domain_name = default
region_name = RegionOne
project_name = service
username = neutron
password = neutron

nova.conf

配置开机启动并启动服务

systemctl restart neutron-linuxbridge-agent openstack-nova-compute

systemctl enable neutron-linuxbridge-agent 1>&2 

========================================================

openstack network agent list

相关推荐