🔄 Why Earlier Attempts to Persist the iptables Rule for Port 18080 on DietPi Failed

🧩 Current Setup Summary


⚠️ Core Issue: The ts-input Chain Isn’t Available Early Enough


📝 Review of Earlier Approaches and Why They Failed

1. 🧰 Using iptables-persistent

2. ⚙️ Basic systemd Service Applying the Rule on Boot

3. ⏰ Cron Job with @reboot Directive


🔧 Why Our Final Workaround Works


📌 Summary

Approach Outcome Reason for Failure
iptables-persistent Rule not applied after reboot ts-input chain missing when rules restored
Basic systemd service Rule insertion fails early Runs before ts-input chain is created
Cron @reboot + sleep Unreliable, race conditions persist Chain not guaranteed to exist after sleep delay
Final script + systemd Reliable rule application Waits and retries until chain exists before insert

Revision #17
Created 2 June 2025 19:00:17 by coolbaron
Updated 4 June 2025 01:01:18 by coolbaron