Firewall rules simulator: write the rules, send the packets.
Reading a rule table is easy until two rules overlap. Build a policy, send made-up packets through it, and the trace shows every rule checked and the one that decided. Then solve 3 graded scenarios built the way firewall performance-based questions are: a network, a set of requirements, and a table to get right.
- graded scenariosplus a sandbox with nothing graded
- 3
- test packetssome hidden until you check
- 57
- real packets sentit all runs in this page
- 0
The simulator
Publish a web server, lock down SSH
A new public web server is going into the DMZ at 192.0.2.10. The web team wants it reachable from anywhere over HTTPS. The admins need SSH, but only from their own subnet. Nothing else gets in: not to the web server, not to its neighbor in the DMZ, and certainly not to the database.
Requirements
- Anyone can reach the web server 192.0.2.10 over HTTPS (TCP 443).
- Only the administration subnet 10.10.10.0/24 can reach the web server over SSH (TCP 22).
- All other traffic is denied, including anything to the database and to other DMZ hosts.
Need a hint?
- You only need ALLOW rules. Anything you don't allow is already denied by the implicit rule at the bottom.
- Make each rule as narrow as the requirement: one protocol, one destination address, one destination port. Leave the source port at ANY.
Hosts and networks
- Web server (DMZ)
192.0.2.10 - Another DMZ host
192.0.2.11 - Administration subnet
10.10.10.0/24 - Database
10.20.20.10 - Internet test clients
198.51.100.0/24and 203.0.113.0/24
Your rules
Checked from the top. The first rule that matches decides, and nothing below it is read.
Implicit deny (locked, always last)
DENY ANY protocol, ANY source, ANY destination, ANY port
Hits so far: 0
Anything no rule above matches is denied.
443), a list (80, 443) or a range (1024-65535).What the firewall did
Send a packet and the trace appears here: each rule checked from the top, until one matches.
The test packets
Checking runs these 10 packets and 12 hidden ones through your rules. Any table that handles every packet correctly passes; there is more than one right answer.
| Test | Packet | Should be | Try it |
|---|---|---|---|
| Public HTTPS | TCP 198.51.100.25:50000→ 192.0.2.10:443 | Allowed | |
| Second public client, HTTPS | TCP 203.0.113.8:50000→ 192.0.2.10:443 | Allowed | |
| Public SSH | TCP 198.51.100.25:50000→ 192.0.2.10:22 | Denied | |
| Admin SSH | TCP 10.10.10.14:50000→ 192.0.2.10:22 | Allowed | |
| Adjacent subnet SSH | TCP 10.10.11.14:50000→ 192.0.2.10:22 | Denied | |
| Public HTTP | TCP 198.51.100.25:50000→ 192.0.2.10:80 | Denied | |
| Public to database | TCP 198.51.100.25:50000→ 10.20.20.10:5432 | Denied | |
| UDP 443 | UDP 198.51.100.25:50000→ 192.0.2.10:443 | Denied | |
| Other DMZ host, HTTPS | TCP 198.51.100.25:50000→ 192.0.2.11:443 | Denied | |
| Ping the web server | ICMP 198.51.100.25→ 192.0.2.10 | Denied |
Your rules are saved in this browser only, so you can come back to them. The model: stateless IPv4, first match wins, implicit deny. What that leaves out.
How the simulator decides
Four rules that most packet filters and ACLs follow, and that Security+ rule-table questions use. A few products order rules differently, so read the rules a question gives you first.
First match wins
Rules are read from the top. The first one that matches the packet decides, and nothing below it is read. Put specific rules above general ones.
Implicit deny
A packet that matches no rule is denied. You write what is allowed; everything else is already blocked. The locked last row is there to remind you.
Stateless, one packet at a time
Each test packet is checked on its own, with no memory of connections. Tests only send traffic in the direction a connection starts, so you never write rules for replies here. On a real stateless ACL you would need them; a stateful firewall tracks replies for you, and that is the case these tests mirror.
IPv4, layer 3 and 4
Rules match a protocol (TCP, UDP, ICMP or ANY), source and destination addresses or CIDR blocks, and source and destination ports. Nothing above the transport layer.
What it leaves out, on purpose
Connection tracking and reply traffic, NAT, zones and interfaces, IPv6, ICMP types, application inspection, logging, and any vendor's syntax. Real firewalls differ on all of these, and a simulator that guessed at them would teach the wrong thing. What is here is the part every packet filter shares. The JSON copy of your table is a study note, not a configuration for a real device.
Where rule tables show up in Security+
Firewall rules, access lists, and ports and protocols sit in Security Operations on both versions of the exam. They can appear two ways: as multiple-choice questions that show a short rule table and ask what happens to a packet, and as performance-based questions where you complete or correct the table yourself.
The three scenarios here practice the habits those questions test: write the narrowest rule that meets the requirement, put specific rules above general ones, and pick the protocol the service actually uses.
Objective titles from CompTIA's published exam objectives. The scenarios are Skillthropic's own and use made-up networks from the address blocks reserved for documentation; they are not exam questions.
Performance-based questions are where people lose time. Here’s the plan.
A lot of candidates meet their first performance-based question on exam day and spend minutes working out what the screen wants. I’m Chris Rees: 25+ years in IT and 55 Pluralsight courses. Practice the format before then and those minutes go to the questions.
- Get the rules into your handsSolve the three scenarios here. Free, no sign-up.
- Find your gapsTake the free Security+ readiness quiz, scored by domain.
- Practice every PBQ typeWork the 48 SY0-801 PBQ labs: rule tables, matching, ordering, diagrams and log evidence.
The PBQ Lab is for SY0-801 and comes with one lab you can try free first.
Questions about firewall rules
What does first match wins mean on a firewall?
The firewall compares a packet against its rules from the top down and acts on the first rule that matches. Later rules are never read for that packet, even if they would match too. That is why a broad allow placed above a specific deny quietly cancels the deny, and why exam questions about rule tables are usually about order.
What is an implicit deny?
It is the default at the bottom of a rule table: anything no rule matches is denied. Most firewalls and ACLs work this way, so a policy is a list of what is allowed. In this simulator the implicit deny is the locked last row, and the trace tells you when it decided a packet.
Why does DNS need both a UDP rule and a TCP rule?
Most DNS lookups use UDP port 53, but DNS falls back to TCP port 53 when an answer is too large for UDP, and full zone transfers (AXFR) use TCP. In this simulator, as on most ACLs, a rule names one protocol, so allowing DNS properly takes one rule for each. Using ANY instead would also open ICMP, every other protocol and every port.
Is this how a real firewall works?
It is the core of how packet filters and ACLs decide, and the model Security+ questions use. Real products add connection tracking, zones, NAT, application inspection and their own syntax, and they differ from each other. The simulator leaves those out on purpose and says so, and the JSON export is a study note, not a configuration any firewall will load.
Are firewall rules on the Security+ exam?
Yes. Reading and fixing rule tables is part of SY0-701 objective 4.5 and SY0-801 objective 4.1, and it is a frequently reported performance-based question type: you are given a network and requirements and asked to complete or correct a rule table. The scenarios here are original practice in that style, not exam questions.
Go deeper
- Free referenceThe ports and protocols to know, with the secure replacement for each cleartext one
- Free interactive referenceThe MITRE ATT&CK matrix, made explorable: every tactic and technique, clickable
- SY0-701 or SY0-801?Security+ SY0-801: release date, what changed, and when SY0-701 retires
- From the blogSecure Network Architecture: Zones, Device Placement, Firewalls vs. IDS/IPS, and Secure Protocols
- From the blogZero Trust Architecture Explained: Control Plane, Data Plane, and the End of the Perimeter
Solved all three? Try a lab from the PBQ Lab.
The PBQ Lab's free sample is a rule-table problem: keep guest Wi-Fi away from the payment terminals. Leave your email on the PBQ Lab page and it opens right there.
Independent training from Skillthropic, not an official exam or exam simulation. The scenarios, networks and explanations are original; public addresses come from the blocks reserved for documentation in RFC 5737 and internal ones from private address space. Objective numbers and titles are from CompTIA's published exam objectives (SY0-701 Version 7.0, SY0-801 Version 2.0). CompTIA® and Security+® are registered trademarks of CompTIA, Inc. Skillthropic is not affiliated with or endorsed by CompTIA.