Ubuntu 16.04 – Replace iptables with firewalld

16.04command linefirewalldiptablessoftware installation

In Ubuntu 16.04, can we install firewalld services?

Best Answer

To switch do the following:

  1. Stop iptables if in use:

    sudo systemctl stop iptables
    
  2. Make sure iptables are not used by your system anymore:

    sudo systemctl mask iptables
    
  3. Check its status:

    sudo systemctl status iptables
    
  4. Remove UFW if installed:

    sudo apt-get remove ufw
    

Firewalld - Dynamic Firewall Manager

This replaces iptable as the preferred way to manage your firewall. Commands to use with firewalld includes:

  1. Install firewalld:

    sudo apt install firewalld
    
  2. Check its status:

    sudo systemctl status firewalld
    
  3. Enable or disable firewalld:

    sudo systemctl [enable | disable ] firewalld
    
  4. Starting and stoping it:

    sudo systemctl [ start | stop ] firewalld
    

So to use it is simply to enable it as in steps 2, then use the man pages to get more information.

See here for more information on how to use firewalld

Related Question