OpenStack Networkingを使用すると、インターフェースデバイスを作成したり、ネットワークに接続したりできます。このガイドは、OpenStack環境でNeutron(ネットワーキング)を構成するのに役立ちます。 Neutronは、仮想ネットワークインフラストラクチャに必要なすべてのネットワーク関連のものを管理し、ネットワーク、サブネット、およびルーターオブジェクトの抽象化を提供します。
コントローラーノードのインストールと構成:
Neutronサービスを構成する前に、データベース、サービス、およびAPIエンドポイントを作成する必要があります。
ルートとしてMySQLサーバーにログインします。
# mysql -u root -p
Create the neutron database.
CREATE DATABASE neutron;
中性子データベースに適切な許可を与えます。
GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'%' IDENTIFIED BY 'password';
「パスワード」を適切なパスワードに置き換えます。 MySQLを終了します。
環境スクリプトから管理者クレデンシャルをロードします。
# source admin-openrc.sh
サービス資格情報を作成するためのneutronユーザーを作成します。
# openstack user create --password-prompt neutron User Password: Repeat User Password: +----------+----------------------------------+ | Field | Value | +----------+----------------------------------+ | email | None | | enabled | True | | id | ac5ee3286887450d911b82d4e263e1c9 | | name | neutron | | username | neutron | +----------+----------------------------------+
管理者の役割をneutronユーザーに追加します。
# openstack role add --project service --user neutron admin +-------+----------------------------------+ | Field | Value | +-------+----------------------------------+ | id | 33af4f957aa34cc79451c23bf014af6f | | name | admin | +-------+----------------------------------+
中性子サービスエンティティを作成します。
# openstack service create --name neutron --description "OpenStack Networking" network +-------------+----------------------------------+ | Field | Value | +-------------+----------------------------------+ | description | OpenStack Networking | | enabled | True | | id | 95237876259e44d9a1a926577b786875 | | name | neutron | | type | network | +-------------+----------------------------------+
neutronサービスAPIエンドポイントを作成します。
# openstack endpoint create \ --publicurl http://controller:9696 \ --adminurl http://controller:9696 \ --internalurl http://controller:9696 \ --region RegionOne \ network +--------------+----------------------------------+ | Field | Value | +--------------+----------------------------------+ | adminurl | http://controller:9696 | | id | ed46eb46c27e4f2b9a58ff574f43d0cb | | internalurl | http://controller:9696 | | publicurl | http://controller:9696 | | region | RegionOne | | service_id | 95237876259e44d9a1a926577b786875 | | service_name | neutron | | service_type | network | +--------------+----------------------------------+
コントローラーノードにネットワークコンポーネントをインストールして構成します:
# apt-get install neutron-server neutron-plugin-ml2 python-neutronclient
/etc/neutron/neutron.confを編集します。
# nano /etc/neutron/neutron.conf
以下の設定を変更し、適切なセクションにエントリを配置してください。
[DEFAULT] ... verbose = True rpc_backend = rabbit auth_strategy = keystone core_plugin = ml2 service_plugins = router allow_overlapping_ips = True notify_nova_on_port_status_changes = True notify_nova_on_port_data_changes = True nova_url = http://controller:8774/v2 [oslo_messaging_rabbit] ... rabbit_host = controller rabbit_userid = openstack rabbit_password = password ## Replace "password" with the password you chose for the openstack account in RabbitMQ [database] ... connection = mysql://neutron:password@controller/neutron ## Replace "password" with the password you chose for neutron database [keystone_authtoken] ... auth_uri = http://controller:5000 auth_url = http://controller:35357 auth_plugin = password project_domain_id = default user_domain_id = default project_name = service username = neutron password = password ## Replace "password" with the password you chose for neutron user in the identity service. [nova] ... auth_url = http://controller:35357 auth_plugin = password project_domain_id = default user_domain_id = default region_name = RegionOne project_name = service username = nova password = password ## Replace "password" with the password you chose for nova user in the identity service.
モジュラーレイヤー2(ML2)プラグインの構成:
/etc/neutron/plugins/ml2/ml2_conf.iniファイルを編集します
# nano /etc/neutron/plugins/ml2/ml2_conf.ini
次のスタンザを変更します。
[ml2] ... type_drivers = flat,vlan,gre,vxlan tenant_network_types = gre mechanism_drivers = openvswitch [ml2_type_gre] ... tunnel_id_ranges = 1:1000 [securitygroup] ... enable_security_group = True enable_ipset = True firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
ネットワークを使用するようにコンピューティングを構成し、コントローラーノードで/etc/nova/nova.confを編集します。
# nano /etc/nova/nova.conf
以下の設定を変更し、適切なセクションにエントリを配置してください。
[DEFAULT] ... network_api_class = nova.network.neutronv2.api.API security_group_api = neutron linuxnet_interface_driver = nova.network.linux_net.LinuxOVSInterfaceDriver firewall_driver = nova.virt.firewall.NoopFirewallDriver [neutron] url = http://controller:9696 auth_strategy = keystone admin_auth_url = http://controller:35357/v2.0 admin_tenant_name = service admin_username = neutron admin_password = password ## Replace "password" with the password you chose for neutron user in the identity service
注:特定のセクションがない場合は、スタンザを作成して配置します。
中性子データベースにデータを入力します。
# 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
コントローラノードでコンピューティングおよびネットワークサービスを再起動します。
# service nova-api restart # service neutron-server restart
ロードされた拡張機能を一覧表示して確認します。
# neutron ext-list +-----------------------+-----------------------------------------------+ | alias | name | +-----------------------+-----------------------------------------------+ | security-group | security-group | | l3_agent_scheduler | L3 Agent Scheduler | | net-mtu | Network MTU | | ext-gw-mode | Neutron L3 Configurable external gateway mode | | binding | Port Binding | | provider | Provider Network | | agent | agent | | quotas | Quota management support | | subnet_allocation | Subnet Allocation | | dhcp_agent_scheduler | DHCP Agent Scheduler | | l3-ha | HA Router extension | | multi-provider | Multi Provider Network | | external-net | Neutron external network | | router | Neutron L3 Router | | allowed-address-pairs | Allowed Address Pairs | | extraroute | Neutron Extra Route | | extra_dhcp_opt | Neutron Extra DHCP opts | | dvr | Distributed Virtual Router | +-----------------------+-----------------------------------------------+
次は、ネットワークノードをインストールして構成します。