updated notes
This commit is contained in:
@@ -745,16 +745,28 @@ sudo dnf repolist # List all repositories
|
||||
### firewall-cmd
|
||||
> Note: firewall-cmd is used to manage the firewall rules.
|
||||
```bash
|
||||
### displaying the firewall zones
|
||||
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
|
||||
|
||||
### setting the default zone
|
||||
sudo firewall-cmd --set-default-zone=public # Set the default zone to public
|
||||
|
||||
### displaying the rules in the firewall
|
||||
sudo firewall-cmd --list-all # Display all the rules in the firewall
|
||||
|
||||
### adding rules to 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
|
||||
|
||||
### removing rules from the firewall
|
||||
sudo firewall-cmd --zone=public --remove-service=http --permanent # Remove the http service from the public zone
|
||||
sudo firewall-cmd --zone=public --remove-port=80/tcp --permanent # Remove the port 80/tcp from the public zone
|
||||
sudo firewall-cmd --zone=public --remove-protocol=tcp --permanent # Remove the tcp protocol from the public zone
|
||||
|
||||
### reloading the firewall
|
||||
sudo firewall-cmd --reload # Reload the firewall
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user