【neutron】mitaka版本openstack网络之linux bridge

来源:互联网 发布:华为荣耀4a手机壳淘宝 编辑:程序博客网 时间:2024/06/05 11:37

作者:【吴业亮】云计算开发工程师
博客:http://blog.csdn.net/wylfengyujiancheng
一、硬件配置及服务拓扑
1. controller节点:一块网卡
2. 网络节点:四块网卡。
3. 计算节点:三块网卡
这里写图片描述
这里写图片描述
controller节点
1. 运行neutron数据库和neutron-server
2. 运行消息队列服务
3. 运行OpenStack身份与合适的配置服务
4. 运行OpenStack计算nova相关网络,需配置nova.conf文件。
5. 运行插件ML2
网络节点
1. Neutron认证相关信息需配置neutron.conf文件。
2. Linux桥代理,L3代理,DHCP代理,元数据代理,和一些依赖项。
计算节点
1. 运行OpenStack身份与合适的配置服务 需配置neutron.conf文件。
2. 运行OpenStack计算nova相关网络,需配置nova.conf文件。
3. Linux桥代理和一些依赖项。
二、各个节点服务关系及说明
这里写图片描述
这里写图片描述
网络节点网络包含以下组件:
1. Linuxbridge-agent
2. DHCP agent
3. L3 agent
4. Metadata agent
这里写图片描述
这里写图片描述
计算节点网络包含以下组件:
1. Linux-bridge-agent
这里写图片描述
这里写图片描述
三、场景举例
Note请注意
南北网络:虚拟机内部数据到外部网络
东西网络:虚拟机之间通信
案例1:南北网络、实例对应一个固定的IP地址
这里写图片描述
案例2:南北网络,实例对应一个浮动IP地址
这里写图片描述
案例3:东西网络,实例在不同的网络上
这里写图片描述
案例4:东西网络、实例在同一网络
这里写图片描述
四、安装配置
(一)controller节点
1、安装组件

# yum install openstack-neutron openstack-neutron-ml2 \  openstack-neutron-linuxbridge ebtables

2、配置服务器组件
编辑 /etc/neutron/neutron.conf文件,并完成以下动作:
在[数据库]节中,配置数据库访问:

[database]connection = mysql+pymysql://neutron:NEUTRON_DBPASS@controller/neutron

替换 NEUTRON_DBPASS为你自己的密码
在[默认的]部分

[DEFAULT]core_plugin = ml2service_plugins = routerallow_overlapping_ips = True

在[默认的]和[oslo_messaging_rabbit]部分,配置RabbitMQ消息队列访问:

[DEFAULT]rpc_backend = rabbit[oslo_messaging_rabbit]rabbit_host = controllerrabbit_userid = openstackrabbit_password = RABBIT_PASS

替换RABBIT_PASS为你自己的密码
在[默认的]和[keystone_authtoken]部分,配置身份服务访问:

[DEFAULT]auth_strategy = keystone[keystone_authtoken]auth_uri = http://controller:5000auth_url = http://controller:35357memcached_servers = controller:11211auth_type = passwordproject_domain_name = defaultuser_domain_name = defaultproject_name = serviceusername = neutronpassword = NEUTRON_PASS

替换NEUTRON_PASS为你自己的密码
Note请注意
注释掉或删除任何其他选项 [keystone_authtoken]部分。
在[默认的]和[nova]部分,配置网络通知计算网络拓扑变化:

[DEFAULT]notify_nova_on_port_status_changes = Truenotify_nova_on_port_data_changes = True[nova]auth_url = http://controller:35357auth_type = passwordproject_domain_name = defaultuser_domain_name = defaultregion_name = RegionOneproject_name = serviceusername = novapassword = NOVA_PASS

替换NOVA_PASS为你自己的密码。
在[oslo_concurrency]节中,配置锁路径:

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

3、编辑/etc/neutron/plugins/ml2/ml2_conf.ini文件
在[ml2]部分,使平、VLAN和VXLAN网络:

[ml2]type_drivers = flat,vlan,vxlan

在[ml2]部分,使VXLAN自助服务网络:

[ml2]tenant_network_types = vxlan

在[ml2]部分

[ml2]mechanism_drivers = linuxbridge,l2population

在[ml2]部分,启用端口安全

[ml2]extension_drivers = port_security

在[ml2_type_flat]部分,虚拟网络配置提供者平面网络:

[ml2_type_flat]flat_networks = provider

在[ml2_type_vxlan]部分,配置VXLAN网络标识符范围自助服务网络:

[ml2_type_vxlan]vni_ranges = 1:1000

在[securitygroup]部分,使ipset提高效率的安全组规则:

[securitygroup]enable_ipset = True

编辑/etc/nova/nova.conf文件和执行以下操作:
在[nova]节中,配置访问参数,使元数据代理,并配置秘密:

[neutron]url = http://controller:9696auth_url = http://controller:35357auth_type = passwordproject_domain_name = defaultuser_domain_name = defaultregion_name = RegionOneproject_name = serviceusername = neutronpassword = NEUTRON_PASSservice_metadata_proxy = True

4、创建链接

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

5、同步数据库

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

6、重启nova服务

systemctl restart openstack-nova-api.service

7、启动neutron服务

# systemctl enable neutron-server.service# systemctl start neutron-server.service

(二)网络节点
1.安装软件包

# yum install openstack-neutron openstack-neutron-ml2 \  openstack-neutron-linuxbridge ebtables

