• About Us
  • Disclaimers
  • Privacy Policy
  • Sitemap
Linux Tutorials for Beginners
Advertisement
  • Ubuntu
    Install and Secure phpMyAdmin on Ubuntu 22.04

    How To Install and Secure phpMyAdmin on Ubuntu 22.04

    Secure SSH with Fail2Ban

    How To Secure SSH with Fail2Ban on Ubuntu 22.04

    Install Uptime Kuma on Ubuntu 22.04

    How To Install Uptime Kuma on Ubuntu 22.04

    Install Ubuntu Server 22.04

    How To Install Ubuntu Server 22.04 LTS with Screenshots

    Set Up Firewall on Ubuntu 22.04

    How To Set Up a Firewall with UFW on Ubuntu 22.04

    Install Nginx on Ubuntu

    How To Install Nginx on Ubuntu 22.04: A Comprehensive Guide

    Install MySQL 8.0 on Ubuntu 22.04

    How To Install MySQL 8.0 on Ubuntu Server 22.04

    install-php74-ubuntu2204

    How To Install PHP 7.4 on Ubuntu 22.04

    Install Snipe-IT on Ubuntu 22.04

    How To Install Snipe-IT Asset Management on Ubuntu 22.04

  • Debian
    Secure SSH with Fail2Ban

    How To Secure SSH with Fail2Ban on Debian 11

    Install Debian 11 Server

    How To Install Debian 11 (Bullseye) Server with Pictures

    Install and Setup Node.js on Debian 11

    How To Install and Setup Node.js on Debian 11

    Install PHP 8.2 on Debian 11

    How To Install PHP 8.2 on Debian 11

    Install Nginx on Debian 11

    How To Install Nginx on Debian 11: A Comprehensive Guide

    Set Up Firewall with UFW on Debian

    How To Set Up a Firewall with UFW on Debian 11

    install php74 on debian 11

    How To Install PHP 7.4 on Debian 11

    Install MariaDB 10.9 on Debian 11

    How To Install MariaDB 10.9 on Debian 11 Server

    Initial Setup Debian Server

    Initial Setup Debian 11 Server: Secure and Efficient

  • Rocky Linux
    Install phpMyAdmin on Rocky Linux 9

    How To Install phpMyAdmin on Rocky Linux 9

    Secure SSH with Fail2Ban

    How To Secure SSH with Fail2Ban on Rocky Linux 9

    Install Rocky Linux 9.2 Server

    How To Install Rocky Linux 9.2 Server with Screenshots

    setup Firewall Using Firewalld Rocky Linux 9

    How To Set Up a Firewall Using FirewallD on Rocky Linux 9

    Install Nginx on Rocky Linux 9

    How To Install Nginx on Rocky Linux 9: A Comprehensive Guide

    Install Apache on Rocky Linux

    How To Install and Configure Apache on Rocky Linux 9

    Install MongoDB on Rocky Linux 9

    How To Install MongoDB 6.0 on Rocky Linux 9

    Install Docker on Rocky Linux

    How To Install Docker CE on Rocky Linux 9

  • CentOS
    Secure SSH with Fail2Ban

    How To Secure SSH with Fail2Ban on CentOS 7

    Install PHP8.2 on CentOS 7

    How To Install PHP 8.2 on CentOS 7 / RHEL 7

    Install Apache on CentOS 7

    How To Install Apache Web Server on CentOS 7

    Set Up FirewallD on CentOS 7

    How To Set Up a Firewall Using FirewallD on CentOS 7

    Initial Setup CentOS 7 Server

    Initial Setup CentOS 7 Server: Secure and Efficient

    Install Nginx on CentOS 7

    How To Install Nginx on CentOS 7: A Comprehensive Guide

    Build NGINX from Source on Centos 7

    How To Build NGINX from Source (Compile) on Centos7

    Install Docker Swarm on CentOS 7

    Install and Configure Docker Swarm Mode on Centos 7

    Install Docker Compose on Centos 7

    How To Install and Use Docker Compose on Centos 7

  • Linux
    Manage Groups on Linux

    A Simple Guide: How To Manage Groups on Linux

    Logrotate In Linux

    How To Manage Log Files Using Logrotate In Linux

    Check File Size in Linux

    The Easy Ways to Check File Size in Linux

    Linux server security system administrators

    Best Practices Linux Server Security for System Administrator

    Backup Files From Remote Linux VPS Using Rsync Script

    How To Backup Files From Remote Linux VPS Using Rsync Script

    SSH Key-based Authentication

    How To Configure SSH Key-based Authentication In Linux

    Linux File Permissions

    Understanding Linux File Permissions for Beginners

    Create Multiboot USB with Ventoy

    How To Create Multiboot USB with Ventoy in Linux

    Find Hard Disk Drive Information in Linux

    How To Find Hard Disk Drive Information in Linux

