部署配置Neutron网络组件
配置Neutron网络(计算节点)
在compute节点上执行
开启内核转发
vi /etc/sysctl.conf
net.ipv4.conf.all.rp_filter=0
net.ipv4.conf.default.rp_filter=0
执行配置
sysctl -p
安装必须组件
yum install openstack-neutron-ml2 openstack-neutron-openvswitch -y
备份默认neutron配置文件
mv /etc/neutron/neutron.conf /etc/neutron/neutron.conf.bak
创建neutron配置文件
vi /etc/neutron/neutron.conf
[DEFAULT]
auth_strategy = keystone
rpc_backend = neutron.openstack.common.rpc.impl_qpid
qpid_hostname = controller
core_plugin = ml2
service_plugins = router
verbose = True
[quotas]
[agent]
[keystone_authtoken]
auth_uri = http://controller:5000
auth_host = controller
auth_protocol = http
auth_port = 35357
admin_tenant_name = service
admin_user = neutron
admin_password = NEUTRON_PASS
[database]
service_provider=VPN:openswan:neutron.services.vpn.service_drivers.ipsec.IPsecVPNDriver:default
备份ml2插件配置
mv /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugins/ml2/ml2_conf.ini.bak
创建ml2插件配置
vi /etc/neutron/plugins/ml2/ml2_conf.ini
[ml2]
type_drivers = gre
tenant_network_types = gre
mechanism_drivers = openvswitch
[ml2_type_flat]
[ml2_type_vlan]
[ml2_type_gre]
tunnel_id_ranges = 1:1000
[ml2_type_vxlan]
[securitygroup]
firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
enable_security_group = True
[ovs]
local_ip = 10.0.1.31
tunnel_type = gre
enable_tunneling = True
修改配置文件权限
chown -R root:neutron /etc/neutron/neutron.conf
chown -R root:neutron /etc/neutron/plugins/ml2/ml2_conf.ini
启动服务
service openvswitch start
chkconfig openvswitch on
删除KVM默认网桥
virsh net-destroy default
virsh net-undefine default
添加br-int网桥
ovs-vsctl add-br br-int
创建ml2配置文件软连接
ln -s plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini
cp /etc/init.d/neutron-openvswitch-agent /etc/init.d/neutron-openvswitch-agent.orig
sed -i 's,plugins/openvswitch/ovs_neutron_plugin.ini,plugin.ini,g' /etc/init.d/neutron-openvswitch-agent
启动服务
service openstack-nova-compute restart
service neutron-openvswitch-agent start
chkconfig neutron-openvswitch-agent on
同样的步骤添加compute02节点,同时要注意机器名和IP地址必须要修改为对应的