Start a project

Tool 435 of 450 · Firewall

Firewall Rule Builder (ufw, iptables, nftables)

Describe the ports and sources you want open and get matching ufw, iptables and nftables rules.

Firewall Rule Builder (ufw, iptables, nftables)

Your input

Result

RuleufwCheck
ufw commands
Ruleset

    01

    What it does

    Describe the ports and sources you want open and get matching ufw, iptables and nftables rules.

    • One simple rule list: allow, deny, reject or limit; ports, ranges and protocols; source addresses
    • ufw commands with comments
    • nftables ruleset (/etc/nftables.conf) or iptables-restore files for IPv4 and IPv6
    • Loopback, established connections and optional ping

    02

    Private by design

    Everything happens in your browser. Nothing you type, paste or upload is sent anywhere, and it keeps working offline once the page has loaded.

    03

    What you get

    ufw commands, nftables or iptables rules, and checks, with a Copy and a Download button on every result.

    • Firewall
    • ufw
    • nftables

    Why it matters

    Writing the same policy in ufw, nftables and iptables syntax is error-prone, and the classic mistake, enabling the firewall without an SSH rule, locks you out of your own server.

    Write the rules once in plain words and get all three, checked for the usual mistakes.

    How to use it

    1. Type or paste your input; the example shows the format.
    2. Press Build rules. Results also update as you type.
    3. Read the summary line, then the table, notes or output below it.
    4. Copy or download what you need. Nothing leaves this page.

    FAQ

    Which should I use?

    ufw on Ubuntu for simple servers; nftables on modern Debian, RHEL and anything new. iptables is legacy but still common in scripts and containers.

    Why does Docker ignore my ufw rules?

    Docker writes its own iptables rules for published ports, ahead of ufw. Publish to 127.0.0.1 or use the DOCKER-USER chain.

    What does limit do?

    It allows a few connections per source per minute and blocks bursts, which slows brute-force attempts on SSH.

    Is my input uploaded?

    No. The tool runs in your browser and nothing you type, paste or open is sent anywhere.

    Can I rely on the result?

    It follows the public specification or formula named on this page and says where it simplifies. Check anything critical against the official tool or documentation before you ship it.

    Work with me

    Want a site that gets these right?

    I build fast, accessible websites and web apps that pass these checks from day one. Tell me about your project and I'll reply personally with honest next steps.

    All developer tools · Back to leej.uk