Multi-Rule UFW Firewall Rule Generator

Create multiple UFW rules and export them as a ready-to-run bash script.

Add a New Rule

Rules Added:

# Generated UFW Rules Script

How to Use This UFW Firewall Rule Generator

  1. Select Allow, Deny, or Limit for your firewall rule.
  2. Choose a predefined service or manually enter the Port/Protocol (e.g., 80/tcp).
  3. Optionally, enter an Application Name (e.g., OpenSSH) instead of a port.
  4. Specify IP/Subnet if you want to limit the rule to a certain source.
  5. Add a comment for clarity (optional).
  6. Select IPv4 and/or IPv6 as needed.
  7. Click Add Rule to save it to the list.
  8. When done, click Copy Script or Download as .sh to get your ready-to-run bash script.
  9. On your Linux server, run:
    bash ufw_rules.sh
  10. Check rules with:
    sudo ufw status verbose