三、网络节点
公共部分记得升级安装,环境变量设置完毕
1. 安装ntp用于时间同步
apt-get install -y ntp
#Comment the ubuntu NTP servers
sed -i 's/server 0.ubuntu.pool.ntp.org/#server 0.ubuntu.pool.ntp.org/g' /etc/ntp.conf
sed -i 's/server 1.ubuntu.pool.ntp.org/#server 1.ubuntu.pool.ntp.org/g' /etc/ntp.conf
sed -i 's/server 2.ubuntu.pool.ntp.org/#server 2.ubuntu.pool.ntp.org/g' /etc/ntp.conf
sed -i 's/server 3.ubuntu.pool.ntp.org/#server 3.ubuntu.pool.ntp.org/g' /etc/ntp.conf
sed -i 's/server ntp.ubuntu.com/server 128.6.3.33/g' /etc/ntp.conf
重启服务
# service ntp restart
设置允许转发
#sed -i 's/#net.ipv4.ip_forward=1/net.ipv4.ip_forward=1/' /etc/sysctl.conf
# To save you from rebooting, perform the following
sysctl net.ipv4.ip_forward=1
编辑/etc/sysctl.conf
net.ipv4.conf.all.rp_filter=0
net.ipv4.conf.default.rp_filter=0
2. 安装Neutron
# apt-get install neutron-server neutron-dhcp-agent neutron-plugin-openvswitch neutron-l3-agent
编辑 /etc/neutron/neutron.conf
[default]
rabbit_host = 128.6.3.33
[keystone_authtoken]
auth_host = 128.6.3.33
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = neutron
admin_password = tsj
[database]
connection = mysql://neutron:tsj@128.6.3.33/neutron
编辑 /etc/neutron/api-paste.ini
[filter:authtoken]
paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory
auth_host=128.6.3.33
admin_user=neutron
admin_tenant_name=service
admin_password=tsj
然后配置插件
#apt-get install neutron-plugin-openvswitch-agent
告诉l3 agent还有dhcp agent,使用ovs
编辑 /etc/neutron/l3_agent.ini
interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver
use_namespaces = True
编辑 /etc/neutron/dhcp_agent.ini
interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver
use_namespaces = True
dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
告诉neutron,使用ovs
编辑 /etc/neutron/neutron.conf
core_plugin = neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2
notification_driver = neutron.openstack.common.notifier.rabbit_notifier
告诉 ovs 插件数据库连接:编辑 /etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini
[database]
connection = mysql://neutron:tsj@128.6.3.33/neutron
[securitygroup]
# Firewall driver for realizing neutron security group function.
firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
[ovs]
tenant_network_type = gre
tunnel_id_ranges = 1:1000
enable_tunneling = True
integration_bridge = br-int
tunnel_bridge = br-tun
local_ip = 192.168.200.1
增加两个网桥
# ovs-vsctl add-br br-int
# ovs-vsctl add-br br-ex
最后重启服务
# cd /etc/init.d/; for i in $( ls neutron-* ); do sudo service $i restart; done