← Fundamentals of Cybersecurity

Lesson 30 of 34 Beginner ~7 min

Firewalls and network protection

If antivirus guards each device, a firewall guards the doorway to your whole network. Together they are classic defence in depth.

What is it?

A firewall is a security guard for network traffic. It checks data trying to enter or leave, and allows or blocks it based on a set of rules. It can be software on your device or a dedicated box protecting an entire network.

Architecture diagram
SVG
Firewalls and network protectionA firewall checks traffic going in and out, and only allows what is permitted.1 · InternetUntrusted2 · FirewallAllows or blocks3 · Your networkTrusted4 · Your devicesProtectedGhostLayer Insights · example lab architecture

Select any component in the diagram to read what it does.

A firewall filtering traffic by its rules.
Text description of this diagram

A firewall checks traffic going in and out, and only allows what is permitted.

Why is it important?

A firewall is often the first layer an attacker meets. By blocking unwanted connections, it stops many attacks before they ever reach your devices — and it can stop malware already inside from “phoning home” to an attacker.

How does it work?

The firewall follows rules that decide what is allowed. A simple rule set might say: allow normal web browsing out, allow replies to things you asked for, and block everything else coming in uninvited. Think of a bouncer with a guest list — on the list, come in; not on it, turned away.

  • Inbound rules control what can reach you from outside.
  • Outbound rules control what your devices can send out.
  • Home routers include a basic firewall that is on by default — keep it that way.

A real-world example

An attacker on the internet scans millions of addresses looking for devices with open doors to break into. Your firewall simply does not answer those uninvited connection attempts, so your devices are invisible to the scan — the attacker moves on to an easier, unprotected target.

Check what you learned

What does a firewall do?

It checks network traffic entering or leaving and allows or blocks it based on a set of rules.

How can a firewall help even if malware is already on a device?

Outbound rules can block the malware from connecting out to an attacker to receive commands or send stolen data.

Key takeaways

  • A firewall allows or blocks network traffic based on rules.
  • It stops many attacks before they reach your devices.
  • Keep the firewall on your router and devices enabled.