Free tech learning for everyone, from basics to pro

NoteCybersecurityIntermediate

Firewalls explained: stateless, stateful and next-generation

In short: Stateless filters judge each packet alone, stateful firewalls track whole connections, and next-generation firewalls add application, user and threat awareness on top.

The main types

TypeDecides usingTypical example
Stateless packet filterEach packet's source, destination, protocol and port, with no memory of earlier packetsRouter ACLs, basic cloud network ACLs
Stateful firewallA connection table: return traffic for an allowed session is permitted automaticallyMost hardware firewalls, cloud security groups
Next-generation firewall (NGFW)Stateful inspection plus the actual application, the user, content and threat signaturesEnterprise perimeter and data centre firewalls
Web application firewall (WAF)HTTP requests: blocks attacks such as SQL injection and cross-site scriptingIn front of websites and APIs

Why stateful matters

With a stateless filter you must write rules for both directions, including the random high ports clients use for replies. A stateful firewall remembers that a user started the connection, so it lets the reply back in automatically and blocks anything unsolicited.

What "next-generation" adds

  • Application identification: allow "Microsoft Teams" or block "BitTorrent" whatever port it uses.
  • User identity: rules like "Finance group can reach the accounting server", tied to your directory.
  • Threat prevention: intrusion prevention, malware and URL filtering.
  • TLS inspection: decrypting traffic to inspect it, which needs careful privacy and legal planning.

Rule-writing principles for any firewall

  1. Order matters: rules are read top to bottom and the first match wins. Put specific rules above general ones.
  2. Default deny: allow only what's needed; everything else is blocked.
  3. Least privilege: specific sources, destinations and ports instead of "any".
  4. Document every rule: who asked for it, why, and when to review it.
  5. Log and review: remove rules nobody uses.

Test yourself with the "Nobody can reach the HTTPS server" challenge.

Frequently asked questions

What is a stateless firewall?

A firewall that checks each packet on its own against rules (source, destination, port and protocol) without remembering connections. Router ACLs are a common example. It is fast but cannot tell whether a packet belongs to an allowed conversation.

What is the difference between a stateful firewall and a next-generation firewall?

A stateful firewall tracks connections and allows return traffic automatically. A next-generation firewall (NGFW) adds application awareness, user identity, intrusion prevention and often URL filtering and TLS inspection.

Is a firewall the same as antivirus?

No. A firewall controls traffic between networks or into a device. Antivirus or endpoint protection checks files and behaviour on the device itself. You need both.

Related guide: How to test network security: a step-by-step checklist

Related guide: Fortinet FortiOS CVE list 2026: exploited FortiGate flaws

Key takeaways

  • Stateless = per packet; stateful = per connection.
  • NGFWs add application, user and threat awareness.
  • First match wins, so order rules from specific to general.
  • Default deny plus least privilege, always documented.
Tracks your learning on this device only. See your progress on the learning paths.
Verified author✓ Valid
Issued to
FM TecHub Team
Role
Editorial team
Reviewer credentials
CCNABTEC HND Network EngineeringBEng (Hons) Computer Networking & Cloud Security
Issuer
FM TecHub · fmtechub.com

The team writes practical, plain-English guides on networking, security and cloud.

More about the team →

Original content written by the FM TecHub Team. © 2026 FM TecHub. You're welcome to share a link to this page; please don't copy the text elsewhere without permission.

Get free updates by email

New notes, tools, CCNA and Security+ tips and important security news from FM TecHub, explained simply. Free, about twice a month. Unsubscribe anytime; see our privacy policy.

PortServiceStatus
SMTP/25Email updatesup

Free · no spam · past emails · powered by Buttondown