next up previous contents
Next: 設定 metadata agent Up: Neutron Previous: Provider Networks   Contents

Self-service network

  1. 編輯 /etc/neutron/neutron.conf,增加 service_plugins, allow_overlapping_ips 兩項設定。
    [root@controller ~]# vim /etc/neutron/neutron.conf 
    [root@controller ~]# egrep '^(\[data|\[DEF|\[keystone_a|\[nova|\[oslo_c|[a-z])' \
    /etc/neutron/neutron.conf 
    
    [DEFAULT]
    core_plugin = ml2
    service_plugins = router     ##
    allow_overlapping_ips = true    ##
    transport_url = rabbit://openstack:123qwe@controller
    auth_strategy = keystone
    notify_nova_on_port_status_changes = true
    notify_nova_on_port_data_changes = true
    
    [database]
    connection = mysql+pymysql://neutron:123qwe@controller/neutron 
    
    [keystone_authtoken]
    auth_uri = http://controller:5000
    auth_url = http://controller:35357
    memcached_servers = controller:11211
    auth_type = password
    project_domain_name = default
    user_domain_name = default
    project_name = service
    username = neutron
    password = 123qwe
    
    [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 = 123qwe
    
    [oslo_concurrency]
    lock_path = /var/lib/neutron/tmp
    
  2. 編輯 /etc/neutron/plugins/ml2/ml2_conf.ini,設定 Modular Layer2 (ML2) 外掛。type_drivers 增加 vxlan,tenant_network_types 設為 vxlan,mechanism_drivers 增加 l2population。
    [root@controller ~]# vim /etc/neutron/plugins/ml2/ml2_conf.ini 
    [root@controller ~]# egrep '^(\[ml2\]|\[ml2_type_flat|\[sec|[a-z])' \
    /etc/neutron/plugins/ml2/ml2_conf.ini
    
    [ml2]
    type_drivers = flat,vlan,vxlan   ##
    tenant_network_types = vxlan     ##
    mechanism_drivers = linuxbridge,l2population  ##
    extension_drivers = port_security
    
    [ml2_type_flat]
    flat_networks = provider
    vni_ranges = 1:1000     ##
    
    [securitygroup]
    enable_ipset = true
    
  3. 編輯 /etc/neutron/plugins/ml2/linuxbridge_agent.ini,設定 linux 橋接代理,其中 physical_interface_mappings 設定 em2 為控制節點主機的網卡代號。啟動 vxlan,設定 local_ip 為控制主機的 IP。
    [root@controller ~]# vim /etc/neutron/plugins/ml2/linuxbridge_agent.ini 
    [root@controller ~]# egrep '^(\[linux_b|\[vxlan|\[sec|[a-z])' \
    /etc/neutron/plugins/ml2/linuxbridge_agent.ini 
    
    [linux_bridge]
    physical_interface_mappings = provider:em2
    
    [securitygroup]
    enable_security_group = true
    firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
    
    [vxlan]
    enable_vxlan = true    ##
    local_ip = 163.17.10.112   ##
    l2_population = true   ##
    
  4. 編輯 /etc/neutron/dhcp_agent.ini,設定 DHCP 代理。
    [root@controller ~]# vim /etc/neutron/dhcp_agent.ini 
    [root@controller ~]# egrep '^(\[DEF|[a-z])' /etc/neutron/dhcp_agent.ini 
    
    [DEFAULT]
    interface_driver = linuxbridge
    dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
    enable_isolated_metadata = true
    



De-Yu Wang 2018-12-12