네트워크 서비스 설치 순서이다. 네트워크 서비스의 코드명은 Neutron이며 SDN(Software Defined Network)을 구현하기 위해 필요한 서비스이다.

routing, firewall, load balancer, virtual private network (VPN) 의 구현이 가능하다.

예전 버전 설치 가이드에서는 네트워크 노드를 따로 구성했던 중요한 서비스

 

설치는 컨트롤러 노드와 컴퓨트 노드에 설치되며 설치 순서는 다른 서비스와 마찬가지이다.

 

컨트롤러 노드 부터 설정한다.

우선 DB 생성 및 권한 설정을 한다. NEUTRON_DBPASS는 개인이 설정할 DB 패스워드로 변경한다.

 

[root@controller ~]# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 400
Server version: 5.5.44-MariaDB MariaDB Server

Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> CREATE DATABASE neutron;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost' \
       IDENTIFIED BY 'NEUTRON_DBPASS';

Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'controller' \

       IDENTIFIED BY 'NEUTRON_DBPASS';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'%' \
       IDENTIFIED BY 'NEUTRON_DBPASS';
Query OK, 0 rows affected (0.00 sec)

 

CLI에서 오픈스택 command를 원할하게 수행하기 위해 admin 계정을 export 해준다. 기존 설치에서 세션이 이어진다면 생략가능하다.

[root@controller ~]# source admin-openrc.sh
 

 

Neutron 유저를 생성하고 admin 롤을 부여한다.

[root@controller ~]# openstack user create --domain default --password-prompt neutron
User Password:
Repeat User Password:
+-----------+----------------------------------+
| Field     | Value                            |
+-----------+----------------------------------+
| domain_id | default                          |
| enabled   | True                             |
| id        | 04f45beeb2a54c5bbadf3b7845c62d86 |
| name      | neutron                          |
+-----------+----------------------------------+

[root@controller ~]# openstack role add --project service --user neutron admin

 

Neutron 서비스를 만든다.

[root@controller ~]# openstack service create --name neutron --description "OpenStack Networking" network
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | OpenStack Networking             |
| enabled     | True                             |
| id          | c47974b46d0c4b3781588c9b8817944a |
| name        | neutron                          |
| type        | network                          |
+-------------+----------------------------------+

 

 

Neutron 서비스의 API 엔드포인트를 만든다.

[root@controller ~]# openstack endpoint create --region RegionOne network public http://controller:9696
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 457104ab1eef491f81bb7aa197f55b69 |
| interface    | public                           |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | c47974b46d0c4b3781588c9b8817944a |
| service_name | neutron                          |
| service_type | network                          |
| url          | http://controller:9696           |
+--------------+----------------------------------+
[root@controller ~]# openstack endpoint create --region RegionOne network internal http://controller:9696
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | c0e4a873e04a4375a92c42ea9284e9de |
| interface    | internal                         |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | c47974b46d0c4b3781588c9b8817944a |
| service_name | neutron                          |
| service_type | network                          |
| url          | http://controller:9696           |
+--------------+----------------------------------+
[root@controller ~]# openstack endpoint create --region RegionOne network admin http://controller:9696
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | de4df65f8e5e4ed6802ceaf7eae57a36 |
| interface    | admin                            |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | c47974b46d0c4b3781588c9b8817944a |
| service_name | neutron                          |
| service_type | network                          |
| url          | http://controller:9696           |
+--------------+----------------------------------+

 

 

패키지를 설치한다.

[root@controller ~]# yum install -y openstack-neutron openstack-neutron-ml2 openstack-neutron-linuxbridge python-neutronclient ebtables ipset
Loading mirror speeds from cached hostfile
 * base: ftp.neowiz.com
 * extras: ftp.neowiz.com
 * updates: ftp.neowiz.com
Package python-neutronclient-3.1.0-1.el7.noarch already installed and latest version
Package ebtables-2.0.10-13.el7.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package ipset.x86_64 0:6.19-4.el7 will be installed
--> Processing Dependency: ipset-libs = 6.19-4.el7 for package: ipset-6.19-4.el7.x86_64