2.配置组件
编辑/etc/neutron/neutron.conf文件,并完成以下动作:
在[数据库]节中,删除配置数据库访问:
在[默认的]部分,使模块化层2)中打开(名为ML2插件,路由器的服务,和重叠的IP地址:

[DEFAULT]core_plugin = ml2service_plugins = routerallow_overlapping_ips = True

在[默认的]和[oslo_messaging_rabbit]部分,配置RabbitMQ消息队列访问:

[DEFAULT]rpc_backend = rabbit[oslo_messaging_rabbit]rabbit_host = controllerrabbit_userid = openstackrabbit_password = RABBIT_PASS

替换RABBIT_PASS为你自己的密码。
在[默认的]和[keystone_authtoken]部分,配置身份服务访问:

[DEFAULT]auth_strategy = keystone[keystone_authtoken]auth_uri = http://controller:5000auth_url = http://controller:35357memcached_servers = controller:11211auth_type = passwordproject_domain_name = defaultuser_domain_name = defaultproject_name = serviceusername = neutronpassword = NEUTRON_PASS

替换NEUTRON_PASS为你自己的密码
Note请注意
注释掉或删除任何其他选项 [keystone_authtoken]部分。
在[oslo_concurrency]节中,配置锁路径:

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

3、编辑/etc/neutron/plugins/ml2/ml2_conf.ini文件
在[ml2]部分,使平、VLAN和VXLAN网络:

[ml2]type_drivers = flat,vlan,vxlan

在[ml2]部分,使VXLAN自助服务网络:

[ml2]tenant_network_types = vxlan

在[ml2]部分,使Linux桥和2层人口机制:

[ml2]mechanism_drivers = linuxbridge,l2population

在[ml2]部分,启用端口安全扩展司机:

[ml2]extension_drivers = port_security

在[ml2_type_flat]部分,虚拟网络配置提供者平面网络:

[ml2_type_flat]flat_networks = provider

在[ml2_type_vxlan]部分,配置VXLAN网络标识符范围自助服务网络:

[ml2_type_vxlan]vni_ranges = 1:1000

在[securitygroup]部分,使ipset提高效率的安全组规则:

[securitygroup]enable_ipset = True

6、编辑 /etc/neutron/plugins/ml2/linuxbridge_agent.inii文件:

[linux_bridge]physical_interface_mappings = provider:PROVIDER_INTERFACE_NAME[vxlan]enable_vxlan = Truelocal_ip = OVERLAY_INTERFACE_IP_ADDRESSl2_population = True[securitygroup]enable_security_group = Truefirewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver

替换 OVERLAY_INTERFACE_IP_ADDRESS与为网卡I

  1. 配置L3代理。编辑 /etc/neutron/l3_agent.ini文件:
[DEFAULT]interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriverexternal_network_bridge =

Note请注意
的 external_network_bridge选择故意不包含值。
2. 配置DHCP代理。编辑 /etc/neutron/dhcp_agent.ini文件:

[DEFAULT]interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriverdhcp_driver = neutron.agent.linux.dhcp.Dnsmasqenable_isolated_metadata = True
  1. 配置元数据代理。编辑 /etc/neutron/metadata_agent.ini文件:
[DEFAULT]nova_metadata_ip=controllermetadata_proxy_shared_secret=METADATA_SECRET

替换METADATA_SECRET为合适的值。
4、创建链接

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

5、启动服务

# systemctl restart openstack-nova-api.service# systemctl enable   neutron-linuxbridge-agent.service neutron-dhcp-agent.service \

neutron-metadata-agent.service

# systemctl start  neutron-linuxbridge-agent.service neutron-dhcp-agent.service \  neutron-metadata-agent.service

(三)计算节点
1.安装软件包

# yum install openstack-neutron-linuxbridge ebtables

2.编辑 /etc/neutron/neutron.conf文件,并完成以下动作:
在 [数据库]节中,注释掉 连接选项,因为计算节点不直接访问数据库。
在 [默认的]和 [oslo_messaging_rabbit]部分,配置RabbitMQ消息队列访问:

[DEFAULT]rpc_backend = rabbit[oslo_messaging_rabbit]rabbit_host = controllerrabbit_userid = openstackrabbit_password = RABBIT_PASS

替换 RABBIT_PASS你的密码
在 [默认的]和 [keystone_authtoken]部分,配置身份服务访问:

[DEFAULT]auth_strategy = keystone[keystone_authtoken]auth_uri = http://controller:5000auth_url = http://controller:35357memcached_servers = controller:11211auth_type = passwordproject_domain_name = defaultuser_domain_name = defaultproject_name = serviceusername = neutronpassword = NEUTRON_PASS

替换NEUTRON_PASS为你的密码
Note请注意
注释掉或删除任何其他选项 [keystone_authtoken]部分。
在 [oslo_concurrency]节中,配置锁路径:

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

3.编辑 /etc/neutron/plugins/ml2/linuxbridge_agent.ini

[linux_bridge]physical_interface_mappings = provider:PROVIDER_INTERFACE_NAME[vxlan]enable_vxlan = Truelocal_ip = OVERLAY_INTERFACE_IP_ADDRESSl2_population = True[securitygroup]enable_security_group = Truefirewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver

4、配置nova配置文件¶
编辑 /etc/nova/nova.conf文件,并完成以下动作:
在 [neutron]节中,配置访问参数:

[neutron]url = http://controller:9696auth_url = http://controller:35357auth_type = passwordproject_domain_name = defaultuser_domain_name = defaultregion_name = RegionOneproject_name = serviceusername = neutronpassword = NEUTRON_PASS

替换 NEUTRON_PASS为自己的密码
5.启动服务

# systemctl enable neutron-linuxbridge-agent.service# systemctl start neutron-linuxbridge-agent.service# systemctl restart openstack-nova-compute.service
3 0
原创粉丝点击