# chmod 640 /etc/neutron/neutron.conf
# chgrp neutron /etc/neutron/neutron.conf
# chgrp neutron /etc/neutron/neutron.conf
گام4: اگر سرویس SELinux بر روی سرور شما فعال است، میبایست ابتدا دستور زیر را اجرا کرده:
# setsebool -P neutron_can_network on
و بعد فایل پیکربندی neutron-server_pol.te را توسط ویرایشگر متنی vi باز (ایجاد) نموده:
# vi neutron-server_pol.te
و سپس خطوط زیر را به آن اضافه نمایید:
# create new
module neutron-server_pol 1.0;
require {
type crontab_exec_t;
type glance_api_exec_t;
type NetworkManager_exec_t;
type loadkeys_exec_t;
type gpg_exec_t;
type mysqld_exec_t;
type glance_registry_exec_t;
type fsadm_exec_t;
type nova_exec_t;
type httpd_config_t;
type virtd_exec_t;
type chfn_exec_t;
type systemd_systemctl_exec_t;
type login_exec_t;
type kdumpctl_exec_t;
type debuginfo_exec_t;
type numad_exec_t;
type policykit_auth_exec_t;
type ssh_keygen_exec_t;
type vlock_exec_t;
type ssh_exec_t;
type dmesg_exec_t;
type glance_scrubber_exec_t;
type hostname_exec_t;
type dbusd_exec_t;
type plymouth_exec_t;
type journalctl_exec_t;
type fusermount_exec_t;
type ping_exec_t;
type gpg_agent_exec_t;
type su_exec_t;
type checkpolicy_exec_t;
type sendmail_exec_t;
type neutron_t;
type systemd_tmpfiles_exec_t;
type memcached_exec_t;
type virsh_exec_t;
type groupadd_exec_t;
type systemd_passwd_agent_exec_t;
type pinentry_exec_t;
type passwd_exec_t;
type systemd_notify_exec_t;
type traceroute_exec_t;
type mysqld_safe_exec_t;
type ssh_agent_exec_t;
type mandb_exec_t;
type mount_exec_t;
type rsync_exec_t;
class dir search;
class file getattr;
}
#============= neutron_t ==============
allow neutron_t NetworkManager_exec_t:file getattr;
allow neutron_t checkpolicy_exec_t:file getattr;
allow neutron_t chfn_exec_t:file getattr;
allow neutron_t crontab_exec_t:file getattr;
allow neutron_t dbusd_exec_t:file getattr;
allow neutron_t debuginfo_exec_t:file getattr;
allow neutron_t dmesg_exec_t:file getattr;
allow neutron_t fsadm_exec_t:file getattr;
allow neutron_t fusermount_exec_t:file getattr;
allow neutron_t glance_api_exec_t:file getattr;
allow neutron_t glance_registry_exec_t:file getattr;
allow neutron_t glance_scrubber_exec_t:file getattr;
allow neutron_t gpg_agent_exec_t:file getattr;
allow neutron_t gpg_exec_t:file getattr;
allow neutron_t groupadd_exec_t:file getattr;
allow neutron_t hostname_exec_t:file getattr;
allow neutron_t httpd_config_t:dir search;
allow neutron_t journalctl_exec_t:file getattr;
allow neutron_t kdumpctl_exec_t:file getattr;
allow neutron_t loadkeys_exec_t:file getattr;
allow neutron_t login_exec_t:file getattr;
allow neutron_t mandb_exec_t:file getattr;
allow neutron_t memcached_exec_t:file getattr;
allow neutron_t mount_exec_t:file getattr;
allow neutron_t mysqld_exec_t:file getattr;
allow neutron_t mysqld_safe_exec_t:file getattr;
allow neutron_t nova_exec_t:file getattr;
allow neutron_t numad_exec_t:file getattr;
allow neutron_t passwd_exec_t:file getattr;
allow neutron_t pinentry_exec_t:file getattr;
allow neutron_t ping_exec_t:file getattr;
allow neutron_t plymouth_exec_t:file getattr;
allow neutron_t policykit_auth_exec_t:file getattr;
allow neutron_t rsync_exec_t:file getattr;
allow neutron_t sendmail_exec_t:file getattr;
allow neutron_t ssh_agent_exec_t:file getattr;
allow neutron_t ssh_exec_t:file getattr;
allow neutron_t ssh_keygen_exec_t:file getattr;
allow neutron_t su_exec_t:file getattr;
allow neutron_t systemd_notify_exec_t:file getattr;
allow neutron_t systemd_passwd_agent_exec_t:file getattr;
allow neutron_t systemd_systemctl_exec_t:file getattr;
allow neutron_t systemd_tmpfiles_exec_t:file getattr;
allow neutron_t traceroute_exec_t:file getattr;
allow neutron_t virsh_exec_t:file getattr;
allow neutron_t virtd_exec_t:file getattr;
allow neutron_t vlock_exec_t:file getattr;
# setsebool -P neutron_can_network on
و بعد فایل پیکربندی neutron-server_pol.te را توسط ویرایشگر متنی vi باز (ایجاد) نموده:
# vi neutron-server_pol.te
و سپس خطوط زیر را به آن اضافه نمایید:
# create new
module neutron-server_pol 1.0;
require {
type crontab_exec_t;
type glance_api_exec_t;
type NetworkManager_exec_t;
type loadkeys_exec_t;
type gpg_exec_t;
type mysqld_exec_t;
type glance_registry_exec_t;
type fsadm_exec_t;
type nova_exec_t;
type httpd_config_t;
type virtd_exec_t;
type chfn_exec_t;
type systemd_systemctl_exec_t;
type login_exec_t;
type kdumpctl_exec_t;
type debuginfo_exec_t;
type numad_exec_t;
type policykit_auth_exec_t;
type ssh_keygen_exec_t;
type vlock_exec_t;
type ssh_exec_t;
type dmesg_exec_t;
type glance_scrubber_exec_t;
type hostname_exec_t;
type dbusd_exec_t;
type plymouth_exec_t;
type journalctl_exec_t;
type fusermount_exec_t;
type ping_exec_t;
type gpg_agent_exec_t;
type su_exec_t;
type checkpolicy_exec_t;
type sendmail_exec_t;
type neutron_t;
type systemd_tmpfiles_exec_t;
type memcached_exec_t;
type virsh_exec_t;
type groupadd_exec_t;
type systemd_passwd_agent_exec_t;
type pinentry_exec_t;
type passwd_exec_t;
type systemd_notify_exec_t;
type traceroute_exec_t;
type mysqld_safe_exec_t;
type ssh_agent_exec_t;
type mandb_exec_t;
type mount_exec_t;
type rsync_exec_t;
class dir search;
class file getattr;
}
#============= neutron_t ==============
allow neutron_t NetworkManager_exec_t:file getattr;
allow neutron_t checkpolicy_exec_t:file getattr;
allow neutron_t chfn_exec_t:file getattr;
allow neutron_t crontab_exec_t:file getattr;
allow neutron_t dbusd_exec_t:file getattr;
allow neutron_t debuginfo_exec_t:file getattr;
allow neutron_t dmesg_exec_t:file getattr;
allow neutron_t fsadm_exec_t:file getattr;
allow neutron_t fusermount_exec_t:file getattr;
allow neutron_t glance_api_exec_t:file getattr;
allow neutron_t glance_registry_exec_t:file getattr;
allow neutron_t glance_scrubber_exec_t:file getattr;
allow neutron_t gpg_agent_exec_t:file getattr;
allow neutron_t gpg_exec_t:file getattr;
allow neutron_t groupadd_exec_t:file getattr;
allow neutron_t hostname_exec_t:file getattr;
allow neutron_t httpd_config_t:dir search;
allow neutron_t journalctl_exec_t:file getattr;
allow neutron_t kdumpctl_exec_t:file getattr;
allow neutron_t loadkeys_exec_t:file getattr;
allow neutron_t login_exec_t:file getattr;
allow neutron_t mandb_exec_t:file getattr;
allow neutron_t memcached_exec_t:file getattr;
allow neutron_t mount_exec_t:file getattr;
allow neutron_t mysqld_exec_t:file getattr;
allow neutron_t mysqld_safe_exec_t:file getattr;
allow neutron_t nova_exec_t:file getattr;
allow neutron_t numad_exec_t:file getattr;
allow neutron_t passwd_exec_t:file getattr;
allow neutron_t pinentry_exec_t:file getattr;
allow neutron_t ping_exec_t:file getattr;
allow neutron_t plymouth_exec_t:file getattr;
allow neutron_t policykit_auth_exec_t:file getattr;
allow neutron_t rsync_exec_t:file getattr;
allow neutron_t sendmail_exec_t:file getattr;
allow neutron_t ssh_agent_exec_t:file getattr;
allow neutron_t ssh_exec_t:file getattr;
allow neutron_t ssh_keygen_exec_t:file getattr;
allow neutron_t su_exec_t:file getattr;
allow neutron_t systemd_notify_exec_t:file getattr;
allow neutron_t systemd_passwd_agent_exec_t:file getattr;
allow neutron_t systemd_systemctl_exec_t:file getattr;
allow neutron_t systemd_tmpfiles_exec_t:file getattr;
allow neutron_t traceroute_exec_t:file getattr;
allow neutron_t virsh_exec_t:file getattr;
allow neutron_t virtd_exec_t:file getattr;
allow neutron_t vlock_exec_t:file getattr;
در آخر فایل پیکربندی neutron-server_pol.te را ذخیره نموده و از آن خارج شوید.
سپس دستورات زیر را اجرا کنید:
# checkmodule -m -M -o neutron-server_pol.mod neutron-server_pol.te
# semodule_package —outfile neutron-server_pol.pp —module neutron-server_pol.mod
# semodule -i neutron-server_pol.pp
# checkmodule -m -M -o neutron-server_pol.mod neutron-server_pol.te
# semodule_package —outfile neutron-server_pol.pp —module neutron-server_pol.mod
# semodule -i neutron-server_pol.pp
گام5: جهت start کردن Neutron Server
# ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini
# su -s /bin/bash neutron -c "neutron-db-manage —config-file /etc/neutron/neutron.conf —config-file /etc/neutron/plugin.ini upgrade head"
# systemctl start neutron-server
# systemctl enable neutron-serve
# systemctl restart openstack-nova-api
# ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini
# su -s /bin/bash neutron -c "neutron-db-manage —config-file /etc/neutron/neutron.conf —config-file /etc/neutron/plugin.ini upgrade head"
# systemctl start neutron-server
# systemctl enable neutron-serve
# systemctl restart openstack-nova-api
گام6: اگر فایروال Firewalld بر روی سرور شما در حال اجراست، توسط دستورات زیر به پورت 9696/TCP اجازه عبور دهید:
# firewall-cmd —add-port=9696/tcp —permanent
# firewall-cmd —reload
# firewall-cmd —add-port=9696/tcp —permanent
# firewall-cmd —reload
در ادامه میبایست جهت پیکربندی Neutron Serviceها بر روی Network Node گامهای زیر را نیز به ترتیب دنبال نمایید، چون این گامها تقریباً مشابه گامهای قبل هستند بنابراین از توضیح اضافه در مورد آنها خودداری خواهیم کرد:
گام1: نصب Neutron Serviceها بر روی Network Node
برای این منظور با فرض اینکه repositoryهای EPEL و Ocata را پیشتر بر روی سرور Network Node خود نصب نمودهاید، کافیست دستور زیر را اجرا نمایید:
# yum —enablerepo=centos-openstack-ocata,epel -y install openstack-neutron openstack-neutron-ml2 openstack-neutron-openvswitch
گام1: نصب Neutron Serviceها بر روی Network Node
برای این منظور با فرض اینکه repositoryهای EPEL و Ocata را پیشتر بر روی سرور Network Node خود نصب نمودهاید، کافیست دستور زیر را اجرا نمایید:
# yum —enablerepo=centos-openstack-ocata,epel -y install openstack-neutron openstack-neutron-ml2 openstack-neutron-openvswitch