About the Firewall Rule Generator

What it does, how it works, and how to use it safely on Linux, macOS, and Windows.

Tip, you can deep link the generator to a specific OS, for example #windows, #mac, or #linux.

What this tool does

The generator builds ready-to-run firewall scripts tailored to your device role and operating system. You choose services to allow, decide whether to exempt an admin IP, and optionally enable country blocking on Linux. The tool produces commands for the native firewall on each platform.

Linux

  • Backends, UFW, iptables + ipset, nftables
  • Optional country blocking using public CIDR lists
  • IPv4 and optional IPv6 set population

macOS

  • Native pf (Packet Filter) with an anchor file
  • Safe flow, validate, load, then enable
  • App-only firewall is not enough for port-level control

Windows

  • PowerShell rules, recommended for clarity
  • netsh rules, useful for legacy or GPO copy-paste
  • Profiles enabled, logging path set

Profiles & portability

  • Export and import configuration profiles as JSON
  • Download scripts with OS-aware filenames
  • Deep link directly to an OS mode

How it works (client-side)

The page runs entirely in your browser. No accounts, no uploads, and no telemetry. Your selections generate a script locally, which you can copy, review, and download. Nothing leaves your device.

Safety first. Firewall changes can interrupt access, including SSH. Always test on a non-critical machine or a virtual machine before applying rules to production devices.

What you control

Quick start

Linux

  1. Open the tool and pick Linux.
  2. Select your backend, UFW, iptables, or nftables.
  3. Choose your device role and services to allow.
  4. Optional, enable country blocking and IPv6 lists.
  5. Generate, review, then run on a test system first.

macOS

  1. Open the tool with #mac.
  2. Select services to allow, then generate.
  3. The script creates a pf anchor, validates with pfctl -n, loads, then enables.
  4. Run in Terminal, you will be prompted for admin rights.

Windows (PowerShell)

  1. Open the tool with #windows.
  2. Choose PowerShell, select services, then generate.
  3. Right-click PowerShell and run as Administrator.
  4. Paste the script and verify rules were added.

Windows (netsh)

  1. Switch the engine to netsh.
  2. Generate and download the .cmd file.
  3. Right-click and run as Administrator.
  4. Confirm the rules via Windows Firewall UI or netsh.

Advanced notes

macOS Packet Filter (pf)

Windows options

Linux sets and persistence

Legal Disclosure. This page and the generator are for educational and informational use. Firewall changes can disrupt connectivity or lock you out of systems. Always review scripts, test in a safe environment, and keep console or recovery access available. The author and host accept no liability for damage, data loss, or misuse.
Open Firewall Generator
LinuxmacOSWindows UFWiptablesnftablespfctl