No Result
View All Result
Linux Tutorials for Beginners
  • Ubuntu
    Install and Secure phpMyAdmin on Ubuntu 22.04

    How To Install and Secure phpMyAdmin on Ubuntu 22.04

    Secure SSH with Fail2Ban

    How To Secure SSH with Fail2Ban on Ubuntu 22.04

    Install Uptime Kuma on Ubuntu 22.04

    How To Install Uptime Kuma on Ubuntu 22.04

    Install Ubuntu Server 22.04

    How To Install Ubuntu Server 22.04 LTS with Screenshots

    Set Up Firewall on Ubuntu 22.04

    How To Set Up a Firewall with UFW on Ubuntu 22.04

    Install Nginx on Ubuntu

    How To Install Nginx on Ubuntu 22.04: A Comprehensive Guide

    Install MySQL 8.0 on Ubuntu 22.04

    How To Install MySQL 8.0 on Ubuntu Server 22.04

    install-php74-ubuntu2204

    How To Install PHP 7.4 on Ubuntu 22.04

    Install Snipe-IT on Ubuntu 22.04

    How To Install Snipe-IT Asset Management on Ubuntu 22.04

  • Debian
    Secure SSH with Fail2Ban

    How To Secure SSH with Fail2Ban on Debian 11

    Install Debian 11 Server

    How To Install Debian 11 (Bullseye) Server with Pictures

    Install and Setup Node.js on Debian 11

    How To Install and Setup Node.js on Debian 11

    Install PHP 8.2 on Debian 11

    How To Install PHP 8.2 on Debian 11

    Install Nginx on Debian 11

    How To Install Nginx on Debian 11: A Comprehensive Guide

    Set Up Firewall with UFW on Debian

    How To Set Up a Firewall with UFW on Debian 11

    install php74 on debian 11

    How To Install PHP 7.4 on Debian 11

    Install MariaDB 10.9 on Debian 11

    How To Install MariaDB 10.9 on Debian 11 Server

    Initial Setup Debian Server

    Initial Setup Debian 11 Server: Secure and Efficient

  • Rocky Linux
    Install phpMyAdmin on Rocky Linux 9

    How To Install phpMyAdmin on Rocky Linux 9

    Secure SSH with Fail2Ban

    How To Secure SSH with Fail2Ban on Rocky Linux 9

    Install Rocky Linux 9.2 Server

    How To Install Rocky Linux 9.2 Server with Screenshots

    setup Firewall Using Firewalld Rocky Linux 9

    How To Set Up a Firewall Using FirewallD on Rocky Linux 9

    Install Nginx on Rocky Linux 9

    How To Install Nginx on Rocky Linux 9: A Comprehensive Guide

    Install Apache on Rocky Linux

    How To Install and Configure Apache on Rocky Linux 9

    Install MongoDB on Rocky Linux 9

    How To Install MongoDB 6.0 on Rocky Linux 9

    Install Docker on Rocky Linux

    How To Install Docker CE on Rocky Linux 9

  • CentOS
    Secure SSH with Fail2Ban

    How To Secure SSH with Fail2Ban on CentOS 7

    Install PHP8.2 on CentOS 7

    How To Install PHP 8.2 on CentOS 7 / RHEL 7

    Install Apache on CentOS 7

    How To Install Apache Web Server on CentOS 7

    Set Up FirewallD on CentOS 7

    How To Set Up a Firewall Using FirewallD on CentOS 7

    Initial Setup CentOS 7 Server

    Initial Setup CentOS 7 Server: Secure and Efficient

    Install Nginx on CentOS 7

    How To Install Nginx on CentOS 7: A Comprehensive Guide

    Build NGINX from Source on Centos 7

    How To Build NGINX from Source (Compile) on Centos7

    Install Docker Swarm on CentOS 7

    Install and Configure Docker Swarm Mode on Centos 7

    Install Docker Compose on Centos 7

    How To Install and Use Docker Compose on Centos 7

  • Linux
    Manage Groups on Linux

    A Simple Guide: How To Manage Groups on Linux

    Logrotate In Linux

    How To Manage Log Files Using Logrotate In Linux

    Check File Size in Linux

    The Easy Ways to Check File Size in Linux

    Linux server security system administrators

    Best Practices Linux Server Security for System Administrator

    Backup Files From Remote Linux VPS Using Rsync Script

    How To Backup Files From Remote Linux VPS Using Rsync Script

    SSH Key-based Authentication

    How To Configure SSH Key-based Authentication In Linux

    Linux File Permissions

    Understanding Linux File Permissions for Beginners

    Create Multiboot USB with Ventoy

    How To Create Multiboot USB with Ventoy in Linux

    Find Hard Disk Drive Information in Linux

    How To Find Hard Disk Drive Information in Linux

