Firewall Lab teaching notes
For high school cybersecurity and networking teachers, AP Cybersecurity, CyberPatriot coaches and middle school CS teachers in grades 7 and 8. Two periods through the six networks, what each one is built to show, what students get wrong and where the app answers it, what it leaves out, and how to take the rules to a real machine.
Using this with a class? Make a free class and add your students yourself: each gets a username and password, with no email or Google account needed. Or give them one join code. Using Google Classroom? Post the link there; with a free class, the link also puts each student in your class, so you see their work. mytekDev is also available from the Google Workspace Marketplace, so your school's Google admin can install it for everyone.A first lesson: Open Order Matters and read its two rules out loud before anyone presses Run the day: Allow web in from anyone, then Block any service in from 203.0.113.66. Ask the class whether the busy computer gets in. Then run it and watch every one of its requests stop at rule 1, never reaching rule 2.
Set up a free class Share to Google Classroom- About these notes
- Two periods
- The six networks
- What students get wrong, and where the app answers it
- What the app simplifies, on purpose
- Taking the rules to a real machine
- Setting it up for a class
- Standards
About these notes
Firewall Lab is one machine, one firewall and one day of traffic. The firewall is a wall with the student's rule cards down its face. Packets from the class and from an attacker arrive mixed together, and each one is checked against the cards from the top: the first card that matches decides it, and if none does, the default on the last line decides. Two counters say how much of the class got through and how much of the attack was kept out. A network is done when both are full.
It is written for AP Cybersecurity Topic 3.4, Protecting Networks: Firewalls, where rules are checked in order and the first match is executed, and where changing the order of the rules can change what is allowed. Research on adults learning firewall rules found that a common mistake was a general allow rule written above a specific block rule, and that rule order and default behavior were not picked up by trial and error: they needed to be taught. The app makes both visible, one packet at a time.
Two periods
The six networks can be done in any order and none locks another, but this order builds one idea on the last. Each network keeps its own rules, so a student can stop and come back.
- Class Site (10 minutes) The app opens with the day already running. The class gets in, and so does a scanner trying 18 doors one after another. Ask why the scanner gets in when the only rule is Allow web. Then change the last line to Block everything else and press Run the day. Both counters fill.
- Teacher Login (10 minutes) Remote login is open to anyone, and three computers are guessing passwords. Most students try Limit first: it keeps 39 of the 54 guesses out, and some still reach the login. Then change who the rule is from to the teacher's laptop, and all 54 are kept out. Ask: why does Limit only slow guessing down?
- Game Night (10 minutes) One rule, Allow any service in from anyone, and the check under the rules quotes a study of real firewalls where about 4 in 5 did the same. Students replace it with the services that are used: the game server from anyone, and remote login from the room only.
- Order Matters (10 minutes) The block rule for the busy computer is already there, under Allow web in from anyone, and it never runs. The check says so and offers Try it above rule 1. Ask the class to predict before anyone moves it.
- Exit question (5 minutes) A packet matches rule 2 and rule 5. Which one decides it? What happens to a packet that matches nothing?
- The Lab (second period, 20 minutes) A lab computer, not a server. It browses, looks up names and uses email, and something on it calls a stranger on port 6667 and sends spam straight out on port 25. The rules here face out: block everything going out, then allow name lookups, the web and email apps going out. The answers come back in with no rule for them, because the firewall keeps track of the conversations this computer started. Then open More and turn that off, and watch the answers get blocked.
- What No Rule Stops (second period, 15 minutes) Let the class's web and email through, and two attacks still arrive: a phishing email from a real mail server on the mail door, and a flood that fills the line before it reaches the wall. Students mark them as attacks no rule could stop, and the card names what does stop each one.
- Print the rule card (10 minutes) Each student prints the rules for one network with the ufw line under each, the counters and the check, and trades with a classmate to answer its three questions: which rule would you remove, which rule would do something different if it moved, and what could still get in.
The six networks
| Network | What is wrong at the start | What it is built to show |
|---|---|---|
| 1. Class Site | The default lets everything in, so a port scan reaches every door | Default deny: allow only what is used |
| 2. Teacher Login | Remote login is open to anyone while three computers guess passwords | Rules can match where a packet comes from; Limit slows guessing and an address rule stops it |
| 3. Game Night | Allow any service in from anyone, and the database, remote desktop and file sharing are found | Close every door nobody uses |
| 4. Order Matters | A block rule sits under a rule that already decides its packets | First match: the exceptions go first |
| 5. The Lab | Nothing stops what the computer sends out | Rules going out, and stateful filtering: the answers come back on their own |
| 6. What No Rule Stops | Email is not let in, and two attacks arrive that no rule can stop | What a firewall cannot do, and what does |
Click any packet on the stage to read what it was, its protocol and port, where it came from, and which rule decided it, or that the default did. In High school mode the real ufw line sits under every rule.
What students get wrong, and where the app answers it
No study was found of what students in grades 6 to 12 believe about firewalls. These are the beliefs teachers and the research on adults describe, and each network is built to meet one.
| What students think | Where the app answers it |
|---|---|
| A firewall keeps hackers out | What No Rule Stops: a phishing email arrives on the same door as real email, and a flood never reaches the wall |
| A firewall is a blocker that keeps dangerous websites out | The help: that is the school's web filter, which judges the site. A firewall rule judges the address, the port and the protocol |
| Every rule that matches has a say | Order Matters: the packet stops at the first card that matches and never reaches the second |
| A rule for the web also covers remote login | Class Site: each service is its own door, and a rule names the door |
| Blocking everything is safest | The Class through counter: block too much and the class does not get in, which is a failure too |
| Limit stops password guessing | Teacher Login: Limit keeps 39 of the 54 guesses out, not all of them |
| The answers to my web pages need a rule to come in | The Lab: they come back on their own, and turning conversations off shows what that saves |
What the app simplifies, on purpose
- It protects one machine at a time, like ufw on a server. A network firewall in front of many machines, with traffic passed through it, is not in this version.
- Rules match the service's port and protocol, and where a packet comes from. The source port is shown when a packet is clicked and never used for matching.
- Blocking always drops the packet quietly. Real firewalls can also answer with a refusal, which a scanner reads differently.
- In the lab one packet is one password guess. Real SSH allows a few tries on each connection.
- Limit keeps its count per rule; ufw keeps one shared list. No network depends on the difference.
- Web traffic is TCP only. Browsers also try port 443 over UDP and fall back to TCP when it is blocked.
- The firewall reads where a packet comes from and where it is going, not what is inside it. Some bigger firewalls can look inside, but a trick email still looks like real mail.
- Home addresses are spread all over the internet, so the lab's range for classmates at home is a stand-in.
- There is no IPv6 and there are no logs to read.
Taking the rules to a real machine
Get the ufw script turns the network's rules into a script for ufw, the firewall that comes with Ubuntu: the two default lines, then every card in order as a real line, such as ufw allow in proto tcp from 198.51.100.20 to any port 22, and ufw enable last. Every line pattern comes from ufw's manual and was checked with ufw's dry run. Copy puts it on the clipboard and Save as a file saves a text file, whose header says to save it on the practice machine as firewall.sh and run it with sudo sh firewall.sh.
The addresses in it are the lab's examples, so they have to be changed to the real network's first. The header says to start from a fresh ufw, so older rules do not come before these.
Setting it up for a class
Grade level in the header switches between Middle school and High school, and the choice is saved with the project. In Middle school mode the ufw line is one click away under each rule, under Show the real line. High school shows the real line under every rule.
Big screen fills a projector with the stage, and the space bar runs the day. Esc leaves it. Skip to the end finishes the day at once and counts everything, and Speed slows the packets down for a class watching together.
With a free account each network's rules are saved in the project, with a line that says how it went, and a shared project lets anyone watch the day run against the student's rules. A visitor can run it and cannot change anything.
Standards
The app addresses these; it does not cover all of any one.
- AP Cybersecurity, Unit 3, Topic 3.4, Protecting Networks: Firewalls: rules checked in order with the first match executed, the order changing what is allowed or denied, stateless and stateful filtering. Scenario 3A: letting outside traffic reach a web server while blocking the rest.
- CSTA 2017, grades 7 and 8: 2-NI-05, security measures that protect information (Class Site and Teacher Login as a model).
- CSTA 2017, grades 9 and 10: 3A-NI-06 (recommending security measures for a scenario), 3A-NI-07 (the tradeoff between usability and security, which is the two counters) and 3A-NI-08 (the tradeoffs of a recommendation).
- CSTA 2017, grades 11 and 12: 3B-NI-04, ways to protect devices and information from unauthorized access.
- CYBER.ORG 2021: 6-8.SEC.COMP and 9-12.SEC.COMP (firewalls, allow and block lists), 9-12.CS.PROT.1 (ports and protocols), and shutting down services and ports that are not used.
Not AP Computer Science Principles: firewalls are not in its course description.
More help
Is something on this page wrong or not clear? Write to us.
Page last reviewed November 2026.
Google, Google Classroom and Chromebook are trademarks of Google LLC.