0:00–0:10
Recap
0:10–0:35
Lecture
0:35–1:50
Lab 2B
1:50–2:00
Debrief
0:00 – 0:10Recap · 10 min

From seeing traffic to controlling it

0:10 – 0:35Lecture · 25 min

Netfilter architecture, IPTables and NFTables rule syntax, and where UFW fits

Instructor note: the packet-flow diagram is the single most important concept today — students who understand which chain a packet hits can debug their own rules. Draw it on the board before touching syntax.
0:35 – 1:50Lab 2B · 75 min

Lab 2B — Matching rule sets across all three tools, then NAT and persistence

Part 1 — IPTables and NFTables, same rules (35 min)

Part 2 — UFW, NAT, and persistence (40 min)

SSH lockout risk: always verify SSH still works from a second session before closing the first, both when applying DROP rules and when enabling UFW. Recovery otherwise requires the Hyper-V console.
Optional take-home extension (on the handout): Tasks 4–6 from the original two-day version (DNS-only-from-S2, interface-specific SSH block on eth0, gateway-only ICMP with a two-rule ordering requirement), the conntrack -L connection-tracking bonus, and the written three-tool comparison. All remain excellent practice.
1:50 – 2:00Debrief · 10 min

Learning outcomes — by end of Day 2, students can…

Write IPTables rulesUse -t, -A/-D/-F/-L, -p, -s/-d, --dport, -j with ACCEPT/DROP/REJECT targets
Write NFTables rulesAdd rules with nft syntax and delete by handle
Configure UFW with NATEnable UFW, set default policies, add/delete rules, and configure masquerade through UFW's config files
Persist firewall rulesUse iptables-persistent to survive a reboot
Explain rule ordering and DROP vs. REJECTDemonstrate a rule-ordering failure and its fix

What you need ready before class

Lab 2B handout printed S1 IPTables/NFTables/UFW all confirmed clean before starting
←← Week 2 Overview ← Day 1 Lab 2B Handout Day 3 →