b2KIT

Firewall Rule Builder

Build firewall rules visually for iptables, nftables, and cloud security groups. Export as commands or JSON configs.

Tested tool guide Tested browser tools Checked August 16, 2026

What Firewall Rule Builder does, with a checked example

The Firewall Rule Builder turns a rule described in plain fields - protocol, source address, ports, action - into ready-to-run firewall syntax. Pick a target, fill in the match conditions, and it renders the rule as an iptables command, an nftables rule, or a cloud security group entry, plus a JSON form of the same rule for config management. The surprise most users hit is rule ordering: the builder shows each rule in isolation, but iptables and nftables evaluate rules top-down and first match wins, so a generated command only does what you expect if you insert it at the right position in the chain.

Worked example

A concrete input and expected output from the current implementation.

Input

Allow inbound SSH: protocol TCP, destination port 22, source 203.0.113.10, action ACCEPT.

Expected output

iptables -A INPUT -s 203.0.113.10 -p tcp --dport 22 -j ACCEPT

Each field maps directly to an iptables clause: -s from the source, -p from the protocol, --dport from the destination port, -j from the action, appended to the INPUT chain because the rule is inbound. The same fields render as the nftables rule 'nft add rule inet filter input ip saddr 203.0.113.10 tcp dport 22 accept' when that target is selected, and as JSON for config-driven workflows.

How the result is produced

1

Field-to-syntax mapping

One rule is a set of match fields - protocol, source address or CIDR, destination port or range, interface, direction - plus an action. The builder recombines those fields into the syntax of the chosen target: -s/-p/--dport clauses for iptables, positional expressions for nftables, protocol-plus-CIDR entries for security groups. The generated text is literal; it is not applied to any system.

2

Direction and chain selection

An inbound rule lands in the INPUT chain (iptables) or an input-hook chain (nftables); outbound becomes OUTPUT, forwarded traffic becomes FORWARD. Cloud security groups instead get an ingress or egress entry. The exported JSON mirrors the structured fields, which matters if you manage rules through configuration files or infrastructure-as-code rather than shell commands.

Good uses

  • You need one SSH or HTTPS allow rule for a specific source and want the exact iptables or nft command without checking man pages for flag order.
  • You are drafting ingress rules for a new cloud security group and want the CIDR and port ranges as reviewable text before pasting them into the console.
  • You are migrating a server from iptables to nftables and need the same logical rules re-expressed in nft syntax.

Limits and checks

  • Order is on you. The builder renders rules one at a time, but iptables and nftables evaluate chains top-down with first match winning, so a generated rule can be silently shadowed by an earlier broader rule in a live chain. Confirm placement with iptables -L -n or nft list ruleset.
  • Ports apply only to TCP and UDP. Entering a destination port on an ICMP rule produces a command the kernel rejects on insert; the generated text is syntax, not a guarantee the rule loads.
  • Cloud security groups are not iptables. AWS security groups only allow traffic (no DROP or REJECT target) and are stateful, so a rule set built for iptables cannot be translated rule-for-rule; the cloud output can express only what a security group can express.

Common questions

Do the generated rules apply to my server, or do I have to run them myself?

The page only builds text; it runs nothing and cannot see your machine. You copy the command and run it yourself with sudo, then verify with iptables -L -n or nft list ruleset. Also note the rules are not persistent: a reboot restores the previous ruleset unless you save it with iptables-save or your distribution's firewall tool.

Can I paste my existing rules to edit them here?

No. The builder is one-way: it produces syntax from the fields you enter and cannot read your live firewall, which would require root access a browser page cannot have. To modify existing rules, re-enter them in the builder or edit your rules file directly, keeping a backup of the current ruleset before reloading it.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools