What Is a Firewall? - IT

What Is a Firewall and How Does It Work?

A firewall is a barrier between networks that decides which traffic is allowed through and which is blocked. It sits between your device or network and everything outside, checking traffic against a set of rules.

The name comes from building construction, where a fire wall is a barrier built to stop fire spreading from one section to another. The idea is the same: contain what should not spread.

How it works

Every piece of network traffic carries identifying information: where it came from, where it is going, which port it is using, and which protocol.

A firewall examines that information and compares it against its rules. A rule might say “allow outgoing web traffic on port 443” or “block all incoming connections from this address range”. Traffic matching an allow rule passes. Traffic matching a block rule is dropped.

What happens to traffic matching no rule is the most important setting in the whole system.

  • Default deny. Anything not explicitly permitted is blocked. This is the secure configuration and the standard in business networks.
  • Default allow. Anything not explicitly blocked is permitted. Easier to use and far weaker, because it only stops threats someone already thought of.

The main types

Packet filtering

The oldest and simplest. It looks at each packet’s source, destination and port in isolation and makes a decision. Fast, and limited, because it has no memory of what came before.

Stateful inspection

This tracks the state of active connections. If you request a web page, the firewall remembers that request and allows the reply through. An unsolicited incoming packet claiming to be a reply is rejected, because no matching outgoing request exists.

This is the baseline for most firewalls today, including the one in your home router.

Proxy firewall

Sits between you and the destination and makes the connection on your behalf, so the two sides never talk directly. More thorough inspection, at the cost of speed.

Next generation firewall

Adds application awareness, intrusion prevention and the ability to inspect encrypted traffic. It can distinguish between different services on the same port, which older firewalls cannot.

Hardware and software

Hardware firewalls are dedicated devices protecting a whole network. Your home router contains one. Everything behind it gets a basic level of protection without any configuration.

Software firewalls run on individual devices. Windows Defender Firewall and the macOS firewall are examples. These protect one machine, including from other machines on the same network, which a network firewall cannot do.

Both together is the normal arrangement, and they are not redundant: one protects the perimeter, the other protects the device.

What a firewall protects you from

  • Unsolicited incoming connections attempting to reach services on your machine
  • Automated scanning and probing of your address, which happens constantly
  • Unauthorised outbound connections from software that should not be talking to the internet
  • Access to blocked categories of site, where that is configured

What it cannot protect you from

This is the part worth being clear about, because firewalls are often assumed to be more complete than they are.

  • Phishing. You open the connection yourself, so the firewall allows it. See our guide on spotting phishing.
  • Malware you install. A download you approved passes through legitimately.
  • Weak or reused passwords. A firewall has no view of credentials.
  • Encrypted traffic, unless it is a next generation firewall configured to inspect it.
  • Threats already inside the network.
  • Vulnerabilities in services you deliberately expose, such as a web server that must be reachable.

A firewall is one layer. Treating it as complete protection is how people end up surprised.

Firewalls and VPNs are different things

They are often mentioned together and do unrelated jobs. A firewall decides what traffic is allowed. A VPN encrypts traffic and changes which address the destination sees. A VPN does not filter anything, and a firewall does not encrypt anything.

Practical advice for home users

  1. Leave your router’s firewall on. It is on by default and there is rarely a reason to change that.
  2. Leave the firewall built into Windows or macOS on.
  3. Be cautious with port forwarding. Each forwarded port is a deliberate hole in the barrier.
  4. Disable UPnP on your router if you do not need it, since it lets applications open ports without asking you.
  5. Keep router firmware updated, as covered in our guide on router troubleshooting.

Frequently asked questions

Do I need a third party firewall?

For most home users, no. The built in Windows and macOS firewalls are capable, and running several firewalls at once can cause conflicts.

Does a firewall slow down the internet?

A basic firewall has negligible impact. Deep inspection on a next generation firewall can reduce throughput on a very fast connection.

Is Windows Defender Firewall good enough?

Yes for typical home use. It is a proper stateful firewall, on by default.

What is the difference between a firewall and antivirus?

A firewall controls network traffic. Antivirus inspects files and running programs. Different layers, different jobs.

Can a firewall block a virus?

It can block the traffic a virus uses to download or communicate, but it does not detect infected files. That is antivirus work.

What does it mean when a port is open?

Something on that machine is listening and reachable. Every open port is a potential entry point, which is why unnecessary ones should be closed.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *