Documentation Index
Fetch the complete documentation index at: https://docs.edisglobal.com/llms.txt
Use this file to discover all available pages before exploring further.
Introduction to UFW
UFW (Uncomplicated Firewall) is a user-friendly interface for managingiptables firewall rules on Linux systems. It’s particularly well-suited for Debian and Ubuntu servers, providing a simplified way to configure your system’s firewall.
Installation
Install UFW using the following command:Basic UFW commands
Check UFW status
Enable and disable UFW
To enable UFW:Managing basic rules
Allow incoming connections
Allow specific ports:Deny incoming connections
Deny specific ports:Delete Rules
Delete rules by number:- List rules with numbers:
- Delete a specific rule:
Advanced Configuration
Allow specific IP addresses
Allow a specific IP address:Configure default policies
Set default policies for incoming and outgoing traffic:Best Practices
-
Always Allow SSH First
Before enabling UFW, ensure SSH access is allowed:
-
Use Specific Rules
Instead of allowing all traffic to a port, specify the service and protocol:
-
Regular Audits
Regularly review your firewall rules:
-
Backup Rules
Backup your UFW rules periodically:
Common configuration examples
Basic web server setup
Database server setup
Rate Limiting
Enable rate limiting for SSH to prevent brute force attacks:Troubleshooting
If you encounter issues:-
Check UFW Status
-
View UFW Logs
-
Reset UFW
If needed, reset UFW to default settings: