UFW - Technological watch
As the digital landscape continues to evolve, ensuring the security of your system is paramount. One tool that simplifies the complex world of firewall management is UFW, or Uncomplicated Firewall. In this blog post, we’ll delve into the problems UFW aims to resolve, the installation process, and key commands for effective firewall configuration.
Problematic
UFW addresses the complexities associated with configuring firewalls, making it accessible even for users with limited networking expertise.
UFW gives simplicity in configuration. Traditional firewalls often involve intricate setups and complex rules. UFW simplifies this process, providing an easy-to-understand interface for users to define rules without delving into complex networking concepts.
UFW has graphical frontends, like GUFW.
Installation
Installing UFW is a straightforward process. Depending on your Linux distribution, use the appropriate package manager:
- Ubuntu/Debian:
sudo apt-get updatesudo apt-get install ufw
- CentOS/RHEL:
sudo yum install ufw
Enable IPv6 (optional)
sudo nano /etc/default/ufw
# add the conf:# IPV6=yes
Configure UFW
# Default configuration :sudo ufw default deny incomingsudo ufw default allow outgoing
sudo ufw allow ssh # or : sudo ufw allow 22
The first two lines are the default policy rules. This implies that individuals attempting to access your server would be unable to establish a connection, but any application within the server would still have the capability to connect to external entities.
The third line enables SSH connections to the server. Without this line, there is a risk of being locked out from external access.
Enable UFW
Finally, we can enable UFW with this command :
sudo ufw enable
Key commands
- Check Status:
sudo ufw status
- Allow Connections:
sudo ufw allow <port_number>sudo ufw allow <protocol>
# Examplesudo ufw allow 80sudo ufw allow http
# Or you can allow an IP range like thissudo ufw allow 30000:30100/tcpsudo ufw allow 30000:30100/udp
- Deny Connections: To deny connections on a specific port:
sudo ufw deny <port_number>sudo ufw deny <protocol>
# Examplesudo ufw deny 80sudo ufw deny http
- Allow/Disallow Specific IP: To allow or deny connections from a specific IP address:
sudo ufw allow from <IP_address>sudo ufw deny from <IP_address>
sudo ufw allow from <IP_address> to any port 22
- Delete Rule:
sudo ufw status numbered
sudo ufw delete <rule_number># orsudo ufw delete allow http
- Check the status:
sudo ufw status verbose
- Disabled Firewall:
sudo ufw disable
- Reset Firewall:
sudo ufw reset
These commands form the foundation for configuring UFW according to your specific security requirements.
Conclusion
In conclusion, UFW serves as a powerful yet user-friendly tool for managing firewalls on Linux systems. By simplifying the configuration process and offering an accessible interface, UFW enables users to enhance their system’s security without the need for extensive networking knowledge.
Redis - Technological watch
Learn what is Redis in less than 5 minutes !
Falco - Technological watch
Learn how to protect your Kubernetes cluster in less than 5 minutes !
Atomic distribution - Fedora Silverblue - Technological watch
Learn what is an Atomic distribution in less than 5 minutes !
RabbitMQ - Technological watch
Learn what is RabbitMQ in less than 5 minutes !
OpenAPI / Swagger - Technological watch
Learn what is OpenAPI / Swagger in less than 5 minutes !
Svelte - Technological watch
Learn what is Svelte in less than 5 minutes !
PicoCSS - Technological watch
Learn what is PicoCSS in less than 5 minutes !
Terraform - Technological watch
Learn what is Terraform in less than 5 minutes !