How To Manage Firewall Rules With Iptables In Linux – POFTUT

How To Manage Firewall Rules With Iptables In Linux

Firewall is main component for network security. Enterprise firewalls are located between internet and enterprise networks to manage access and other stuff. There are also host firewalls those are very similar with network firewalls but more simple. Iptables is de facto standard firewall for both Linux systems and networks. We will look how to manage iptables in a Linux system.

Get Status of Iptables Service

Ubuntu use iptables as ufw with is Ubuntu Firewall. ufw makes iptables management simpler.


CentOS, Fedora

Running firewall related commands needs root privileges

Enable Firewalls

We will enable and disable iptables firewalld with related distribution commands.


CentOS, Fedora

Stop Firewalls

We may need to stop firewalls if there is a problem about ports and we do not want to add new rule to the firewall.


CentOS, Fedora

Open Port 80 / http In Firewall

There are some differences in firewall architecture of ufw and firewalld . Here we will look how to add http port for open.


  • allow port http for the firewall
  • v6 specifies IPv6 so we create two rules one for IPv4 and one for IPv6

  • As we see our http rules add with two lines

CentOS, Fedora

We add http service which by default port 80 to the –zone=public which is default zone.

We check new rules like below

Leave a Reply

Your email address will not be published. Required fields are marked *

Enjoy this blog? Please spread the word :)