天天看點

OpenStack Juno系列之網絡節點搭建

OpenStack Juno系列之網絡節點搭建

neutron節點搭建

------------------

添加轉發

vi  /etc/sysctl.conf

net.ipv4.ip_forward=1

net.ipv4.conf.all.rp_filter=0

net.ipv4.conf.default.rp_filter=0

重新整理下

sysctl -p

安裝neutron各子產品服務

apt-get install neutron-plugin-ml2 neutron-plugin-openvswitch-agent \

  neutron-l3-agent neutron-dhcp-agent

編輯配置檔案

vi  /etc/neutron/neutron.conf

[DEFAULT]

verbose = True

rpc_backend = rabbit

rabbit_host = controller

rabbit_password = RABBIT_PASS

core_plugin = ml2

service_plugins = router

allow_overlapping_ips = True

auth_strategy = keystone

[keystone_authtoken]

auth_uri = http://controller:5000/v2.0

identity_uri = http://controller:35357

admin_tenant_name = service

admin_user = neutron

admin_password = NEUTRON_PASS

編輯ml2配置檔案

vi /etc/neutron/plugins/ml2/ml2_conf.ini

[ml2]

type_drivers = flat,gre

tenant_network_types = gre

mechanism_drivers = openvswitch

[ml2_type_flat]

flat_networks = external

[ml2_type_gre]

tunnel_id_ranges = 1:1000

[securitygroup]

enable_security_group = True

enable_ipset = True

firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver

[ovs]

local_ip = INSTANCE_TUNNELS_INTERFACE_IP_ADDRESS

tunnel_type = gre

enable_tunneling = True

bridge_mappings = external:br-ex

To configure the Layer-3 (L3) agent:

 vi /etc/neutron/l3_agent.ini

interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver

use_namespaces = True

external_network_bridge = br-ex

To configure the DHCP agent:

vi  /etc/neutron/dhcp_agent.ini

dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq

dnsmasq_config_file = /etc/neutron/dnsmasq-neutron.conf

vi /etc/neutron/dnsmasq-neutron.conf

dhcp-option-force=26,1454

# pkill dnsmasq

To configure the metadata agent:

vi /etc/neutron/metadata_agent.ini

nova_metadata_ip = controller

auth_url = http://controller:5000/v2.0

auth_region = regionOne

metadata_proxy_shared_secret = METADATA_SECRET

到控制節點上編輯

vi  /etc/nova/nova.conf

[neutron]

service_metadata_proxy = True

重新開機服務

service nova-api restart

回到neutron節點上:

配置OVS,重新開機服務

service openvswitch-switch restart

ovs-vsctl add-br br-ex

ovs-vsctl add-port br-ex INTERFACE_NAME

ethtool -K INTERFACE_NAME gro off

service neutron-plugin-openvswitch-agent restart

service neutron-l3-agent restart

繼續閱讀