What are UFW and iptables?
UFW (Uncomplicated Firewall) and iptables are Linux tools for controlling network traffic at the kernel level. UFW provides a simplified command-line interface on top of iptables, making it easier to allow or deny traffic by port, protocol, and IP address without writing raw netfilter rules.
How to use this generator
Choose between UFW and iptables output, then add rules by specifying the action (allow/deny), port or port range, protocol (TCP/UDP), and optional source or destination IP. Use the built-in presets for common setups like web servers, SSH access, or database ports, then copy the generated commands to your terminal.
Why generate firewall rules visually?
Firewall misconfigurations are a leading cause of security incidents and accidental lockouts. Building rules visually lets you review every rule before applying it, reducing the risk of exposing sensitive services or accidentally blocking legitimate traffic.