Linux Firewall Generator (nftables, iptables)

A firewall configurator for a Linux server. Pick a backend (nftables or iptables), set the allowed services and enable the protections you need, and the tool will assemble a complete configuration: default drop policy, connection-state tracking, SSH with rate limiting, scan protection and logging. Everything is computed in your browser, nothing is sent. This is a tool for administrators, so read the rule descriptions and test before deploying. Related: Linux server administration.

Allowed services

TCP ports (comma or space separated)

SSH is configured separately below (with rate limiting). Here put the rest, e.g. 80, 443.

UDP ports (optional)

Default policy and state

Default-deny: block everything that is not explicitly allowed. The foundation of a secure firewall.

Stateful filtering: responses to established connections pass automatically, and invalid packets are dropped.

Essential for services that communicate locally. Without it, some applications will stop working.

The server can initiate connections (updates, DNS). Disable only for a very restrictive policy.

SSH

SSH port

Limits the rate of new connections to the SSH port, making dictionary attacks harder.

Limit (new / minute) Burst (packets)
Addresses/networks (CIDR, comma separated)

ICMP (ping)

Permits ICMP echo for IPv4 and IPv6. Helpful for diagnostics.

Extra protection

Blocks packets with an invalid flag combination, used in port scans (e.g. NULL, XMAS).

Limits the number of new TCP connections per second, mitigating SYN flooding.

Logging

Adds a log rule before dropping. Entries go to the system log (dmesg/journald).


                    
⚠ A wrong configuration can lock you out of the server. First test the syntax, deploy from a console or a second session, and make sure the SSH rule comes before the drop policy.

nftables and iptables in brief

Linux has filtered traffic in the kernel for years through the netfilter subsystem, which two tools give access to. iptables is the classic, ubiquitous interface, where rules are added one command at a time in the INPUT, OUTPUT and FORWARD chains. nftables is its successor: it has a cleaner, declarative syntax, handles IPv4 and IPv6 in one inet family and is the default backend in new distributions. This generator produces the configuration in the syntax you choose, keeping the same secure layout: default drop, accept established/related state, loopback, explicit rules for SSH and selected services. A firewall is best treated as one element of broader server maintenance and hardening, alongside updates, backups and monitoring.

What makes a secure server firewall

Default-deny policy An input chain with a default drop policy, followed by explicit accept rules only for the services you need. Anything unforeseen is dropped.
State tracking (conntrack) A rule accepting established/related means it is enough to allow traffic in one direction and the responses pass automatically. Invalid packets are dropped.
Loopback Accepting traffic on the lo interface is required for services that communicate locally. Missing it is a common cause of failures after enabling the firewall.
SSH with rate limiting Limiting the rate of new connections to the SSH port (limit rate) makes dictionary attacks harder. Optionally narrow access to trusted source addresses.
Scan and SYN-flood protection Dropping packets with unusual flags and rate-limiting new connections reduces the impact of port scanning and simple volumetric attacks.

Frequently asked questions about Linux firewalls

nftables is the newer, default firewall in current distributions (Debian 10+, RHEL 8+, Ubuntu), with cleaner syntax and IPv4/IPv6 in the inet family. iptables is the older standard, still common. On new installations choose nftables.

Save to /etc/nftables.conf, check: nft -c -f /etc/nftables.conf, load: nft -f /etc/nftables.conf. Enable at boot: systemctl enable --now nftables. Inspect rules with nft list ruleset.

iptables commands last until reboot. To persist, use iptables-persistent (Debian/Ubuntu): netfilter-persistent save or iptables-save > /etc/iptables/rules.v4. On RHEL use iptables-services.

The rule allowing SSH must come before the drop policy. Deploy from a KVM console or a second session. A temporary job that restores the previous rules, in case the new ones cut off access, helps.

No. The configuration is assembled in your browser with JavaScript. The ports, addresses and interfaces you enter are never sent or stored anywhere beyond your device.

Tool and write-up: Marcin Szewczyk-Wilgan, WebOptimo. Syntax based on the nftables and iptables documentation and hands-on practice configuring firewalls on Linux servers. Test the generated configuration before deploying. The generator runs in your browser, with no data sent.

We'll configure your server's firewall

We design and deploy nftables and iptables rules, harden Linux servers and look after infrastructure. No obligation — a concrete proposal after a short conversation.

Phone

+48 608 271 665

Mon–Fri, 8:00–16:00

E-mail

kontakt@weboptimo.pl

We reply within 24h

Company

WebOptimo

VAT ID: PL6391758393