Configuring Neutron FWaaS

After our work with the OpenStack Neutron LBaaS plugin, let's look at another useful plugin, FireWall as a Service (FWaaS). By enabling the FWaaS agent plugin on our network node, we are able to create and manage firewalls through Neutron API calls. There are drivers for many hardware vendors; the following example uses IPTables to provide the firewalling service.

We configure Neutron FWaaS on the nodes running the Neutron L3 agent (this will be the network node if not using Distributed Virtual Routers (DVR), or the compute node if using DVR) and configure Neutron Server API on the controller nodes to pick up the service. We can also expose the FWaaS feature in Horizon on the controller nodes.

Getting ready

Ensure that you have a suitable server running the OpenStack network components. If you are using the accompanying Vagrant environment, as described in the Preface, we will use the same network and controller nodes for this recipe.

Ensure that you are logged into the network node as well as the controller node in our environment. If you created these nodes with Vagrant, you can execute the following command:

vagrant ssh network
vagrant ssh controller

How to do it...

To enable the Neutron FWaaS feature, first carry out the following steps on the nodes running the L3 agent. In normal circumstances this will be the network node. If you are running DVR, this will be on the compute nodes. Follow these steps:

  1. We enable the firewall service in the [DEFAULT] section of the /etc/neutron/neutron.conf file by adding firewall to the service_plugins line:
    service_plugins = firewall

    Tip

    The service_plugins line is a comma-delimited list, for example:

    service_plugins = router, firewall
  2. In the same file, we add the following lines to the [SERVICE_PROVIDERS] section:
    [SERVICE_PROVIDERS]
    service_provider = FIREWALL:Iptables:neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver:default
  3. We then edit the /etc/neutron/fwaas_driver.ini file so it has the following content:
    [fwaas]
    driver = neutron.services.firewall.drivers.linux.iptables_fwaas.IptablesFwaasDriver
    enabled = True
  4. Restart the neutron-l3-agent service to pick up these changes as follows:
    sudo restart neutron-l3-agent
    
  5. On the controller node running the Neutron Server API and Horizon, make the same change to the /etc/neutron/neutron.conf file:
    [DEFAULT]
    service_plugins = firewall
    
    [SERVICE_PROVIDERS]
    service_provider = FIREWALL:Iptables:neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver:default

    Tip

    Add firewall to the service_plugins list if something already exists here, such as router:

    service_plugins = router, firewall
  6. Restart the Neutron Server service to pick up this change:
    sudo restart neutron-server
    
  7. Edit the /etc/openstack-dashboard/local_settings.py file to enable the FWaaS feature in Horizon:
    OPENSTACK_NEUTRON_NETWORK = {
        'enable_firewall': True,
        ...
    }
  8. Restart Apache to pick up this change:
    sudo service apache2 restart
    

How it works...

We have enabled the Neutron FWaaS plugin in our environment by configuring the relevant Neutron configuration files on our nodes that are running the L3 agent (network nodes in the non-DVR mode or compute nodes in the DVR mode).

The /etc/neutron/neutron.conf file notifies our Neutron services of this feature with the following lines:

[DEFAULT]
service_plugins = firewall

[SERVICE_PROVIDERS]
service_provider = FIREWALL:Iptables:neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver:default

The specific configuration of the LBaaS agent is achieved in the /etc/neutron/fwaas-driver.ini file on the node running the L3 agent.

We then notify the Neutron API service running on the controller node about the Neutron FWaaS Plugin. We copy the same neutron.conf settings found earlier onto the controller node and restart the Neutron Server API service.

We can then enable this feature in Horizon by setting the configuration enable_firewall to True and restarting Apache to pick up this change.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset