Accelerate firewalld forwarded traffic

The firewalld service supports the flowtable functionality, which can improve performance of the forwarded traffic. The mechanism uses the kernel connection tracking to bypass the majority of the networking stack. As a result, you get the accelerated data packets of established connections.

About this task

The flowtable mechanism has the following features:

  • Uses connection tracking to bypass the classic packet forwarding path.
  • Avoids revisiting the routing table by bypassing the classic packet processing.
  • Works only with TCP and UDP protocols.
  • Hardware independent software fast path.

Procedure

  1. Enable the flowtable feature:
    # sed -i 's/^NftablesFlowtable=.*/NftablesFlowtable=enp1s0 enp2s0/' /etc/firewalld/firewalld.conf

    The command sets the NftablesFlowtable option (defaults to off) in the /etc/firewalld/firewalld.conf file to a list of network interfaces for which you want the flowtable to be enabled. In this case NftablesFlowtable=enp1s0 enp2s0.

  2. Reload your firewall configuration for the changes to take effect:
    # firewall-cmd --reload