...(중략)...

  python-singledispatch.noarch 0:3.4.0.2-2.el7

  python-webtest.noarch 0:1.3.4-6.el7
  python2-pecan.noarch 0:1.0.2-2.el7      

  radvd.x86_64 0:1.9.2-9.el7

Complete!
[root@controller ~]#


 

이후 단계에서는 네트워크 설정에 관해서 2가지 옵션이 있다.

Provider networks와 Self-service networks이며 Provider networks는 Layer 2기반으로 networks, routers, floating IP addresses 설정 없이

물리 네트워크에 의존하는 간단한 설정이며 Self-service networks은 VXLAN과 같은 오버레이 기술을 이용하여 Layer 3(라우팅)을 구현한다.

이후로는 Self-service networks 에 따라 설정을 함.

 

/etc/neutron/neutron.conf 파일을 아래와 같이 수정한다.

[database]섹션에 database 연결 정보를 입력한다. NEUTRON_DBPASS는 개인이 설정한 패스워드로 변경한다.

[DEFAULT]섹션에서 Modular Layer 2 (ML2) 및 router 모듈, 오버랩핑 IP 허용을 활성화 시킨다.

[DEFAULT] 와 [oslo_messaging_rabbit] 섹션에서 RabbitMQ 메세지 큐 설정을 한다. RABBIT_PASS는 개인이 설정한 패스워드로 변경한다.

[DEFAULT] 와 [keystone_authtoken] 섹션에서 Identity 서비스 접근 설정을 한다. NEUTRON_PASS는 개인이 설정한 패스워드로 변경한다. [keystone_authtoken]은

해당 내용 외에는 모든 내용을 주석처리하거나 삭제한다.

[DEFAULT] and [nova] 섹션에 네트워크 토폴리지가 변경됨을 알린다.

[oslo_concurrency] 섹션에 lock path 설정을 한다.

 (옵션)[DEFAULT] 섹션에서 트러블슈팅시 도움이 될수 있게 verbose를 활성화한다.

[root@controller ~]# vi /etc/neutron/neutron.conf
[DEFAULT]

...
core_plugin = ml2
service_plugins = router
allow_overlapping_ips = True

...

rpc_backend = rabbit

...
auth_strategy = keystone

...

notify_nova_on_port_status_changes = True
notify_nova_on_port_data_changes = True
nova_url = http://controller:8774/v2

...
verbose = True

...


 

 

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

...

[oslo_messaging_rabbit]

...

rabbit_host = controller
rabbit_userid = openstack
rabbit_password = RABBIT_PASS

...

