What Is a Firewall? A Practical Guide to Network Protection

A firewall controls network traffic using rules, but its coverage depends on where it runs and what it can inspect. Compare device, network, and web application firewalls; understand incoming and outgoing rules; and learn what to check in Windows or macOS before changing settings or troubleshooting a blocked business application.

Share this articleLinkedInWhatsAppEmail
A golden firewall wall between a router and laptop lets one connection through a gateway while a separate connection ends at the wall.
On this page

A firewall controls network traffic according to rules. It can allow a connection needed for work and block traffic the policy does not permit. Its protection depends on where it operates, which traffic reaches it, and what its rules and inspection features can evaluate.

This guide explains those differences and gives you useful questions for checking an existing setup. A laptop firewall, a network boundary, and a web application firewall do different jobs. Their names alone do not establish that a particular device or website is protected appropriately.

Last verified: 28 October 2026. This is a documentation-based explanation, not a firewall deployment, a security audit, or a test of the protection on your device. Follow the documentation for your product and involve the administrator for a managed system.

What does a firewall control?

NIST’s firewall guidance, published in 2009, describes devices or programs that control network traffic between networks or hosts with different security needs. The paper provides foundational concepts; it is not evidence of current product menus or features.

A rule can use information about a connection to decide whether to allow or block it. The details available depend on the product. Some rules identify an application or service, while others use network addresses, ports, or protocols. A port number helps identify the service a connection is trying to reach; it is not a physical socket on the computer.

Consider a hypothetical laptop policy: it must allow access to a business website but need not accept unsolicited connections to an unused service. Allowing the first task does not require allowing every incoming connection.

Where different firewalls operate

First ask what traffic the firewall is responsible for. The following comparison describes useful roles rather than a complete taxonomy of filtering technologies. A product can combine several functions.

Firewall roles and the boundaries to check
RoleWhat it focuses onUseful questionLimit
Device firewallNetwork connections involving a particular computerWhich apps or services may receive connections?It does not configure protection on every other device
Network firewallTraffic crossing its configured network boundaryWhich networks and paths pass through it?Some traffic between local devices may not cross it
Web application firewallRequests reaching a protected website or applicationWhich applications and request paths does it cover?It does not replace device or account security

Cloudflare’s web application firewall documentation, for example, describes checking incoming web and application programming interface (API) requests against rulesets. That is a specific service role, not proof that every firewall inspects web requests in the same way. Check the actual service’s features and coverage.

Packet filtering checks details such as addresses, ports, and protocols. Stateful inspection also tracks connections so it can assess whether a packet fits the expected connection state. These terms describe how traffic is evaluated, rather than where a firewall runs. Avoid assuming that a longer feature list automatically establishes better protection for your particular workflow.

Comparison of device, network, and web application firewalls, with a coverage question and a limitation for each.

Incoming and outgoing firewall rules can differ

Incoming traffic reaches a device or service; outgoing traffic leaves it. The rules for those directions need not match. Seeing that a firewall is enabled does not tell you its complete policy.

The Microsoft Windows Firewall overview states that the default behavior blocks incoming traffic unless it is solicited or matches a rule, while allowing outgoing traffic unless a blocking rule applies. It also describes domain, private, and public profiles. These are Windows-specific defaults, not rules to assume for every product.

Check the active profile and any exceptions rather than relying on a single on/off label. A rule useful on one network may be inappropriate elsewhere. For business equipment, ask who manages the policy and whether central settings control what the user can change.

Check firewall status in the right product

Windows settings

Microsoft’s Windows Security instructions show Firewall & network protection and the available network profiles. On an organization-managed device, policy may prevent changes. Record what you see and ask the administrator about anything unclear.

Mac settings

Apple’s Mac firewall settings guide describes System Settings, Network, then Firewall, with options for incoming connections and allowed apps or services. Select the guide version that matches the system you use. Do not assume its options or defaults are identical to Windows.

A router, hosted service, or business security appliance needs its own documentation and authorized administration process. The presence of a router does not prove which firewall features are enabled, what traffic they inspect, or who maintains the rules.

Understand what a firewall cannot establish

A firewall acts on traffic it can evaluate. Its visibility and features matter, especially for encrypted content. A permitted connection is not a promise that every file or instruction carried over it is harmless. Likewise, a network boundary may not see traffic that never passes through it.

Antivirus protection addresses a different part of the problem. Microsoft’s virus and threat protection guidance describes scanning files and programs and monitoring for threats in real time. That example explains why connection controls and file protection can complement each other; it does not guarantee that either catches every threat.

Our cyber attack explainer distinguishes deceptive messages, compromised accounts, harmful software, service disruption, and interception. Those mechanisms require different checks. A firewall does not make it safe to share a password with an unverified caller.

Review firewall behavior without guessing

If an application stops connecting, establish what changed before concluding that the firewall caused it. Instead of guessing, note the application, the network, the time, and the exact error. Ask the responsible administrator to compare that information with the relevant rules and available records.

Microsoft’s firewall logging guidance describes separate options for dropped packets and successful connections. Logging needs appropriate configuration; an enabled firewall does not by itself establish that the record you need exists. A blocked connection also does not automatically prove an attack.

  • Define the need: Identify the application or service and the legitimate task it must perform.
  • Find the owner: Confirm who can review policy and approve a necessary exception.
  • Check the evidence: Compare the reported problem with current configuration and available logs.
  • Verify the result: Have the responsible person check that the approved task works and the rule still has a clear purpose.

Microsoft recommends allowing a necessary app appropriately rather than switching off the whole firewall. This article does not prescribe an exception for an unknown app. For the wider account, maintenance, and recovery work, use our cybersecurity basics guide.

Firewall: common questions

Does it replace antivirus software?

No. A firewall controls network traffic; antivirus software looks for harmful software and related behavior. Products may bundle both while their functions remain different. Check what is actually included and enabled.

Does switching it on block every threat?

No. Results depend on the traffic path, rules, features, and the rest of the system. Maintain suitable account protection, software updates, and recoverable data alongside connection controls.

Should you switch it off to fix a connection problem?

Use the product’s troubleshooting guidance and the responsible administrator. Understand the specific application’s needs before changing rules. A broad change can affect protection beyond the task you were trying to fix.

About the editorial credit

TWK Editorial Team

TWK Editorial Team is the collective editorial credit used for brand-attributed articles. The credit does not imply hands-on product testing, a professional credential, or an independent expert review.

Editorial Policy Corrections & Updates