Learn the basics of using UFW and Firewalld for firewall management on Linux. Set up and configure firewalls to enhance system security effectively.
Firewall, UFW, Firewalld, Linux, Security, Network Management, System Administration
Firewalls are essential in securing your Linux systems. Below, we discuss two popular firewall management tools, UFW (Uncomplicated Firewall) and Firewalld, along with practical examples of their usage.
UFW is designed to be an easy way to manage a Netfilter firewall. It is particularly well-suited for host-based firewalls.
# Install UFW (if not already installed)
sudo apt install ufw
# Enable UFW
sudo ufw enable
# Allow SSH connections
sudo ufw allow ssh
# Allow HTTP traffic
sudo ufw allow http
# Check UFW status
sudo ufw status
# Disable UFW
sudo ufw disable
Firewalld is a dynamic firewall management tool with support for zones that define the trust level of network connections or interfaces.
# Install Firewalld (if not already installed)
sudo yum install firewalld
# Start Firewalld
sudo systemctl start firewalld
# Enable Firewalld to start on boot
sudo systemctl enable firewalld
# Allow SSH service
sudo firewall-cmd --permanent --add-service=ssh
# Allow HTTP service
sudo firewall-cmd --permanent --add-service=http
# Reload Firewalld to apply changes
sudo firewall-cmd --reload
# Check Firewalld status
sudo firewall-cmd --state
How do I avoid rehashing overhead with std::set in multithreaded code?
How do I find elements with custom comparators with std::set for embedded targets?
How do I erase elements while iterating with std::set for embedded targets?
How do I provide stable iteration order with std::unordered_map for large datasets?
How do I reserve capacity ahead of time with std::unordered_map for large datasets?
How do I erase elements while iterating with std::unordered_map in multithreaded code?
How do I provide stable iteration order with std::map for embedded targets?
How do I provide stable iteration order with std::map in multithreaded code?
How do I avoid rehashing overhead with std::map in performance-sensitive code?
How do I merge two containers efficiently with std::map for embedded targets?