Network Security Basics
Learn how firewalls filter traffic by address and port, what VPNs do and don't protect, why networks are segmented, and how common network attacks work.
Welcome back!
Step 1 of 13Learn
Doors, locks and guards
Every service listening on a port is a potential door into a network. Network security is largely about keeping as few doors open as possible, controlling who can use them and noticing when someone tries the handles. Automated scanners probe every public IP address on the internet constantly, so a server exposed to the internet will see login attempts within minutes of going online.
The main tool is a firewall, which allows or blocks traffic based on rules. A typical rule names a direction, a source, a destination, a protocol and a port:
ALLOW in any → 203.0.113.10 TCP 443 (public website)
ALLOW in 198.51.100.0/24 → 203.0.113.10 TCP 22 (SSH only from office)
DENY in any → any any (everything else)Rules are checked from top to bottom and the first match wins, so order matters. The last rule shows the most important principle: default deny. Block everything, then allow only what's needed.
Modern firewalls are stateful. They remember outgoing connections and automatically let the replies back in, so your home router can block all unsolicited incoming traffic while web browsing still works. Firewalls exist at several levels: in the router or a dedicated appliance at the network edge, in cloud platforms as security groups, and on each computer (Windows Defender Firewall, ufw or firewalld on Linux).
Step 2 of 13Practice · Spot the mistake
This firewall policy is meant to allow only HTTPS to the web server from anywhere and SSH only from the admin subnet 10.9.9.0/24. Rules are checked top to bottom. Tap the two rules that break the intent.
Step 3 of 13Diagram
How a firewall reads its rules
Tap a shape with to see more.
- Packet arrives
Source, destination, protocol and port are checked.
- Rule 1
If it matches, its action applies and checking stops.
- Rule 2, 3…
Checked in order only if earlier rules did not match.
- First match wins
A broad "allow" placed too high overrides every rule below it.
- No match: drop
The final catch-all handles anything not explicitly listed.
Step 4 of 13Learn
VPNs: tunnels through untrusted networks
A VPN (virtual private network) creates an encrypted tunnel between your device and a VPN server, or between two sites. Everything inside the tunnel is hidden from the networks in between.
Two common uses:
- Remote access. An employee at home or in a hotel connects to the company VPN and can reach internal systems as if they were in the office, with the traffic encrypted across the internet.
- Site-to-site. Two offices connect their networks permanently over the internet through VPN gateways, instead of paying for private lines.
Consumer VPN services are a third use: they route your traffic through the provider's servers, which hides your browsing from the local network and changes the IP address websites see.
Be clear about what a VPN does not do. It doesn't make you anonymous; the VPN provider can see where your traffic goes, so you are shifting trust from your local network or ISP to them. It doesn't stop malware, phishing or tracking by websites you log into. And since most websites already use HTTPS, a VPN on public Wi-Fi mainly adds protection for the minority of traffic that isn't encrypted and hides which sites you visit from the local network.
Many organizations are moving from "connect to the VPN and you're trusted" toward zero trust: every request is checked based on the user's identity and device health, wherever they connect from.
Step 5 of 13Practice · True or false
Using a VPN makes you completely anonymous online and protects you from phishing.
Step 6 of 13Practice · Diagram
What a VPN tunnel hides, and from whom
Which point gains the visibility the café network lost?
Tap the shape that answers the question, then press Check.
- Your laptop
Encrypts traffic before it leaves.
- Café Wi-Fi
Sees only encrypted data going to the VPN server.
- VPN server
Decrypts and forwards; it can see your traffic, so trust matters.
- Website
Sees the VPN server's address, but still knows who you are if you log in.
Step 7 of 13Learn
Segmentation and common attacks
Segmentation divides a network into zones so one compromised device can't reach everything. Common zones are users, servers, guest Wi-Fi, payment systems, and internet-facing servers in a DMZ (demilitarized zone) between the internet and the internal network. Firewalls control what crosses between zones. Inside a building, VLANs (virtual LANs) create separate Layer 2 networks on the same switches, so the guest Wi-Fi and the finance department can share hardware but not traffic.
Attacks you should recognize:
- Port scanning. Tools probe a range of ports to find listening services. Not harmful by itself, but often the first step of an attack.
- Brute-force login attempts. Bots try common usernames and passwords against SSH, RDP and web logins. Defenses: strong passwords or keys, multi-factor authentication, rate limiting and not exposing admin services to the internet.
- Man-in-the-middle (MITM). An attacker positions themselves between two parties, for example with a fake Wi-Fi hotspot named like the café's network, or by sending forged ARP replies on a LAN, to read or alter traffic. HTTPS and certificate checks are the main defense.
- DDoS (distributed denial of service). Thousands of compromised devices flood a target with traffic until it can't serve real users. Defenses are usually provided upstream by providers and CDNs that can absorb huge volumes.
- DNS spoofing. Forged DNS answers send users to a fake server. DNSSEC and encrypted DNS help.
Step 8 of 13Practice · Match the pairs
Match each attack to the defense that addresses it most directly.
Tap an answer, then tap the place where it belongs (or drag it there).
- Brute-force SSH logins from the internet
- Fake café Wi-Fi intercepting traffic
- A massive traffic flood against a website
- A hacked smart camera probing office PCs
Step 9 of 13Practice · Diagram
A segmented small-business network
Which zone should be able to reach the internet but nothing inside?
Tap the shape that answers the question, then press Check.
- Firewall / router
- DMZ
Public web server: reachable from the internet, isolated from everything else.
- Staff LAN
Laptops and desktops.
- Server zone
File and database servers; only needed ports open from the staff LAN.
- Payment systems
Card terminals kept separate to limit risk.
- Guest Wi-Fi
Internet only: cannot see any internal zone.
Step 10 of 13Note
Step 11 of 13Practice · Sort into groups
Sort each measure by what it mainly does.
Tap an item, then tap its group (or drag it there).
Step 12 of 13Practice · Fill in the blanks
Fill in the blanks
A firewall policy that blocks everything except what is explicitly allowed follows the principle of .
Step 13 of 13Practice · Choose one
A small company wants staff to reach an internal file server from home. Which approach is safest?
Lesson complete!