Technology Encyclopedia Home >How to configure firewall in Manjaro Linux?

How to configure firewall in Manjaro Linux?

Configuring a firewall in Manjaro Linux typically involves using ufw (Uncomplicated Firewall). Here's a step-by-step guide:

  1. Install UFW: If it's not already installed, you can install it using pacman, the package manager for Manjaro:

    sudo pacman -S ufw
    
  2. Enable UFW: After installation, enable the firewall:

    sudo ufw enable
    
  3. Set Default Policies: Define the default policies for incoming and outgoing traffic. For a more secure setup, you might want to block all incoming traffic and allow all outgoing traffic:

    sudo ufw default deny incoming
    sudo ufw default allow outgoing
    
  4. Allow Specific Services: If you need to allow certain services like SSH or HTTP, you can specify them:

    sudo ufw allow ssh
    sudo ufw allow http
    
  5. Check the Status: To verify the current status of UFW and see which rules are active:

    sudo ufw status verbose
    
  6. Delete Rules: If you need to remove a rule, you can do so by specifying the rule number from the status output:

    sudo ufw delete 1
    

For example, if you want to allow incoming traffic on port 8080 for a web server, you would use:

sudo ufw allow 8080/tcp

This setup ensures that your Manjaro Linux system is protected by a firewall that only allows necessary traffic, enhancing security.

If you're looking for cloud-based solutions to manage or enhance your firewall capabilities, consider services like Tencent Cloud's Anti-DDoS Pro, which offers advanced protection against distributed denial-of-service attacks, complementing your local firewall setup.