ELI5: How does a firewall work?

Explained with a security guard

A firewall works just like a security guard standing at the front door of your house, checking everyone who wants to come in or go out to keep you safe.

Imagine your computer is a big, fun clubhouse where you keep your favorite toys, photos, and secret diary entries. The internet is like the busy street outside your clubhouse. Many friendly neighbors walk by, like your friends sharing games or funny cat videos. However, there are also troublemakers on that street, such as hackers or computer viruses, who want to sneak into your clubhouse to break things or steal your toys.

To stop the bad guys, you place a guard at the clubhouse gate. This guard is the firewall.

The guard holds a clipboard with a specific set of security rules:

  • Checking visitors: When someone knocks on your door from the outside, the guard asks who they are and what they are delivering. If it is a video you asked to watch, the guard opens the gate and lets it in. If it is a stranger trying to sneak in without an invitation, the guard locks the gate and sends them away.
  • Checking outgoing traffic: The guard also watches anyone leaving your clubhouse. If a sneaky intruder somehow got inside and tries to run out carrying your secret diary, the guard catches them at the door and stops them.
  • Following the guest list: The guard only lets things happen if they match the rules you agreed on, ignoring everything else to keep the house peaceful.

Without this guard, your front door would be wide open to anyone walking down the street. With a firewall, your computer stays safe because only welcome visitors and safe messages are allowed through the door.

Ask your own question

Opens the question on the homepage. Nothing is sent until you press Explain it.

Follow-up questions

Test yourself

Three quick questions to see if it stuck. You can challenge a friend after.