No Result
View All Result
Linux Tutorials for Beginners
No Result
View All Result

Home » CentOS » How To Set Up a Firewall Using FirewallD on CentOS 7

How To Set Up a Firewall Using FirewallD on CentOS 7

sammbysamm
October 17, 2023
Set Up FirewallD on CentOS 7

How To Set Up a Firewall Using FirewallD on CentOS 7

Share on FacebookShare on LinkedinShare on Whatsapp

Generally in the digital age, where information travels at the speed of light, ensuring the security of your server is paramount. One of the most effective ways to bolster your server’s security is by setting up a firewall. In this article, we will walk you through the process of setting up a firewall using FirewallD on CentOS 7. No need to fret if you’re not a tech expert. We’ll explain things using everyday language and guide you through each step.

Table of Contents

  • Understanding Firewalls
  • Getting Started
    • Step 1: Check FirewallD Status
    • Step 2: Enable FirewallD on CentOS 7
    • Step 3: Set FirewallD to Start at Boot
  • Basic Firewall Configuration
    • Step 4: Allow SSH Access on CentOS 7
    • Step 5: Reload FirewallD on CentOS 7
  • Advanced Firewall Configuration
    • Step 6: List Available Services on CentOS 7
    • Step 7: Allow Additional Services on CentOS 7
  • Monitoring Firewall Rules on CentOS 7
  • Conclusion

Understanding Firewalls

Before we dive into the setup process, let’s grasp the basics. A firewall is like a virtual fence around your server. It monitors and controls incoming and outgoing network traffic, acting as a barrier against potential threats.

OTHER POSTS

How To Secure SSH with Fail2Ban on CentOS 7

How To Install PHP 8.2 on CentOS 7 / RHEL 7

How To Install Apache Web Server on CentOS 7

FirewallD is a dynamic firewall management tool that simplifies the firewall configuration process. It’s the go-to choice for CentOS 7 users.

Getting Started

Now, let’s roll up our sleeves and get to work.

Step 1: Check FirewallD Status

Firstly, ensure that FirewallD is installed and running on your CentOS 7 server. Open your terminal and execute the following command:

Bash
$ sudo systemctl status firewalld

Step 2: Enable FirewallD on CentOS 7

If FirewallD is not active, enable it with this following command:

Bash
$ sudo systemctl start firewalld

Step 3: Set FirewallD to Start at Boot

To ensure FirewallD starts automatically on your CentOS 7 upon server reboot, run this following command:

Bash
$ sudo systemctl enable firewalld
Set Up Firewalld on Centos 7
Status Firewalld on CentOS 7

Basic Firewall Configuration

With FirewallD up and running, let’s configure some basic rules to secure your server.

Step 4: Allow SSH Access on CentOS 7

Allow SSH access to your CentOS 7 server so you can manage it remotely. Execute the following command:

Bash
$ sudo firewall-cmd --zone=public --add-service=ssh --permanent

This command permits SSH traffic and makes the rule permanent.

Step 5: Reload FirewallD on CentOS 7

To apply the changes, reload FirewallD:

Bash
$ sudo firewall-cmd --reload

Advanced Firewall Configuration

Now, let’s explore some advanced configurations to further enhance your server’s security.

Step 6: List Available Services on CentOS 7

To see a list of available services you can allow or deny, use this following command:

Bash
$ sudo firewall-cmd --list-services

