# Firewall

> A gatekeeper that decides which network traffic gets in or out.

- Level: Basic
- Topics: Security, Networks
- URL: https://tidbit.legios.com.ar/firewall/
- In Spanish: [Firewall](https://tidbit.legios.com.ar/es/firewall/)

A **firewall** sits between a network (or a single computer) and the outside world and checks every connection against a list of rules: where it comes from, where it goes, which port it uses, which direction. Whatever matches an allow rule passes; the rest is dropped. The usual default is simple: anything that starts from inside can go out, nothing that starts from outside can come in unless a rule says so.

You already have several. The router at home blocks unsolicited connections to your laptop and TV. Windows and macOS ship with a firewall turned on, so a random machine on the café Wi-Fi cannot open a connection to your file sharing. In the cloud, a web server might allow exactly two ports, `443` for HTTPS and `22` for the admin, and nothing else. Specialized ones, like a **WAF** (web application firewall), read the content of web requests and block known attack patterns.

What it does not do is just as important. A firewall does not stop you from downloading Malware, does not detect phishing, and cannot see inside traffic that is encrypted. It is a border control, not a bodyguard: one layer among several.

Practical takeaway: leave the firewall on your laptop enabled, and do not open ports on your home router ('port forwarding') unless you know exactly which device and why. Every open port is a door that you are now responsible for.

## An analogy

A building receptionist with a list. Residents walk out whenever they want; visitors only get in if someone registered them, and only to the floor they were registered for.

## Keep in mind

- A firewall allows or drops connections based on rules: address, port, direction.
- The default that matters: outbound is free, inbound is blocked unless allowed.
- Your router, your laptop and every cloud server already have one.
- It does not stop malware you download or phishing you click; it is one layer.

## Go deeper

- [What is a firewall? (Cloudflare Learning Center)](https://www.cloudflare.com/learning/security/what-is-a-firewall/)
- [Firewall on Wikipedia](https://en.wikipedia.org/wiki/Firewall_(computing))

## Related terms

- [Port](https://tidbit.legios.com.ar/port/): The numbered door on a computer that says which program a connection is for.
- [Router](https://tidbit.legios.com.ar/router/): The box that connects your devices to each other and to the internet.
- [Wi-Fi](https://tidbit.legios.com.ar/wi-fi/): Networking over radio waves: the internet without the cable, within a few rooms.
- [Cloud computing](https://tidbit.legios.com.ar/cloud-computing/): Renting computers over the internet instead of buying your own.
- [Server](https://tidbit.legios.com.ar/server/): A computer whose job is to answer requests from other computers, all day, every day.
- [HTTPS](https://tidbit.legios.com.ar/https/): The padlock in your browser: web traffic nobody in between can read.
- [AWS WAF](https://tidbit.legios.com.ar/aws-waf/): A filter in front of your website that reads each request and blocks the bad ones.
- [Malware and ransomware](https://tidbit.legios.com.ar/malware-and-ransomware/): Software built to harm you; ransomware locks your files and charges to unlock them.
