Option 1: Provider 網絡
在
controller node
控制節(jié)點安裝按厘、配置網絡組件
安裝組件
$ yum install openstack-neutron openstack-neutron-ml2 \
openstack-neutron-linuxbridge ebtables
配置服務器組件
網絡服務器組件配置包括數據庫、認證機制遣铝、消息隊列棱貌、網絡拓撲變更提醒原环、以及插件
默認的配置文件因發(fā)行版本不同而變化,你可能需要添加下列條目或選項贿条,而不是修改現(xiàn)有的雹仿。
- 編輯
/etc/neutron/neutron.conf
,完成如下內容:
[database]
...
connection = mysql+pymysql://neutron:123456@controller/neutron
#注釋或刪除[database]條目中其他的connection
[DEFAULT]
...
core_plugin = ml2 #使用modular layer 2(ML2)插件
service_plugins = #禁用其他插件
transport_url = rabbit://openstack:123456@controller #使用rabbitMQ
auth_strategy = keystone #使用keystone認證
notify_nova_on_port_status_changes = True
notify_nova_on_port_data_changes = True
[keystone_authtoken]
...
auth_uri = http://controller:5000
auth_rul = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = neutron
password = 123456
#注釋或刪除[keystone_authtoken]條目中其他選項
[nova]
...
auth_url = http://controller:35357
auth_type = password
project_domain_name = Default
user_domain_name = Default
region_name = RegionOne
project_name = service
username = nova
password = 123456
[oslo_concurrency]
...
lock_path = /var/lib/neutron/tmp
配置 Modular Layer 2 (ML2)插件
ML2插件使用Linux bridge機制建立layer-2虛擬網絡架構供虛擬機使用
- 編輯
/etc/neutron/plugins/ml2/ml2_conf.ini
,添加如下內容:
[ml2]
...
type_drivers = flat,vlan #啟用flat和vlan網絡
tenant_network_types = #禁用self-service網絡
mechanism_drivers = linuxbridge #啟用linux bridge
extension_drivers = port_security #啟用port安全擴展驅動
[ml2_type_flat]
...
flat_networks = provider #配置provider虛擬網絡為flat
[securitygroup]
...
enable_ipset = True #啟用ipset增加安全組規(guī)則的效率
配置Linux bridge代理
Linux bridge代理會建立layer-2(bridge和swiching)
虛擬網絡架構,并處理安全組
- 編輯
/etc/neutron/plugins/ml2/linuxbridge_agent.ini
[linux_bridge]
physical_interface_mappings = provider:enp0s8
[vxlan]
enable_vxlan = False
[securitygroup]
enable_security_group = True #啟用安全組
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
#配置Linuxbridge iptables firewall driver
配置 DHCP
- 編輯`/etc/neutron/dhcp_agent.ini
[DEFAULT]
...
interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver
dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
enable_isolated_metadata = True