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
Put this on your class site

Students can use Firewall Lab right on your page, with no account. What they make stays on that page; to keep their work, they make a free account.

Google Sites: Insert, then Embed, then By URL, and paste this address.

https://mytekdev.com/try/firewalllab?embed=1

Canvas, a blog, or any page that takes HTML: paste this code where you edit the page as HTML.

<iframe src="https://mytekdev.com/try/firewalllab?embed=1" width="100%" height="640" style="border:0" allow="fullscreen" title="Firewall Lab demo from mytekDev"></iframe>

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.

Nothing in the app touches a real network. Every packet is simulated in the page, every address is private or from the ranges set aside for examples, and the attacks are named by what they do, never by a tool. Students defend; there is no way to build an attack.

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.

  1. 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.
  2. 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?
  3. 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.
  4. 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.
  5. Exit question (5 minutes) A packet matches rule 2 and rule 5. Which one decides it? What happens to a packet that matches nothing?
  6. 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.
  7. 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.
  8. 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

NetworkWhat is wrong at the startWhat it is built to show
1. Class SiteThe default lets everything in, so a port scan reaches every doorDefault deny: allow only what is used
2. Teacher LoginRemote login is open to anyone while three computers guess passwordsRules can match where a packet comes from; Limit slows guessing and an address rule stops it
3. Game NightAllow any service in from anyone, and the database, remote desktop and file sharing are foundClose every door nobody uses
4. Order MattersA block rule sits under a rule that already decides its packetsFirst match: the exceptions go first
5. The LabNothing stops what the computer sends outRules going out, and stateful filtering: the answers come back on their own
6. What No Rule StopsEmail is not let in, and two attacks arrive that no rule can stopWhat 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 thinkWhere the app answers it
A firewall keeps hackers outWhat 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 outThe 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 sayOrder Matters: the packet stops at the first card that matches and never reaches the second
A rule for the web also covers remote loginClass Site: each service is its own door, and a rule names the door
Blocking everything is safestThe Class through counter: block too much and the class does not get in, which is a failure too
Limit stops password guessingTeacher Login: Limit keeps 39 of the 54 guesses out, not all of them
The answers to my web pages need a rule to come inThe Lab: they come back on their own, and turning conversations off shows what that saves

What the app simplifies, on purpose

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.

Only on a practice machine the student is allowed to change, never a school server. On a cloud machine reached over SSH, a rule that lets your own address in on port 22 has to come first, or the next login is refused. The script says so above its last line, and ufw asks yes or no before it turns on.

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.

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.