[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 = NEUTRON_PASS

...

[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 = NOVA_PASS

...

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

 

 

Modular Layer 2 (ML2) plug-in를 설정을 위해 /etc/neutron/plugins/ml2/ml2_conf.ini 파일을 아래와 같이 수정한다.

 

[root@controller ~]# vi /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 = public
...

[ml2_type_vxlan]
...
vni_ranges = 1:1000
...

[securitygroup]
...
enable_ipset = True 


 

Linux bridge agent 설정을 위해 /etc/neutron/plugins/ml2/linuxbridge_agent.ini 파일을 아래와 같이 수정한다.

[linux_bridge] 섹션에 public 가상 네트워크에 public 네트워크 인터페이스를 맵핑시켜준다.

[vxlan] 섹션에서 vxlan및 layer-2 population을 활성화 시켜주며 overlay 네트워크를 핸들링할 물리 네트워크의 주소를 입력한다. 여기서는 10.0.0.11을 입력

[agent] 섹션에서 ARP spoofing protection을 활성화 시킨다.

[securitygroup] 섹션에서 security groups을 활성화 시키고 Linux bridge iptables firewall driver를 설정한다.

[root@controller ~]# vi /etc/neutron/plugins/ml2/linuxbridge_agent.ini
[linux_bridge]

...

physical_interface_mappings = public:eth1

#physical_interface_mappings = public:PUBLIC_INTERFACE_NAME

...

[vxlan]
enable_vxlan = True
local_ip = 10.0.0.1

#local_ip = OVERLAY_INTERFACE_IP_ADDRESS
l2_population = True

..

[agent]
...
prevent_arp_spoofing = True

...

[securitygroup]
...
enable_security_group = True
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver

 

 

가상 NAS네트워크 및 Layer 3 설정을 위해 /etc/neutron/l3_agent.ini파일을 아래와 같이 수정한다.

[DEFAULT] 섹션에서 Linux bridge interface driver 및 external network bridge 구성. external network bridge는 다수의 external networks 이 가능하게 의도적으로 비워둔다.

[root@controller ~]# vi /etc/neutron/l3_agent.ini
[DEFAULT]

...
interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver
external_network_bridge =

 

가상 네트워크에 DHCP 서비스를 제공하기 위해 /etc/neutron/dhcp_agent.ini파일을 아래와 같이 수정한다.

[DEFAULT]섹션에 Linux bridge interface driver, Dnsmasq DHCP driver 설정 및

public 네트워크 상의 인스턴스가 metadata에 접근할수 있게 isolated_metadata 을 활성화 시킨다.

 

[root@controller ~]# vi /etc/neutron/dhcp_agent.ini
[DEFAULT]

...
interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver
dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
enable_isolated_metadata = True  

 

DHCP 설정관련 추가로 VXLAN과 같은 오버레이 네트워크 들은 패킷의 헤더에 페이로드 및 유저정보가 포함되어 있다. 근데 이때 가상네트워크 임을 모르는 상태에서

Instance들이 default상태의 mtu값 1500으로 패킷을 전송시 성능저하 또는 연결문제가 생길수 있어 아래와 같이 Instance들의 mtu 값을 1450으로 DHCP에서 설정한다.

(일부 클라우드 이미지들은 이러한 DHCP의 옵션을 무시하는 경우가 있어 이때는 메타 데이터, 스크립트, 또는 다른 적합 한 메서드를 사용하여 구성해야 한다.)

[DEFAULT] 섹션에 dnsmasq구성파일을 사용하게 설정한다.

[DEFAULT]

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

 

/etc/neutron/dnsmasq-neutron.conf 파일을 생성하여 편집한다.

[root@controller ~]# vi /etc/neutron/dnsmasq-neutron.conf
dhcp-option-force=26,1450

 

 

메타데이터 에이전트를 설정하기 위해 /etc/neutron/metadata_agent.ini 파일을 아래와 같이 수정한다.

메타데이터 에이전트는 인스턴스에 자격증명 등의 구성정보를 제공한다.

[DEFAULT] 섹션에 access 파라메터 설정을 한다. NEUTRON_PASS는 설정한 패스워드로 변경한다.

[DEFAULT] 섹션에 metadata host를 controller로 설정한다.

[DEFAULT] metadata proxy shared secret 설정을 한다.

 

[root@controller ~]# vi /etc/neutron/metadata_agent.ini

[DEFAULT]
...
auth_uri = http://controller:5000
auth_url = http://controller:35357
auth_region = RegionOne
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = neutron
password = NEUTRON_PASS

...
nova_metadata_ip = controller

...
metadata_proxy_shared_secret = METADATA_SECRET

 

compute 서비스가 neutron을 사용하도록 하기 위해 /etc/nova/nova.conf 를 아래와 같이 수정한다.

[neutron] 섹션에서 access 파라메터 설정, metadata proxy 활성화 secret 설정을 한다.

 

네트워킹 서비스는 ML2 plug-in 설정 파일인 /etc/neutron/plugins/ml2/ml2_conf.ini를 가리키는 /etc/neutron/plugin.ini라는 심볼릭 링크를 생성한다

만약 이 심볼릭 링크가 없다면 만들어 준다.

 

[root@controller ~]# ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini
[root@controller ~]# ls -alrt /etc/neutron/plugin.ini
lrwxrwxrwx. 1 root root 37 Mar  5 16:50 /etc/neutron/plugin.ini -> /etc/neutron/plugins/ml2/ml2_conf.ini

 

DB의 tables 생성해준다.

[root@controller ~]# 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

 

Nova 설정 파일이 변경이 있었으니 nova 서비스를 재시작 해주고 Neutron도 시작 및 부팅시 시작할수 있게 설정한다.

[root@controller ~]# systemctl restart openstack-nova-api.service
[root@controller ~]# systemctl enable neutron-server.service \
   neutron-linuxbridge-agent.service neutron-dhcp-agent.service \
   neutron-metadata-agent.service neutron-l3-agent.service
Created symlink from /etc/systemd/system/multi-user.target.wants/neutron-server.service to /usr/lib/systemd/system/neutron-server.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/neutron-linuxbridge-agent.service to /usr/lib/systemd/system/neutron-linuxbridge-agent.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/neutron-dhcp-agent.service to /usr/lib/systemd/system/neutron-dhcp-agent.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/neutron-metadata-agent.service to /usr/lib/systemd/system/neutron-metadata-agent.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/neutron-l3-agent.service to /usr/lib/systemd/system/neutron-l3-agent.service.
[root@controller ~]# systemctl start neutron-server.service \
   neutron-linuxbridge-agent.service neutron-dhcp-agent.service \
   neutron-metadata-agent.service neutron-l3-agent.service

[root@controller ~]#  

 

다음은 컴퓨트 노드를 설정한다

패키지부터 설치한다.

[root@compute1 ~]# yum install openstack-neutron openstack-neutron-linuxbridge ebtables ipset
Loaded plugins: fastestmirror
Determining fastest mirrors
 * base: centos.mirror.cdnetworks.com
 * extras: centos.mirror.cdnetworks.com
 * updates: centos.mirror.cdnetworks.com
Package ebtables-2.0.10-13.el7.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package ipset.x86_64 0:6.19-4.el7 will be installed
--> Processing Dependency: ipset-libs = 6.19-4.el7 for package: ipset-6.19-4.el7.x86_64

 

...(중략)...

  python-webtest.noarch 0:1.3.4-6.el7

  python2-pecan.noarch 0:1.0.2-2.el7

Complete!


 

 

/etc/neutron/neutron.conf파일을 수정하여 아래와 같이 수정한다.

[DEFAULT] 과 [oslo_messaging_rabbit] 섹션에 RabbitMQ 접근 설정을 한다. RABBIT_PASS 는 설정한 패스워드로 변경
[DEFAULT] 과 [keystone_authtoken] 섹션에 인증정보를 입력한다. NEUTRON_PASS 는 설정한 패스워드로 변경.

keystone_authtoken 섹션은 입력한 내용 외에는 모두 삭제 또는 주석처리를 한다.
[oslo_concurrency] 섹션에 lackpath 설정을 한다.

 

[root@compute1 ~]# vi /etc/neutron/neutron.conf

[DEFAULT]
...
rpc_backend = rabbit
...
auth_strategy = keystone
...
[oslo_messaging_rabbit]
...
rabbit_host = controller
rabbit_userid = openstack
rabbit_password = RABBIT_PASS
...
[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 = NEUTRON_PASS
...
[oslo_concurrency]
...
lock_path = /var/lib/neutron/tmp

 

Linux bridge agent 설정을 위해 /etc/neutron/plugins/ml2/linuxbridge_agent.ini 파일을 아래와 같이 수정한다.

[linux_bridge] 섹션에 public 가상 네트워크에 public 네트워크 인터페이스를 맵핑시켜준다.

[vxlan] 섹션에서 vxlan및 layer-2 population을 활성화 시켜주며 overlay 네트워크를 핸들링할 물리 네트워크의 주소를 입력한다. 여기서는 10.0.0.31을 입력한다

[agent] 섹션에서 ARP spoofing protection을 활성화 시킨다.

[securitygroup] 섹션에서 security groups을 활성화 시키고 Linux bridge iptables firewall driver를 설정한다.

[root@compute1 ~]# vi /etc/neutron/plugins/ml2/linuxbridge_agent.ini
[linux_bridge]

...

physical_interface_mappings = public:eth1

#physical_interface_mappings = public:PUBLIC_INTERFACE_NAME

...

[vxlan]
enable_vxlan = True
local_ip = 10.0.0.31

#local_ip = OVERLAY_INTERFACE_IP_ADDRESS
l2_population = True

..

[agent]
...
prevent_arp_spoofing = True

...

[securitygroup]
...
enable_security_group = True
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver

 

 

/etc/nova/nova.conf 파일을 다음과 같이 수정한다.

[neutron] 섹션에 다음과 같이 인증정보를 입력한다. NEUTRON_PASS는 설정한 패스워드로 변경한다.

[root@compute1 ~]# vi /etc/nova/nova.conf
[neutron]

...
url = http://controller:9696
auth_url = http://controller:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
region_name = RegionOne
project_name = service
username = neutron
password = NEUTRON_PASS

 

Nova 설정 파일이 변경이 있었으니 nova 서비스를 재시작 해주고 Neutron도 시작 및 부팅시 시작할수 있게 설정한다.

[root@compute1 ~]# systemctl restart openstack-nova-compute.service
[root@compute1 ~]# systemctl enable neutron-linuxbridge-agent.service
Created symlink from /etc/systemd/system/multi-user.target.wants/neutron-linuxbridge-agent.service to /usr/lib/systemd/system/neutron-linuxbridge-agent.service.
[root@compute1 ~]# systemctl start neutron-linuxbridge-agent.service

 

 

설치 확인을 위해 컨트롤로 노드로 다시 이동한다.

neutron  ext-list 명령어를 통해 잘 설치가 되었는지 확인한다.

[root@controller ~]# neutron ext-list
+-----------------------+-----------------------------------------------+
| alias                 | name                                          |
+-----------------------+-----------------------------------------------+
| dns-integration       | DNS Integration                               |
| ext-gw-mode           | Neutron L3 Configurable external gateway mode |
| binding               | Port Binding                                  |
| agent                 | agent                                         |
| subnet_allocation     | Subnet Allocation                             |
| l3_agent_scheduler    | L3 Agent Scheduler                            |
| external-net          | Neutron external network                      |
| flavors               | Neutron Service Flavors                       |
| net-mtu               | Network MTU                                   |
| quotas                | Quota management support                      |
| l3-ha                 | HA Router extension                           |
| provider              | Provider Network                              |
| multi-provider        | Multi Provider Network                        |
| extraroute            | Neutron Extra Route                           |
| router                | Neutron L3 Router                             |
| extra_dhcp_opt        | Neutron Extra DHCP opts                       |
| security-group        | security-group                                |
| dhcp_agent_scheduler  | DHCP Agent Scheduler                          |
| rbac-policies         | RBAC Policies                                 |
| port-security         | Port Security                                 |
| allowed-address-pairs | Allowed Address Pairs                         |
| dvr                   | Distributed Virtual Router                    |
+-----------------------+-----------------------------------------------+

 

 

agent-list를 확인한다. 컨트롤러에 4개 컴퓨트에 1개 설치한 것이 잘 보여야 한다.

[root@controller nova]# neutron agent-list
+--------------------------------------+--------------------+------------+-------+----------------+---------------------------+
| id                                   | agent_type         | host       | alive | admin_state_up | binary                    |
+--------------------------------------+--------------------+------------+-------+----------------+---------------------------+
| 4d8264e6-41a8-4063-9e20-e661251a0eb2 | Linux bridge agent | controller | :-)   | True           | neutron-linuxbridge-agent |
| 6bc769ba-f740-4c62-96d9-fccf9bd285d9 | Linux bridge agent | compute1   | :-)   | True           | neutron-linuxbridge-agent |
| 89fbdf23-7421-43eb-8121-12d7641b0861 | DHCP agent         | controller | :-)   | True           | neutron-dhcp-agent        |
| b75d266f-9c8b-4705-af65-ce31bcc4aa69 | Metadata agent     | controller | :-)   | True           | neutron-metadata-agent    |
| c5f8e1a6-b711-48bc-97c6-efa46200b42d | L3 agent           | controller | :-)   | True           | neutron-l3-agent          |
+--------------------------------------+--------------------+------------+-------+----------------+---------------------------+

 

 

 

+ Recent posts