diff --git a/src/rhcsa.md b/src/rhcsa.md index 5687c80..3c72446 100644 --- a/src/rhcsa.md +++ b/src/rhcsa.md @@ -743,8 +743,22 @@ sudo dnf repolist # List all repositories ## Understand and Configure Firewalls ### firewall-cmd +> Note: firewall-cmd is used to manage the firewall rules. ```bash sudo firewall-cmd --get-active-zones # Display the active zones sudo firewall-cmd --get-default-zone # Display the default zone sudo firewall-cmd --get-zones # Display the zones -``` \ No newline at end of file + +sudo firewall-cmd --list-all # Display all the rules in the firewall + +sudo firewall-cmd --zone=public --add-service=http --permanent # Add the http service to the public zone +sudo firewall-cmd --zone=public --add-port=80/tcp --permanent # Add the port 80/tcp to the public zone +sudo firewall-cmd --zone=public --add-protocol=tcp --permanent # Add the tcp protocol to the public zone + +sudo firewall-cmd --reload # Reload the firewall +``` + +### port reference +```bash +sudo less /etc/services # Display the services +```