mirror of
https://github.com/lgcosta/pf-linux-port.git
synced 2026-11-12 20:15:36 -03:00
1.2 KiB
1.2 KiB
Demo (asciinema)
The lab can be recorded as an asciinema cast. Every
byte in the recording is the real output of the lab VMs (Alpine under libvirt
running the kernel built from source with pf.ko); only the pacing is
scripted.
Record
pip install asciinema # once
bash scripts/vm-run-tests.sh # or: scripts/vm-create.sh + deploy
asciinema rec out/demo-pf-linux.cast -c "bash scripts/demo-session.sh"
The session walks through:
- the lab topology and the freshly loaded
pf.ko(dmesgproof), pfctl -s infoover the OpenBSD ioctl ABI,- a real
pf.conf(table, stateful rules, explicit drop) andpfctl -sr, - transit ping +
pfctl -ss(stateful), pfctl -t <table> -T show(live tables),- a blocked ping (counters with
pfctl -sr -vv), divert-towith thepdivertrelay (packet to userspace and back),- shutdown.
Play back
asciinema play out/demo-pf-linux.cast
Upload
asciinema upload out/demo-pf-linux.cast
scripts/demo-record.py is an alternative recorder that produces the same
asciicast v2 format without the asciinema binary (it drives the lab over
ssh and writes the cast itself).