Skip to content

Instantly share code, notes, and snippets.

@sid-r-singh
Last active June 8, 2021 03:03
Show Gist options
  • Save sid-r-singh/c4cf8860c778bc77b2a70fee4eb1eb18 to your computer and use it in GitHub Desktop.
Save sid-r-singh/c4cf8860c778bc77b2a70fee4eb1eb18 to your computer and use it in GitHub Desktop.
---
title: Firewalld config
description: Learn how to Setup Firewalld
---
<PageDescription>
In this article you will learn how how to Setup Firewalld.
</PageDescription>
## 1. Configure firewall to allow HTTPS
<Tabs>
<Tab label="Ubuntu/Debian">
The default firewall configuration tool for Ubuntu is ufw. Since Debian doesnot install ufw by default,
it can be installed using
```bash
sudo apt install ufw
```
First check whether port 443 is already open using
```bash
sudo ufw status verbose
```
</Tab>
<Tab label="CentOS/RHEL">
The default firewall tool on onRHEL 8 / CentOS 8 servers is firewalld (Dynamic Firewall Manager).
Check if https is already enabled using
```bash
sudo firewall-cmd --zone=public --list-ports
```
If you see `https` in the output then it's enabled. If not use the following commands to enable
```bash
sudo firewall-cmd --permanent --add-service=https --zone=public
sudo firewall-cmd --reload
sudo firewall-cmd --list-services --zone=public
```
Then reload firewalld using
```bash
sudo firewall-cmd --reload
```
</Tab>
</Tabs>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment