Lion Cipher Lab

Harden the Linux kernel network stack with sysctl — and verify it

Why it matters

Below your firewall rules and your service configs sits the kernel itself, and it will quietly do things an attacker loves unless you tell it not to: accept packets with forged source addresses, follow ICMP redirects that reroute your traffic, honour source-routed packets that pick their own path back, and fall over under a SYN flood. These behaviours are controlled by a few dozen tunables under /proc/sys/net, read and written with the `sysctl` command. The catch is that defaults vary wildly between distributions and even between a cloud image and a laptop — some ship sane, some ship wide…

What you'll learn

Steps in this lab

  1. What this lab is — and what it deliberately is NOT
  2. The knobs you're about to turn, in plain language (and why)
  3. Set up a real kernel to work on (VM, WSL2, or a privileged namespace)
  4. Audit the baseline FIRST — score the host X/N before you change anything
  5. Write the sysctl.d drop-in and apply it with `sysctl --system`
  6. Re-audit (N/N) and spot-check a single key
  7. PROVE rp_filter works: a SAFE spoofed-packet test in a namespace
  8. The honest limit: strict rp_filter BREAKS asymmetric routing (use loose=2)
  9. SYN-flood survival: tcp_syncookies, and the counter to watch (labelled illustration)
  10. The honest negatives — and what to pair this with
  11. What you built, and the habit underneath it

Open the full interactive lab →