yum install openstack-neutron-fwaas -y
[root@openstack-controller ~]# cat etc/neutron/fwaas_driver.ini[DEFAULT][service_providers]service_provider = FIREWALL_V2:fwaas_db:neutron_fwaas.services.firewall.service_drivers.agents.agents.FirewallAgentDriver:default[fwaas]agent_version = v2driver = neutron_fwaas.services.firewall.service_drivers.agents.drivers.linux.iptables_fwaas_v2.IptablesFwaasDriverenabled = True
[root@openstack-controller ~]# cat etc/neutron/l3_agent.ini | egrep -v "^$|^#"[DEFAULT]interface_driver = openvswitch[AGENT]extensions = fwaas_v2
[root@openstack-controller ~]# cat etc/neutron/plugins/ml2/ml2_conf.ini[DEFAULT][ml2]type_drivers = flat,vlan,vxlantenant_network_types = vxlanmechanism_drivers = openvswitch,l2populationextension_drivers = port_security[ml2_type_flat]flat_networks = providervni_ranges = 1:1000enable_ipset = true[ml2_type_vxlan]vni_ranges = 1001:2000[securitygroup]enable_ipset = true[agent]extensions = fwaas_v2[fwaas]firewall_l2_driver = noop
[DEFAULT]service_plugins = router,firewall_v2[service_providers]service_provider = FIREWALL_V2:fwaas_db:neutron_fwaas.services.firewall.service_drivers.agents.agents.FirewallAgentDriver:default
neutron-db-manage --subproject neutron-fwaas upgrade head
systemctl restart neutron-server.servicesystemctl restart neutron-l3-agent.servicesystemctl restart neutron-openvswitch-agent.servicesystemctl restart httpd.servicesystemctl restart memcached.service
[root@openstack-controller ~]# openstack firewall group rule list+--------------------------------------+----------------------+---------+------------------------------------------------+| ID | Name | Enabled | Summary |+--------------------------------------+----------------------+---------+------------------------------------------------+| 48ee5653-d8d0-46c2-b607-906ac15ceb1b | default ingress ipv4 | True | ANY, || | | | source(port): none specified(none specified), || | | | dest(port): none specified(none specified), || | | | deny || 9f024dc9-a1da-42a1-b633-8840a4a131ce | default ingress ipv6 | True | ANY, || | | | source(port): none specified(none specified), || | | | dest(port): none specified(none specified), || | | | deny || b2bd89f1-87f9-4d04-ab62-2a1fa920cf5b | default egress ipv6 | True | ANY, || | | | source(port): none specified(none specified), || | | | dest(port): none specified(none specified), || | | | allow || ce9348ad-91f5-445d-9b84-0123872b0f79 | default egress ipv4 | True | ANY, || | | | source(port): none specified(none specified), || | | | dest(port): none specified(none specified), || | | | allow |+--------------------------------------+----------------------+---------+------------------------------------------------+
[root@openstack-controller ~]# openstack firewall group policy list+--------------------------------------+-----------------+------------------------------------------------------------------------------------+| ID | Name | Firewall Rules |+--------------------------------------+-----------------+------------------------------------------------------------------------------------+| 9ef0e864-90c8-46d4-8829-0b1ad2b0e238 | default ingress | [u'48ee5653-d8d0-46c2-b607-906ac15ceb1b', u'9f024dc9-a1da-42a1-b633-8840a4a131ce'] || f17b454e-d427-4502-ad3a-d84142d7b181 | default egress | [u'ce9348ad-91f5-445d-9b84-0123872b0f79', u'b2bd89f1-87f9-4d04-ab62-2a1fa920cf5b'] |+--------------------------------------+-----------------+------------------------------------------------------------------------------------+
[root@openstack-controller ~]# openstack firewall group list+--------------------------------------+---------+--------------------------------------+--------------------------------------+| ID | Name | Ingress Policy ID | Egress Policy ID |+--------------------------------------+---------+--------------------------------------+--------------------------------------+| 641140f0-725a-484f-9c96-373b7e074845 | default | 9ef0e864-90c8-46d4-8829-0b1ad2b0e238 | f17b454e-d427-4502-ad3a-d84142d7b181 |+--------------------------------------+---------+--------------------------------------+--------------------------------------+
openstack firewall group rule create --protocol icmp --source-ip-address 192.0.2.8 --destination-ip-address 10.1.1.37 --action deny --name myrule
openstack firewall group policy create --firewall-rule myrule myfirewallpolicy
[root@openstack-controller ~]# openstack firewall group create --ingress-firewall-policy myfirewallpolicy --port 620ea2e0-529e-471b-8b4d-494668165c65 --name myfirewallgroup+-------------------+-------------------------------------------+| Field | Value |+-------------------+-------------------------------------------+| Description | || Egress Policy ID | None || ID | 1b0e0a1b-94f8-4cba-b51e-f6618017dcb8 || Ingress Policy ID | b55bd0e3-630c-43fb-aeaf-3ca5df1eb385 || Name | myfirewallgroup || Ports | [u'620ea2e0-529e-471b-8b4d-494668165c65'] || Project | 15b1010426194e309cd8f3de6bf63e1a || Shared | False || State | UP || Status | PENDING_CREATE || project_id | 15b1010426194e309cd8f3de6bf63e1a |+-------------------+-------------------------------------------+
[root@openstack-controller ~]# openstack firewall group show myfirewallgroup+-------------------+-------------------------------------------+| Field | Value |+-------------------+-------------------------------------------+| Description | || Egress Policy ID | None || ID | 1b0e0a1b-94f8-4cba-b51e-f6618017dcb8 || Ingress Policy ID | b55bd0e3-630c-43fb-aeaf-3ca5df1eb385 || Name | myfirewallgroup || Ports | [u'620ea2e0-529e-471b-8b4d-494668165c65'] || Project | 15b1010426194e309cd8f3de6bf63e1a || Shared | False || State | UP || Status | ACTIVE || project_id | 15b1010426194e309cd8f3de6bf63e1a |+-------------------+-------------------------------------------+
[root@openstack-controller ~]# openstack port list --router router1+--------------------------------------+------+-------------------+-----------------------------------------------------------------------------+--------+| ID | Name | MAC Address | Fixed IP Addresses | Status |+--------------------------------------+------+-------------------+-----------------------------------------------------------------------------+--------+| 079b7a7d-f99b-497b-932f-e6f0ebcd8f8b | | fa:16:3e:52:d7:cc | ip_address='192.0.2.1', subnet_id='a463c01b-2c98-4253-93cf-56e3812429af' | ACTIVE || 620ea2e0-529e-471b-8b4d-494668165c65 | | fa:16:3e:22:fe:43 | ip_address='10.1.1.254', subnet_id='8543e3af-99de-496f-8599-52a367f8fc36' | ACTIVE || aefbd66b-8133-4348-89eb-d18c4d342268 | | fa:16:3e:eb:3f:8c | ip_address='10.1.112.114', subnet_id='d37c85b6-c2b4-469c-aacc-b1253596c540' | ACTIVE |+--------------------------------------+------+-------------------+-----------------------------------------------------------------------------+--------+