Step 7: Allow Additional Services on CentOS 7

You can add more services to the allowed list using the following command. Then replace http with the service you want to allow, and don’t forget to reload FirewallD afterward:

Bash
$ sudo firewall-cmd --zone=public --add-service=http --permanent
$ sudo firewall-cmd --reload

Step 8: Block a Port on CentOS 7

To block a specific port, replacing PORT_NUMBER with the desired port. Use this following command:

Bash
$ sudo firewall-cmd --zone=public --remove-port=PORT_NUMBER/tcp --permanent
$ sudo firewall-cmd --reload

Monitoring Firewall Rules on CentOS 7

To check the rules you’ve set up, use this following command:

Bash
$ sudo firewall-cmd --list-all

Conclusion

Setting up a firewall using FirewallD on CentOS 7 is a fundamental step in securing your server. In this article, we’ve covered the essential steps in a user-friendly way. Remember, server security is an ongoing process, so keep an eye on your firewall rules and update them as needed to stay protected in the ever-evolving digital landscape.

Also Read Our Other Guides :

  • How To Set Up a Firewall Using FirewallD on Rocky Linux 9
  • How To Set Up a Firewall with UFW on Debian 11
  • How To Set Up a Firewall with UFW on Ubuntu 22.04
  • Initial Setup Debian 11 Server: Secure and Efficient
  • Initial Setup Ubuntu Server 22.04: Secure and Efficient
  • Initial Setup Rocky Linux 9 Server: Secure and Efficient
  • How To Install RTMP Server with Nginx on CentOS 7

Finally, now you have learned how to set up a firewall using FirewallD on CentOS 7.

Tags: CentOSFirewallFirewallDSecurityServer Guide

If you got help by our tutorials, please buy me a coffee..!

Buy Me a Coffee

Thank you so much for your support!!

Previous Post

How To Set Up a Firewall with UFW on Ubuntu 22.04

Next Post

How To Set Up a Firewall Using FirewallD on Rocky Linux 9

Leave a Reply Cancel reply

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

RECENT POST

Install and Secure phpMyAdmin on Ubuntu 22.04

How To Install and Secure phpMyAdmin on Ubuntu 22.04

by samm
July 22, 2024
0

Are you ready to take control of your MySQL databases on Ubuntu 22.04? In this step-by-step guide, we'll walk you...

Manage Groups on Linux

A Simple Guide: How To Manage Groups on Linux

by samm
November 12, 2023
0

Are you a Linux enthusiast looking to enhance your system administration skills? One fundamental aspect you should master is how...

Install phpMyAdmin on Rocky Linux 9

How To Install phpMyAdmin on Rocky Linux 9

by samm
November 11, 2023
0

If you're navigating the world of Rocky Linux 9 and looking to streamline your MariaDB or MySQL database management, installing...

Logrotate In Linux

How To Manage Log Files Using Logrotate In Linux

by samm
November 10, 2023
0

Log files are an essential part of any Linux system. They provide valuable insights into the system's activities, helping administrators...

Load More

RECOMMENDED.

Install Redis on Debian

How To Install Redis on Debian 11 Server

October 16, 2023
Secure SSH with Fail2Ban

How To Secure SSH with Fail2Ban on Rocky Linux 9

October 29, 2023
sammlinux sammlinux sammlinux

Related Posts

Secure SSH with Fail2Ban
CentOS

How To Secure SSH with Fail2Ban on CentOS 7

October 29, 2023
Install PHP8.2 on CentOS 7
CentOS

How To Install PHP 8.2 on CentOS 7 / RHEL 7

October 17, 2023
Install Apache on CentOS 7
CentOS

How To Install Apache Web Server on CentOS 7

October 16, 2023
Initial Setup CentOS 7 Server
CentOS

Initial Setup CentOS 7 Server: Secure and Efficient

October 17, 2023
Load More
Next Post
setup Firewall Using Firewalld Rocky Linux 9

How To Set Up a Firewall Using FirewallD on Rocky Linux 9

  • About Us
  • Disclaimers
  • Privacy Policy
  • Sitemap

© 2023 sammlinux - Learn Today for Lead Tomorrow.

No Result
View All Result
  • Ubuntu
  • Debian
  • Rocky Linux
  • CentOS
  • Linux

© 2023 sammlinux - Learn Today for Lead Tomorrow.