Forging the firewall rules by example
In this recipe, we want to show you how to create your own firewalld service definitions or how to change existing ones, which any CentOS 7 system administrator should know if the predefined service files don't fit your system's need.
Getting ready
To complete this recipe, you will require a minimal installation of the CentOS 7 operating system with root
privileges and a console-based text editor of your choice. We will be changing the SSH service's port number in firewalld, so make sure that you have configured the new port as shown in the recipe Locking down remote access and hardening SSH. Here, in our example, we have changed the port to 2223
. Also, we will create a new firewalld service for a small Python-based web server that we will use to demonstrate the integration of new system service's into firewalld. It's advantageous to grasp the basics of firewalld by working through the Working with a firewall recipe before starting here.