[root@openstack-controller ~]# ip netns exec qrouter-ab63f034-0a79-4041-b348-6e8bd0c40e64 iptables -vnL neutron-l3-agent-fwaas-defauChain neutron-l3-agent-fwaas-defau (2 references)pkts bytes target prot opt in out source destination0 0 neutron-l3-agent-dropped all -- * * 0.0.0.0/0 0.0.0.0/0
[root@openstack-controller ~]# ip netns exec qrouter-ab63f034-0a79-4041-b348-6e8bd0c40e64 iptables -vnL neutron-l3-agent-iv41b0e0a1bChain neutron-l3-agent-iv41b0e0a1b (1 references)pkts bytes target prot opt in out source destination0 0 neutron-l3-agent-dropped all -- * * 0.0.0.0/0 0.0.0.0/0 state INVALID0 0 ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED327 27468 neutron-l3-agent-dropped icmp -- * * 192.0.2.8 10.1.1.37
https://docs.openstack.org/neutron-fwaas-dashboard/latest/
4.1 下载源码
git clone -b stable/train https://github.com/openstack/neutron-fwaas-dashboard.git
4.2 安装python程序
cd neutron-fwaas-dashboard/pip install
[root@openstack-controller ~]# pip -Vpip 8.1.2 from /usr/lib/python2.7/site-packages (python 2.7)
4.3 开启neutron-fwaas-dashboard
find / -name enabled | grep "openstack_dashboard/local/enabled"cp neutron_fwaas_dashboard/enabled/_70*_*.py /usr/share/openstack-dashboard/openstack_dashboard/local/enabled
4.4 编辑loacl_settings
vim /etc/openstack-dashboard/local_settingsPOLICY_FILES_PATH = '/etc/openstack-dashboard'POLICY_FILES = {'identity': 'keystone_policy.json','compute': 'nova_policy.json','volume': 'cinder_policy.json','image': 'glance_policy.json','orchestration': 'heat_policy.json','network': 'neutron_policy.json','telemetry': 'ceilometer_policy.json','neutron-fwaas': 'neutron-fwaas-policy.json'}
4.5 更新Django
cd neutron-fwaas-dashboardpwd/root/neutron-fwaas-dashboard#汉化失败./manage.py compilemessagesDJANGO_SETTINGS_MODULE=openstack_dashboard.settings python manage.py collectstatic --noinputDJANGO_SETTINGS_MODULE=openstack_dashboard.settings python manage.py compress --force
4.6 重启Httpd
systemctl restart httpd



文章转载自运维扫盲人,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




