Skip to main content

Firewall Configuration

Configuring The Firewall

Start and enable the firewall

  1. To start and enable the firewall use the commands below
systemctl start firewalld
systemctl enable firewalld

Get an overview

Default Zone

  1. Find the default zone.  The default zone is usually public
firewall-cmd --get-default-zone

05.PNG

Display Allowed Services

  1. Display the allowed services of the zone
firewall-cmd --list-service --zone=external

By default, "public" zone is applied with a NIC and dhcpv6-client and ssh are allowed.

06.PNG

Display Services Defined By Default

  1. To list all service defined by default use the command below
firewall-cmd --get-services

It should give you an output similar to

07.PNG

Add/Remove services

  1. Add or Remove allowed services.  The change will be back after rebooting the system. If you change settings permanently, add the "--permanent" option.

08.PNG

Add/Remove Ports

  1. Add or remove allowed ports

09.PNG

Add/Remove Prohibited ICMP Types

  1. Add or remove prohibited ICMP types

010.PNG