Security · 8 min read

What Is a Firewall? Types, How It Works and Configuration Basics

What is a firewall and how does it work? Packet-filtering, stateful, proxy and next-generation firewalls (NGFW) explained, network vs host firewalls, and the configuration basics every business should apply.

A firewall is a security control that inspects network traffic and allows or blocks it according to rules. It sits between networks of different trust, such as the internet and your office LAN, or your staff network and your CCTV network, and only lets through the connections you have approved. Modern next-generation firewalls (NGFW) also identify applications and users and block threats inside allowed traffic.

How a firewall works

  1. A packet arrives on an interface, for example from the internet.
  2. The firewall checks whether it belongs to an existing, allowed connection (stateful inspection).
  3. If it is new, the firewall compares it with the rule list from top to bottom: source, destination, port or application, user and time.
  4. The first matching rule decides: allow, deny or allow with inspection. If no rule matches, the default rule denies it.
  5. The decision is logged for monitoring and investigations.

Types of firewall

TypeWhat it checksTypical use
Packet-filtering (stateless)Each packet's IP addresses, ports and protocol, with no memory of connectionsRouter ACLs, simple filtering
Stateful inspectionConnection state: only replies to allowed sessions get back inThe baseline for any business gateway
Proxy / application-level gatewayTerminates and re-creates connections, inspecting contentWeb proxies, high-security zones
Next-generation firewall (NGFW)Applications, users, intrusion prevention (IPS), malware, URL categories, TLS inspectionBusiness internet edge and data centre
Web application firewall (WAF)HTTP requests to your web apps: SQL injection, cross-site scriptingProtecting websites and APIs
Cloud firewall / FWaaSTraffic in cloud networks or from remote users, delivered as a serviceCloud workloads, SASE

Network firewall vs host firewall

A network firewall protects a whole segment at its edge. A host firewall, such as Windows Defender Firewall or nftables on Linux, protects a single device. Use both: the network firewall controls what enters and moves between zones, and the host firewall limits what each machine accepts.

Firewall configuration basics

  • Default deny: block everything inbound, and allow outbound only what the business needs.
  • Zones: separate staff, guests, servers, CCTV/IoT and management, with rules between them.
  • Specific rules: name the source, destination and service. Avoid "any-any" rules.
  • No exposed management: never open the firewall's admin page or SSH to the internet. Manage it through a VPN with MFA.
  • Logging and review: log denies and important allows, and review unused rules every quarter.
  • Patching: internet-facing firewalls and VPN gateways are prime attack targets. Apply security updates quickly.

Step-by-step guidance is in our firewall rules best practices tutorial and port forwarding safely.

Do small businesses need a firewall?

Yes. Every internet connection needs at least a stateful firewall with default-deny inbound rules, and most businesses also benefit from web filtering and IPS. The firewall works best alongside network segmentation, MFA and endpoint protection. See EDR vs XDR.

Navijin and firewalls

Navijin NavGATE gateways provide stateful firewalling, NAT, VLAN zones and VPN for branch and SMB sites, managed from NavCloud. Talk to our engineers about the right edge design for your site.

FAQ

Frequently asked questions

What is a firewall in simple words?

A gatekeeper for network traffic: it checks each connection against your rules and only lets approved traffic through.

What are the main types of firewall?

Packet-filtering, stateful inspection, proxy (application-level), next-generation firewalls (NGFW), web application firewalls (WAF) and cloud firewalls (FWaaS).

What is the difference between a firewall and a NGFW?

A traditional firewall filters by addresses, ports and connection state. A NGFW also identifies applications and users and adds intrusion prevention, malware and URL filtering.

Is a router a firewall?

Most business routers include a basic stateful firewall and NAT, but a dedicated firewall or security gateway adds deeper inspection, logging and zone control.

What is firewall configuration?

Defining interfaces, zones, address objects and an ordered rule list that allows required traffic and denies everything else, plus logging and admin-access settings.

Need help designing your network?

Navijin engineers provide free design consultations, bills of materials and quotations for business projects.